glassfish
  1. glassfish
  2. GLASSFISH-7524

The application doesn't deploy with --libraries

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.1.1
    • Fix Version/s: 9.1.1_dev
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      7,524

      Description

      I have an EAR file with one WAR module and eleven EJB modules. Some of the
      classes needed by the modules are libraries so I'm deploying with the
      --libraries c:/eclipse_workspace/RigelJars/Arch.jar

      The class com.isb.rigel.core.ha.IRequeterId is with the Arch.jar. It is an
      interface the EJBs use.

      If I don't use the --libraries option I get other errors when creating EJBs
      server code.

      I guess the problem is that the --libraries option is working during the
      deployment phase but it's not used in the startup of the application somehow.

      You can see the error I get below:

      ADVERTENCIA: java.lang.NoClassDefFoundError: com/isb/rigel/core/ha/IRequesterId
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at
      com.sun.appserv.server.util.ASURLClassLoader.loadClass(ASURLClassLoader.java:144)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at
      com.sun.appserv.server.util.ClassLoaderChain.loadClass(ClassLoaderChain.java:179)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      at com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:688)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:423)
      at
      com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:175)
      at
      com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:500)
      at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:527)
      at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:191)
      at
      com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
      at
      com.sun.enterprise.server.ExtendedApplicationLoader.doLoad(ExtendedApplicationLoader.java:134)
      at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:238)
      at
      com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
      at
      com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
      at
      com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
      at
      com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:959)
      at
      com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:943)
      at
      com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:467)
      at
      com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:182)
      at
      com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
      at
      com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:231)
      at
      com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
      at
      com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
      at
      com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:609)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:653)
      at
      com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:773)
      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 com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:381)
      at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:364)
      at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:477)
      at
      com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
      at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
      at $Proxy1.invoke(Unknown Source)
      at
      com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
      at
      com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
      at
      com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
      at
      com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
      at
      com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
      at
      com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at
      org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
      at
      org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
      at
      com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
      at
      com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
      Caused by: java.lang.ClassNotFoundException: com.isb.rigel.core.ha.IRequesterId
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      a
      ADVERTENCIA: t java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at
      com.sun.appserv.server.util.ASURLClassLoader.loadClass(ASURLClassLoader.java:144)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ... 93 more

      ADVERTENCIA: ADM5603:Event listener error [com/isb/rigel/core/ha/IRequesterId]

        Issue Links

          Activity

          Hide
          Hong Zhang added a comment -

          Yes, I can reproduce this problem with cluster. And when I set my debugger to
          trace the code, the config context that's used seems obsolete and did not have
          the Application config bean we are looking for. I think I need help from admin
          config expert here.

          Kedar: what config context should we use to get the most up-to-date config beans
          as part of the deployment?

          The code to get the Applications Config Bean is as follows (in
          glassfish/appserv-core/src/java/com/sun/appserv/server/util/ASClassLoaderUtil.java)

          private static Applications getApplications() throws ConfigException

          { ConfigContext serverConfigCtx = ApplicationServer.getServerContext().getConfigContext(); serverConfigCtx.refresh(true); Domain domain = ((Domain)serverConfigCtx.getRootConfigBean()); return domain.getApplications(); }

          For some reason, this Applications Config Bean does not contain the application
          config bean that's currently being redeployed.

          Earlier to fix the PE case, I added the code
          serverConfigCtx.refresh(true);
          to refresh the config context so it's in synch with the latest changes, but that
          did not seem to help with cluster case.

          I know we have a few config context, admin config context, runtime config
          context and event config context (though we cannot get the event one from the
          code here) and maybe other ones. Which one should be used here to make sure we
          get the right information here?

          Show
          Hong Zhang added a comment - Yes, I can reproduce this problem with cluster. And when I set my debugger to trace the code, the config context that's used seems obsolete and did not have the Application config bean we are looking for. I think I need help from admin config expert here. Kedar: what config context should we use to get the most up-to-date config beans as part of the deployment? The code to get the Applications Config Bean is as follows (in glassfish/appserv-core/src/java/com/sun/appserv/server/util/ASClassLoaderUtil.java) private static Applications getApplications() throws ConfigException { ConfigContext serverConfigCtx = ApplicationServer.getServerContext().getConfigContext(); serverConfigCtx.refresh(true); Domain domain = ((Domain)serverConfigCtx.getRootConfigBean()); return domain.getApplications(); } For some reason, this Applications Config Bean does not contain the application config bean that's currently being redeployed. Earlier to fix the PE case, I added the code serverConfigCtx.refresh(true); to refresh the config context so it's in synch with the latest changes, but that did not seem to help with cluster case. I know we have a few config context, admin config context, runtime config context and event config context (though we cannot get the event one from the code here) and maybe other ones. Which one should be used here to make sure we get the right information here?
          Hide
          Dies Koper added a comment -

          Created an attachment (id=2664)
          proposed patch

          Show
          Dies Koper added a comment - Created an attachment (id=2664) proposed patch
          Hide
          Dies Koper added a comment -

          Created an attachment (id=2732)
          same as prev. patch but with 'cvs diff -c' for more context

          Show
          Dies Koper added a comment - Created an attachment (id=2732) same as prev. patch but with 'cvs diff -c' for more context
          Hide
          Hong Zhang added a comment -

          Dies, thanks for attaching the diff -c. Now I see the changes more clearly, it
          seems we always need to do sendAssociateEvent to trigger the remote instance to
          get the right config context. As I said before, while there is probably a bug in
          propagating the right config context to remote instance, your fix seems a pretty
          good safe alternative fix. Please go ahead and check in the changes after
          running the usual (PE-EE QL etc) tests. Thanks!

          Show
          Hong Zhang added a comment - Dies, thanks for attaching the diff -c. Now I see the changes more clearly, it seems we always need to do sendAssociateEvent to trigger the remote instance to get the right config context. As I said before, while there is probably a bug in propagating the right config context to remote instance, your fix seems a pretty good safe alternative fix. Please go ahead and check in the changes after running the usual (PE-EE QL etc) tests. Thanks!
          Hide
          Dies Koper added a comment -

          Applied to V2.1-next branch:

          Checking in phasing/AssociationPhase.java;
          /cvs/glassfish/appserv-
          core/src/java/com/sun/enterprise/deployment/phasing/AssociationPhase.java,v
          <-- AssociationPhase.java
          new revision: 1.5.6.2; previous revision: 1.5.6.1
          done

          Show
          Dies Koper added a comment - Applied to V2.1-next branch: Checking in phasing/AssociationPhase.java; /cvs/glassfish/appserv- core/src/java/com/sun/enterprise/deployment/phasing/AssociationPhase.java,v <-- AssociationPhase.java new revision: 1.5.6.2; previous revision: 1.5.6.1 done

            People

            • Assignee:
              Hong Zhang
              Reporter:
              obdulin
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: