Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 224846

Summary: Cannot create Java EE artifacts: servlet, beans, etc.
Product: [WebTools] WTP Java EE Tools Reporter: Kaloyan Raev <kaloyan>
Component: jst.j2eeAssignee: Kaloyan Raev <kaloyan>
Status: CLOSED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: blocker    
Priority: P1 CC: david_williams, thebravoman
Version: 3.0   
Target Milestone: 3.0 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

Description Kaloyan Raev CLA 2008-03-31 04:45:57 EDT
Build ID: I20080329212442

Steps to reproduce:
1. Start IDE in clean workspace.
2. Create a Dynamic Web Project. 
3. Call the Servlet wizard and finish it. 

The Servlet is not created. Instead there are errors in the Problems view: 

Project '.JETEmitters' is missing required library: 'D:\eclipse\target-wtp3.0\eclipse\ce:file:plugins\org.eclipse.jst.j2ee_1.1.200.v200803290400.jar'	

Project '.JETEmitters' is missing required library: 'D:\eclipse\target-wtp3.0\eclipse\ce:file:plugins\org.eclipse.jst.j2ee.web_1.1.200.v200803270300.jar'	

The problem is that instead of "plugin" there is "ce:file:plugins" in the jar paths.
Comment 1 Kaloyan Raev CLA 2008-03-31 04:53:08 EDT
This problem should also explain some of the failing JEE JUnit tests. 
Comment 2 Kaloyan Raev CLA 2008-03-31 05:23:54 EDT
The root cause appears to be in WTPJETEmmitter.getJarredPluginPath():484.
There the location of the JAR is retrieved by calling "bundle.getLocation()". This method returns the location of the plugin JAR, but prefixed with "resource:file:". It seems that on line 484 there is an attempt to remove this prefix from the string - substring(7). I suppose that the prefix was shorter in previous releases of Eclipse SDK and it has been changed in the last days. 

The getJarredPluginPath() method is not called if the respective plugins are checked out in the workspace. This is why this problem did not appear in my dev environment. 

Comment 3 Kaloyan Raev CLA 2008-03-31 05:26:14 EDT
Created attachment 94183 [details]
patch

Patch that replaces
    bundle.getLocation().substring(7);
with
    FileLocator.getBundleFile(bundle).getPath();
Comment 4 David Williams CLA 2008-03-31 05:30:14 EDT
Mid-air collision ... and looks like you've already gotten it ... but, for reference, there's what I was writing. 



Think this is related to bug 224384? Issues with getJarredPluginPath have been found in P2'd Platform, where we install our code in "eclipse/dropins" instead of in the old eclipse/plugins and features. 

The incorrect path look very similar to the original bug 224148. (which also provides a solution ... see https://bugs.eclipse.org/bugs/show_bug.cgi?id=224148#c9

Comment 5 David Williams CLA 2008-03-31 05:35:20 EDT
And, just FYI, if required, we could declare with this bug, and say "we don't work with a P2 type install" with this I-build ... but, I certainly agree it should be fixed for M6, if not this I-build. 
Comment 6 Kaloyan Raev CLA 2008-03-31 05:42:29 EDT
David, thank you for the additional references. 
I have just dropped to fix and released it to the build. 

This bug blocks smoke testing and I would not wish to declare this I-build in this case. I suggest we wait for the build and I will re-smoke. 

BTW, there is a build already running. Could we cancel it and trigger a new one? This will speed up the whole thing with an hour or two. 
Comment 7 Kaloyan Raev CLA 2008-03-31 05:46:38 EDT
*** Bug 224384 has been marked as a duplicate of this bug. ***
Comment 8 kiril mitov CLA 2008-04-02 08:48:12 EDT
Verified with wtp-sdk-I-I20080331115711-20080331115711
Comment 9 Kaloyan Raev CLA 2008-05-12 09:38:29 EDT
Closing