glassfish
  1. glassfish
  2. GLASSFISH-11516

Embedded does not work in offline mode (without internet)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: V3
    • Fix Version/s: 3.1_ms06
    • Component/s: embedded
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      11,516

      Description

      The embedded jars consists of a number of tld files. Some of these containt tags
      like this :

      <!DOCTYPE taglib
      PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
      "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

      When an application containing a single tld is deployed, all these tlds are
      parsed, which fails when there is no internet connection. In regular glassifsh
      files like web-jsptaglibrary_1_1.dtd are in lib/dtds/. In embedded these are not
      installed on the temporary filesystem that embedded uses.

        Activity

        Hide
        Bhavanishankar added a comment -

        Can you please put a write up on how you were using 3.0.1 embedded glassfish in your netbeans 6.9.1 (along with the app you are trying to deploy)?

        Show
        Bhavanishankar added a comment - Can you please put a write up on how you were using 3.0.1 embedded glassfish in your netbeans 6.9.1 (along with the app you are trying to deploy)?
        Hide
        rouche added a comment -

        In fact i found the bug i have in jira.
        http://java.net/jira/browse/GLASSFISH-12278

        Reverted to 3.0 now.

        Show
        rouche added a comment - In fact i found the bug i have in jira. http://java.net/jira/browse/GLASSFISH-12278 Reverted to 3.0 now.
        Hide
        manuel_b added a comment -

        Hi rouche,
        I am having similar problems like you. I upgraded from embedded Glassfish V3.0.1 to V3.1.

        I have some more informations for your second (2) problem. 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

        I am looking into this.

        Show
        manuel_b added a comment - Hi rouche, I am having similar problems like you. I upgraded from embedded Glassfish V3.0.1 to V3.1. I have some more informations for your second (2) problem. I am running an embedded glassfish in my TestNG. These get started by maven. I was able to attache a debugger: start TestNG test (which start internally a embedded glassfish) $ mvn -Dmaven.surefire.debug test wait until it stops and attach the debugger $ jdb -attach 5005 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 to know where to set a breakpoint > stop at com.sun.enterprise.v3.server.ApplicationLifecycle:412 wait until it stops and show local variables > locals 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 I am looking into this.
        Hide
        manuel_b added a comment -

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

        }
        }
        ...

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

        I just checked glassfish v3.0.1 the function org.glassfish.webservices.WsUtil.getWebServerInfoForDAS() is not called during deployment.

        Show
        manuel_b added a comment - I just checked glassfish v3.0.1 the function org.glassfish.webservices.WsUtil.getWebServerInfoForDAS() is not called during deployment.

          People

          • Assignee:
            Bhavanishankar
            Reporter:
            sirajg
          • Votes:
            10 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: