Soumya wrote:
Hi,
I tried accessing DAO from sessionbean as per your example code.I am getting following error when deploying my ear file to appserver
[19-Jul-2006 16:07:50] Application Deployer for TestEjbHibernate STARTS.
[19-Jul-2006 16:07:50] Copy the archive to C:\product\10.1.3\OracleAS_1\j2ee\home\applications\TestEjbHibernate.ear
[19-Jul-2006 16:07:50] Initialize C:\product\10.1.3\OracleAS_1\j2ee\home\applications\TestEjbHibernate.ear begins...
[19-Jul-2006 16:07:50] Unpacking TestEjbHibernate.ear
[19-Jul-2006 16:07:50] Done unpacking TestEjbHibernate.ear
[19-Jul-2006 16:07:50] Unpacking cai-web.war
[19-Jul-2006 16:07:51] Done unpacking cai-web.war
[19-Jul-2006 16:07:51] Initialize C:\product\10.1.3\OracleAS_1\j2ee\home\applications\TestEjbHibernate.ear ends...
[19-Jul-2006 16:07:51] Starting application : TestEjbHibernate
[19-Jul-2006 16:07:51] Initializing ClassLoader(s)
[19-Jul-2006 16:07:51] Initializing EJB container
[19-Jul-2006 16:07:51] Loading connector(s)
[19-Jul-2006 16:07:51] Starting up resource adapters
[19-Jul-2006 16:07:51] Processing EJB module: cai-ejb.jar
[19-Jul-2006 16:07:51] Operation failed with error: com/cai/datamatching/model/LookupList
I placed my jsps,DAO(in web-inf/classes) in war file and ejbs in jar file.Altogether i packed as ear file and deployed.If this is not proper way to package please suggest me how i should do.I don't want to package DAO with ejbs because DAOs should be accessible to other layers also.So please suggest me on this.Do i need to specify any mapping in ejb-jar.xml regarding DAO location.Please provide detail steps
Does the class "com/cai/datamatching/model/LookupList" exist in your cai-ejb.jar file? Files/libraries in your cai-web.war are not visible to ejb container.
Where do you normally place classes required by your EJB's / deployed J2EE applications? Are the DAO's being used by your web container or by your ejb container? Your persistant classes are probably required in both your cai-web.war and cai-ejb.jar file.
I suppose you could package your DAO (and dependants) into a jar in your ear file (your cai-ejb.jar manifest.mf should have a classpath entry which includes necessary jars). Jars in the ear should be accessible in both web/ejb tiers.
e.g.
Code:
Manifest-Version: 1.0
Class-Path: log4j-1.2.11.jar commons-logging-1.0.4.jar hibernate-3.1.3
.jar ehcache-1.1.jar asm-1.5.3.jar asm-attrs-1.5.3.jar dom4j-1.6.1.ja
r antlr-2.7.6rc1.jar cglib-2.1.3.jar commons-collections-3.1.jar
I'm not sure that this is really a hibernate problem, as the error does not indicate any hibernate messages.