Hi - just want to let you know that I figured out the problem. What happened
was that one of the entities compiled into ecommerce-ps-entities.jar was
referencing ConfigurationKey.class, but that code was part of the exploded
JAR living in the apps/ directory. So of course, since library is loaded
before deployable code, ConfigurationKey.class was not loaded yet and so
exception happened. Took me a while to figure that out, but once I moved
ConfigurationKey.class to the entities JAR OpenEJB was happy and log is
clean (see attached).

adam
http://www.nabble.com/file/p24926395/openejb.log openejb.log 


adam.z wrote:
> 
> Hi Jean-Louis,
> 
> Thanks for catching that! I failed to mention this in my original post,
> but those classes do exist in the exploded jar which is being deployed (in
> OpenEJB apps directory). I do not understand why is OpenEJB not seeing
> them? See attached screenshot.
> 
> adam http://www.nabble.com/file/p24924127/screenshot.jpeg screenshot.jpeg 
> 
> 
> Jean-Louis MONTEIRO wrote:
>> 
>> Hello Adam,
>> 
>> Did you try solving first this exception?
>> Caused by: java.lang.NoClassDefFoundError:
>> com/kkamerica/ecommerce/ejb/api/dao/internal/ConfigurationDaoLocal$ConfigurationKey
>>      at java.lang.Class.getDeclaredMethods0(Native Method)
>>      at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
>>      at java.lang.Class.getDeclaredMethods(Class.java:1791)
>>      at
>> org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethodProperties(JavaXClass.java:89)
>>      at
>> org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:106)
>>      at
>> org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:98)
>>      at
>> org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:1023)
>>      at
>> org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:859)
>>      at
>> org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:667)
>>      at
>> org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:546)
>>      at
>> org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:291)
>>      at
>> org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
>>      at
>> org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
>>      at
>> org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
>>      at
>> org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
>>      at
>> org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
>>      at
>> org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
>>      at
>> org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:183)
>>      at
>> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:482)
>>      ... 14 more
>> Caused by: java.lang.ClassNotFoundException:
>> com.kkamerica.ecommerce.ejb.api.dao.internal.ConfigurationDaoLocal$ConfigurationKey
>>      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>      at java.security.AccessController.doPrivileged(Native Method)
>>      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>      ... 33 more
>> 
>> It seems to me that this error causes deployments issues above.
>> I haven't seen anything else bad in the log file.
>> 
>> Hope it helps.
>> Please let us know if you still have problems.
>> 
>> Jean-Louis
>> 
>> 
>> adam.z wrote:
>>> 
>>> Hello,
>>> 
>>> I'm trying to deploy an EJB 3.0 Hibernate code with two data sources
>>> under OpenEJB without a success. Basically, it's a data access layer
>>> with stateless EJBs modeled as DAOs. After a week of configuration and
>>> playing with docs, I got to the point where the container starts up, but
>>> in the log EJB deployment fails. The error doesn't make sense to me,
>>> because OpenEJB complains about EJB deployments not being found, such
>>> as:
>>> 
>>> 2009-08-10 14:04:10,671 - DEBUG - Clearing Sun JarFileFactory cache for
>>> directory /opt/openejb-3.1.1/apps/ch
>>> 2009-08-10 14:04:10,672 - DEBUG - App failing deployment may not have
>>> undeployed cleanly: /opt/openejb-3.1.1/apps/ch
>>> org.apache.openejb.UndeployException: Failed undeploying application:
>>> id=/opt/openejb-3.1.1/apps/ch
>>> Nested caused by: 
>>> java.lang.Exception: deployment not found: PsProxyOrderCommitDaoEjb
>>> 
>>> but earlier in the log it shows it has deployed the very EJB (???):
>>> 
>>> 2009-08-10 14:04:03,347 - INFO  - Auto-deploying ejb
>>> PsProxyOrderCommitDaoEjb:
>>> EjbDeployment(deployment-id=PsProxyOrderCommitDaoEjb)
>>> 
>>> My app is deployed as exploded JAR (inside /opt/openejb/apps/), and my
>>> entities for the two respective data sources live in:
>>> 
>>> /opt/openejb/lib/ecommerce-ps-entities.jar
>>> /opt/openejb/lib/ecommerce-web-entities.jar
>>> 
>>> My interfaces are also bundled separately, and live in:
>>> 
>>> /opt/openejb/lib/ecommerceejb-api-1.0.jar
>>> 
>>> In persistence.xml I'm telling hibernate that it can find entities using
>>> <jar-file>../../lib/<jar></jar> and it seems to be happy.
>>> 
>>> Why is OpenEJB failing though?
>>> 
>>> adam
>>> 
>>> PS. clean log is attached from a signle failed deployment 
>>> http://www.nabble.com/file/p24905914/openejb.log openejb.log 
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OpenEjb-undeploying-app-on-startup-tp24905914p24926395.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to