Bug 248661 - Axis2: Missing required libraries in Axis 2 WS Client Projects
Summary: Axis2: Missing required libraries in Axis 2 WS Client Projects
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P2 major with 1 vote (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-25 17:25 EDT by Mark Hutchinson CLA
Modified: 2010-09-24 06:11 EDT (History)
13 users (show)

See Also:
Olivier_Thomann: review+


Attachments
patch for the issue 248661 (1.54 KB, patch)
2008-10-07 03:52 EDT, Saminda Wijeratne CLA
no flags Details | Diff
WebAppLibrariesContainer.java (3.48 KB, application/octet-stream)
2008-10-29 14:34 EDT, Konstantin Komissarchik CLA
no flags Details
WebAppLibrariesContainerInitializer.java (1.21 KB, application/octet-stream)
2008-10-29 14:35 EDT, Konstantin Komissarchik CLA
no flags Details
FlexibleProjectContainer.java (19.42 KB, application/octet-stream)
2008-10-29 14:35 EDT, Konstantin Komissarchik CLA
no flags Details
debug output (84.69 KB, text/plain)
2008-12-19 14:55 EST, Mark Hutchinson CLA
no flags Details
debug output (42.31 KB, text/plain)
2008-12-22 10:29 EST, Mark Hutchinson CLA
no flags Details
Project with test cases (3.66 KB, application/octet-stream)
2009-07-16 08:10 EDT, Jay Arthanareeswaran CLA
no flags Details
Test Project (9.19 KB, application/octet-stream)
2009-07-16 08:15 EDT, Jay Arthanareeswaran CLA
no flags Details
This patch is superseded by the patch attached to comment#54 (this latter patch also has tests) Olivier/Jerome, could you review this candidate patch to see if this is a realistic test for what is described in the bug ? - Thanks. (1.41 KB, patch)
2009-07-21 03:57 EDT, Srikanth Sankaran CLA
no flags Details | Diff
JDT/Core plugin patch (4.25 MB, application/octet-stream)
2009-07-31 01:31 EDT, Jay Arthanareeswaran CLA
no flags Details
JDT/Core plugin patch (With Updated version) (4.25 MB, application/octet-stream)
2009-07-31 05:44 EDT, Jay Arthanareeswaran CLA
no flags Details
Proposed Fix (3.41 KB, patch)
2009-08-10 02:12 EDT, Jay Arthanareeswaran CLA
no flags Details | Diff
JDT/Core plugin patch (4.25 MB, application/octet-stream)
2009-08-18 04:41 EDT, Jay Arthanareeswaran CLA
no flags Details
Updated patch (5.43 KB, patch)
2009-08-18 05:02 EDT, Jay Arthanareeswaran CLA
srikanth_sankaran: iplog+
srikanth_sankaran: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hutchinson CLA 2008-09-25 17:25:26 EDT
Build ID:  WTP 3.1 M2 build I-3.1-20080925012741

Steps To Reproduce:
1. Create an Axis 2 Client from a wsdl into a new Web Project
2. Notice an error similar to this in the problems view: Project 'BU3Client' is missing required library: 'E:\workspaces\wtp\smoketest\BU3Client\WebContent\WEB-INF\classes'


More information:
The work around is to create the Dynamic Web Project ahead of time, and generate the client into that.

This is not happening for Axis 1 clients.
Comment 1 Kathy Chan CLA 2008-09-29 09:32:03 EDT
Saminda,

This problem is not happening for WTP 3.0.2 and looks like a recent change in behaviour for this week's driver (smoke test for the 09/18 WTP 3.1 driver was fine).  Please take a look since with this problem in the WTP 3.1 09/25 driver, the user is not able to use the Web services wizard to create projects for Axis2 client.
Comment 2 Mark Hutchinson CLA 2008-10-01 14:55:15 EDT
I can consistently reproduce this on the 3.1M2 build, but can't reproduce it consistently while self hosting against HEAD.

At first I could not reproduce this at all in a self hosting environment.  So I closed all the plugins I had open in my development environment, and started opening them to see which ones would "fix" the problem.  I thought I narrowed it down to org.eclipse.jst.axis2.consumption.core and org.eclipse.jst.axis2.consumption.ui.  i.e. If I closed those plugins in my development environment I would see the problem, if I had them open then I would not see the problem.  My first theory was that there could have been something committed to head, but not released to build.

Now I am less sure about this theory.  Now, even when I have these plugins open, I am running into the problem.  So now I able to reproduce the problem in a self hosted environment.

I'm not sure why exactly I wasn't able to reproduce the problem while self hosting at first, and now I am since I don't think anything has changed.  Maybe looking into these two plugins would be a good starting point for this problem, and what (if any) the differences are between self hosting, and using the M2 build are.
Comment 3 Saminda Wijeratne CLA 2008-10-02 07:49:28 EDT
I managed to reproduce this issue in 3.1 M2. But was not able to reproduce in the HEAD revision with self hosting mode.
When i managed to reproduce this in the WTP 3.1 M2, I refreshed the project and the errors which was shown in the problem view vanished. There were no longer any errors.
Here after if i create more client stubs in to a new web probjects i no longer can reproduce the issue.
If i clean the workspace and close eclipse and start eclipse (or start eclipse with a new workspace) then again i'm able to reproduce the issue.
If i had created a client stub with this issue and after that if i create more client stubs to new web projects those projects showed this issue only until the point i clicked finish in the last page (after the stubs were added to the web project the errors for that project vanishes).

Do u think this is a problem of some configurations not reloaded or project is refreshed b4 some settings are created/added wrt axis2/..etc???
Comment 4 Mark Hutchinson CLA 2008-10-02 14:14:01 EDT
I am seeing the same behaviour: refreshing the project makes the errors go away.

After refreshing one project, subsequent client projects show an error for a little while, but the error disappears by the time the wizard has completed.  

Maybe there is some timing issue about when the project gets refreshed, I am not sure.
Comment 5 Saminda Wijeratne CLA 2008-10-07 03:52:17 EDT
Created attachment 114386 [details]
patch for the issue 248661

Since i cant think of a reason i tried a few experiments on this. I tried refreshing the project after it is being created (you know project.refreshLocal()). I tried putting it after the codegen has being completed. But non of the experiments worked (the project still showed errors). So i'm assuming when we manually refresh the project it does something more than call the method project.refreshLocal(). Any ideas???

Only thing that worked was to close and open the project again after the codegen. Which is what contained in the patch i'm providing. So with this patch when the wizard completes the errors should not be there. I dont think this is a good solution for the issue since we still dont know what the problem is.
Comment 6 Kathy Chan CLA 2008-10-10 16:13:37 EDT
The problem still occurs in today's WTP 3.1 smoke test driver (http://build.eclipse.org/webtools/committers/wtp-R3.1-I/20081010055538/I-3.1-20081010055538/).  

By CC:  Carl, are you aware of any change in Web classpath or platform related to resource change that went in after the 09/19 WTP 3.1 driver (the last driver I tested which did not have this problem) that could have change cause this kinds of symptom?  If I just create a dynamic Web project, then go to Project -> propterties -> Project Facet and add the Axis2 facet (which copies some JARs to WEB-INF/lib), I get the error:

Description	Resource	Path	Location	Type
Project 'p1' is missing required library: 'D:\wtp\wtp31_1010\eclipse\workspace\p1\WebContent\WEB-INF\classes'	p1		Build path	Build Path Problem
The project cannot be built until build path errors are resolved	p1		Unknown	Java Problem

If I refresh the project, then the problem goes away.

Saminda also mentioned that calling project.refreshLocal() programmatically did not help.

Do you know what would have trigger that error?
Comment 7 Kathy Chan CLA 2008-10-17 10:33:33 EDT
With the WTP 3.1 10/16 driver, going through an Axis2 service plus client scenario (with the wizard creating a new client Web project with Axis2 facet) is OK.  I've tried creating a dynamic Web project and adding Axis2 facet successfully as well (last week's driver would complain about build path problem).  The only scenario that still has problem is if I create a dynamic Web project and then go to Project Properties to add the Axis2 facets.  I still get:

Description	Resource	Path	Location	Type
Project 'a2b' is missing required library: 'D:\wtp\wtp31_1016\eclipse\workspace\a2b\WebContent\WEB-INF\classes'	a2b		Build path	Build Path Problem
The project cannot be built until build path errors are resolved	a2b		Unknown	Java Problem


Comment 8 Carl Anderson CLA 2008-10-17 10:54:51 EDT
Kathy, 

     Konstantin has been changing around the Java Facet and its support (which also modifies the way that user libraries are handled) in WTP 3.1.  That's the only thing I can think of that might have caused this timing issue.  (A bug that was just committed that might have helped fix some issues was bug 246488 )  I am not positive that that is the cause, but thought that it bears investigating.
Comment 9 Carl Anderson CLA 2008-10-17 11:24:04 EDT
I meant to reference bug 246448 in my last comment.
Comment 10 Kathy Chan CLA 2008-10-17 11:49:37 EDT
Konstantin,

Do you have any insight on why adding Axis2 facet would cause this problem with the latest WTP 3.1 driver:

Project 'a2b' is missing required library:
'D:\wtp\wtp31_1016\eclipse\workspace\a2b\WebContent\WEB-INF\classes' 
Comment 11 Konstantin Komissarchik CLA 2008-10-20 14:02:45 EDT
I don't see any way that bug 246448 would have anything to do with what you are seeing. It's a completely unrelated part of code. This is likely a problem with interaction between WTP component model and JDT. I will take a quick look in a bit to see if I spot anything obvious.
Comment 12 Konstantin Komissarchik CLA 2008-10-20 14:22:11 EDT
This looks like a JDT bug. I've seen similar problems before, but they are typically intermittent and we haven't had any luck getting something reproducible to JDT. What happens is that the web project starts out without WebContent/WEB-INF/classes folder. The Axis2 facet creates this folder and writes a couple of prop files to it. The folder and it's contents appear to be created correctly using Eclipse resources API since they do show up in the Navigator. When the folder is created, the Web App Libraries container picks it up and adds it to its list of contents. The container refreshes and tells JDT about new contents. The Project Explorer / Package Explorer show the container's new contents (including the classes directory), but JDT still doesn't remove the marker. It got confused somewhere along the way. 
Comment 13 Kathy Chan CLA 2008-10-20 14:50:34 EDT
Thanks for the analysis, Konstantin!

Re-routing to JDT to get some insight into this problem.
Comment 14 Kathy Chan CLA 2008-10-27 14:08:33 EDT
Could someone on the JDT team take a look at this problem and give us some insight on what could have caused this problem?  This problem only starts to show up in the last month or so.  

We found that manually refreshing the project would make the problem go away but Saminda found that just calling project.refreshLocal() programmatically did not work.

With the 10/23 WTP driver, this problem shows up again after letting the wizard create the project with Axis2 facet.  With the 10/16 driver, Axis2 project created by the wizard was OK but just adding the Axis2 facet would cause the problem.
Comment 15 Jerome Lanneluc CLA 2008-10-29 12:38:16 EDT
Konstantin, calling JavaCore.setClasspathContainer(...) with the same 
IClasspathContainer instance is a no-oop from JDT/Core point. 

See the Javadoc on IClasspathContainer.getClasspathEntries():
	 * The method is typically called exactly once for a given Java project,
	 * and the resulting list of entries cached internally by the Java model.

However, the Package Explorer doesn't cache this value. This is why it shows the new values.

So if you change the returned value of IClasspathContainer.getClasspathEntries() and call JavaCore.setClasspathContainer(...), it will update the Package Explorer, but it will not update the markers created by JDT/Core.

Could it explain what you see?
Comment 16 Konstantin Komissarchik CLA 2008-10-29 14:31:22 EDT
> Konstantin, calling JavaCore.setClasspathContainer(...) with the same 
> IClasspathContainer instance is a no-oop from JDT/Core point. 
> 
> So if you change the returned value of
> IClasspathContainer.getClasspathEntries() and call
> JavaCore.setClasspathContainer(...), it will update the Package Explorer, but
> it will not update the markers created by JDT/Core.
> 
> Could it explain what you see?

No. Container refresh is handled by creating a new instance of the container and calling setClasspathContainer() on the new instance. I will attach container source code for ease of reference.
Comment 17 Konstantin Komissarchik CLA 2008-10-29 14:34:20 EDT
Created attachment 116455 [details]
WebAppLibrariesContainer.java
Comment 18 Konstantin Komissarchik CLA 2008-10-29 14:35:00 EDT
Created attachment 116456 [details]
WebAppLibrariesContainerInitializer.java
Comment 19 Konstantin Komissarchik CLA 2008-10-29 14:35:46 EDT
Created attachment 116457 [details]
FlexibleProjectContainer.java
Comment 20 Jerome Lanneluc CLA 2008-10-30 05:06:12 EDT
OK, those containers and initializer look good at first glance. So I would need more information to understand the problem
Comment 21 Jerome Lanneluc CLA 2008-10-30 05:08:15 EDT
First I would need the version of the org.eclipse.jdt.core plugin.
Then I would need steps to reproduce. Remember that I'm not familiar at all with WTP. So I need to know what to download, what needs to be setup, details steps that reproduce the problem.

TIA
Comment 22 Mark Hutchinson CLA 2008-10-30 14:18:57 EDT
Saminda,

Are you able to reproduce this on a recent integration driver?

I tried on I-3.1-20081023170256 and could no longer reproduce the problem, so maybe this was indirectly fixed somehow.

I would run into the problem 100% of the time on the wtp 3.1 M2 driver.

I would like to make sure this is still a problem before we have Jerome try it.

Thanks
Comment 23 Konstantin Komissarchik CLA 2008-10-30 14:33:25 EDT
My past experience with various variants of this problem is that it is highly intermittent. In certain situations it appeared that some people were able to reproduce the problem almost 100% of the time, but then the problem would not reproduce for others using the same bits. Walter Harley spent a considerable amount of time trying to reproduce it in the debugger in order to capture more information, but was unable to do so. That was a release or so back. 

So I don't think this is the case of build-to-build differences. I was hoping that this variant of the repro might be easier to reproduce, but it is starting to sound like it might not be the case...
Comment 24 Kathy Chan CLA 2008-10-30 16:26:45 EDT
Eric ran the smoke test last Friday on the driver

http://build.eclipse.org/webtools/committers/wtp-R3.1-I/20081023110843/I-3.1-20081023110843/ 

He was able to reproduce the problem with the wizard creating the Web project containing Axis2 facet.  I'll try again with the WTP 3.1 integration driver tomorrow and see if the problem is still there or not.  If so, we would provide Jerome with the steps to reproduce the problem.
Comment 25 Kathy Chan CLA 2008-10-31 15:59:31 EDT
I tried with the wtp-sdk-I-3.1-20081030163955 driver and the problem is still there.  Here's the steps to reproduce:

1. Download the following zips from:
http://build.eclipse.org/webtools/committers/wtp-R3.1-I/20081030163955/I-3.1-20081030163955/

dtp-sdk-1.6.2M1-200810240500.zip
eclipse-SDK-I20081029-0100-win32.zip
emf-runtime-I200810291305.zip
GEF-SDK-I200810141852.zip
unzip.bat
wtp-sdk-I-3.1-20081030163955.zip
xsd-runtime-I200810291305.zip

2. Unzip the zips to a directory.

3. Download Axis2 v1.4 from:

http://archive.apache.org/dist/ws/axis2/1_4/axis2-1.4-bin.zip

4. Unzip into Axis2 directory.

5. Start up WTP by invoking "eclipse -data workspace".

6. Download Tomcat 6.0 from:

http://apache.sunsite.ualberta.ca/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.zip

7. Unzip into Tomcat6 directory.

8. Choose Windows -> Preference -> Server -> Runtime Environment.  Click Add.  Select Apache Tomcat 6.0.

9. Select Browse to browse to the directory Tomcat is unzipped to.  Click Finish.

10. In the preference page, navigate to Web Services -> Axis2 Preferences.  Click Browse and select the directory Axis2 is unzipped to.  Click OK.

11. Select New -> Project and enter a name for the project.

12. Select the new project and select New -> Web Services -> WSDL files.  Click Next.  Click Finish.

13. Select NewWSDLFile.wsdl and select New -> Web Services -> Web Services Client.

14.  Click the Web services runtime hyperlink on the right side of the wizard and select Apache Axis2 under Web services runtime.  Click OK.  

15. Click the Client project hyperlink and enter a name "wp" for the name of a new client project (Project type Dynamic Web project).  Click OK.  Then click Finish.  

Note that this problem only occurs for new, non-existing project.

Notice that the resulting resulting project has an error:

Project 'wp' is missing required library: 'D:\wtp\wtp31_1030\eclipse\workspace1\wp\WebContent\WEB-INF\classes'	

When the error occurs, the error would disappear after refreshing the project.  Also, I found that with the same driver, sometimes with just exiting Eclipse and going back, the problem would not show up anymore.

Sometime, the problem would show up just by:

1. New -> Project -> Dynamic Web project.  Type a name for the project.
2. Choose Apache Tomcat 6 as the target runtime.
3. Select the Modify... button next to the configuration combo and select Axis2 Web services.  Click OK.  Click Finish.

Again, this seems to be intermitten as well.


Comment 26 Jerome Lanneluc CLA 2008-11-14 05:57:10 EST
> 11. Select New -> Project and enter a name for the project.
What kind of project should I create?
Comment 27 Jerome Lanneluc CLA 2008-11-14 06:10:33 EST
- Assumed that step 11 was New -> Project -> Dynamic Web project.
- Also used http://build.eclipse.org/webtools/committers/wtp-R3.1-I/20081113215244/I-3.1-20081113215244/ instead (since http://build.eclipse.org/webtools/committers/wtp-R3.1-I/20081010055538/I-3.1-20081010055538/ was broken).

But I could not reproduce: after step 15 I got no errors in the problem view.

- Also followed step 1. to 3. 
and I could not reproduce either.
Comment 28 Kathy Chan CLA 2008-11-21 12:45:00 EST
Yes.  Step 11 mean to create a dynamic project.

I tried again with the 11/20 WTP 3.1 driver.  Creating a new Web project using the Web services wizard in Axis2 scenario (Step 1 to 15) produce no error.  However, just following Step 1 to 3 to add the Axis2 facet:

1. New -> Project -> Dynamic Web project.  Type a name for the project.
2. Choose Apache Tomcat 6 as the target runtime.
3. Select the Modify... button next to the configuration combo and select Axis2
Web services.  Click OK.  Click Finish.

The problem occurs most of the time.  The symptom of this problem seems to change from week to week.  Sometimes it would show up when creating new Web project with Axis2 facet using the Web services wizard.  Sometimes, it's just manually creating a dynamic Web project with Axis2 facet.  The problem is intermittent and might not happen all the time.  However, it happends 60% to 80% of the time with a new workspace.  Others in the team is seeing the problem as well.
Comment 29 Kathy Chan CLA 2008-12-10 16:37:28 EST
Hi Jerome,

Do you have any chance to reproduce this problem yet?

We are hitting the error:

Project 'p1' is missing required library:
'D:\wtp\wtp31_1010\eclipse\workspace\p1\WebContent\WEB-INF\classes'   

in an adopter product which is based on WTP 3.1.

In the adopter product case, doing a refresh on the project does not solve the problem.

Is there some trace in the code that update the classpath that could be turn on to make debugging this problem easier?
Comment 30 Jerome Lanneluc CLA 2008-12-12 09:56:52 EST
(In reply to comment #29)
> Do you have any chance to reproduce this problem yet?
Unfortunately, I still cannot reproduce the problem.

> Is there some trace in the code that update the classpath that could be turn on
> to make debugging this problem easier?
To turn debug tracing on, please follow those steps:
1. Create a .options file with the following content:
# Turn on debug tracing for org.eclipse.jdt.core plugin
org.eclipse.jdt.core/debug=true
# Reports classpath variable initialization, and classpath container resolution
org.eclipse.jdt.core/debug/cpresolution=true
2. Start eclipse with the following command:
eclipse.exe -debug <path to your .options file> -vm <path to java.exe>
e.g. eclipse.exe -debug c:\temp\.options -vm c:\jdk1.5.0\bin\java.exe
=> this should open a DOS console
3. Ensure that the DOS console buffer size is as big as possible 
(Properties > Layout > Screen Buffer Size > set width and height to 9999)
4. When the problem occurs, copy/paste the content of the DOS console into a
file, and attach the file to this bug

Comment 31 Mark Hutchinson CLA 2008-12-19 14:55:11 EST
Created attachment 120972 [details]
debug output

Attached is the debug output when I have the following .options file:
# Turn on debug tracing for org.eclipse.jdt.core plugin
org.eclipse.jdt.core/debug=true
# Reports classpath variable initialization, and classpath container resolution
org.eclipse.jdt.core/debug/cpresolution=true

I reproduced the error by following the steps in comment 1.

This is the error in my problems view:
The container 'Web App Libraries' references non existing library 'D:\drivers\wtp-3.1-121208\eclipse\axis2\WebServiceProject2\WebContent\WEB-INF\classes'
Comment 32 Jerome Lanneluc CLA 2008-12-22 06:13:06 EST
Unfortunately, it is very hard to read the trace since it has been wrapped. Please make sure to set the buffer width to a bigger value.
Comment 33 Mark Hutchinson CLA 2008-12-22 10:29:23 EST
Created attachment 121074 [details]
debug output

this debug output should be formatted better
Comment 34 Robert Taniwa CLA 2009-01-08 12:25:01 EST
Did the last trace have the info you were looking for?

Thanks.
Comment 35 Jerome Lanneluc CLA 2009-01-09 06:25:16 EST
(In reply to comment #33)
> Created an attachment (id=121074) [details]
> debug output
> 
> this debug output should be formatted better
> 
Thanks. According to this trace the "org.eclipse.jst.j2ee.internal.web.container" container was initialized with a "D:/drivers/wtp-3.1-121208/eclipse/axis2c/WebServiceProject/WebContent/WEB-INF/classes" entry which doesn't exist.

Moving to WTP for more insights.
Comment 36 Konstantin Komissarchik CLA 2009-01-09 11:16:09 EST
Jerome,

Please see Comment #12 regarding the operation of this scenario. In particular note that when this happens Package Explorer and Project Explorer both show the presence of this directory. It is only JDT classpath model that is not picking up on it.
Comment 37 Jerome Lanneluc CLA 2009-01-23 04:58:04 EST
It sounds like at the time JDT/Core creates the marker, the folder doesn't exist. If the UI shows it correctly, it means that the folder was created in the meantime.

What we need to understand is why the folder creation didn't force the marker to be removed.

One scenario I can imagine is that the folder is not created using org.eclipse.core.resources but it is created using java.io. Can we rule out this scenario?

Also a workaround for this problem would be to create the folder before setting the classpath container. Can WTP do that?
Comment 38 Carl Anderson CLA 2009-01-26 17:03:45 EST
The code in question is in JavaFacetInstallDelegate (which Konstantin owns), and has the following:

            final IFolder defOutputFolder = project.getFolder( config.getDefaultOutputFolder() );
            mkdirs( defOutputFolder, true );

            // Add the java nature. This will automatically add the builder.

            final IProjectDescription desc = project.getDescription();
            final String[] current = desc.getNatureIds();
            final String[] replacement = new String[ current.length + 1 ];
            System.arraycopy( current, 0, replacement, 0, current.length );
            replacement[ current.length ] = JavaCore.NATURE_ID;
            desc.setNatureIds( replacement );
            project.setDescription( desc, null );

            // Setup the classpath.
            
            jproject.setRawClasspath( cp.toArray( new IClasspathEntry[ cp.size() ] ), 
                                      defOutputFolder.getFullPath(), null );

            JavaFacetUtil.resetClasspath( project, null, fv );
            JavaFacetUtil.setCompilerLevel( project, fv );


Now, the mkdirs() method consists of the following:

        if( ! folder.exists() )
        {
            final IContainer parent = folder.getParent();
            
            if( parent instanceof IFolder )
            {
                mkdirs( (IFolder) parent, isDerived );
            }
            
            folder.create( true, true, null );
            folder.setDerived( isDerived );
        }

So, if you follow that through, during the installation of the Java Facet (which should happen before the Web Facet is installed), the WEB-INF\classes directory is created at mkdirs (defOutputFolder, true);, using the IFolder API of Eclipse, and then it is added to the classpath.  As such, we are already doing what Jerome Lanneluc suggests as a workaround in comment #37.  This seems to be a timing issue of something else kicking off the validation done by the JDT before the Java Facet is installed.  (And note that the entire Web Project Creation is done in a WorkspaceModify operation, which should keep the JDT validation from being kicked off by anything done within it.)
Comment 39 Konstantin Komissarchik CLA 2009-01-27 00:00:40 EST
Carl,

This problem doesn't happen during java facet install. It happens during Axis facet install. 

Could someone from the WS team attach the relevant code from the Axis facet install delegate that causes the WEB-INF/classes directory to be created? 

Just remembered something... Back in August of 2008, in order to work around JDT Bug 141906, the container was changed to use IResource.getLocation() rather than IResource.getFullPath() to create a path that is passed to JDT. Jerome, is it possible that this is causing a different code path to be followed than the one that you are expecting?

Could someone who can reliably reproduce this issue sync to revision 1.34 of FlexibleProjectContainer class (head revision is 1.35) and see if the problem still exists. 
Comment 40 Yen Lu CLA 2009-01-27 13:26:00 EST
I can't speak for the Axis 2 scenario but our product was hitting a similar problem in a similar stage with the same message. When I applied Konstantin's suggestion of reverting FlexibleProjectContainer.java back to 1.34, I no longer run into the problem.
Comment 41 Yen Lu CLA 2009-02-12 09:00:41 EST
Hi,

Is there any update on this bug? I'm still seeing this issue with M5 versions of WTP 3.1 and Eclipse 3.5. It only goes away when I self-host with Konstantin's 2009-01-27 suggested code reversion.

Thanks,
Yen
Comment 42 Konstantin Komissarchik CLA 2009-02-12 12:39:32 EST
Well, I am leaving WTP behavior unaltered for now despite findings described in Comment #39 in order to give the JDT team at least something to go on when trying to understand this bug. If no progress is made by the JDT team on this issue when it's time to wrap up Galileo, I will apply a workaround in WTP that will mask this issue but bring back the original problem that the change from workspace paths to absolute paths was designed to address.
Comment 43 Jerome Lanneluc CLA 2009-03-11 13:10:53 EDT
Reassigning to Srikanth for a fresh look at this problem.
Comment 44 Jerome Lanneluc CLA 2009-05-06 10:48:00 EDT
Srikanth, we should push on this for 3.6 (it is now too late for 3.5). And if we have a fix, we should backport to 3.5.1.

Konstantin, I guess Srikanth will need your help after 3.5 to understand the problem.
Comment 45 Konstantin Komissarchik CLA 2009-05-06 13:12:48 EDT
> Konstantin, I guess Srikanth will need your help after 3.5 to understand the
> problem.

Sure. Let me know when you are ready to look at this bug and we can do a phone conf or something.
Comment 46 Srikanth Sankaran CLA 2009-06-23 06:37:17 EDT
(In reply to comment #45)
> > Konstantin, I guess Srikanth will need your help after 3.5 to understand the
> > problem.
> Sure. Let me know when you are ready to look at this bug and we can do a phone
> conf or something.

Hello,

    I can look at this now.

    Are the instructions in comment #25 up to date ? If not please
provide updated information to get started on this.

    It is going to take some time for me to internalize the background,
experiment with the setup etc, we can see if a phone conf makes sense
after that - Thanks. 



Comment 47 Srikanth Sankaran CLA 2009-07-15 05:15:24 EDT
(In reply to comment #45)
> > Konstantin, I guess Srikanth will need your help after 3.5 to understand the
> > problem.
> Sure. Let me know when you are ready to look at this bug and we can do a phone
> conf or something.

Hello Konstantin,

     The links specified in comment#25 are stale and as such I am
blocked on working on this. I need your help.

     Rather than updating comment #25 which involves numerous steps,
I would prefer remote desktop access to a machine where I can login
observe and debug the problem. As I know nothing about, WTP, tomcat,
WSDL, web servrices etc, this would also eliminate any procedural 
errors in attempting to reproduce the problem on my side.

    This is also better since Jerome already had tried these steps
without any luck.

     (1) Can we ensure that the SDK version of 3.5 is used for this
purpose ? I would like to be able to debug JDT/Core code on the
remote machine.

     (2) JVM options to enable remote debugging:
-Xdebug -Xnoagent -runjdwp:transport=dt_socket,server=y,suspend=n,address=8000

On another note, we recently closed bug#280497 and bug# 276373.
These ring a (albeit very mild) bell.



Comment 48 Jay Arthanareeswaran CLA 2009-07-16 08:10:33 EDT
Created attachment 141765 [details]
Project with test cases

This project has a couple of Junit test cases, which demonstrates the behavior - one each with IResource.getFullpath() and IResource.getLocation(). As we have been discussing, the one using IResource.getLocation fails. To execute this test, you need to use a simple Java project (Test) with a folder 'classes' and add the folder to the classpath of the project. 

It seems to me that any folder (as a classpath entry) with an absolute (system) path is considered to be external and hence marked with an INVALID_CLASSPATH status. This code is at

org.eclipse.jdt.internal.core.ClasspathEntry.validateLibraryEntry(IPath, IJavaProject, String, IPath, String) : Line no 2032 onwards.
Comment 49 Jay Arthanareeswaran CLA 2009-07-16 08:15:16 EDT
Created attachment 141767 [details]
Test Project

Please use this test project with the test cases attached earlier. Once this test project is set-up, the same workspace has to be used for the Junit plugin project and also make sure to uncheck the 'clear' option in the run configurations dialogue.
Comment 50 Srikanth Sankaran CLA 2009-07-17 00:05:41 EDT
(In reply to comment #48)

> It seems to me that any folder (as a classpath entry) with an absolute (system)
> path is considered to be external and hence marked with an INVALID_CLASSPATH
> status. This code is at
> org.eclipse.jdt.internal.core.ClasspathEntry.validateLibraryEntry(IPath,
> IJavaProject, String, IPath, String) : Line no 2032 onwards.

The above is true only when org.eclipse.jdt.internal.core.JavaModel.getTarget(IPath, boolean) returns null, right ? (since an external file system folder 
as well as an external file is encapsulated by java.io.File)

So the real question would be : why would JavaModel#getTarget return null
in these cases.

Have you had any luck with condensing these into a junit yet ?
Comment 51 Srikanth Sankaran CLA 2009-07-21 03:57:29 EDT
Created attachment 142102 [details]
This patch is superseded by the patch attached to
comment#54 (this latter patch also has tests)

Olivier/Jerome, could you review this candidate patch to see if this is a realistic test for what is described in the bug ? - Thanks.

Please apply this patch on the 3.5 maint branch and
see if it helps. This fixes the same symptoms as the
original complaint in comment#0 that Jay managed to
reproduce with the test cases attached via 
comment #48 & comment #49. While the symptom is the
same, the underlying cause may not be and hence we
need this tested.

If this patch does not help, then we will need
remote desktop access for debugging as requested
in comment #47.

If Konstantin is away and someone on the CC list
can help test this, please do - Thanks.
Comment 52 Jay Arthanareeswaran CLA 2009-07-31 01:31:08 EDT
Created attachment 143100 [details]
JDT/Core plugin patch

Attached is the JDT/Core plug-in patch with the fix mentioned in https://bugs.eclipse.org/bugs/show_bug.cgi?id=248661#c51

A couple of things to note before testing:

1. The patch is on 3.5 stream and meant to be tested with Eclipse 3.5
2. The workaround mentioned below needs to be backed out:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=248661#c42
Comment 53 Jay Arthanareeswaran CLA 2009-07-31 05:44:56 EDT
Created attachment 143118 [details]
JDT/Core plugin patch (With Updated version)

Updating the plug-in patch with the exact version as the R3.5. Please ensure that you overwrite the existing one when testing with 3.5. Also one can verify that the patch has been loaded by finding the following message in the .metadata/.log file:
"Bug fix patch 248661 being run"
Comment 54 Jay Arthanareeswaran CLA 2009-08-10 02:12:15 EDT
Created attachment 143864 [details]
Proposed Fix 

Attached the fix for source in HEAD along with relevant tests.
Comment 55 Srikanth Sankaran CLA 2009-08-10 04:54:48 EDT
(In reply to comment #54)
> Created an attachment (id=143864) [details]
> Proposed Fix 
> Attached the fix for source in HEAD along with relevant tests.

Olivier, please see if this potential patch is testing (a) a realistic
scenario and (b) if that scenario maps closely to what is described here
in this defect. Having never managed to reproduce this problem locally,
we have basically started with the observation in comment#39 and built
a test case out of it - thanks. 

Comment 56 Olivier Thomann CLA 2009-08-10 11:59:59 EDT
Without feedback, no code will be released for 3.5.1 and it is getting really late. So unless we get feedback in the next couple of days, I will remove 3.5.1 as the target milestone.
Comment 57 Robert Taniwa CLA 2009-08-11 12:49:06 EDT
Mark/Yen, can you see if this patch resolves our issue? Thanks.
Comment 58 Srikanth Sankaran CLA 2009-08-12 01:50:12 EDT
(In reply to comment #57)
> Mark/Yen, can you see if this patch resolves our issue? Thanks.

Just to clarify, please test the JDT/Core patched plugin posted
via comment #53. Also a reminder that the workaround referred to
in comment#42 needs to backed out before testing.

(Source patch posted via comment#54 is really meant for internal
team review process and is not released yet)
Comment 59 Mark Hutchinson CLA 2009-08-12 10:56:41 EDT
I tried this on WTP 3.2I-20090805214636  (based on eclipse eclipse-SDK-M20090729-0903-win32.zip) and was not able to reproduce the original problem, even without applying the patch.  Since I can't reproduce the original problem I am unable to verify this fix works.

In comment 42 Konstantin mentioned the possibility of adding a workaround.  Was this workaround ever added, and if so how do I remove it so I can try to verify this?
Comment 60 Olivier Thomann CLA 2009-08-12 14:56:56 EDT
You should try to reproduce using an older build like (Build ID:  WTP 3.1 M2 build I-3.1-20080925012741).
Comment 61 Olivier Thomann CLA 2009-08-12 15:58:23 EDT
If there is a workaround for 3.5.1 in WTP, we might consider moving it to either 3.5.2 or only 3.6.
Comment 62 Olivier Thomann CLA 2009-08-13 10:58:37 EDT
Changing target milestone to 3.6 as a workaround is used for 3.5.1.
Comment 63 Olivier Thomann CLA 2009-08-13 11:40:16 EDT
The fix and the patch looks good. The only thing that I'd like to understand is how Axis2 ended up with this problem.
The current workaround should be removed and the patch tested.
Please post testing progress in this bug report.
Comment 64 Mark Hutchinson CLA 2009-08-14 15:16:34 EDT
I was able to reproduce the original problem on WTP 3.1 M2
build I-3.1-20080925012741.  The patch appears to fix the problem.

I did notice, that the "Bug fix patch 248661 being run" message is printed in the log about 200 times every time I run through this scenario?  Could there be any performance impact with this patch?  Just timing with my watch, it seems that the axis 2 scenario runs twice as slow.  (Maybe this is just caused by all the extra logging)
Comment 65 Srikanth Sankaran CLA 2009-08-17 02:44:58 EDT
(In reply to comment #64)
> I was able to reproduce the original problem on WTP 3.1 M2
> build I-3.1-20080925012741.  The patch appears to fix the problem.

Mark, thanks a lot for testing and Jay, thanks a lot for the patch.

> I did notice, that the "Bug fix patch 248661 being run" message is printed in
> the log about 200 times every time I run through this scenario?  Could there be
> any performance impact with this patch?  Just timing with my watch, it seems
> that the axis 2 scenario runs twice as slow.  (Maybe this is just caused by all
> the extra logging)

Probably. Jay, could you move this logging to 
org.eclipse.jdt.internal.core.JavaModelManager.startup() 
(if still needed) and update the plugin patch for testing ? 

Also does it make sense to cache the IPath corresponding
to workspace root ? I see that your fix kicks in ONLY when
we would have otherwise reported a missing required library
error, so that is good.
Comment 66 Jay Arthanareeswaran CLA 2009-08-18 04:41:32 EDT
Created attachment 144797 [details]
JDT/Core plugin patch

Mark,

Can you test this plug-in patch. I removed the log message that gets printed frequently. Instead, I added a one-time message as follows:

"!MESSAGE Starting up JavaModelManager"

Please look for this to verify the patch and tell me if you still find a performance issue. The patch also incorporates other suggestions (comment #65) that Srikanth made. And note that this is to be tested with eclipse 3.5.
Comment 67 Jay Arthanareeswaran CLA 2009-08-18 05:02:41 EDT
Created attachment 144798 [details]
Updated patch

This is the patch for HEAD to be reviewed. This patch incorporates the suggestions made by Srikanth. Also removed the log messages that is part of the plug-in patch.
Comment 68 Mark Hutchinson CLA 2009-08-20 10:36:19 EDT
The most recent patch, with the reduced logging performs fine.
Comment 69 Srikanth Sankaran CLA 2009-08-21 01:17:29 EDT
(In reply to comment #68)
> The most recent patch, with the reduced logging performs fine.

Mark, Thanks much for testing again. Jay, thanks for coming up
with the fix despite not being able to reproduce it locally.

Released in HEAD for 3.6M2
Comment 70 Olivier Thomann CLA 2009-09-16 09:55:35 EDT
Verified for 3.6M2 using I20090915-0100.