Has this question ever been answered?
I guess, Mark just didn't read this post :)
Are there any problems with getting datasource in DAO? Are DAO classes outside of JBoss?
Thank you for answering my question.
I think I could get it work if I bundle the DAO classes with the session bean. That means I put all of them into one jar file. Then I can use the DAO classes to get the database connections from the DataSource sepcified in jboss.jcml.
But we plan to put all DAO classes and some other util classes into one library jar file and place it under jboss/lib/ext directory so that they can be shared by all the beans (Is it a right approach?).
If we do in this way, can the DAO classes still get the datasource connection via InitialContext?
If you use session bean that uses DAO then you should get connection w/o problems if DataSource is bound in the server the session bean runs in.
As to the right place to put common jar in 2.4.x, sorry I don't remember. Does 2.4 deploys usual jar files (not ejbs)? If so then I'd just deploy the shared jar. If not, then I think lib/ext is the right place.