glassfish
  1. glassfish
  2. GLASSFISH-14404

Inconsistent behavior of deployment of an EJB module with Main-Class manifest

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.2_b06, 4.0
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

      Description

      This is an embedded test (v2/appserv-tests/devtests/ejb/ejb31/embedded/skipjar)
      that currently suppresses from processing EJB modules that have Main-Class
      manifest (via a property passed to createEJBContainer() call).

      If I modify the test as described in [1], the deployment fails with unexpected
      results.

      The test builds 3 jars:
      -ejb.jar
      -pu.jar
      -client.jar (that has all classes in the above2 and also a client class and a
      manifest with Main-Class)

      There is also a reporter.jar in the classpath as for all devtests (besides
      static-shell.jar which we are smart to exclude).

      There are 2 tests: as jars (run_se) and as unpacked dirs (run_se_unpacked).
      The -client.jar is excluded from processing by the property passed to
      createEJBContainer call (I added the prop after you enabled a module to be both).

      I commented out the prop, to see what would happen...

      For run_se, I also changed the classpath not to have -ejb.jar in it.

      Both tests fail, and fail weirdly:

      1) run_se fails with the output below (notice that it added everything correctly
      to the ScatteredArchive):

      [java] INFO: [DeploymentElement] adding EJB module to ScatteredArchive
      ejb-ejb31-embedded-skipjar-client.jar
      [java] Oct 29, 2010 5:46:45 PM com.sun.logging.LogDomains$1 log
      [java] INFO: [DeploymentElement] adding library to ScatteredArchive
      ejb-ejb31-embedded-skipjar-pu.jar
      [java] Oct 29, 2010 5:46:45 PM com.sun.logging.LogDomains$1 log
      [java] INFO: [DeploymentElement] adding library to ScatteredArchive reporter.jar
      [java] Oct 29, 2010 5:46:45 PM com.sun.logging.LogDomains$1 log
      [java] INFO: [EJBContainerImpl] Deploying app:
      org.glassfish.api.embedded.ScatteredArchive@4dc4e792 located at null
      [java] Oct 29, 2010 5:46:45 PM com.sun.logging.LogDomains$1 log
      [java] SEVERE: Exception while deploying the app
      [ejb-ejb31-embedded-skipjar-client]
      [java] Oct 29, 2010 5:46:45 PM com.sun.logging.LogDomains$1 log
      [java] SEVERE:
      /Users/mvatkina/v3/v2/appserv-tests/devtests/ejb/ejb31/embedded/skipjar/gfembed4297581697145092559tmp/applications/reporter.jar
      [java] java.io.FileNotFoundException:
      /Users/mvatkina/v3/v2/appserv-tests/devtests/ejb/ejb31/embedded/skipjar/gfembed4297581697145092559tmp/applications/reporter.jar
      [java] at
      com.sun.enterprise.deploy.shared.ArchiveFactory.openArchive(ArchiveFactory.java:185)
      [java] at
      com.sun.enterprise.deploy.shared.ArchiveFactory.openArchive(ArchiveFactory.java:108)
      [java] at
      com.sun.enterprise.v3.server.ApplicationLifecycle.getExternalLibraries(ApplicationLifecycle.java:522)
      [java] at
      com.sun.enterprise.v3.server.ApplicationLifecycle.getDeployableTypes(ApplicationLifecycle.java:486)
      [java] at
      com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:342)
      [java] at
      com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:243)
      [java] at
      org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:193)
      [java] at
      org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:137)
      [java] at
      org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:132)

      2) For run_se_unpacked I kept the classpath as-is, so it had 2 ejb modules,
      -ejb.jar (with "sample" name via DD), and -client.jar (no DD, so default module
      name). So global JNDI names would be different. The output is this (sorry,
      deployment "eats" the actual exceptions ):
      [java] INFO: [EJBContainerImpl] Deploying app:
      /var/folders/IF/IFNvUBVCFPWlqMFXX-mK2++++TI/Tmp/ejb-app2505259789123896777
      <...>
      [java] WARNING: appclient module [ejb-ejb31-embedded-skipjar-clientdir.jar]
      contains characteristics of other module type: ejb
      [java] Oct 29, 2010 5:46:54 PM com.sun.logging.LogDomains$1 log
      [java] WARNING: appclient module [ejb-ejb31-embedded-skipjar-clientdir.jar]
      contains characteristics of other module type: ejb
      [java] Oct 29, 2010 5:46:54 PM com.sun.logging.LogDomains$1 log
      [java] SEVERE: Exception while invoking class
      org.glassfish.appclient.server.core.AppClientDeployer prepare method
      [java] Oct 29, 2010 5:46:54 PM com.sun.logging.LogDomains$1 log
      [java] SEVERE: Exception while invoking class
      org.glassfish.javaee.full.deployment.EarDeployer prepare method
      [java] Oct 29, 2010 5:46:54 PM com.sun.logging.LogDomains$1 log

      -marina

      [1]

      Index: build.xml
      ===================================================================
      — build.xml (revision 42315)
      +++ build.xml (working copy)
      @@ -64,7 +64,7 @@
      <echo message="Running with $

      {embedded.classpath} in classpath"/>
      <java fork="on"
      failonerror="true"
      -
      classpath="${assemble.dir}/${appname}-client.jar:${assemble.dir}/${appname}-ejb.jar:${assemble.dir}/${appname}-pu.jar:${embedded.classpath}

      :$

      {env.APS_HOME}/lib/reporter.jar"
      +
      classpath="${assemble.dir}/${appname}-client.jar:${assemble.dir}/${appname}-xxx.jar:${assemble.dir}/${appname}-pu.jar:${embedded.classpath}:${env.APS_HOME}

      /lib/reporter.jar"
      classname="$

      {se.client}

      ">
      <arg line="$

      {jndiroot}

      "/>
      </java>
      Index: client/Client.java
      ===================================================================
      — client/Client.java (revision 42315)
      +++ client/Client.java (working copy)
      @@ -69,7 +69,7 @@
      private void test() {

      Map<String, Object> p = new HashMap<String, Object>();

      • p.put("org.glassfish.ejb.embedded.skip-client-modules", "true");
        + //p.put("org.glassfish.ejb.embedded.skip-client-modules", "true");

      EJBContainer c = EJBContainer.createEJBContainer(p);
      // ok now let's look up the EJB...

        Activity

        Hide
        Hong Zhang added a comment -

        will look at this in the next release

        Show
        Hong Zhang added a comment - will look at this in the next release
        Hide
        Hong Zhang added a comment -

        I have checked in the changes to handle the ejb jar with Manifest Main-Class case: the ejb jar will be processed as an ejb jar instead of appclient jar (verified with regular deployment).
        Marina is in the process of switching to the new embedded api's, reassign the issue to her for her to verify with the new embedded api once she finishes.

        Show
        Hong Zhang added a comment - I have checked in the changes to handle the ejb jar with Manifest Main-Class case: the ejb jar will be processed as an ejb jar instead of appclient jar (verified with regular deployment). Marina is in the process of switching to the new embedded api's, reassign the issue to her for her to verify with the new embedded api once she finishes.
        Hide
        marina vatkina added a comment -

        I do not see any problems after switching to the new API

        Show
        marina vatkina added a comment - I do not see any problems after switching to the new API
        Hide
        Hong Zhang added a comment -

        Port the fix to 3.1.2 branch and marked the fix versions as both 3.1.2 and trunk.

        Show
        Hong Zhang added a comment - Port the fix to 3.1.2 branch and marked the fix versions as both 3.1.2 and trunk.

          People

          • Assignee:
            marina vatkina
            Reporter:
            marina vatkina
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: