Problem with tomcat 7.0.11 + Maven + "serve modules without publishing" : return of bug 31 [message #660608] |
Sat, 19 March 2011 21:38 |
slaurent Messages: 5 Registered: February 2010 |
Junior Member |
|
|
Hello,
I'm using SpringSource ToolSuite 2.6.0 (based on eclipse 3.6.2) with tomcat 7.0.11 and a maven project (a Roo example).
When I deploy the webapp without "Serve modules without publishing" it works OK.
But when I activate this feature, the Spring context fails to load because it fails to find the persistence.xml file :
java.io.FileNotFoundException: /Users/slaurent/dev/workspaces/workspace-sts-2.6.0.RELEASE/c linic/src/main/webapp/WEB-INF/classes/META-INF/persistence.x ml (No such file or directory)
Indeed, with maven it should be looking for classpath resources in target/classes not in src/main/webapp/WEB-INF/classes
I spent some time trying to debug this and I think that the root cause is that in the <Context> that WTP generated for tomcat, the <Resources> element has the attribute
extraResourcePaths=" /WEB-INF/classes|/Users/slaurent/dev/workspaces/workspace-st s-2.6.0.RELEASE/clinic/target/classes "
It seems to be just like bug 318449 but I thought it had been fixed in Helios SR2 ??
[Updated on: Sat, 19 March 2011 21:38] Report message to a moderator
|
|
|
Re: Problem with tomcat 7.0.11 + Maven + "serve modules without publishing" : return of bu [message #660771 is a reply to message #660608] |
Mon, 21 March 2011 14:12 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
On 3/19/2011 5:38 PM, slaurent wrote:
> Hello,
>
> I'm using SpringSource ToolSuite 2.6.0 (based on eclipse 3.6.2) with
> tomcat 7.0.11 and a maven project (a Roo example).
>
> When I deploy the webapp without "Serve modules without publishing" it
> works OK.
> But when I activate this feature, the Spring context fails to load
> because it fails to find the persistence.xml file :
>
> java.io.FileNotFoundException:
> /Users/slaurent/dev/workspaces/workspace-sts-2.6.0.RELEASE/c
> linic/src/main/webapp/WEB-INF/classes/META-INF/persistence.x ml (No such
> file or directory)
>
> Indeed, with maven it should be looking for classpath resources in
> target/classes not in src/main/webapp/WEB-INF/classes
>
> I spent some time trying to debug this and I think that the root cause
> is that in the <Context> that WTP generated for tomcat, the <Resources>
> element has the attribute extraResourcePaths="
> /WEB-INF/classes|/Users/slaurent/dev/workspaces/workspace-st
> s-2.6.0.RELEASE/clinic/target/classes "
>
> It seems to be just like bug 318449 but I thought it had been fixed in
> Helios SR2 ??
It got broke again post 7.0.8, see Bug 338564[1]. I assume this is the
cause of your symptom. The fix for Tomcat 7.0.9 and later is already
present in WTP 3.3M6, and was recently committed to WTP 3.2.4. The
timing didn't allow it to get squeezed into WTP 3.2.3.
If you download the "Updated loader jar for Tomcat 7.0.9 and later"
attachment in the bug and save it as
"org.eclipse.jst.server.tomcat.runtime.70.loader.jar" (instead of
"*.zip"), then you can copy this one on top of the one in the
"<workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmp?/lib "
directory and it should work correctly. If you disable and re-enable
the "Serve modules without publishing" feature, you will have to re-copy
the jar.
Alternatively, until WTP 3.2.4 comes out, you could replace the copy in
the org.eclipse.jst.server.tomcat.core_1.1.203.v20110201.jar plug-in.
Without the code changes to the plug-in for WTP 3.2.4, it could no
longer support Tomcat 7.0.8, but it would work for Tomcat 7.0.9 and
later, which would be more useful. At least until they break it again.
Hopefully things have stabilized in Tomcat relative to this feature.
I don't see any further improvements of the type the have made so far to
the file in question.
Cheers,
Larry
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=338564
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03170 seconds