glassfish
  1. glassfish
  2. GLASSFISH-16359

ClassNotFoundException with exploded JARs in WEB-INF/lib

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.1
    • Component/s: cdi
    • Labels:
      None

      Description

      I´m getting ClassNotFoundException trying to deploy a web app with an exploded jar in WEB-INF/lib. Steps to reproduce:

      1. Create a JAR project
      2. Create a web application
      3. Put the exploded JAR project into WEB-INF/lib
      4. Create a beans.xml file and put it into WEB-INF/lib
      5. Import some class of the JAR project into a class of the web project

      The problem only occurs if the web-project have beans.xml into WEB-INF/lib

      Forum reference: http://www.java.net/forum/topic/glassfish/glassfish/classnotfoundexception-exploded-project-0

      I attached 3 projects:

      • project-compacted-jar.war: The JAR is compacted (not exploded) in WEB-INF/lib: the error does NOT happen
      • project-exploded-jar.war: The JAR is exploded in WEB-INF/lib: the error does happen
      • project-exploded-jar-wt-beans-xml.war: The JAR is exploded in WEB-INF/lib but the web project doesn´t have beans.xml: the error does NOT happen

      Exception shown while deploying project-exploded-jar.war:

      INFO: Portable JNDI names for EJB MyService : [java:global/project-exploded-jar/MyService, java:global/project-exploded-jar/MyService!web.MyService]
      SEVERE: ectcore.jar.core.MyUtilityClass
      java.lang.ClassNotFoundException: ectcore.jar.core.MyUtilityClass
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1518)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1368)
      at org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:340)
      at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:148)
      at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:128)
      at org.glassfish.weld.DeploymentImpl.<init>(DeploymentImpl.java:120)
      at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:334)
      at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:99)
      at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
      at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:249)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:619)

        Activity

        Hide
        Hong Zhang added a comment -

        As the issues seems cdi specific, assign to cdi team for initial evaluation.

        Show
        Hong Zhang added a comment - As the issues seems cdi specific, assign to cdi team for initial evaluation.
        Hide
        Sivakumar Thyagarajan added a comment -

        This issue has been fixed in 3.1.1. I could not reproduce this issue with 3.1.2 and trunk builds. Marking this as resolved in 3.1.1

        Show
        Sivakumar Thyagarajan added a comment - This issue has been fixed in 3.1.1. I could not reproduce this issue with 3.1.2 and trunk builds. Marking this as resolved in 3.1.1

          People

          • Assignee:
            Sivakumar Thyagarajan
            Reporter:
            fabriciolemos
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: