2 Replies Latest reply: Jun 4, 2010 9:39 AM by 770809 RSS

    Stateful session Bean in Model not working

    770809
      I made a sample application very very simple, and the weblogic server cant find the @stateful annotation on the class. is it there another possibility? here i post the error i get:

      ----------------------
      [Running application MyTest1 on Server Instance IntegratedWebLogicServer...]
      [09:48:51 PM] ---- Deployment started. ----
      [09:48:51 PM] Target platform is (Weblogic 10.3).
      [09:48:52 PM] Retrieving existing application information
      [09:48:52 PM] Running dependency analysis...
      [09:48:52 PM] Deploying 3 profiles...
      [09:48:53 PM] Wrote Web Application Module to /home/issanllo/.jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/MyTest1/ViewWebApp.war
      [09:48:53 PM] Wrote EJB Module to /home/issanllo/.jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/MyTest1/ModelEJB.jar
      [09:48:53 PM] Wrote Enterprise Application Module to /home/issanllo/.jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/MyTest1
      [09:48:53 PM] Deploying Application...
      <03-jun-2010 21H48' CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1275594533727' for task '2'. Error is: 'weblogic.application.ModuleException: Exception preparing module: EJBModule(ModelEJB.jar)
      [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
      No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation..'
      weblogic.application.ModuleException: Exception preparing module: EJBModule(ModelEJB.jar)
      [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
      No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation..
           at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
           at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
           at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
           at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
           Truncated. see log file for complete stacktrace

      Caused By: java.io.IOException: No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
           at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:219)
           at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
           at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1210)
           at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:382)
           at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
           Truncated. see log file for complete stacktrace
      >
      <03-jun-2010 21H48' CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'MyTest1'.>
      <03-jun-2010 21H48' CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
      weblogic.application.ModuleException: Exception preparing module: EJBModule(ModelEJB.jar)
      [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
      No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation..
           at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
           at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
           at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
           at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
           Truncated. see log file for complete stacktrace

      Caused By: java.io.IOException: No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
           at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:219)
           at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
           at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1210)
           at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:382)
           at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
           Truncated. see log file for complete stacktrace
      >
      #### Cannot run application MyTest1 due to error deploying to IntegratedWebLogicServer.
      [09:48:54 PM] #### Deployment incomplete. ####
      [09:48:54 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
      [Application MyTest1 stopped and undeployed from Server Instance IntegratedWebLogicServer]

      -------
      and the very simple class with a Local and Remote interfaces at Model project in jDeveloper 11g (11.1.1.3)

      package test.core;

      import java.util.ArrayList;
      import java.util.List;

      import javax.ejb.Local;
      import javax.ejb.Remote;
      import javax.ejb.Stateful;

      @Stateful(name = "ControlSessionBean", mappedName = "MyTest1-Model-ControlSessionBean")
      public class ControlSessionBean implements ControlSessionRemote,
      ControlSessionLocal
      {
      private String username;
      private String password;

      public ControlSessionBean()
      {
      }

      public List simple()
      {

      List <String> s = new ArrayList();

      s.add(username);
      s.add(password);

      return s;
      }
      }


      any suggestions why it is not working??

      sincerely

      Israel S Llorens
        • 1. Re: Stateful session Bean in Model not working
          Pedja
          Hi,

          Sounds like the project got confused. Try going to Model project properties -> EJB Module, change the EJB Version to NOT SPECIFIED, and then back to 3.0 (to refresh the Model project).
          Also, try deleting the 'classes' folders manually.

          Pedja
          • 2. Re: Stateful session Bean in Model not working
            770809
            not working... i tried to make the stateful session bean Control.. and is still not working the error i get now is this one:

            <04-jun-2010 16H29' CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1275661769594' for task '9'. Error is: 'weblogic.application.ModuleException: Could not setup environment'
            weblogic.application.ModuleException: Could not setup environment
                 at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
                 at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
                 at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
                 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
                 at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
                 Truncated. see log file for complete stacktrace

            Caused By: weblogic.deployment.EnvironmentException: [J2EE:160200]Error resolving ejb-ref 'gecu.view.LoginBean/controlBean' from module 'GeCU_Web_view_root' of application 'GeCU_Web'. The ejb-ref does not have an ejb-link and the JNDI name of the target bean has not been specified. Attempts to automatically link the ejb-ref to its target bean failed because no EJBs in the application were found to implement the 'gecu.model.ControlSession' interface. Please link or map this ejb-ref to its target EJB and ensure the interfaces declared in the ejb-ref are correct.
                 at weblogic.deployment.BaseEnvironmentBuilder.autowireEJBRef(BaseEnvironmentBuilder.java:427)
                 at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:502)
                 at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
                 at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
                 at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
                 Truncated. see log file for complete stacktrace
            >
            <04-jun-2010 16H29' CEST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application 'GeCU_Web'.>
            <04-jun-2010 16H29' CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'GeCU_Web'.>
            <04-jun-2010 16H29' CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
            weblogic.application.ModuleException: Could not setup environment
                 at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
                 at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
                 at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
                 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
                 at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
                 Truncated. see log file for complete stacktrace

            Caused By: weblogic.deployment.EnvironmentException: [J2EE:160200]Error resolving ejb-ref 'gecu.view.LoginBean/controlBean' from module 'GeCU_Web_view_root' of application 'GeCU_Web'. The ejb-ref does not have an ejb-link and the JNDI name of the target bean has not been specified. Attempts to automatically link the ejb-ref to its target bean failed because no EJBs in the application were found to implement the 'gecu.model.ControlSession' interface. Please link or map this ejb-ref to its target EJB and ensure the interfaces declared in the ejb-ref are correct.
                 at weblogic.deployment.BaseEnvironmentBuilder.autowireEJBRef(BaseEnvironmentBuilder.java:427)
                 at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:502)
                 at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
                 at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
                 at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
                 Truncated. see log file for complete stacktrace
            >
            [04:29:35 PM] #### Deployment incomplete. ####
            [04:29:35 PM] Remote deployment failed