10 Replies Latest reply on Dec 7, 2005 6:57 PM by Bill Burke

    EAR deployment with custom datasource

    asael Newbie

      Restarting topic cause the help is irrelevant.
      ( http://www.jboss.org/index.html?module=bb&op=viewtopic&t=65727 )

      Simple scenario:

      Custom -ds.xml (referenced in application.xml)
      .par with persistence.xml :

       <property name="hibernate.cache.provider_class"

      .ejb3 ( not needed cause won't deploy at all, but would reference PersistenceContext something )


      <application version="1.4"
      <!-- and many more ;) -->

      What happens the .par gets deployed first and persistence.xml is found and parsed. So it tries create the EntitityManager which references the NOT YET deployed datasource. So it stops and all further modules won't deployed either cause they rely on the persistence archive/Entity Manager.

      "kabir.khan@jboss.com" wrote:
      If you go to the JMX console, you should find your datasource listed. It's ObjectName should be something like:


      You can use the @org.jboss.annotation.ejb.Depends annotation to specify dependencies on other services.


      @Depends ("jboss.jca:service=DataSourceBinding,name=MYDSNAME")
      public class MyBean implements ....


      See the Service bean tutorial example for more information regarding Depends.

      It doesn't help cause it doesn't come that far, it already stops creating the EntityManager. And declaring that dependency on each persistent object in .par wouldn't make sense at all.

      So any possible solution, besides deploying the datasource server wide?