[jboss-user] [EJB 3.0 Development] - Stateful beans from 2 Jars - 1 persistence unit

Nick Dodd do-not-reply at jboss.com
Wed Apr 14 13:03:12 EDT 2010


Nick Dodd [http://community.jboss.org/people/baronDodd] created the discussion

"Stateful beans from 2 Jars - 1 persistence unit"

To view the discussion, visit: http://community.jboss.org/message/537473#537473

--------------------------------------------------------------
I have a persistence unit named FOO inside a jar file as follows:


<persistence-unit name="FOO">
     <provider>org.hibernate.ejb.HibernatePersistence</provider>
     <jta-data-source>java:/MYDS</jta-data-source>
     <properties>
          <property name="hibernate.hbm2ddl.auto" value="update"/>
     </properties>
     <jar-file>file:../anotherDir/secondary.jar</jar-file>
</persistence-unit>


This jar contains several Entity Beans and Session Beans that use this persistence unit ok.

As you can see I also have a second jar referenced in the persistence unit, it is another jar (not within an ear) that contains 1 more Entity bean and also 1 Session Bean.

When I start the server +all+ tables are successfully created including the entity defined in the secondary jar.

However - the Session Bean in the secondary jar is causing problems.

public class SecondaryFacade implements SecondaryFacadeLocal, SecondaryFacadeRemote {
 
......
 
   @PersistenceContext(unitName="FOO")
    protected EntityManager em;
 
......


ObjectName: persistence.units:unitName=FOO
  State: NOTYETINSTALLED
  Depends On Me:
    jboss.j2ee:service=EJB3,jar=secondary.jar,name= SecondaryFacade

This issue may be related but not sure:

 http://community.jboss.org/message/344723#344723 http://community.jboss.org/message/344723#344723

Am running JBoss 4.3.0. What I am doing might not even be possible or legal but if so then why does it deploy the Entity Bean successfully but not the Session Bean?

Many thanks

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/537473#537473]

Start a new discussion in EJB 3.0 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100414/1c0cf824/attachment.html 


More information about the jboss-user mailing list