3 Replies Latest reply on Jul 31, 2014 2:36 AM by Itzik Baruch

    Can't deploy Spring + JPA application on Wildfly

    Itzik Baruch Newbie

      Hi,

      I'm trying to deploy Spring + JPA (Hibernate) application on Wildfly 8.0.0 CR1.

       

      I followed the developer guide both "Using server-deployed persistence units" and "Using Spring-managed persistence units" and none of them worked.


      I have attached the configuration files I'm using.


      The commented lines are other combinations I tried.


      Can someone help me out?


      Edited

      ---------

      The error message I get is (when I try to deploy the application):

      Error creating bean with name 'entityManagerFactory': Invocation of init method faield: nested exception is javax.naming.NameNotFoundException: env/persistence/star -- service jboss naming.context.java.module.\"starweb-1.0\".\"starweb-1.0\".env.persistence.star


      FYI. the developer guide is not indexed by google and it took some time to realize it exists.

        • 1. Re: Can't deploy Spring + JPA application on Wildfly
          Scott Marlow Master

          From your question, I'm not really clear if you are trying to have Spring manage the JPA persistence context/entity manager or the EE container.  The persistence.xml is configured for EE container use I think.  If you agree, you could remove the JDBC properties, such that instead of:

           

          <properties>

                                  <property name="hibernate.connection.driver_class" value="oracle.jdb.OracleDriver" />

                                  <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

                                  <property name="hibernate.connection.url" value="jdbc:oracle:thin:@//dana-scan:5326/stardb" />

                                  <property name="hibernate.connection.username" value="*****" />

                                  <property name="hibernate.connection.password" value="*****" />

                                  <property name="hibernate.hbm2ddl.auto" value="none" />

                                  <property name="hibenrate.show_sql" value="true" />

                                  <property name="javax.persistence.lock.timeout" value="0" />

          </properties>

           

           

          You should have:

          <properties>

                                  <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

                                  <property name="hibernate.hbm2ddl.auto" value="none" />

                                  <property name="hibernate.show_sql" value="true" />

                                  <property name="javax.persistence.lock.timeout" value="0" />

          </properties>

           

          • 2. Re: Can't deploy Spring + JPA application on Wildfly
            Scott Marlow Master

            Generally, you should include more descriptions of the symptoms that you are observing.  Including the configuration files, as you did, is also good but we need to see the full deployment error (if there was one).

            • 3. Re: Can't deploy Spring + JPA application on Wildfly
              Itzik Baruch Newbie

              I've updated the first post with the error message.