0 Replies Latest reply on Nov 15, 2006 9:56 AM by Rafal Hudowski

    Problem with deploying entity beans on Jboss

    Rafal Hudowski Newbie

      Jboss 4.0.4 GA with EJB 3.0
      J have a very simple application.
      -> Meta-inf
          -> application.xml
      -> app-ejb-1.0.jar
             -> Meta-inf
                -> persistance.xml
             -> company
                -> app
                   -> ejb
                      -> entity
                         -> Document.class
                         -> Scan.class
                      -> session
                   -> interfaces
                      -> TestStatelessBeanLocal.class
      <?xml version="1.0" encoding="UTF-8"?>

      <persistence-unit name="app">

      oracle9i-ds.xml (deployed on Jboss):






      J have this connection url( (DESCRIPTION=(ADDRESS....) defined in tnsames.ora so i think it's correct.
      @Table(name = "DOCUMENTS")
      public class Document implements java.io.Serializable

      private static final long serialVersionUID = -2324201610375801418L;

      private int doc_id;
      private String name;

      public int getDoc_id()
      return doc_id;

      public void setDoc_id(int id)
      this.doc_id = id;

      public String getName()
      return name;

      public void setName(String name)
      this.name = name;

      Scan.java is very similar to Document.java

      My problem: Entity beans don't deploy. I see on Jboss:

      [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.4.GA/server/app/deploy/1app-ear-jboss-1.0.ear
      [Ejb3Deployment] EJB3 deployment time took: 15
      [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=1app-ear-jboss-1.0.ear,jar=app-ejb-1.0.jar,name=TestStatelessBean,service=EJB3 with dependencies:
      [EJBContainer] STARTED EJB: comarch.app.ejb.session.TestStatelessBean ejbName: TestStatelessBean
      [EJB3Deployer] Deployed: file:/C:/jboss-4.0.4.GA/server/app/tmp/deploy/tmp542761app-ear-jboss-1.0.ear-contents/app-ejb-1.0.jar
      [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.4.GA/server/app/deploy/1app-ear-jboss-1.0.ear

      When I'm trying add into TestStatelessBean.java:

      private EntityManager manager;
      i see warning:

      WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=app-ejb-1.0.jar
      java.lang.RuntimeException: Field private javax.persistence.EntityManager comarch.app.ejb.session.TestStatelessBean.manager @PersistenceUnit in error: EMPTY STRING unitName but there is no deployments in scope

      I think my Jboss doesn't see this Entity Beans. Maybe it's a problem with my definition of data source? I don't know how can I verify this data source. In oracle9i-ds.xml is '
      <check-valid-connection-sql>select sysdate from dual
      but i can write bad connections (e.g. host which doesn't exist) and this ds is every time deployed on the Jboss without error.
      I haven't got any idea where is the problem.
      Please, help me!