Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Strange Java classpath issue...

Options
  • 22-04-2009 11:09am
    #1
    Closed Accounts Posts: 2,349 ✭✭✭


    Hey all,

    I have a JAR file called XercesPatch.jar that extends another jar called XercesImpl.jar. These JAR files are all in a common lib folder. There are a few lib folders, and they all have XercesImpl, but only one has XercesPatch.

    The thing I'm coding won't work with XercesPatch due to bugs in its implementation (which Adobe haven't fixed >:/). I get an IllegalAccessError when I run my program. Also, removing it from the lib folder is not an option.

    All the code I'm working on basically does is to call JUnit tests in another project.

    So:
    1. I removed XercesPatch.jar from the build path in Eclipse. It still gets picked up however and I get the same error.
    2. I removed the XercesImpl.jar dependency that was in the same directory and used a different copy in another folder. There is no XercesPatch.jar in the other folder. It still picks it up and I get the error.
    3. The only thing I can do is to rename XercesPatch.jar so it can't find it. Then it runs fine. This was the suggested workaround in the Adobe bug, however the file is needed by other projects so this is not a viable solution.

    How the hell is this possible? It explicitly goes looking for XercesPatch.jar (according to FileMonitor) even though there's no actual reference to it in the classpath or in XercesImpl...There's no environment variables that have the path set to that folder either.

    I don't think it's an Eclipse issue as I get the same problem running it from Ant


Comments

  • Moderators, Science, Health & Environment Moderators Posts: 10,079 Mod ✭✭✭✭marco_polo


    Complete stab in the dark here but is the current working directory in the classpath ie (.)? Perhaps it is able to find the lib folder containing the jar file relative to that?


  • Closed Accounts Posts: 2,349 ✭✭✭nobodythere


    Thanks for the reply^^

    Got it. It's to do with Flex and the IBM JDK. Actually I'm really really unsure how I fixed it. For anyone coming across this on Google: http://bugs.adobe.com/jira/browse/SDK-18492

    I added that -Xbootclasspath/a:/path/XercesImpl.jar to the VM args in Eclipse, the location with the XercesPatch.jar in the same folder. Then I removed XercesImpl.jar from the build path and it worked!

    Then bizarrely I removed the -Xbootclasspath... from the VM args and it still works. Wtf...


Advertisement