Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: V3
    • Fix Version/s: V3
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      11,296

      Description

      I think there is a problem using the EJB Container. I have a very simple test
      and it fails. I have the latest Netbeans 6.8.

      Here's how I can reproduce it:

      Using Netbeans 6.8
      Create a new Enterprise App Project.
      Create a new Stateless Session Bean.
      Right click on the project Tools -> Create Tests.
      Modify the tests a little bit to make it work.

      Run – Fails.
      Debug – Passes.

      Source Code:

      package sk;

      import javax.ejb.Stateless;
      import javax.ejb.LocalBean;

      /**
      *

      • @author 206080739
        */
        @Stateless
        @LocalBean
        public class NewSessionBean {

      public String sayHello()

      { return "hello"; }

      }

      Test case:

      @Test
      public void testSayHello() throws Exception

      { System.out.println("sayHello"); NewSessionBean instance = (NewSessionBean)javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/NewSessionBean"); String expResult = "hello"; String result = instance.sayHello(); System.out.println("result: " + result); // assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. // fail("The test case is a prototype."); }

      Stack Trace:

      sayHello
      Dec 10, 2009 3:28:15 PM com.sun.enterprise.v3.server.AppServerStartup run
      INFO: GlassFish v3 (74.2) startup time : Embedded(6798ms) startup
      services(1547ms) total(8345ms)
      Dec 10, 2009 3:28:16 PM
      org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
      INFO: JMXStartupService: JMXConnector system is disabled, skipping.
      Dec 10, 2009 3:28:16 PM
      com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates
      INFO: Using
      com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the
      delegate
      Dec 10, 2009 3:28:17 PM com.sun.pkg.client.SystemInfo loadProxyInfo
      SEVERE: Invalid HTTPS proxy setting in file C:\Documents and
      Settings\206080739\Application Data\updatetool\defaults.cfg: empty host
      Dec 10, 2009 3:28:18 PM AppServerStartup run
      INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
      Dec 10, 2009 3:28:23 PM com.sun.enterprise.deployment.archivist.Archivist
      readAnnotations
      WARNING: Error in annotation processing: java.lang.NoClassDefFoundError:
      build/classes/sk/NewSessionBean (wrong name: sk/NewSessionBean)
      Dec 10, 2009 3:28:23 PM org.glassfish.api.ActionReport failure
      SEVERE: Exception while deploying the app
      java.lang.IllegalArgumentException: Invalid ejb jar [SimpleEjbModule.jar]: it
      contains zero ejb.
      Note:
      1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or
      message-driven bean.
      2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
      3. If the jar file contains valid EJBs which are annotated with EJB component
      level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please
      check server.log to see whether the annotations were processed properly.
      at
      com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:72)
      at
      com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:124)
      at
      com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:722)
      at com.sun.enterprise.deployment.Application.visit(Application.java:1744)
      at
      com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:774)
      at
      com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:253)
      at
      com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:222)
      at
      org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:145)
      at
      org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:78)
      at
      com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612)
      at
      com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554)
      at
      com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
      at
      org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214)
      at
      org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144)
      at
      org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128)
      at
      org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120)
      at
      javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
      at
      javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
      at sk.NewSessionBeanTest.testSayHello(NewSessionBeanTest.java:46)
      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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at
      org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at
      org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at
      org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at
      org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at
      org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at
      org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
      at
      org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
      at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
      at
      org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at
      org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
      at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
      at
      org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
      at
      org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
      at
      org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)
      Dec 10, 2009 3:28:23 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl
      createEJBContainer
      INFO: [EJBContainerProviderImpl] Cleaning up on failure ...
      Dec 10, 2009 3:28:23 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
      INFO: JMXStartupService and JMXConnectors have been shut down.
      Dec 10, 2009 3:28:23 PM com.sun.enterprise.v3.server.AppServerStartup stop
      INFO: Shutdown procedure finished
      Dec 10, 2009 3:28:23 PM AppServerStartup run
      INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting
      Dec 10, 2009 3:28:23 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl
      createEJBContainer
      SEVERE: ejb.embedded.exception_instantiating
      javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
      at
      org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135)
      at
      org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120)
      at
      javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
      at
      javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
      at sk.NewSessionBeanTest.testSayHello(NewSessionBeanTest.java:46)
      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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at
      org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at
      org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at
      org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at
      org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at
      org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at
      org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
      at
      org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
      at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
      at
      org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at
      org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
      The following providers:
      org.glassfish.ejb.embedded.EJBContainerProviderImpl
      Returned null from createEJBContainer call.
      )
      at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
      at
      org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
      at
      org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
      at
      org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)

        Activity

        Hide
        marina vatkina added a comment -

        This might be a bug in Netbeans 6.8 - please file it there if it is.

        See this warning in the output:

        WARNING: Error in annotation processing: java.lang.NoClassDefFoundError:
        build/classes/sk/NewSessionBean (wrong name: sk/NewSessionBean)

        Because the annotation processing failed, the resulting jar wasn't process fully
        and you got the exception about the zero ejbs.

        Show
        marina vatkina added a comment - This might be a bug in Netbeans 6.8 - please file it there if it is. See this warning in the output: WARNING: Error in annotation processing: java.lang.NoClassDefFoundError: build/classes/sk/NewSessionBean (wrong name: sk/NewSessionBean) Because the annotation processing failed, the resulting jar wasn't process fully and you got the exception about the zero ejbs.

          People

          • Assignee:
            ksak
            Reporter:
            stankb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: