Hi. META-INF/resources.xml can be enough to define a datasource.

Can tou share your logs?
Le 7 juin 2012 23:01, "Jeremyau" <[email protected]> a écrit :

> Ok, I'm still trying to make it work. Now I'm working on the persistence
> side.
>
> So I've defined a resource in tomee.xml. I've added the
> mysql-connectors.jar
> in the tomee lib directory.
> ...
> <Resource id="jdbc/petcatalog" type="DataSource">
>  JdbcDriver com.mysql.jdbc.Driver
>  JdbcUrl jdbc:mysql://localhost:3306/test?autoReconnect=true
>  UserName root
>  Password root
>  JtaManaged true
> </Resource>
> ...
> *First question*: Is it possible to define the tomee.xml in my project?
> Therefore, I could add mysql-connectors dependency to my project instead of
> adding it in the tomee server.
>
> Then, I've also defined the persistence.xml
> ...
>  <persistence-unit name="catalogPU" transaction-type="JTA">
>    <jta-data-source>jdbc/petcatalog</jta-data-source>
>    <class>model.Item</class>
>    <properties/>
>  </persistence-unit>
> ...
> And finally, my entity manager:
> ...
>    @PersistenceContext(unitName = "catalogPU")
>    private EntityManager em;
> ...
> Unfortunately, nothing happens... It seems my application does not access
> to
> the database for some reason.  The application is started but it is just
> empty.
>
> Where am I wrong?
>
> Thanks.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655492.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to