When running my WebApp project from Eclipse most of times it run correctly. But if by mistake to stop server, I kill it in "Console" view on instead of "Stop" Server from "Servers" View. While running clean project I get this
java.lang.NullPointerException
at org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities.getDefaultProjectArchiveName(VirtualReferenceUtilities.java:81)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getJavaClasspathReferences(J2EEModuleVirtualComponent.java:332)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getNonManifestRefs(J2EEModuleVirtualComponent.java:236)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:160)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:208)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:201)
at org.eclipse.jst.common.internal.modulecore.SingleRootUtil.hasConsumableReferences(SingleRootUtil.java:217)
at org.eclipse.jst.common.internal.modulecore.SingleRootUtil.validateSingleRoot(SingleRootUtil.java:165)
at org.eclipse.jst.common.internal.modulecore.SingleRootUtil.isSingleRoot(SingleRootUtil.java:93)
at org.eclipse.jst.common.internal.modulecore.SingleRootExportParticipant.canOptimize(SingleRootExportParticipant.java:84)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.canOptimize(FlatVirtualComponent.java:136)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.cacheResources(FlatVirtualComponent.java:118)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.fetchResources(FlatVirtualComponent.java:101)
at org.eclipse.wst.web.internal.deployables.FlatComponentDeployable.members(FlatComponentDeployable.java:147)
at org.eclipse.wst.server.core.internal.ModulePublishInfo.hasDelta(ModulePublishInfo.java:418)
at org.eclipse.wst.server.core.internal.ServerPublishInfo.hasDelta(ServerPublishInfo.java:443)
at org.eclipse.wst.server.core.internal.Server.hasPublishedResourceDelta(Server.java:1539)
at org.eclipse.wst.server.core.internal.Server$ResourceChangeJob$1.visit(Server.java:214)
at org.eclipse.wst.server.core.internal.Server.visitModule(Server.java:2929)
at org.eclipse.wst.server.core.internal.Server.visit(Server.java:2913)
at org.eclipse.wst.server.core.internal.Server$ResourceChangeJob.run(Server.java:225)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
And while launching I get this
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Webapp 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:4319)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
Please help recover from this.
I encountered the same issue and cleaning and recreating server does not help. But when I deployed another project, it was able to start successfully. After much comparison, I found differences in the .project files. So I copy the contents of the .project file of the working project into the one that has problem, add it back to the server and it works. Following is the contents of the .project file that works. Note that you need to change the name of the project accordingly:
I suffered from this problem, but cause was different. Problem sprang from
wrong server name([Project Name] != [Server Name])
. I thought that i could figure out by recreate Server.This Problem can solve by following below steps:
[Severs]
and remove server.[Project Explorer]
and delete Server(you created).[Project -> Clean]
[Severs]
and new server.server.xml
foor your web server.[Severs]
and remove server.Just do maven -> Update project configuration and clean/build from your eclipse. Project will be loaded.
I have stopped using this method of running my webapp. I use
mvn tomcat:run
instead. Much easier. Though I don't know how to debug.In my case it was enough to copy (from working project):
This problem might be caused by your local project being out of sync with your code repository. I would suggest to refresh/synchronize your project.