Results 1 to 6 of 6

Thread: DefaultXmlBeanDefinitionParser NoClassDefFoundError in RC1

  1. #1

    Default DefaultXmlBeanDefinitionParser NoClassDefFoundError in RC1

    Hello

    I've been working with the new JMS functionality in 2.0 rc1 and I've started to get a NoClassDefFoundError for DefaultXmlBeanDefinitionParser. I've been download the snapshots and building over the last month and I'm currently using build 50. DefaultXmlBeanDefinitionParser is not in the source tree. I've checked 54 and its not there either.

    In checking what I've downloaded it IS in build 20. For the time being I'm guessing its okay to just copy what's in 20 over to 50 and re-build but I thought some one should know.

    Thanks
    Tom

  2. #2

    Default

    Okay,

    Iwas wrong. Copying over DefaultXmlBeanDefinitionParser from build 20 to build 50 did not work. I'm getting compile errors about it not overriding abstract methods and the use of a deprecated API.

    Thanks
    Tom

  3. #3

    Default

    More information,

    What I'm trying to do is run an ActiveMQ broker embedded in Tomcat. In trying to do that I got the following stack trace.

    Code:
    org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'brokerService' defined in ServletContext resource [/WEB-INF/applicationContext-JMS.xml]: Class that bean class [org.apache.activemq.xbean.BrokerFactoryBean] depends on not found; nested exception is java.lang.NoClassDefFoundError
    Caused by: 
    java.lang.NoClassDefFoundError
    	at org.apache.activemq.xbean.BrokerFactoryBean.class$(BrokerFactoryBean.java:42)
    	at org.apache.activemq.xbean.BrokerFactoryBean.<clinit>(BrokerFactoryBean.java:45)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:242)
    	at org.springframework.util.ClassUtils.forName(ClassUtils.java:160)
    	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:320)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:903)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:138)
    	at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:652)
    	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:382)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:314)
    	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:3727)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)
    	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
    	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:585)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: java.lang.ClassNotFoundException: org.apache.xbean.spring.context.impl.URIEditor
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:164)
    	... 39 more
    In seraching the ActiveMQ forums I found the solution was to use the xbean-spring-2.2.jar. So I added that to my lib directory and then I got:
    Code:
    2006-06-20 18:10:33,375 ERROR main [org.springframework.web.context.ContextLoader] - <Context initialization failed>
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerService' defined in ServletContext resource [/WEB-INF/applicationContext-JMS.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/DefaultXmlBeanDefinitionParser
    Caused by: 
    java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/DefaultXmlBeanDefinitionParser
    	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:87)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:278)
    	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
    	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
    	at org.apache.activemq.xbean.BrokerFactoryBean.afterPropertiesSet(BrokerFactoryBean.java:76)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:901)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:870)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:393)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:257)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:332)
    	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:3727)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)
    	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
    	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:585)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    So it appears its a version incompatibility problem between Spring/Xbean/ActiveMQ. I'm not sure where to go from here. I'll post the information on the various forums. If anyone has any suggestions I'd appreciate it.

    Thanks
    Tom

  4. #4

    Default

    To resolve this issue you have to update xbean-spring to version >=2.4

  5. #5

    Default

    Thanks, but it appears that the most current jar available on the XBeans site is 2.3. Do you know where I can get 2.4?

    Thanks
    Tom

  6. #6
    Join Date
    Oct 2006
    Posts
    4

    Default

    Hi!

    I have got the same problem after changing Spring from v1.2.8 to 2.0. I've tried all available xbean-spring versions (v2.2 thru v.2.6) but they all cause some kind of exception.

    Have you solved your problem? And if so, how?

    Arndt Kubosch
    Datek Wireless AS
    Norway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •