|
Re: Could not publish to the server [message #1000487 is a reply to message #1000425] |
Mon, 14 January 2013 21:42 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
On 1/14/2013 2:39 PM, Paulo Vitor Braga Pessoa wrote:
> Hi everybody,
>
> When I try to publish one simple web project in tomcat 7 server, the wtp
> gives me a nullpointer with the following stacktrace:
>
>
> java.lang.NullPointerException
> at
> org.eclipse.wst.server.core.util.PublishHelper.publishSmart(PublishHelper.java:331)
>
> at
> org.eclipse.wst.server.core.util.PublishHelper.publishSmart(PublishHelper.java:367)
>
> at
> org.eclipse.wst.server.core.util.PublishHelper.publishSmart(PublishHelper.java:367)
>
> at
> org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.publishDir(TomcatServerBehaviour.java:348)
>
> at
> org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.publishModule(TomcatServerBehaviour.java:268)
>
> at
> org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1046)
>
> at
> org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1138)
>
> at
> org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:955)
>
> at
> org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
>
> at
> org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3108)
> at
> org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
>
>
> I have tried to remove server and add again, even update eclipse!
>
> This error never happens to me before, can you help-me?
>
> Sorry for my bad english.
>
> Additional information:
>
> eclipse.buildId=M20120914-1800
> java.version=1.6.0_29
> java.vendor=Apple Inc.
> BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=pt_BR
>
>
It's not clear exactly what scenario brings about this NPE. Does
right-clicking on the Tomcat 7 server in the Servers view and executing
"Clean..." able to get past this error?
Cheers,
Larry
|
|
|
|
|
|
Re: Could not publish to the server [message #1225766 is a reply to message #1224802] |
Mon, 30 December 2013 18:38 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
On 12/28/2013 1:08 PM, Lisias Toledo wrote:
> I just get this exact misbehaviour with Kepler Build id: 20130919-0819 .
> Stack trace belows.
>
> It's something on the workspace? The project was being published
> all-right for months. without any problems. And then, for no apparent
> reason, this error start to popup from nowhere.
>
> I deleted the server from workspace, recreated and no go.
>
> I deleted org.eclipse.wst.xml.core from .metadata\.plugins . It was
> recreated, but no go.
>
> I even deleted every org.eclipse.wst.* on .plugins. No go.
>
> It appears to be a regression from
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=219627
>
> Should I reopen the bug?
>
> java.lang.NullPointerException
> at
> org.eclipse.wst.server.core.util.PublishHelper.publishSmart(PublishHelper.java:331)
>
This is a different bug since the NPE is at a different location. The
code for your NPE is:
long mod = -1;
IFile file = (IFile) mf.getAdapter(IFile.class);
if (file != null) {
mod = file.getLocalTimeStamp();
} else {
File file2 = (File) mf.getAdapter(File.class);
mod = file2.lastModified(); // Line 331
}
The code is trying to determine the modified date of a file resource in
your project, which is why deleting things under the ".metadata" folder
didn't help. It would seem that a resource in your project that is
expected to be a file somehow isn't, or is corrupted in some way.
Unfortunately the code offers nothing in the way of diagnostic help
beyond the NPE. If you aren't able to guess which resource is the
problem, I would suggest you create a separate workspace and in that
workspace create a simple dummy plug-in project. Run this plug-in
project in debug mode and import your dynamic web project into the
workspace it creates. Set up your server and set a breakpoint on
NullPointerException. Then try to publish and hopefully you will be
able to tell from the "mf" variable what resource is causing the
problem. There might be other "normal" NPEs that occur before hitting
line 331 of PublishHelper. Source for PublishHelper can be obtained
from the the link[1] below.
Cheers,
Larry
[1]
http://git.eclipse.org/c/servertools/webtools.servertools.git/tree/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishHelper.java
|
|
|
Powered by
FUDForum. Page generated in 0.03315 seconds