[GLASSFISH-16141] Updatet from embedded version 3.0.1 to 3.1 causes SEVERE: Exception while invoking class org.glassfish.webservices.WebServicesDeployer prepare method Created: 03/Mar/11  Updated: 06/Apr/12

Status: Open
Project: glassfish
Component/s: web_services
Affects Version/s: 3.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: manuel_b Assignee: Bhakti Mehta
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: 16 minutes
Time Spent: Not Specified
Original Estimate: 16 minutes
Environment:

Mac OS X 10.6.6, Java version "1.6.0_22", Glassfish 3.1 (groupId: org.glassfish.extras, artifactId: glassfish-embedded-all, version: 3.1)


Attachments: XML File domain_withoutpasswords.xml    
Tags: 3_1-upgrade, 3_1_1-scrubbed, update, upgrade, webservice-api

 Description   

When upgrading the dependency from embedded glassfish from 3.0.1 to 3.1 the WebServiceDeployer is not starting up.

During throwing the real error message another error is happening:

SEVERE: Exception while invoking class org.glassfish.webservices.WebServicesDeployer prepare method
Jan 27, 2011 4:30:30 PM org.glassfish.api.ActionReport failure
SEVERE: Exception while preparing the app
java.util.logging.ErrorManager: 5
java.lang.NullPointerException
at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
at java.util.ResourceBundle.getString(ResourceBundle.java:334)
...

I am running an embedded glassfish in my TestNG. These get started by maven. I was able to attache a debugger:

  1. start TestNG test (which start internally a embedded glassfish)
    $ mvn -Dmaven.surefire.debug test
  2. wait until it stops and attach the debugger
    $ jdb -attach 5005
  3. Use http://java.net/projects/glassfish/sources/svn/content/tags/3.1/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java?rev=45380
  4. to know where to set a breakpoint
    > stop at com.sun.enterprise.v3.server.ApplicationLifecycle:412
  5. wait until it stops and show local variables
    > locals
  6. print a stack trace
    > eval prepareException.printStackTrace()

Here is the complete stack trace for the WebServicesDeployer prepare methodexception.
SEVERE: Exception while invoking class org.glassfish.webservices.WebServicesDeployer prepare method
java.lang.RuntimeException
at org.glassfish.webservices.WebServicesDeployer.prepare(WebServicesDeployer.java:192)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:193)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:142)
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:132)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
at de.apaxo.semrecsys.test.EJB3Container.startGlassfish(EJB3Container.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:73)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:516)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:196)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:126)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:258)
at org.testng.SuiteRunner.run(SuiteRunner.java:221)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:946)
at org.testng.TestNG.runSuitesLocally(TestNG.java:883)
at org.testng.TestNG.run(TestNG.java:814)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: java.lang.NullPointerException
at org.glassfish.webservices.WsUtil.getWebServerInfoForDAS(WsUtil.java:1548)
at org.glassfish.webservices.WebServicesDeployer.doWebServicesDeployment(WebServicesDeployer.java:618)
at org.glassfish.webservices.WebServicesDeployer.prepare(WebServicesDeployer.java:183)
... 33 more

http://java.net/projects/glassfish/sources/svn/content/tags/3.1/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/WsUtil.java?rev=45380

So the problem seems to be that the networkListeners are empty and the following code which is supposed to fill them is not working correctly:

...
if(this.networkListeners == null) {
List<Integer> adminPorts = new ArrayList<Integer>();

for (org.glassfish.api.container.Adapter subAdapter :
habitat.getAllByContract(org.glassfish.api.container.Adapter.class)) {
if (subAdapter instanceof AdminAdapter)

{ AdminAdapter aa = (AdminAdapter) subAdapter; adminPorts.add(aa.getListenPort()); }

else if (subAdapter instanceof AdminConsoleAdapter)

{ AdminConsoleAdapter aca = (AdminConsoleAdapter) subAdapter; adminPorts.add(aca.getListenPort()); }


}

for (NetworkListener nl : config.getNetworkConfig().getNetworkListeners().getNetworkListener()) {

if(!adminPorts.contains(Integer.valueOf(nl.getPort())))

{ // get rid of admin ports if(networkListeners == null) networkListeners = new ArrayList<NetworkListener>(); networkListeners.add(nl); }


}
}
...



 Comments   
Comment by Bhakti Mehta [ 18/May/11 ]

I will look more into this issue

Comment by Bhakti Mehta [ 15/Jun/11 ]

Please can you give me the exact steps which you take to upgrade so I can reproduce this

Comment by manuel_b [ 15/Jun/11 ]

Hi Bhakti,
unfortunately I can just give you the maven pom entries:

working:
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>

Not working:
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.1</version>
<scope>test</scope>
</dependency>

I will also attach my domain.xml.

If you have any recommendations I can reconfigure my system and try again.

Comment by manuel_b [ 15/Jun/11 ]

Added domain file for glassfish 3.0.1 which was used when using embedded 3.1.

Comment by manuel_b [ 15/Jun/11 ]

Hi Bhakti,
no I am not in the Glassfish QE team. I am just a student who just finished his master degree and who was using Glassfish.

I am running an own EAR file on glassfish. You can read my thesis and documentation about the application here:

http://manuel.themis02.de/MasterThesisEvalRecommender/trunk/doc/2010-Manuel-Blechschmidt-730786-EvalRecSys.pdf

User: guest
Password: guest

I just registered for JIRA and joined your effort. Thought it could be useful for your if I log my experiences.

Feel free to ignore this request.

Comment by netstart [ 06/Apr/12 ]

I have the same problem





Generated at Mon Sep 26 18:53:12 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.