Skip to main content

Can't publish web app to GlassFish

18 replies [Last post]
sinnednehc
Offline
Joined: 2004-05-21

I installed GlassFish eclipse plugin, configured to glassfish-v2ur1 app server. Then I created a Dynamic Web Application in eclipse, added a simple index.html. When I publish the web app, I got error message window:
---------------------------------------------------------------------------------------------------------------
Publishing to GlassFish V2...(Time of error: March 2, 2008 7:19:57 AM EST)
Reason:
java.lang.NullPointerException.
---------------------------------------------------------------------------------------------------------------

Did anyone have the same problem?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bennyrio
Offline
Joined: 2008-03-18

Thanks,
Putting my dynamic web project to an EAR project did the trick.
I'm running eclipse europa 3.3.2/WST 2.0.2 and glassfish V2ur1

However, I still looking for clean solution

bedouin
Offline
Joined: 2008-05-19

I had a similar error today with Jonas and fixed the problem.

You just need to upgrade the latest patches for WST [b][u]and[/b][/u] JST as well.

Finally all worked perfectly with 2.0.2. (WST & JST)

Our config is Jonas 4.8.6 and Eclipse Winter (3.3.2)

Message was edited by: bedouin

vascopedro
Offline
Joined: 2008-05-21

How do you upgrade to the latest patches of WST and JST?

I have looke at the update manager and the WTP website, WST and JST subproject websites, but couldn't find anything.

Thanks,

Vasco

mysticone
Offline
Joined: 2008-03-04

I can confirm that deploying with WST 2.0.1 works like a charm.

I tried both 2.0.0 and 2.0.2 they both have a different error, in 2.0.0 its an error related to a method not being found and in 2.0.2 its a null pointer exception.

Since I had problems getting 2.0.1 installed, I started from a fresh copy of eclipse and manually installed WST 2.0.1 from the archive website.

sugi0207
Offline
Joined: 2008-03-04

http://archive.eclipse.org/webtools/downloads/index.php

This is not your answer wanting it...

vbkraemer
Offline
Joined: 2003-09-03

Yes. I have the same problem. Others have reported this in a different thread, that has the solution. http://forums.java.net/jive/thread.jspa?messageID=276561

hope this helps.
vbk

imamrazaansari
Offline
Joined: 2008-06-12

I have been able to solve this problem by updating through Eclipse Update Manager.

Update Manager would by itself look for the patch and then show you to install. Once you installed it and restart the eclipse problem would be resolved

Regards
Imam Raza
Software Architect
www.folio3.com

mprabhat123
Offline
Joined: 2007-10-03

I have upgraded to the latest through upgrade manager but
It still appears to be a bug with the glassfish plug in in eclipse.

anyway embeding the Web application to an EAR works fine. Its not a clean solution thugh.

-PM

kyozo
Offline
Joined: 2008-03-22

Hi,

The easy fix for this is to add your Dynamic Web Project to an EAR project -
EDIT: you could also just update your eclipse, I just did this, and the patch is included in the WTP updates, after I found the solution with adding it to an EAR project, I installed the updates, and verified that it works with publishing a WAR file as well.

For me that works like a charm, I'm running eclipse 3.3.2 (j2ee distribution) and GlassFish v2ur1 and the GlassFish eclipse plugin on Ubuntu Linux 7.10. (eclipse and glassfish are totally fresh installs)

If you already have a Dynamic Web Projecct, then create a new EAR project (right click in project explorer and select "new -> project..." and under j2ee select "Enterprise Application Project" name it, and follow the wizard, then selecting your Dynamic Web Project.

Then under your server view, right click on your server and select "add and remove projects..." and add your EAR project.

Cheers

Kyozo

schnandr
Offline
Joined: 2008-03-11

Hi,

I am using the current eclipse jee version and I installed the wst patch over the update manager.

I get still the NullpointerException when I want to deploy a simle webapp. Here the eclipse error log entry:

Could not publish to the server.

java.lang.NullPointerException
at org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities.getDeployUriOfComponent(ComponentUtilities.java:327)
at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.getURI(J2EEFlexProjDeployable.java:429)
at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.guessModuleName(AntPublisher.java:259)
at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.getPublishProperties(AntPublisher.java:224)
at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.publish(AntPublisher.java:110)
at org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour.publishModule(GenericServerBehaviour.java:84)
at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModule(SunAppServerBehaviour.java:106)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:749)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:835)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:669)
at org.eclipse.wst.server.core.internal.Server.doPublish(Server.java:887)
at org.eclipse.wst.server.core.internal.Server.publish(Server.java:874)
at org.eclipse.wst.server.core.internal.PublishServerJob.run(PublishServerJob.java:72)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Session data:
eclipse.buildId=M20080221-1800
java.version=1.6.0_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86

The trick with the EAR project doesn't work for me.... Has anybody the same problem and solved it?

ellulpatrick
Offline
Joined: 2007-05-29

I am having the same problem... A bit disappointed considering i decided to give Glassfish a go for the first time... and I'm an Eclipse user...

carlavmott
Offline
Joined: 2005-02-10

HI,

I have installed the patch found at:
http://download.eclipse.org/webtools/patches/drops/R2.0.2/P-P20080308085...

and I see that everything works fine. Based on what I have read the problem seems to affect other servers as well.

Carla

dgashby
Offline
Joined: 2007-09-11

There's a report and quite a bit of discussion about this in the Eclipse bug repository: https://bugs.eclipse.org/bugs/show_bug.cgi?id=219627

sugi0207
Offline
Joined: 2008-03-04

It might be an influence to which WTP is renewed.
I encountered this error by the Jetty WTP plug-in, too.

The problem was solved by returning 2.0.1 the version of WTP from 2.0.2.
Please try this.

#Or, it is likely to be corrected by the upgrade of WTP or the plug-in.

mysticone
Offline
Joined: 2008-03-04

Same problem here. I'd try your solution but I can't seem to find 2.0.1 version of WTP all I have is 2.0.0 and 2.0.2

sugi0207
Offline
Joined: 2008-03-04

Will you operate normally in 2.0.0?

Or, if you have installed 2.0.1 in the past, you will be able to return it
by the following way.

[Software Updates]-[Manage configuration]
WST 2.0.2-[Replace With Another Version]

I returned it from 2.0.2 to 2.0.1 by this way.

dgashby
Offline
Joined: 2007-09-11

I'm seeing the same problem, Glassfish starts OK from Eclipse but when I try and publish a dynamic web app I get the NPE. The last thing to appear in the Eclipse log is:

!ENTRY org.eclipse.wst.server.core 4 0 2008-03-04 16:06:23.691
!MESSAGE Could not publish to the server.
!STACK 0
java.lang.NullPointerException
at org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities.getDeployUriOfComponent(ComponentUtilities.java:327)
at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.getURI(J2EEFlexProjDeployable.java:429)
at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.guessModuleName(AntPublisher.java:259)
at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.getPublishProperties(AntPublisher.java:224)
at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.publish(AntPublisher.java:110)
at org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour.publishModule(GenericServerBehaviour.java:84)
at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModule(SunAppServerBehaviour.java:95)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:749)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:835)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:669)
at org.eclipse.wst.server.core.internal.Server.doPublish(Server.java:887)
at org.eclipse.wst.server.core.internal.Server.publish(Server.java:874)
at org.eclipse.wst.server.core.internal.PublishServerJob.run(PublishServerJob.java:72)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

f273345
Offline
Joined: 2003-06-27

I have the same configuration and the same problem, no solution for the moment.