0

NullPointerException when deploying to Tomcat

asked 2010-11-06 09:48:10 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

updated 2010-11-07 12:36:23 +0800

Hello everyone,

I suddenly have a problem trying to publish my ZK project to Tomcat 6 from within ZK Studio.

Til yesterday everything worked fine but suddenly today when I click "Run As->Run on server" the attempt fails with the following error message:

Publishing to "Tomcat 6.0 at localhost" has encountered a problem.
Could not publish to server.
An internal error occurred during: "Updating status for Tomcat v6.0 Server at localhost...".
java.lang.NullPointerException

This also happens if I press CMD+B (Ctrl+B) for a full rebuild after cleaning the whole project.

Does anyone know how to solve or at least debug this?

delete flag offensive retag edit

10 Replies

Sort by ยป oldest newest

answered 2010-11-07 12:37:17 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

This starts to get really frustrating...

I tried to create a plain new ZK project - no change.
Uninstalled Tomcat 6.0 and installed Tomcat 7.0. - no change.

Damn, what's wrong with this?

link publish delete flag offensive edit

answered 2010-11-10 20:22:32 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi valmar,
can you start Tomcat outside of eclipse? Or else could you try creating another workspace and new project in it?

link publish delete flag offensive edit

answered 2010-11-11 03:22:19 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Try to clean the Tomcat Work Directory like in this pic.

link publish delete flag offensive edit

answered 2010-11-11 06:54:16 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

@ashishd Yes, starting Tomcat from outside eclipse works perfectly.

@terrytornado I did that already.
The funny thing is: After doing that, I get a 404 every time I try to load my web app in the browser (through http://localhost:8080/myapp).
Before that, the website showed at least the version of the last successful build (which is already days old).
I think eclipse seems to have a problem deploying the new build files to a directory where Tomcat can access them.
I believe, it tries to publish to the following directory but fails (for some reason):
/Users/USERNAME/Documents/workspaces/zk/.metadata/.plugins/org.eclipse.wst.server.core/tmp0

link publish delete flag offensive edit

answered 2010-11-11 07:50:13 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

I have sometimes problems with eclipse plugins too, mostly the maven plugins.

In your case it can helps, if you delete the files from your mentioned directory of the eclipse Tomcat plugin.
Make a reboot. :-)

link publish delete flag offensive edit

answered 2010-11-11 08:29:03 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

I did that already too :-)

The funny thing: If I manually remove these files, reboot and re-publish, the first build and deployment works. After that: Same old problem.

This is really weird. Everything worked perfectly but since a few days this problem occurs.

Maybe I should try a full reinstall of tomcat, zk studio and the zk sdk...

link publish delete flag offensive edit

answered 2010-11-11 08:48:35 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

I removed that directory tmp0 again and now when I start Tomcat from within ZK Studio, I get this error message:

Publishing failed
Could not publish to the server.
java.lang.NullPointerException
Could not publish server configuration: /Users/valmar/Documents/workspaces/zk/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/server.xml (No such file or directory).
/Users/valmar/Documents/workspaces/zk/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/server.xml (No such file or directory)

How can I reinitialize this directory?

link publish delete flag offensive edit

answered 2010-11-11 09:44:24 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

Ok, I found the problem.

There was a corrupt project in my workspace associated with Tomcat.

So, whenever I wanted to publish a project to the same server, the attempt failed.

After deleting the corrupt project, everything works fine.

link publish delete flag offensive edit

answered 2010-11-11 11:32:24 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

:-) Great

link publish delete flag offensive edit

answered 2010-11-11 12:45:18 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

Thanks for the help btw :-)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-11-06 09:48:10 +0800

Seen: 3,571 times

Last updated: Nov 11 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More