[JBoss/Spring Integration] - ApplicationContext NoClassDefFound
by ven346
Hello,
When I run an EAR in jboss4.2.2GA, that uses Spring 2.0.2, I get an error saying the ApplicationContext of spring cannot be found (see below)
This happens however, when a bean is instantiated during the initialization of this same application context.
Does somebody have any idea?
Regards, Ron
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.epo.cassius.businessservice.actionhandler.impl.ActionHandlerImpl]
Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
Caused by:
java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
at org.epo.cassius.businessservice.actionhandler.impl.ActionHandlerImpl.(ActionHandlerImpl.java:59)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:84)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:45)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:701)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:388)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112963#4112963
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112963
18 years, 4 months
[JBoss Seam] - Re: How do I reload a Data Model on a SessionBean everytime
by Andy Gibson
Also, I think there is another small problem with the code you have there. I could be wrong on this, so hopefully someone will correct me if that is the case.
You have outjection on the datamodel for users, and also return a value for the factory method.
When you return the value from the factory, that is outjected as the variable "users". When the method completes, the Seam interceptor then looks for outjected variables and outjects the data model as "users". At that point, you have set it twice. While I don't think it would be a problem at run time, the return value from the factory method is unnecessary, and it should be like :
| @Name("userList")
| @Scope(PAGE)
| @Restrict("#{identity.loggedIn}")
| public class UserList implements UserListInterface {
|
| @DataModel("users")
| private List<User> users;
|
| @Factory("users")
| public void getUsers() {
| users = entityManager.createQuery(....).getResultList();
| }
|
| }
|
|
Here, you are using the factory to assign the value, and the @Datamodel annotation handles the outjection.
For more details see :
http://docs.jboss.com/seam/latest/reference/en/html/concepts.html#d0e3302
Cheers,
Andy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112961#4112961
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112961
18 years, 4 months
[EJB/JBoss] - commit-option A cache invalidation issue
by tigrik
Hi guys!
I was searching for solution quite long, but haven't found a real solution.
My applications has a EJB 2.1 part and EJB3 part. In some rare cases I have to write into EJB2 part using EJB3, so EJB2 commit-option-A caching doesn't get it. (JBOSS 4.0.5)
Is there an easy way to remove an instance from the cache, something like
session.evict() in Hibernate?
Commit-Option-B is not really an option, because it's much slower. Commit-Option-D is not an option too, because I need the changes to be registered by EJB2 in the same moment.
What I do now is mirroring of the EJB3 update but it's not a perfect solution, as long I need 2 updates every time I wan't to update.
I've tried the InvalidationManager solution, but it seems like I need a dependency on the jboss.jar and it's not so cool either.
Thank you in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112952#4112952
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112952
18 years, 4 months