Exception invoking: startup on an @In component
bossy Aug 5, 2009 2:56 PMHello,
In my seam application I have an entity bean, corresponding to a table in my DB.
@Entity @Table(name = "MY_TABLE") public class MyTable implements java.io.Serializable { private String col1; private String col2; @In ListHelper listHelper; ..... }
ListHelper is a component that I need in this entity bean. It looks like this:
@Name("listHelper") @Scope(ScopeType.SESSION) @Startup public class ListHelper { }
The problem I face is that when I deploy the application in JBOSS (4.2.3) I get the following exception
during startup:
13:42:52,766 ERROR [[/ABC]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener org.jboss.seam.InstantiationException: Could not instantiate Seam component: ABCEntityManagerFactory at org.jboss.seam.Component.newInstance(Component.java:2106) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:112) at org.jboss.seam.init.Initialization.init(Initialization.java:735) ....... Caused by: java.lang.RuntimeException: exception invoking: startup at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154) at org.jboss.seam.Component.callComponentMethod(Component.java:2219) at org.jboss.seam.Component.callCreateMethod(Component.java:2134) at org.jboss.seam.Component.newInstance(Component.java:2094) ... 140 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) ... 143 more Caused by: java.lang.NoClassDefFoundError: Lcom/app/ListHelper; at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2291) at java.lang.Class.getDeclaredFields(Class.java:1743) at org.hibernate.reflection.java.JavaXClass.getDeclaredFieldProperties(JavaXClass.java:76) at org.hibernate.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:100) at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:219) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:134) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:318) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1233) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:869) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:183) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:240) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51) at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85) at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50) ... 149 more Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.app.ListHelper at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306) at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521) at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 167 more 13:42:52,766 ERROR [StandardContext] Error listenerStart 13:42:52,766 ERROR [StandardContext] Context [/ABC] startup failed due to previous errors
I'm not quite sure why I get this. I thought it might have something to do with the scope, but even changing the scope of ListHelper to APPLICATION didn't help. So it's something else.
Could someone help me with this? Is it actually possible to do this?
Thanks