Showing posts with label JNDI. Show all posts
Showing posts with label JNDI. Show all posts

Tuesday, 17 March 2009

Put persistence.xml in the war

I've been trying for days to get jpa, jndi, glassfish, hibernate and oracle to play together.

The main problem turns out that you have to put the persistence.xml file in your war file (project/web-root/WEB-INF/src/META-INF) not in your jar file.
I'll probably investigate more to see if it is somehow possible to put it in the jar, but for now my problems are solved.

... after some further experimentation I was able to put it in the jar, but I'm using <mapping-file>xx_orm.xml</mapping-file> now.

Saturday, 14 February 2009

No PasswordCredential found

I got the exception below while trying to set up a JNDI database configuration in glasshish to point to my local Oracle XE installation. Google didn't help so I'm posting it here for in case it happens to me again.
I didn't actually figure out how to resolve it. I fiddled around in domains/domain1/config/domain.xml a little, but in the end I think restarting Glassfish did the trick for me.


INFO: RAR7099: The mcf being used to allocate the connection and the MCF in the pool are not equal.
WARNING: RAR5038:Unexpected exception while creating resource for pool aum_pool. Exception : No PasswordCredential found
WARNING: RAR5117 : Failed to obtain/create connection from connection pool [ aum_pool ]. Reason : No PasswordCredential found
WARNING: RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: No PasswordCredential found]
WARNING: java.sql.SQLException: Error in allocating a connection. Cause: No PasswordCredential found
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)