-
1. Re: Embedded Alpha 5 can't find persistence.unit
jgilbert Feb 5, 2006 11:09 PM (in response to jgilbert)ahhh!
i see that alpha 5 upgraded the persistence.xml format to spec.
problem solved! -
2. Re: Embedded Alpha 5 can't find persistence.unit
dhinojosa Feb 24, 2006 12:26 AM (in response to jgilbert)"jgilbert" wrote:
ahhh!
i see that alpha 5 upgraded the persistence.xml format to spec.
problem solved!
What was your solution? -
3. Re: Embedded Alpha 5 can't find persistence.unit
lucluc Feb 24, 2006 5:07 AM (in response to jgilbert)I have same problem too.
Please, post the detailed solution.
Thanks in advance.
Regards
F -
4. Re: Embedded Alpha 5 can't find persistence.unit
dhinojosa Feb 24, 2006 5:59 PM (in response to jgilbert)I got mine to work..... My error was that my bean mappings in embedded-jboss-beans.xml did not match those in my persistence.xml
For example:
----------embedded-jboss-beans.xml------
org.hsqldb.jdbcDriver
jdbc:hsqldb:test/conf/hsqldb/superduper
sa
java:/superduperDS
0
10
1000
100000
-----------persistence.xml---------------------
<persistence-unit name="superduper">
<jta-data-source>java:/superduperDS</jta-data-source>
</persistence-unit>
If I call my datasource superduperDS then I need to make sure that bean name for the bootstrap is called superduperDSBootstrap and the bean name for the datasouce is called superduperDS. All this is case sensitive. So make sure your names are consistent and good luck. -
5. Re: Embedded Alpha 5 can't find persistence.unit
dhinojosa Feb 24, 2006 6:01 PM (in response to jgilbert)Ooops formatting. :(
I got mine to work..... My error was that my bean mappings in embedded-jboss-beans.xml did not match those in my persistence.xml
For example:
----------embedded-jboss-beans.xml------<bean name="superduperDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource"> <property name="driverClass">org.hsqldb.jdbcDriver</property> <property name="connectionURL">jdbc:hsqldb:test/conf/hsqldb/superduper</property> <property name="userName">sa</property> <property name="jndiName">java:/superduperDS</property> <property name="minSize">0</property> <property name="maxSize">10</property> <property name="blockingTimeout">1000</property> <property name="idleTimeout">100000</property> <property name="transactionManager"><inject bean="TransactionManager"/></property> <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property> <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property> </bean> <bean name="superduperDS" class="java.lang.Object"> <constructor factoryMethod="getDatasource"> <factory bean="superduperDSBootstrap"/> </constructor> </bean>
-----------persistence.xml---------------------<persistence> <persistence-unit name="superduper"> <jta-data-source>java:/superduperDS</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="jboss.entity.manager.jndi.name" value="java:/superduper"/> </properties> </persistence-unit> </persistence>
If I call my datasource superduperDS then I need to make sure that bean name for the bootstrap is called superduperDSBootstrap and the bean name for the datasouce is called superduperDS. All this is case sensitive. So make sure your names are consistent and good luck. -
6. Re: Embedded Alpha 5 can't find persistence.unit
lucluc Feb 26, 2006 11:34 AM (in response to jgilbert)Thanks very much, dhinojosa.
Mine was a classpath problem. It seems that file persistence.xml inside tutorial.jar can never be found & read.
I think this is a silly problem, because it's better to deploy persistence.xml along with .jar that contains the beans. I still haven't found the solution.
regards
F -
7. Re: Embedded Alpha 5 can't find persistence.unit
dhinojosa Feb 26, 2006 3:10 PM (in response to jgilbert)Well about the persistence.xml it does have to be in a META-INF folder. So, as far as your classpath goes make sure that within that classpath there is your META-INF folder with the persistence.xml within it.
-
8. Re: Embedded Alpha 5 can't find persistence.unit
lucluc Feb 27, 2006 5:10 AM (in response to jgilbert)Thanks again, dhinojosa.
Persistence.xml was correctly placed in meta-inf inside Tutorial.jar.
It was the .jar that was not place on classpath.
now it works very well.
bye
F -
9. Re: Embedded Alpha 5 can't find persistence.unit
fabiorusso Jul 7, 2006 4:22 AM (in response to jgilbert)That absolutely solved my problem! Got firebird working. Now I can easily and quickly unit test my ejb3 classes locally
:-) Thank you so much!