The LocalEntityManagerFactoryBean should look in META-INF/persistence.xml but I think what is happening is that it can't find a JPA provider for that persistence unit. Any chance that you don't have a JPA provider in the classpath or properly configured? Even though there are other ways of doing it, I don't see a <*provider*>...</*provider*> section in your persistence-unit section above so that might be something to check.
Chris On Nov 15, 2007 4:50 PM, Guillaume Nodet <[EMAIL PROTECTED]> wrote: > There is no automatic discovery of persistent units so you'd have to > create > it yourself using spring jpa support afaik. > > On Nov 15, 2007 8:21 PM, Hamlet84 < [EMAIL PROTECTED]> wrote: > > > > > i've just try it, but i have got the same problem :-(( > > > > Chris Custine-2 wrote: > > > > > > Try moving your persistence.xml to META-INF. > > > > > > Chris > > > > > > On Nov 15, 2007 3:25 AM, Hamlet84 <[EMAIL PROTECTED]> wrote: > > > > > >> > > >> Hi.. > > >> I have an application with ServiceMix 3.2 and Camel component. > > >> Well, I want to use the JPA Component in camel to store Exchange in a > > >> persistent database. But i have a problem when I install the > > application > > >> in > > >> ServiceMix. > > >> > > >> in Camel-context.xml > > >> [..] > > >> <bean id="transactionTemplate" > > >> class=" org.springframework.transaction.support.TransactionTemplate"> > > >> <property name="transactionManager"> > > >> <bean class="org.springframework.orm.jpa.JpaTransactionManager"> > > >> <property name="entityManagerFactory" > > ref="entityManagerFactory"/> > > >> </bean> > > >> </property> > > >> </bean> > > >> > > >> <bean id="jpaTemplate" class=" > org.springframework.orm.jpa.JpaTemplate > > "> > > >> <property name="entityManagerFactory" ref="entityManagerFactory"/> > > > >> </bean> > > >> > > >> <bean id="entityManagerFactory" > > >> class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> > > >> <property name="persistenceUnitName" value="camel"/> > > >> </bean> > > >> > > >> my Persistence.xml > > >> > > >> <persistence xmlns=".." xmlns:xsi=".." version="1.0"> > > >> > > >> <persistence-unit name="camel" transaction-type="RESOURCE_LOCAL"> > > >> > > >> <properties> > > >> <property name="hibernate.dialect " > > >> value="org.hibernate.dialect.HSQLDialect"/> > > >> <property name="hibernate.connection.driver_class" > > >> value="org.hsqldb.jdbcDriver"/> > > >> <property name="hibernate.connection.username" value="sa"/> > > >> <property name="hibernate.connection.password" value=""/> > > >> <property name=" hibernate.connection.url" > > >> value="jdbc:hsqldb:mem:camel_etl"/> > > >> <property name="hibernate.hbm2ddl.auto" value="create"/> > > >> </properties> > > >> > > >> </persistence-unit> > > >> </persistence> > > >> > > >> the error is "Invocation of init method failed; nested exception is > > >> javax.persistence.PersistenceException: No Persistence provider for > > >> EntityManager named camel" > > >> > > >> I think that it is a problem of the position of file persistence.xml. > > My > > >> service activator has the follow structure > > >> > > >> test-su.zip > > >> |--test-camel-su.zip > > >> |---camel-context.xml > > >> |---persistence.xml > > >> |---META-INF > > >> |--jbi.xml > > >> |--META-INF > > >> |--- jbi.xml > > >> -- > > >> View this message in context: > > >> > > > http://www.nabble.com/Using-JPA-in-ServiceMix-%2B-Camel-tf4811001s22882.html#a13765083 > > >> Sent from the Camel - Users mailing list archive at Nabble.com. > > >> > > >> > > > > > > > > > > -- > > View this message in context: > > > http://www.nabble.com/Using-JPA-in-ServiceMix-%2B-Camel-tf4811001s22882.html#a13779788 > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ >
