glassfish
  1. glassfish
  2. GLASSFISH-16141

Updatet from embedded version 3.0.1 to 3.1 causes SEVERE: Exception while invoking class org.glassfish.webservices.WebServicesDeployer prepare method

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: web_services
    • Labels:
      None
    • 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)

      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); }


      }
      }
      ...

        Activity

        Hide
        Bhakti Mehta added a comment -

        I will look more into this issue

        Show
        Bhakti Mehta added a comment - I will look more into this issue
        Hide
        Bhakti Mehta added a comment -

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

        Show
        Bhakti Mehta added a comment - Please can you give me the exact steps which you take to upgrade so I can reproduce this
        Hide
        manuel_b added a comment -

        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.

        Show
        manuel_b added a comment - 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.
        Hide
        manuel_b added a comment -

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

        Show
        manuel_b added a comment - Added domain file for glassfish 3.0.1 which was used when using embedded 3.1.
        Hide
        manuel_b added a comment -

        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.

        Show
        manuel_b added a comment - 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.
        Hide
        netstart added a comment -

        I have the same problem

        Show
        netstart added a comment - I have the same problem

          People

          • Assignee:
            Bhakti Mehta
            Reporter:
            manuel_b
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 16 minutes
              16m
              Remaining:
              Remaining Estimate - 16 minutes
              16m
              Logged:
              Time Spent - Not Specified
              Not Specified