zlaja
zlaja

Reputation: 1363

Publish on Tomcat from Eclipse

I have problem when publishing web project on tomcat. I've got this error:

!ENTRY org.eclipse.wst.server.core 4 0 2013-07-17 14:22:41.293 !MESSAGE Could not publish to the server. !STACK 0 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:338) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getNonManifestRefs(J2EEModuleVirtualComponent.java:242) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:166)

But If I turn off Maven's resolve dependencies from Workspace in web project everything works fine.

Any idea

Thanks

Zlaja

Upvotes: 3

Views: 1805

Answers (3)

Philippe Brunet
Philippe Brunet

Reputation: 71

I guess the problem is solved .. for years now, but it could interest somebody else, facing the same kind of problem with Eclipse.

I use Eclipse Luna, a quite fresh installation (1 month).

I had no problem deploying my webapp when ... today, I suddenly got the same exception (as mentioned above) when publishing the webapp.

I found the problem. For me, it was in the .project file:

        <buildCommand>
        <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
        <triggers>full,incremental,</triggers>
        <arguments>
            <dictionary>
                <key>LaunchConfigHandle</key>
                <value>&lt;project&gt;/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder (1).launch</value>
            </dictionary>
        </arguments>
    </buildCommand>

I don't why, but the line related to externalToolBuilders is wrong: checking my workspace, I figured out that the correct statement is:

<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch</value>

After correction, I could publish my webapp.

Hope it could help...

PS: it's not the first time I got exception with Eclipse .. and more that once, I found the solution checking the .project, and comparing it with another .project file, belonging to another application/module that works correctly...

Upvotes: 1

real_mym
real_mym

Reputation: 11

I have had a similar issue. In my case, the web app project had a dependency to another library project. An the library project had no facets enabled. So I enabled facets for Java and Utility Module. That seemed to resolve the issue. It was in Eclipse :

Version: Mars Release (4.5.0) Build id: 20150621-1200

Upvotes: 1

zlaja
zlaja

Reputation: 1363

I have used m2e plugin instead of m2e-wtp. After installing m2e-wtp it works fine.

Zlaja

Upvotes: 1

Related Questions