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

Bug 319951

Summary: NPE with tomcat server when "Serve modules without publishing" selected
Product: [WebTools] WTP ServerTools Reporter: perseusli <perseusli>
Component: jst.serverAssignee: Larry Isaacs <larryisaacs>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: major    
Priority: P3 CC: b_stader, kenneth.chenis, perseusli, thatnitind
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description perseusli CLA 2010-07-15 03:34:30 EDT
Build Identifier: 

When run or debug a tomcat server whith "Serve modules without publishing" options selected, it'l get a NullPointerException.

Reproducible: Always

Steps to Reproduce:
1.Create a tomcat server with "Serve modules without publishing" selected.
2.Add a web project to the server and press run or debug button.
3.The server start with a NullPointerException and the web project fails.
Comment 1 perseusli CLA 2010-07-15 03:38:22 EDT
The Eclipse version is Helios JEE package.
Comment 2 Angel Vera CLA 2010-07-16 11:31:20 EDT
Can you post the stacktrace that you get? the latest NPE that we got reports of was Bug# 318492
Comment 3 perseusli CLA 2010-07-18 23:23:15 EDT
(In reply to comment #2)
> Can you post the stacktrace that you get? the latest NPE that we got reports of
> was Bug# 318492

&#20005;&#37325;: Error starting static Resources
java.lang.IllegalArgumentException: Document base E:\......\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\brick_spot_sys does not exist or is not a readable directory
	at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
	at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4048)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4217)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2010-7-19 11:17:35 org.apache.catalina.core.StandardContext start
&#20005;&#37325;: Error in resourceStart()
2010-7-19 11:17:35 org.apache.catalina.core.StandardContext start
&#20005;&#37325;: Error getConfigured
2010-7-19 11:17:35 org.apache.catalina.core.StandardContext start
&#20005;&#37325;: Context [/sys] startup failed due to previous errors
2010-7-19 11:17:35 org.apache.catalina.core.StandardContext stop
&#20449;&#24687;: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/sys] has not been started
2010-7-19 11:17:35 org.apache.coyote.http11.Http11Protocol start
&#20449;&#24687;: Starting Coyote HTTP/1.1 on http-6080
2010-7-19 11:17:36 org.apache.jk.common.ChannelSocket init
&#20449;&#24687;: JK: ajp13 listening on /0.0.0.0:6009
2010-7-19 11:17:36 org.apache.jk.server.JkMain start
&#20449;&#24687;: Jk running ID=0 time=0/312  config=null
2010-7-19 11:17:36 org.apache.catalina.startup.Catalina start
&#20449;&#24687;: Server startup in 1751 ms
Comment 4 Larry Isaacs CLA 2010-08-17 13:51:04 EDT
I'm not able to duplicate this problem with the steps provided.   Since there doesn't seem to be an indication that projects aren't working with "Serve modules without publishing" enabled, I'll assume it is working given this NPE occurs.  With "Serve modules without publishing" enabled, no <Context> should have a docBase pointing to the ".../tmp0/wtpwebapps" folder.  This log output suggests that somehow, a <Context> in the server.xml found under the Servers project in your workspace got "disconnected" from it's associated project.  As a result, it's seen as an "external" <Context> and is not be adjusted for "Serve modules without publishing".  As long as this "disconnected" <Context> is present, you will get this error.  Manually removing it should get rid of the error.

The question is how the brick_spot_sys project got "disconnected".  If the NPE is still occurring, please attach the server.xml found under the Servers project in your workspace.  Also, does the  brick_spot_sys project still exist in your workspace?
Comment 5 perseusli CLA 2010-08-18 21:08:49 EDT
It seems WTP 3.2.1.v201007151559 has resolved this problem. I've updated and it works well.