Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349821

Summary: Publishing to Glassfish: java.lang.NullPointerException
Product: [WebTools] WTP ServerTools Reporter: Missing name <wbrana>
Component: wst.serverAssignee: jst.server <jst.server-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
screenshot none

Description Missing name CLA 2011-06-20 09:45:43 EDT
Build Identifier: 20110301-1815

java.lang.NullPointerException

Reproducible: Always

Steps to Reproduce:
1. create new project with target Glassfish 3.1
2. run on Server
3.
Comment 1 Missing name CLA 2011-06-20 09:46:47 EDT
Created attachment 198257 [details]
screenshot
Comment 2 Missing name CLA 2011-06-20 09:58:01 EDT
!ENTRY org.eclipse.wst.server.core 4 0 2011-06-20 15:44:25.174
!MESSAGE Could not publish to the server.
!STACK 0
java.lang.NullPointerException
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectFrameworkImpl.create(FacetedProjectFrameworkImpl.java:670)
        at org.eclipse.wst.common.project.facet.core.ProjectFacetsManager.create(ProjectFacetsManager.java:346)
        at org.eclipse.wst.common.componentcore.internal.util.FacetedProjectUtilities.getProjectFacetVersion(FacetedProjectUtilities.java:28)
        at org.eclipse.jst.j2ee.project.JavaEEProjectUtilities.getProjectFacetVersion(JavaEEProjectUtilities.java:68)
        at org.eclipse.jst.j2ee.project.JavaEEProjectUtilities.isProjectOfType(JavaEEProjectUtilities.java:64)
        at org.eclipse.jst.j2ee.project.JavaEEProjectUtilities.isDynamicWebProject(JavaEEProjectUtilities.java:115)
        at com.sun.enterprise.jst.server.sunappsrv.sunresource.wizards.ResourceUtils.getRuntimeResourceLocation(ResourceUtils.java:188)
        at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.registerSunResource(SunAppServerBehaviour.java:753)
        at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishDeployedDirectory(SunAppServerBehaviour.java:671)
        at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModuleForGlassFishV3(SunAppServerBehaviour.java:557)
        at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModule(SunAppServerBehaviour.java:247)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1051)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1143)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:956)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:775)
        at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3046)
        at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:341)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 3 Missing name CLA 2011-06-20 10:48:48 EDT
I'm getting different exception with new project:

!ENTRY oracle.eclipse.tools.glassfish 4 0 2011-06-20 16:42:58.285
!MESSAGE cannot Deploy test2
!STACK 1
org.eclipse.core.runtime.CoreException: Deployment Error for module: test2: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com
.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class com.sun.faces.application.ServletContextSensitiveSingletonStore. Please see server.log for more details.
        at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishDeployedDirectory(SunAppServerBehaviour.java:723)
        at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModuleForGlassFishV3(SunAppServerBehaviour.java:557)
        at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModule(SunAppServerBehaviour.java:247)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1051)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1143)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:956)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:775)
        at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3046)
        at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:341)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!SUBENTRY 1 oracle.eclipse.tools.glassfish 4 0 2011-06-20 16:42:58.285
!MESSAGE Deployment Error for module: test2: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.commo
n.spi.util.InjectionException: Error creating managed object for class com.sun.faces.application.ServletContextSensitiveSingletonStore. Please see server.log for more details.
Comment 4 Missing name CLA 2011-06-20 12:19:21 EDT
It works now after removing redundant libs from build path.
Comment 5 Missing name CLA 2011-06-21 10:40:47 EDT
NPE appeared again after adding JSF components
Comment 6 Angel Vera CLA 2011-06-21 15:59:43 EDT
I can't put my finger on where the problem is, but it is best to start with: 
com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour. Can you open a bug with the server adapter?