Announcement Announcement Module
Collapse
No announcement yet.
NoClassDefFoundError for javax/xml/stream/XMLStreamException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoClassDefFoundError for javax/xml/stream/XMLStreamException

    Hi,
    I am trying to run test cases for newly released spring batch 2.0.0 and am getting this exception for some 35 test cases out of total 125 (please see the full trace below).
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jobLauncher' defined in class path resource [simple-job-launcher-context.xml]: Cannot resolve reference to bean 'jobRepository' while setting bean property 'jobRepository'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jobRepository' defined in class path resource [simple-job-launcher-context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:275)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:104)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1245)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1010)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:380)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)
    at org.springframework.batch.core.launch.support.JobR egistryBackgroundJobRunner.run(JobRegistryBackgrou ndJobRunner.java:218)
    at org.springframework.batch.core.launch.support.JobR egistryBackgroundJobRunner.access$000(JobRegistryB ackgroundJobRunner.java:64)
    at org.springframework.batch.core.launch.support.JobR egistryBackgroundJobRunner$1.run(JobRegistryBackgr oundJobRunner.java:176)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jobRepository' defined in class path resource [simple-job-launcher-context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1338)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:473)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:269)
    ... 21 more
    Caused by: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
    at org.springframework.batch.core.repository.dao.XStr eamExecutionContextStringSerializer.init(XStreamEx ecutionContextStringSerializer.java:65)
    at org.springframework.batch.core.repository.dao.XStr eamExecutionContextStringSerializer.afterPropertie sSet(XStreamExecutionContextStringSerializer.java: 60)
    at org.springframework.batch.core.repository.dao.Jdbc ExecutionContextDao.afterPropertiesSet(JdbcExecuti onContextDao.java:155)
    at org.springframework.batch.core.repository.support. JobRepositoryFactoryBean.createExecutionContextDao (JobRepositoryFactoryBean.java:169)
    at org.springframework.batch.core.repository.support. AbstractJobRepositoryFactoryBean.getTarget(Abstrac tJobRepositoryFactoryBean.java:139)
    at org.springframework.batch.core.repository.support. AbstractJobRepositoryFactoryBean.initializeProxy(A bstractJobRepositoryFactoryBean.java:129)
    at org.springframework.batch.core.repository.support. AbstractJobRepositoryFactoryBean.afterPropertiesSe t(AbstractJobRepositoryFactoryBean.java:135)
    at org.springframework.batch.core.repository.support. JobRepositoryFactoryBean.afterPropertiesSet(JobRep ositoryFactoryBean.java:126)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1369)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1335)
    ... 31 more


    I searched for the class in all of the jars within the distribution but could not find it.
    I have setup the project in eclipse (3.4.2) following instructions at http://static.springsource.org/sprin...g-started.html under "With Eclipse and without Maven".

    Does anybody know what jar is missing?
    Thanks

  • #2
    You need to add com.springsource.javax.xml.stream-1.0.1.jar.

    Comment


    • #3
      Thanks for the reply.
      This file is not part of org.springframework.batch-2.0.0.RELEASE-with-dependencies.zip distribution. Do you know where it can be downloaded from?

      Comment


      • #4
        Yes, i also couldnt find this jar file in Release2.0.0. May be, senior members
        like Dave, etc can give us inputs.

        But, this jar is present in RC3 bundle.

        --venkat

        Comment


        • #5
          This worked for me:

          Using maven:

          <dependency>
          <groupId>javax.xml.stream</groupId>
          <artifactId>stax-api</artifactId>
          <version>1.0-2</version>
          </dependency>

          or direct link to jar:

          http://download.java.net/maven/1/jav...-api-1.0-2.jar

          Comment

          Working...
          X