Results 1 to 7 of 7

Thread: Spring Batch - DM server 2.0 Deployment errors.

  1. #1
    Join Date
    Jan 2010
    Posts
    26

    Default Spring Batch - DM server 2.0 Deployment errors.

    Hi There,

    I am trying to deploy a spring application (which is a combo of spring integration and Batch) to Spring DM server 2.0 but I am stuck with the following error. Not sure what it means!
    it says class not found but i can see the jar file in SPRING_DM_HOME/repository/ext/org.springframework.transaction-3.0.0.RELEASE.jar

    Code:
    Caused by: com.springsource.kernel.osgi.framework.ExtendedClassNotFoundException: org.springframework.transaction.interceptor.TransactionAttribute in KernelBundleClassLoader: [bundle=org.springframework.batch.core_2.1.0.RELEASE]
            at com.springsource.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:149)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            ... 42 common frames omitted
    Caused by: java.lang.ClassNotFoundException: org.springframework.transaction.interceptor.TransactionAttribute
            at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
            at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
            at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
            at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
            at com.springsource.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:145)
            ... 44 common frames omitted

    Just wondering if a Spring Batch/Integration application can be deployed to Spring DM server at all? Is there any samples available?

    Thanks

    cheers
    Last edited by msns3ka; Feb 25th, 2010 at 04:00 PM.

  2. #2
    Join Date
    Dec 2009
    Location
    West Chester, Pennsylvania USA
    Posts
    36

    Default Maven dependencies

    Have you included both jars in your pom.xml (assuming you are using Maven).

    <dependency>
    <groupId>org.springframework.batch</groupId>
    <artifactId>org.springframework.batch.core</artifactId>
    <version>2.1.0.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>org.springframework.batch</groupId>
    <artifactId>org.springframework.batch.infrastructu re</artifactId>
    <version>2.1.0.RELEASE</version>
    </dependency>
    Regards,
    Gordon Dickens

    gordon@gordondickens.com
    twitter.com/gdickens
    linkedin.com/in/gordondickens
    Blog: technophile.gordondickens.com

  3. #3
    Join Date
    Dec 2009
    Location
    West Chester, Pennsylvania USA
    Posts
    36

    Default template.mf settings

    Also include the following in your template.mf

    Import-Template: org.springframework.batch.*;version="[2.1.0.RELEASE, 2.1.0.RELEASE]",
    org.springframework.integration.*;version="[1.0.3.RELEASE,3.0)",
    org.springframework.*;version="[3.0.0,3.0.1)",
    javax.jms.*;version="1.1.0"
    Import-Bundle: org.springframework.integration;version="1.0.3.REL EASE",
    org.springframework.integration.jms;version="1.0.3 .RELEASE",
    org.springframework.integration.adapter;version="1 .0.3.RELEASE",
    org.springframework.integration.file;version="1.0. 3.RELEASE",
    org.springframework.integration.http;version="1.0. 3.RELEASE",
    org.springframework.integration.stream;version="1. 0.3.RELEASE",
    org.springframework.batch.core;version="2.1.0.RELE ASE",
    org.springframework.batch.infrastructure;version=" 2.1.0.RELEASE"
    Import-Library: org.springframework.spring;version="[3.0.0, 4.0)"
    Regards,
    Gordon Dickens

    gordon@gordondickens.com
    twitter.com/gdickens
    linkedin.com/in/gordondickens
    Blog: technophile.gordondickens.com

  4. #4
    Join Date
    Jan 2010
    Posts
    26

    Default

    Hi gdickens,

    Thanks.

    I am using a simple jar file with a Manifest [changed as per your instructions]

    Code:
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: MyJob Plug-in
    Bundle-SymbolicName: MyJob
    Bundle-Version: 1.0.0
    Bundle-Activator: myjob.Activator
    Import-Package: org.osgi.framework;version="1.3.0"
    Import-Template: 
     org.springframework.batch.*;version="[2.1.0.RELEASE,2.1.0.RELEASE]",
     org.springframework.integration.*;version="[2.0.0.M2,2.0.0.M2)",
     org.springframework.*;version="[3.0.0,3.0.0)",
     javax.jms.*;version="1.1.0"
    Import-Bundle: 
     org.springframework.integration;version="2.0.0.M2",
     org.springframework.integration.adapter;version="2.0.0.M2",
     org.springframework.integration.event;version="2.0.0.M2",
     org.springframework.integration.file;version="2.0.0.M2",
     org.springframework.batch.core;version="2.1.0.RELEASE",
     org.springframework.batch.infrastructure;version="2.1.0.RELEASE",
     com.springsource.org.aopalliance;version="1.0.0"
    Import-Library: 
     org.springframework.spring;version="[3.0.0, 4.0)"

    I am seeing the following error in Spring DM Server ...:

    Code:
    . com.springsource.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'MyJob' at
     version '1.0.0': Cannot resolve: MyJob
        Resolver report:
            Uses violation: <Import-Package: org.springframework.integration.aop; version="0.0.0"> in bundle <AirNZOneOffJob_1.0.0>
                Found conflicts:
                    package        'org.springframework.aop.support_3.0.1.RELEASE' in bundle 'org.springframework.aop_3.0.1.RELEASE' used by 'org.springframework.integration.aop_2.0.0.M2' in bundle 'org.springframework.integration_2.0.0.M2'
                    conflicts with 'org.springframework.aop.support_3.0.0.RELEASE' in bundle 'org.springframework.aop_3.0.0.RELEASE' used by 'org.springframework.aop.aspectj_3.0.0.RELEASE' in bundle 'org.springframework.aop_3.0.0.RELEASE'
    .
    .
    .
    .
    .
    .

  5. #5
    Join Date
    Dec 2009
    Location
    West Chester, Pennsylvania USA
    Posts
    36

    Default dependency with 0.0.0

    It looks like your Import-Template version ranges are excluding the end version.

    [version, version] is what you want, you have [version, version) the parenthesis excludes that version, so modify your Import-Template to either specify the only version (single value in double quotes as with the javax.jms entry) or use a closing bracket instead of the parenthesis (as below).

    Import-Template:
    org.springframework.batch.*;version="[2.1.0.RELEASE,2.1.0.RELEASE]",
    org.springframework.integration.*;version="[2.0.0.M2,2.0.0.M2]",
    org.springframework.*;version="[3.0.0,3.0.0]",
    javax.jms.*;version="1.1.0"
    Regards,
    Gordon Dickens

    gordon@gordondickens.com
    twitter.com/gdickens
    linkedin.com/in/gordondickens
    Blog: technophile.gordondickens.com

  6. #6
    Join Date
    Jan 2010
    Posts
    26

    Default

    Thanks,

    I made a huge progress but stuck up with the following error: [I have already installed jar files 'com.springsource.com.thoughtworks.xstream-1.3.1.jar' , com.springsource.org.codehaus.jettison-1.0.1.jar in Spring DM Server]

    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jettison/mapped/Configuration
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
            ... 116 common frames omitted
    Caused by: java.lang.NoClassDefFoundError: org/codehaus/jettison/mapped/Configuration
            at com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver.<init>(JettisonMappedXmlDriver.java:48)
            at org.springframework.batch.core.repository.dao.XStreamExecutionContextStringSerializer.init(XStreamExecutionContextStringSerializer.java:65)
            at org.springframework.batch.core.repository.dao.XStreamExecutionContextStringSerializer.afterPropertiesSet(XStreamExecutionContextStringSerializer.java:60)
            at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.afterPropertiesSet(JdbcExecutionContextDao.java:170)
            at org.springframework.batch.core.repository.support.JobRepositoryFactoryBean.createExecutionContextDao(JobRepositoryFactoryBean.java:205)
            at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean.getTarget(AbstractJobRepositoryFactoryBean.java:162)
            at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean.initializeProxy(AbstractJobRepositoryFactoryBean.java:150)
            at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean.afterPropertiesSet(AbstractJobRepositoryFactoryBean.java:157)
            at org.springframework.batch.core.repository.support.JobRepositoryFactoryBean.afterPropertiesSet(JobRepositoryFactoryBean.java:156)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
            ... 123 common frames omitted

    The following is my MANIFEST.MF

    Code:
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: MyJob Plug-in
    Bundle-SymbolicName: MyJob
    Bundle-Version: 1.0.0
    Bundle-Activator: myjob.Activator
    Import-Package: org.osgi.framework;version="1.3.0"
    Import-Template: 
     org.springframework.*;version="3.0.0.RELEASE",
     org.springframework.batch.*;version="2.1.0.RELEASE",
     org.springframework.integration.*;version="2.0.0.M2",
     javax.jms.*;version="1.1.0",
     com.springsource.org.apache.commons.*;version="1.2.2.osgi",
     com.springsource.org.hsqldb.*;version="1.8.0.10",
     com.springsource.org.codehaus.jettison.*;version="1.0.1",
     com.springsource.com.thoughtworks.xstream.*;version="1.3.1"
    Import-Bundle: 
     org.springframework.integration;version="2.0.0.M2",
     org.springframework.integration.adapter;version="2.0.0.M2",
     org.springframework.integration.event;version="2.0.0.M2",
     org.springframework.integration.file;version="2.0.0.M2",
     org.springframework.batch.core;version="2.1.0.RELEASE",
     org.springframework.batch.infrastructure;version="2.1.0.RELEASE",
     org.springframework.aop;version="3.0.0.RELEASE",
     com.springsource.org.apache.commons.dbcp;version="1.2.2.osgi",
     com.springsource.org.hsqldb;version="1.8.0.10",
     com.springsource.org.codehaus.jettison;version="1.0.1",
     com.springsource.com.thoughtworks.xstream;version="1.3.1"
    Import-Library: 
     org.springframework.spring;version="3.0.0.RELEASE"

  7. #7
    Join Date
    Dec 2009
    Location
    West Chester, Pennsylvania USA
    Posts
    36

    Default Transitive dependency

    It looks like it is missing that transitive dependency. You should add it explicitly to the top of the Import-Template section (Bundlor didn't resolve that dependency).

    Keep in mind that you can see the dependencies by searching at: http://www.springsource.com/repository/app/
    Regards,
    Gordon Dickens

    gordon@gordondickens.com
    twitter.com/gdickens
    linkedin.com/in/gordondickens
    Blog: technophile.gordondickens.com

Posting Permissions

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