Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325671 - WtpDirContext throws NullPointerException when reloading a Maven project
Summary: WtpDirContext throws NullPointerException when reloading a Maven project
Status: CLOSED DUPLICATE of bug 318492
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: jst.server (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: jst.server CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-18 04:33 EDT by Mariano Eloy Fernández Osca CLA
Modified: 2010-09-18 07:38 EDT (History)
0 users

See Also:


Attachments
A complete Eclipse project configured to reproduce the error. (6.14 KB, application/octet-stream)
2010-09-18 04:35 EDT, Mariano Eloy Fernández Osca CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mariano Eloy Fernández Osca CLA 2010-09-18 04:33:58 EDT
Build Identifier: 20100617-1415

I'm trying to set up Maven + WTP to hot deploy changes onto a Tomcat 6.0 server. I'm using Tomcat's "Serve modules without publishing" options to speed up things.
To accomplish this I needed to twist a little bit MVN and JDT config to put compiled classes directly to WEB-INF/classes so 
These are the main configuration files I'm working around.

org.eclipse.wst.common.component
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="mvnweb">
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<property name="context-root" value="mvnweb"/>
<property name="java-output-path" value="/src/main/webapp/WEB-INF/classes"/>
</wb-module>
</project-modules>

pom.xml
  	<outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory>

Default output folder in Java Build Path is set to /src/main/webapp/WEB-INF/classes.

Everything looks fine, server starts up, but when changing a single line on a servlet a NullPointerException is thrown by org.eclipse.jst.server.tomcat.loader.WtpDirContext.file(WtpDirContext.java:209)


Reproducible: Always

Steps to Reproduce:
1. Set up a project as described above
2. Start up Tomcat
3. Change a single line on a Servlet and save it
4. Watch for that error stacktrace on the server's console
Comment 1 Mariano Eloy Fernández Osca CLA 2010-09-18 04:35:57 EDT
Created attachment 179165 [details]
A complete Eclipse project configured to reproduce the error.
Comment 2 Mariano Eloy Fernández Osca CLA 2010-09-18 04:36:51 EDT
Extra things to run the project:

- m2eclipse plugin
- Apache Tomcat 6.0
Comment 3 Mariano Eloy Fernández Osca CLA 2010-09-18 04:40:26 EDT
The final goal is to set up a web project in Eclipse combined with Maven and make it work in such a way that changes made to classes are visible as quickly as possible.
That's why I'm trying to skip publishing web resources, thus pointing WTP directly to src/main/webapp, and also changing Java sources default output directory (/target/classes) to WEB-INF/classes.
Comment 4 Mariano Eloy Fernández Osca CLA 2010-09-18 07:38:43 EDT
Searching for "WtpDircontext" in Google pointed me to Bug 318492.

*** This bug has been marked as a duplicate of bug 318492 ***