[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Could not find datasource message in client JPA although

ezanih do-not-reply at jboss.com
Fri Jan 9 04:48:06 EST 2009


Phew...sigh! After 23 days, working on my JPA entity program, I finally got it working with the help of a EJB3.0 layer in between my calling client/servlet/jsp and my JPA entities and the database.

A few things I learnt (for the benefit of others) :-

(1) Be careful to get compatible Hibernate components by looking at the Compatibility Matrix

(2) Whatever is in the JBoss client folder will override whatever you add to the classpath in Eclipse (so you should replace the files directly in the JBoss client folder)

(3) Be sure to get the JNDI naming absolutely spot-on (type exactly as the JNDI View shows in JMX-console in JBoss) - read Jaikiran's Oct 2007 article

(4) Learn the difference between java namespacing and global JNDI namespacing and that a standalone client cannot directly access a java:/ namespace (eg. a wrapper datasource) if the JPA entity is being managed by the JBoss server container which is on a different JVM

(5) learn the additional configuration work that you need to do on a JBoss server (such as setting the JNDI properties)

(6) learn exactly what the server does in terms of transaction mgmt when you use JTA and Hibernate EntityManager. A lot of code that you type may not be needed (especially if you use annotation and injection)

So that's it! Thank you all! Thank you Jaikiran! I'm off to expand my program further by adding additional RichFaces, Seam, JBoss ESB, jBPM and Rules components so I'll be returning to the forum in no time !!! :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200521#4200521

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200521



More information about the jboss-user mailing list