Community
Participate
Working Groups
Build ID: I20081211-1908 Steps To Reproduce: I received this error with a project that was working perfectly fine in previous versions of Eclipse (3.4). I am using Weblogic 9.2 which has a library directory with a number of jar files and subdirectories with other jar files. To reproduce this error I created a class path variable WEBLOGIC_HOME set to: c:/bea/weblogic92/ (Weblogic installed to default directory). 1. Create new Java project 2. Try to add library weblogic.jar (found in server/lib/) 3. Got error Description Resource Path Location Type Cannot nest 'C:bea/weblogic92/server/lib/ant/ant-juni' inside library 'C:bea/weblogic92/server/lib/ant/' test Build path Build Path Problem More information:
I cannot reproduce the problem. Please give more details on how to reproduce (starting from a fresh workspace).
(In reply to comment #1) > I cannot reproduce the problem. Please give more details on how to reproduce > (starting from a fresh workspace). > I did provided all relevant information. Let me reiterate. I am attaching screenshots of all of this 1. Download Weblogic 9.2 and install it into the default directory (c:/bea/weblogic92) 2. Run Eclipse 3.5M4 with an new empty workspace. 3. Create a Java project. 4. Create a variable WEBLOGIC_SERVER_LIB pointing to c:/bea/weblogic9.2/server/lib 5. Goto properties of the Java project 6. Add weblogic.jar from the WEBLOGIC_SERVER_LIB directory. 7. See the error which prevents adding the library to the project. If you add the jar by modifying manually the .classpath file you got a build error. Once again this worked fine in the previous version of Eclipse. See the zip attachment with the screenshots. The first screenshots shows the content of the lib directory. The lib directory has a subdirectory with another list of jar files. I checked the MANIFEST.MF file from the weblogic.jar. The classpath parameter has references to other jar files (ant/ant.jar and so on)
Created attachment 121554 [details] Screenshots of each step
I think the MANIFEST.MF file is the one triggering this bug. If I add the file as an external jar there is no problem, only when it is added using a classpath variable. Thanks
I don't have access to Weblogic (for legal reasons). Could you please create a small jar with a MANIFEST.MF that reproduces the problem?
(In reply to comment #5) > I don't have access to Weblogic (for legal reasons). Could you please create a > small jar with a MANIFEST.MF that reproduces the problem? > It is free to download.
I think I found the problem and a workaround. Starting with version 3.5 adding a JAR to the classpath of a Java project will also add any library present in the MANIFEST.MF. The Class-Path parameter in the MANIFEST.MF file describes extension libraries that should be put into the classpath when running the jar. This classpath will be built recursively. However I do not think Eclipse should use for compilation. I can not speak for everybody, but most developers are very careful in putting together the classpath. In my case what seems to happening is the Eclipse reads the manifest file from weblogic.jar then from the referred jars. It ends in a circular pattern. See the attached screen shot. Now we can debate that Weblogic jar files have the wrong manifest file, but the manifest file should not be used for compilation purpose only for running. I also find that the manifest file in Weblogic has newlines in the Class-Path parameter and I don't think that is right. However weblogic works fine so very likely java can read the manifest file fine. I could not find a compilation option that clearly states how this works in Eclipse. I found one option that seems to help. If I change the option "Incomplete build path" from Error to Warning then project no longer has build error. I think this new feature could cause serious problems to a lot of developers. Eclipse should have a clearly labeled option by default to set to false to check or not the manifest file in the jar.
Created attachment 121807 [details] Classpath generated from manifest file
This feature was asked in bug 198572. However I agree that errors should not be reported because of the Class-Path parameter in the MANIFEST.MF. Could you please attach the MANIFEST.MF so that we understand what's causing the error to be reported?
(In reply to comment #9) I am attaching the manifest file from weblogic.jar. I read the history of this bug. Interesting that it was raised originally because of Weblogic, but exactly that one does not work. I checked other manifest files in the Weblogic jar files and they all suffer the wrapping problem.
Created attachment 122099 [details] weblogic.jar manifest file
Created attachment 122511 [details] jar to reproduce the problem To reproduce: 1. New Java project 2. Add the attached jar as an external library Observe: You get a build path problem: Cannot nest 'D:temp/lib/sublib/' inside library 'D:temp/lib/'
Created attachment 122513 [details] Regression test
Should there be an option or classpath attribute to allow disabling the JAR chaining ?
I actually meant: Should there ALSO be an option or classpath attribute to allow disabling the JAR chaining ? (in addition to addressing this bug)
If we introduced this option, it would only be to workaround bugs such as this one. So I think this option should be a system property and not a user preference.
Created attachment 122658 [details] Proposed fix
Fix and test released for 3.5M5
Verified for 3.5M5 using I20090125-2000 build