I test a POC with Service include in Mule like bean spring, I have a issue with Hibernate and Jpa dependencies. Every body now which version of Hibernate and JPA are supported/use in Mule 3.4 CE.
I have a lot of exception when i wan't to run the flow : whith hibernate 3.6.0.Final :
java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
at org.hibernate.engine.EJB3CascadeStyle$1.<init>(EJB3CascadeStyle.java:44)
at org.hibernate.engine.EJB3CascadeStyle.<clinit>(EJB3CascadeStyle.java:39)
at org.hibernate.ejb.event.EJB3PersistEventListener.<clinit>(EJB3PersistEventListener.java:39)
at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:101)
at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:159)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:288)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
with 4.0.1 and uppe :
java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V
at org.hibernate.service.ServiceRegistryBuilder.buildServiceRegistry(ServiceRegistryBuilder.java:244)
at org.hibernate.ejb.Ejb3Configuration.buildLifecycleControledServiceRegistry(Ejb3Configuration.java:930)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:903)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:288)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:119)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:73)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101)
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:57)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:84)
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:207)
at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:47)
at org.mule.tooling.server.application.ApplicationDeployer.run(ApplicationDeployer.java:58)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:91)
My dependence tree :
[INFO] +- org.mule:mule-core:jar:3.4.0:provided
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.0:provided
[INFO] | +- org.safehaus.jug:jug:jar:asl:2.0.0:provided
[INFO] | +- commons-cli:commons-cli:jar:1.2:provided
[INFO] | +- commons-collections:commons-collections:jar:3.2.1:provided
[INFO] | +- commons-io:commons-io:jar:1.4:provided
[INFO] | +- commons-lang:commons-lang:jar:2.4:provided
[INFO] | +- commons-pool:commons-pool:jar:1.5.3:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:provided
[INFO] | +- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] | +- org.slf4j:jcl-over-slf4j:jar:1.6.1:provided
[INFO] | +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] | +- log4j:log4j:jar:1.2.16:compile
[INFO] | +- asm:asm:jar:3.1:provided
[INFO] | +- asm:asm-commons:jar:3.1:provided
[INFO] | | \- asm:asm-tree:jar:3.1:provided
[INFO] | +- org.mvel:mvel2:jar:2.1.3.Final:provided
[INFO] | +- org.jgrapht:jgrapht-jdk1.5:jar:0.7.3:provided
[INFO] | \- org.mule.common:mule-common:jar:0.11.0:provided
[INFO] +- org.mule.modules:mule-module-spring-config:jar:3.4.0:provided
[INFO] | +- org.mule.modules:mule-module-annotations:jar:3.4.0:provided
[INFO] | | \- cglib:cglib-nodep:jar:2.2:provided
[INFO] | +- org.springframework:spring-context:jar:3.2.1.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:3.2.1.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:3.2.1.RELEASE:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1-osgi:provided
[INFO] | \- jaxen:jaxen:jar:1.1.1:provided
[INFO] | \- jdom:jdom:jar:1.0:provided
[INFO] +- org.mule.transports:mule-transport-file:jar:3.4.0:provided
[INFO] +- org.mule.modules:mule-module-xml:jar:3.4.0:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:provided
[INFO] | +- commons-jxpath:commons-jxpath:jar:1.3-osgi:provided
[INFO] | +- com.thoughtworks.xstream:xstream:jar:1.4.2:provided
[INFO] | | \- xmlpull:xmlpull:jar:1.1.3.1:provided
[INFO] | +- joda-time:joda-time:jar:1.6:provided
[INFO] | +- xpp3:xpp3_min:jar:1.1.3.4.O-osgi:provided
[INFO] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.0.8:provided
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.0.2:provided
[INFO] | +- net.java.dev.stax-utils:stax-utils:jar:20080702-osgi:provided
[INFO] | +- net.sf.saxon:saxon:jar:8.9.0.4-osgi:provided
[INFO] | +- net.sf.saxon:saxon-dom:jar:8.9.0.4-osgi:provided
[INFO] | +- net.sf.saxon:saxon-xqj:jar:8.9.0.4:provided
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.1:provided
[INFO] | \- com.sun.xml.bind:jaxb-impl:jar:2.1.5:provided
[INFO] +- org.mule.tests:mule-tests-functional:jar:3.4.0:test
[INFO] | +- org.springframework:spring-beans:jar:3.2.1.RELEASE:compile
[INFO] | +- commons-net:commons-net:jar:2.0:test
[INFO] | +- org.apache.ftpserver:ftpserver-core:jar:1.0.2:test
[INFO] | | \- org.apache.mina:mina-core:jar:2.0.0-M6:test
[INFO] | +- org.apache.ftpserver:ftplet-api:jar:1.0.2:test
[INFO] | +- org.apache.sshd:sshd-core:jar:0.6.0:test
[INFO] | +- bouncycastle:bcprov-jdk14:jar:139:test
[INFO] | +- org.mule:mule-core:test-jar:tests:3.4.0:test
[INFO] | | +- javax.activation:activation:jar:1.1-osgi:provided
[INFO] | | \- org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:jar:1.1-osgi:test
[INFO] | \- org.mockito:mockito-all:jar:1.9.0:test
[INFO] +- mockobjects:mockobjects-core:jar:0.09:test
[INFO] +- junit:junit:jar:4.9:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- mysql:mysql-connector-java:jar:5.1.10:compile
[INFO] +- org.mule.transports:mule-transport-email:jar:3.4.0:provided
[INFO] | \- javax.mail:mail:jar:1.4.3:provided
[INFO] +- org.mule.transports:mule-transport-jdbc:jar:3.4.0:provided
[INFO] | +- commons-dbutils:commons-dbutils:jar:1.2:provided
[INFO] | \- com.experlog:xapool:jar:1.5.0-osgi:provided
[INFO] +- org.springframework:spring-orm:jar:3.2.1.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework:spring-core:jar:3.2.1.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.0.1.Final:test
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:test
[INFO] | +- org.hibernate:hibernate-core:jar:4.0.1.Final:test
[INFO] | | \- antlr:antlr:jar:2.7.7:test
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:test
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:test
[INFO] | +- org.javassist:javassist:jar:3.15.0-GA:test
[INFO] | \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:test
[INFO] \- fr.myapp:jar:0.0.1-SNAPSHOT:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.2.4.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:3.2.4.RELEASE:compile
[INFO] \- org.springframework.data:spring-data-jpa:jar:1.4.2.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-commons:jar:1.6.2.RELEASE:compile
[INFO] \- org.aspectj:aspectjrt:jar:1.7.2:compile
My spring service run in test context whithout muleESB, is OK.
Mule distribution contains Hibernate core JARs at ${MULE_HOME}/lib/opt. But for some reason it doesn't contain Hibernate entity manager JAR. So, if you include hibernate-entitymanager.jar-4.0.1.Final in your classpath, it will try to access core hibernate classes from ${MULE_HOME}/lib/opt JARs which has been loaded by a different classloader and thus gives java.lang.IllegalAccessError.
Solution is to delete Mule provided Hibernate JARs from ${MULE_HOME}/lib/opt and add your own. Please ensure that you have a backup before you carry out such operation.
the suppression of hibernate-core-3.6.0.Final.jar in /opt/mule help to run muleEsb.
As pointed out by mmeyer this is a Class Loader issue. You can fix this in Mule 3.2 Mule provides a Fine Grained Class Loading option. To fix the above we can provide the following property in src/main/app/mule-deploy.properties and it loads both org.hibernate.engine.CascadeStyle and org.hibernate.engine.EJB3CascadeStyle using the application class loader:
FIX: Add the following to src/main/app/mule-deploy.properties
loader.override=org.hibernate
Note: Mule Studio still continues with this issue and hence one has to add hibernate entity manager jar to \MuleStudio\plugins\org.mule.tooling.server.3.4.1.ee_3.4.1.201312062152\mule\opt
My observation using mule CE standalone:
Scenario 1: (Deployment Fails)
My Mule App /lib
- has hibernate-entitymanager-3.6.0.Final .
- I excluded all other hibernate jars including hibernate-core-3.6.0.Final.jar
MuleCE3.4.0/lib/opt
- has hibernate-core-3.6.0.Final.jar and other hibernate jars
Error when app is deployed:
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [persistenceContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.()V from class org.hibernate.engine.EJB3CascadeStyle$1 (org.mule.api.lifecycle.InitialisationException)
Scenario 2 (Deployment Successful)
My Mule App /lib
- has hibernate-entitymanager-3.6.0.Final .
- I excluded all other hibernate jars including hibernate-core-3.6.0.Final.jar
MuleCE3.4.0/lib/opt
- has hibernate-core-3.6.0.Final.jar and other hibernate jars
- [Different from Scenario 1] Copy hibernate-entitymanager-3.6.0.Final to MuleCE/lib/opt
Related
Deployment to Pivotal cloud foundry of my spring boot app fails with the following error:
Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]:
java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl
Using its java buildpack 4.17.2
Problem only in cloud foundry deployment, locally works fine.
Cleaned up dependencies, using spring boot 1.5.19 and its started validator.
How to get rid of this missing dependency? spring-boot-starter-validation includes hibernate validator.
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.5.19.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:1.5.19.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.19.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.19.RELEASE:compile
[INFO] | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | +- org.springframework:spring-core:jar:4.3.22.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.17:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.19.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.19.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.37:compile
[INFO] | | | \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.37:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.37:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.22.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:4.3.22.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.22.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.22.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-validation:jar:1.5.19.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.37:compile
[INFO] | \- org.hibernate:hibernate-validator:jar:5.3.6.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] | \- com.fasterxml:classmate:jar:1.3.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.19.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.19.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.19.RELEASE:compile
[INFO] | | \- org.springframework:spring-jdbc:jar:4.3.22.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | +- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.18.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.18.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:4.3.22.RELEASE:compile
[INFO] | | \- org.springframework:spring-tx:jar:4.3.22.RELEASE:compile
[INFO] | \- org.springframework:spring-aspects:jar:4.3.22.RELEASE:compile
[INFO] +- org.liquibase:liquibase-core:jar:3.6.3:compile
[INFO] | \- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.5.19.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.22.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:4.2.11.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-core:jar:4.2.11.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:4.2.11.RELEASE:compile
[INFO] +- wsl-java-validate:wslvalidate4:jar:4.0.1:compile
[INFO] +- wsl-java-validate:asn1:jar:4.0.1:compile
[INFO] +- wsl-java-validate:jsafe:jar:4.0.1:compile
[INFO] +- wsl-java-validate:certj:jar:4.0.1:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.6:compile
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] +- org.springframework.security:spring-security-jwt:jar:1.0.9.RELEASE:compile
[INFO] | \- org.bouncycastle:bcpkix-jdk15on:jar:1.56:compile
[INFO] | \- org.bouncycastle:bcprov-jdk15on:jar:1.56:compile
[INFO] +- org.springframework.boot:spring-boot-starter-quartz:jar:2.1.4.RELEASE:compile
[INFO] | \- org.quartz-scheduler:quartz:jar:2.3.1:compile
[INFO] | +- com.mchange:mchange-commons-java:jar:0.2.15:compile
[INFO] | \- com.zaxxer:HikariCP-java7:jar:2.4.13:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.19.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.19.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.19.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] | \- org.springframework:spring-test:jar:4.3.22.RELEASE:test
EDIT:
FIXED. Turns out it has been a problem caused by below jboss libraries I have picked up from another module of my webapp.
After excluding below libraries from target jar file, all works as expected.
Still strange my local deployments did not detect similar hibernate validator issues, need to understand more diffs between PCF java build packs and local java runtime.
[INFO] | +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.3.2:compile
[INFO] | | \- javax.xml.soap:saaj-api:jar:1.3:compile
[INFO] | +- xml-security:xmlsec:jar:1.3.0:compile
[INFO] | +- com.sun.xml.rpc:jaxrpc-impl:jar:1.1.3_01:compile
[INFO] | +- com.sun.xml.rpc:jaxrpc-spi:jar:1.1.3_01:compile
[INFO] | +- com.sun.xml.fastinfoset:FastInfoset:jar:1.0.2:compile
[INFO] | +- jboss:jbossws-core:jar:1.0.4.GA:compile
[INFO] | +- jboss:jboss-common-client:jar:4.0.4.GA:compile
[INFO] | +- jboss.jbossws:jboss-jaxws-ext:jar:3.0.1-native-2.0.4.GA:compile
[INFO] | \- org.jboss:jbossxb:jar:2.0.3.GA:compile
[INFO] | +- org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:compile
[INFO] | +- org.jboss:jboss-common-core:jar:2.2.9.GA:compile
[INFO] | +- org.jboss:jboss-reflect:jar:2.0.2.GA:compile
[INFO] | +- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] | +- xerces:xercesImpl:jar:2.9.1:compile
[INFO] | +- com.wutka:dtdparser:jar:1.21:compile
[INFO] | \- sun-jaxb:jaxb-api:jar:2.1.9:compile
I have developed a library (smartconnect-commons) which has integration with redis caching using spring-data-redis. This library can be plugged-in with any application which ever wants to use redis. JUnit tests in that library are successful. No issues so far.
Now I am using above library as a dependency in a Spring boot app. When running the spring boot app, it is failed with application context initialization errors.
2017-08-17 10:38:25,118 [main] ERROR org.springframework.boot.SpringApplication - - Application startup failed
java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.redis.repository.configuration.EnableRedisRepositories.repositoryFactoryBeanClass()
at java.lang.reflect.Method.getDefaultValue(Method.java:612)
at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:132)
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotations(Class.java:3446)
at org.springframework.core.type.StandardAnnotationMetadata.<init>(StandardAnnotationMetadata.java:68)
at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport.getConfigurationSource(AbstractRepositoryConfigurationSourceSupport.java:65)
at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport.registerBeanDefinitions(AbstractRepositoryConfigurationSourceSupport.java:58)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:354)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.adp.smartconnect.SmartconnectWPInitializer.main(SmartconnectWPInitializer.java:32)
Looks like there is a mis match with spring dependency versions, I spent lot of time but could not figure out that. Please see dependency tree of spring boot app.
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) # smartconnect-wage-payments-writer ---
[INFO] com.adp.smartconnect:smartconnect-wage-payments-writer:war:1.0.0-SNAPSHOT
[INFO] +- com.adp.smartconnect:smartconnect-config:jar:2.3.42:compile
[INFO] | +- org.mule.modules:mule-module-mongo:jar:5.0.999:compile
[INFO] | \- org.mongodb:mongo-java-driver:jar:3.4.2:compile
[INFO] +- com.adp.smartconnect:smartconnect-commons:jar:1.0.9-SNAPSHOT:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-redis:jar:1.8.3.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-keyvalue:jar:1.2.3.RELEASE:compile
[INFO] | | +- org.springframework:spring-oxm:jar:4.3.8.RELEASE:compile
[INFO] | | +- org.springframework:spring-context-support:jar:4.3.8.RELEASE:compile
[INFO] | | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] | +- redis.clients:jedis:jar:2.9.0:compile
[INFO] | | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] | +- org.springframework:spring-core:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework:spring-test:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-mongodb:jar:1.10.3.RELEASE:compile
[INFO] | | +- org.springframework:spring-expression:jar:4.3.8.RELEASE:compile
[INFO] | | \- org.springframework.data:spring-data-commons:jar:1.13.3.RELEASE:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.8.8:compile
[INFO] | +- org.json:json:jar:20140107:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] | +- com.adp.avs.domain:cdm:jar:1.0.9:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.8.8:compile
[INFO] | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- com.adp.smartconnect:avs-prod-payload:jar:2.3.3:compile
[INFO] | +- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | +- io.swagger:swagger-annotations:jar:1.5.3:compile
[INFO] | +- org.projectlombok:lombok:jar:1.16.16:compile
[INFO] | +- com.adp.smartconnect:smartconnect-mongo-cdm-library-cdm-0.9:jar:1.0.90:compile
[INFO] | | +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] | | \- org.mule.modules:smartconnect-tracking-service-connector-cdm-0.9:jar:1.0.90:compile
[INFO] | | \- org.mule.tools.devkit:mule-devkit-shade:jar:3.8.0:compile
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.7:compile
[INFO] | +- org.apache.logging.log4j:log4j-core:jar:2.7:compile
[INFO] | \- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.3.RELEASE:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.14:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.14:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.14:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.5.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.3:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.8.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.3.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.3.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.3.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | \- org.skyscreamer:jsonassert:jar:1.4.0:test
[INFO] | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] +- com.typesafe.akka:akka-actor_2.11:jar:2.5.0:compile
[INFO] | +- org.scala-lang:scala-library:jar:2.11.8:compile
[INFO] | +- com.typesafe:config:jar:1.3.1:compile
[INFO] | \- org.scala-lang.modules:scala-java8-compat_2.11:jar:0.7.0:compile
[INFO] +- com.typesafe.akka:akka-remote_2.11:jar:2.5.0:compile
[INFO] | +- com.typesafe.akka:akka-stream_2.11:jar:2.5.0:compile
[INFO] | | +- org.reactivestreams:reactive-streams:jar:1.0.0:compile
[INFO] | | \- com.typesafe:ssl-config-core_2.11:jar:0.2.1:compile
[INFO] | | \- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] | +- com.typesafe.akka:akka-protobuf_2.11:jar:2.5.0:compile
[INFO] | +- io.netty:netty:jar:3.10.6.Final:compile
[INFO] | +- io.aeron:aeron-driver:jar:1.2.3:compile
[INFO] | \- io.aeron:aeron-client:jar:1.2.3:compile
[INFO] | \- org.agrona:agrona:jar:0.9.3:compile
[INFO] +- com.typesafe.akka:akka-cluster_2.11:jar:2.5.0:compile
[INFO] +- com.typesafe.akka:akka-testkit_2.11:jar:2.5.0:compile
[INFO] +- com.typesafe.akka:akka-slf4j_2.11:jar:2.5.0:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- javax.jms:javax.jms-api:jar:2.0:compile
[INFO] +- com.ibm.mq:mqallclient:jar:8.0:compile
[INFO] +- org.springframework:spring-jms:jar:4.3.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework:spring-messaging:jar:4.3.8.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.3.8.RELEASE:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.0:compile
[INFO] +- commons-io:commons-io:jar:2.5:compile
[INFO] +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | +- commons-lang:commons-lang:jar:2.4:compile
[INFO] | +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | \- commons-digester:commons-digester:jar:2.1:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.9.3:compile
[INFO] +- org.mockito:mockito-all:jar:1.10.19:test
[INFO] +- org.powermock:powermock-api-mockito:jar:1.7.0:test
[INFO] | \- org.powermock:powermock-api-mockito-common:jar:1.7.0:test
[INFO] | \- org.powermock:powermock-api-support:jar:1.7.0:test
[INFO] +- org.powermock:powermock-module-junit4:jar:1.7.0:test
[INFO] | \- org.powermock:powermock-module-junit4-common:jar:1.7.0:test
[INFO] | +- org.powermock:powermock-reflect:jar:1.7.0:test
[INFO] | \- org.powermock:powermock-core:jar:1.7.0:test
[INFO] | \- org.javassist:javassist:jar:3.21.0-GA:test
[INFO] \- junit:junit:jar:4.12:test
I observed that spring-data-redis module is not working with spring boot 1.5.3 version. So when I upgraded spring boot version to 1.5.6, issue is resolved.
I had the same problem.
[ERROR] [org.springframework.boot.SpringApplication:771] Application startup failed
java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.redis.repository.configuration.EnableRedisRepositories.repositoryFactoryBeanClass()
That is because I pull some new code from git, which including code about redis, need the spring-boot-starter-data-redis library.
As the problems given by IDEA, I press alt+enter to auto import this library.
So the problem comes.
I finally click "In IDEA menu File -->Project Structure->Project Settings-->Libraries"
I found the version here is not the same version in build.gradle.
I guess this version maybe mismatch the other libraries of spring boot.
So I remove this library and try to run gradle command to build the project.
I solved the problem in this way.
I was trying the spring batch word count program and faced a version issue like this :
ERROR [org.springframework.batch.core.step.AbstractStep] - <Encountered an error executing the step>
java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.Counter, but class was expected
I use Cloudera Hadoop2 cdh4.5.0 and Spring hadoop version 1.0.1.RELEASE. I cant identify the exact problem as Spring batch is compatible with hadoop cdh4.
My dependency tree is as shown below.
[INFO] org.springframework.data:batch-wordcount:jar:0.0.1
[INFO] +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
[INFO] | +- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.springframework:spring-tx:jar:3.0.5.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework.batch:spring-batch-core:jar:2.2.0.RELEASE:compile
[INFO] | +- com.thoughtworks.xstream:xstream:jar:1.3:compile
[INFO] | | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] | +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] +- org.springframework.batch:spring-batch-infrastructure:jar:2.2.0.RELEASE:compile
[INFO] | \- org.springframework.retry:spring-retry:jar:1.0.2.RELEASE:compile
[INFO] +- org.springframework.batch:spring-batch-test:jar:2.2.0.RELEASE:compile
[INFO] | +- (junit:junit:jar:4.10:compile - omitted for conflict with 4.11)
[INFO] | +- (org.springframework:spring-test:jar:3.2.0.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | +- commons-io:commons-io:jar:1.4:compile
[INFO] | +- commons-dbcp:commons-dbcp:jar:1.2.2:compile
[INFO] | | \- commons-pool:commons-pool:jar:1.3:compile
[INFO] | \- commons-collections:commons-collections:jar:3.2:compile
[INFO] +- junit:junit:jar:4.11:test (scope not updated to compile)
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.springframework.data:spring-data-hadoop:jar:1.0.2.RELEASE:compile
[INFO] +- org.apache.hadoop:hadoop-common:jar:2.0.0-cdh4.5.0:compile
[INFO] | +- org.apache.hadoop:hadoop-annotations:jar:2.0.0-cdh4.5.0:compile
[INFO] | | \- jdk.tools:jdk.tools:jar:1.6:system
[INFO] | +- com.google.guava:guava:jar:11.0.2:compile
[INFO] | +- commons-net:commons-net:jar:3.1:compile
[INFO] | +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] | +- org.mortbay.jetty:jetty:jar:6.1.26.cloudera.2:compile
[INFO] | +- org.mortbay.jetty:jetty-util:jar:6.1.26.cloudera.2:compile
[INFO] | +- com.sun.jersey:jersey-core:jar:1.8:compile
[INFO] | +- com.sun.jersey:jersey-json:jar:1.8:compile
[INFO] | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | \- (com.sun.jersey:jersey-core:jar:1.8:compile - omitted for duplicate)
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.apache.hadoop:cloudera-jets3t:jar:2.0.0-cdh4.5.0:compile
[INFO] | | \- (net.java.dev.jets3t:jets3t:jar:0.9.0:compile - omitted for conflict with 0.6.1)
[INFO] | +- net.java.dev.jets3t:jets3t:jar:0.6.1:compile
[INFO] | | +- (commons-codec:commons-codec:jar:1.3:compile - omitted for conflict with 1.4)
[INFO] | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate)
[INFO] | | \- (commons-httpclient:commons-httpclient:jar:3.1:compile - omitted for duplicate)
[INFO] | +- (junit:junit:jar:4.8.2:compile - omitted for conflict with 4.11)
[INFO] | +- commons-lang:commons-lang:jar:2.5:compile
[INFO] | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | | +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.6.1:runtime
[INFO] | +- org.codehaus.jackson:jackson-core-asl:jar:1.8.8:compile
[INFO] | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.8:compile
[INFO] | +- net.sf.kosmosfs:kfs:jar:0.3:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.4.0a:compile
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.0.0-cdh4.5.0:compile
[INFO] | +- com.jcraft:jsch:jar:0.1.42:compile
[INFO] | \- org.apache.zookeeper:zookeeper:jar:3.4.5-cdh4.5.0:compile
[INFO] | \- jline:jline:jar:0.9.94:compile
[INFO] +- org.apache.hadoop:hadoop-hdfs:jar:2.0.0-cdh4.5.0:compile
[INFO] | +- tomcat:jasper-runtime:jar:5.5.23:compile
[INFO] | | \- commons-el:commons-el:jar:1.0:compile
[INFO] +- org.apache.hadoop:hadoop-tools:jar:2.0.0-mr1-cdh4.5.0:compile
[INFO] | +- com.cloudera.cdh:hadoop-ant:pom:2.0.0-mr1-cdh4.5.0:compile
[INFO] | \- org.apache.hadoop:hadoop-core:jar:2.0.0-mr1-cdh4.5.0:compile
[INFO] | +- hsqldb:hsqldb:jar:1.8.0.10:compile
[INFO] | +- org.eclipse.jdt:core:jar:3.1.1:compile
[INFO] +- org.hamcrest:hamcrest-all:jar:1.1:compile
[INFO] +- org.apache.hadoop:hadoop-client:jar:2.0.0-mr1-cdh4.5.0:compile
[INFO] +- org.apache.hadoop:hadoop-streaming:jar:2.0.0-mr1-cdh4.5.0:compile
[INFO] \- org.springframework:spring-test:jar:3.0.5.RELEASE:compile
Also, Does ommited for duplicate dependencies cause any error ?
You should use the 1.0.2.RELEASE-cdh4 version with Cloudera CDH4 - these distro specific releases are available in the Spring repository:
<repository>
<id>spring-releases</id>
<name>Spring Release Repository</name>
<url>http://repo.spring.io/libs-release</url>
</repository>
More info here: https://github.com/spring-projects/spring-hadoop/wiki/Build-with-Cloudera-CDH4
I am trying to deploy enterprise archive into web-logic application server. This ear contains two modules. web service module and web application module.
This application was previously running on Apache tomcat server and now i am migrating to web-logic application server.
I am getting following error when deploying to the web-logic application server. Below exception.
For web service and web application, I am using Hibernate and Spring frameworks. Following are the dependencies of web service
[INFO]
[INFO] Building WebServiceModule Maven Webapp 1.0-SNAPSHOT
[INFO]
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) # MavenWebAppModule ---
[INFO] com.packt.maven:MavenWebAppModule:war:1.0-SNAPSHOT
[INFO] +- com.packt.maven:BusinessLogicModule:jar:1.0-SNAPSHOT:compile
[INFO] | +- com.packet.maven:DataPersistanceModule:jar:1.0-SNAPSHOT:compile
[INFO] | \- com.packt.maven:DataModelModule:jar:1.0-SNAPSHOT:compile
[INFO] +- com.packt.maven:WebServiceClientModule:jar:1.0-SNAPSHOT:compile
[INFO] +- org.apache.struts:struts2-core:jar:2.1.8:compile
[INFO] | +- com.opensymphony:xwork-core:jar:2.1.6:compile
[INFO] | | \- org.springframework:spring-test:jar:2.5.6:compile
[INFO] | +- org.freemarker:freemarker:jar:2.3.15:compile
[INFO] | +- ognl:ognl:jar:2.7.3:compile
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
[INFO] | \- commons-io:commons-io:jar:1.3.2:compile
[INFO] +- org.apache.struts:struts2-spring-plugin:jar:2.1.8:compile
[INFO] | +- org.springframework:spring-beans:jar:2.5.6:compile
[INFO] | +- org.springframework:spring-core:jar:2.5.6:compile
[INFO] | \- org.springframework:spring-context:jar:2.5.6:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- xml-apis:xml-apis:jar:1.0.b2:provided (scope not updated to compile)
[INFO] +- javassist:javassist:jar:3.12.1.GA:compile
[INFO] +- com.oracle:ojdbc6:jar:11.2.0:compile
[INFO] +- org.springframework:spring:jar:2.5.6:compile
[INFO] +- org.springframework:spring-web:jar:2.5.6:compile
[INFO] +- org.hibernate:hibernate:jar:3.2.7.ga:compile
[INFO] | +- net.sf.ehcache:ehcache:jar:1.2.3:compile
[INFO] | +- javax.transaction:jta:jar:1.0.1B:compile
[INFO] | \- asm:asm-attrs:jar:1.5.3:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- cglib:cglib:jar:2.2:compile
[INFO] +- antlr:antlr:jar:2.7.7:compile
[INFO] +- asm:asm:jar:3.3:compile
[INFO] +- javax.xml.soap:saaj-api:jar:1.3.3:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.3.4:compile
[INFO] | \- org.jvnet:mimepull:jar:1.4:compile
[INFO] \- junit:junit:jar:3.8.1:test (scope not updated to compile)
[INFO]
Following are the dependencies of maven web app module
[INFO]
[INFO] Building MavenWebAppModule Maven Webapp 1.0-SNAPSHOT
[INFO]
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) # WebServiceModule ---
[INFO] com.packt.maven:WebServiceModule:war:1.0-SNAPSHOT
[INFO] +- org.springframework:spring:jar:2.5.6:compile
[INFO] +- org.springframework:spring-web:jar:2.5.6:compile
[INFO] | +- org.springframework:spring-beans:jar:2.5.6:compile
[INFO] | +- org.springframework:spring-context:jar:2.5.6:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework:spring-core:jar:2.5.6:compile
[INFO] +- xml-apis:xml-apis:jar:1.0.b2:provided (scope not updated to compile)
[INFO] +- javax:javaee-api:jar:6.0:provided
[INFO] +- junit:junit:jar:3.8.1:test (scope not updated to compile)
[INFO] +- com.oracle:ojdbc6:jar:11.2.0:compile
[INFO] +- org.hibernate:hibernate:jar:3.2.7.ga:compile
[INFO] | +- net.sf.ehcache:ehcache:jar:1.2.3:compile
[INFO] | +- javax.transaction:jta:jar:1.0.1B:compile
[INFO] | \- asm:asm-attrs:jar:1.5.3:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- cglib:cglib:jar:2.2:compile
[INFO] +- antlr:antlr:jar:2.7.7:compile
[INFO] +- com.sun.xml.ws:jaxws-rt:jar:2.2.3:compile
[INFO] | +- javax.xml.ws:jaxws-api:jar:2.2.3:compile
[INFO] | | +- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | \- org.glassfish:javax.annotation:jar:3.1-b35:compile
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.3.8:compile
[INFO] | +- com.sun.xml.stream.buffer:streambuffer:jar:1.2:compile
[INFO] | +- org.codehaus.woodstox:wstx-asl:jar:3.2.1:compile
[INFO] | | \- stax:stax-api:jar:1.0.1:compile
[INFO] | +- org.jvnet.staxex:stax-ex:jar:1.4:compile
[INFO] | | \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | +- com.sun.org.apache.xml.internal:resolver:jar:20050927:compile
[INFO] | +- org.jvnet:mimepull:jar:1.5:compile
[INFO] | +- com.sun.xml.ws:policy:jar:2.2.2:compile
[INFO] | | +- com.sun.xml.txw2:txw2:jar:20090102:compile
[INFO] | | \- com.sun.istack:istack-commons-runtime:jar:2.2.1:compile
[INFO] | +- org.glassfish.gmbal:gmbal-api-only:jar:3.1.0-b001:compile
[INFO] | | \- org.glassfish.external:management-api:jar:3.0.0-b012:compile
[INFO] | \- org.glassfish.ha:ha-api:jar:3.1.8:compile
[INFO] +- asm:asm:jar:3.3:compile
[INFO] \- org.jvnet.jax-ws-commons.spring:jaxws-spring:jar:1.8:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- org.apache.xbean:xbean-spring:jar:2.7:compile
[INFO] +- javax.jws:jsr181-api:jar:1.0-MR1:compile
[INFO] +- javax.xml.soap:saaj-api:jar:1.3:compile
[INFO] +- com.sun.xml.stream:sjsxp:jar:1.0:compile
[INFO] +- javax.annotation:jsr250-api:jar:1.0:compile
[INFO] \- javax.activation:activation:jar:1.1:compile
[INFO]
In my weblogic application configuration i have provided following configuration to load java from my applications first. Could anybody help me on this issue. Thanks in advance for anyhelp
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.0/weblogic-application.xsd http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd">
<!--weblogic-version:10.3.1 -->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
<wls:prefer-application-packages>
<wls:package-name>antlr.*</wls:package-name>
</wls:prefer-application-packages>
</wls:weblogic-application>
Exception.......
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sun.xml.ws.transport.http.servlet.SpringBinding#0' defined in ServletContext resourcepring/config/SpringBeans.xml]: Cannot create inner bean '(inner bean)' of type [org.jvnet.jax_ws_commons.spring.SpringService] while setting bean property 'service'; nested exceramework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation; nested exception is java.lang.Linkageaint violation: when resolving field "DATETIME" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the referring class, javax/xml/datatype/Datahe class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation; nested exceptiogeError: loader constraint violation: when resolving field "DATETIME" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the referring class, jtatypeConstants, and the class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
I already had problems with the esapi, but at the end it worked...
I included the OWASP ESAPI in my pom.xml like this
<!-- ESAPI Version 2.0.1 -->
<dependency>
<groupId>org.owasp.esapi</groupId>
<artifactId>esapi</artifactId>
<version>2.0.1</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
If i run this function:
String clean = ESAPI.encoder().canonicalize("someString");
the ESAPI encoder works perfect...
But if I try to use the HASH function,
ESAPI.encryptor().hash(password, salt);
I got this result
javax.servlet.ServletException: javax.ejb.EJBException: org.owasp.esapi.errors.ConfigurationException: java.lang.ClassNotFoundException: org.owasp.esapi.reference.JavaEncryptor from [Module "deployment.demoapp_demo.war:main" from Service Module Loader] Encryptor class (org.owasp.esapi.reference.JavaEncryptor) must be in class path.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
but as you can see, the ESAPI is i my dependencys but JavaEncryptor can't be found....
joergi#nerdbook:~/dev/demoapp/trunk/demoapp_demo$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Java EE 6 webapp project
[INFO] task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] de.demoapp:demoapp_demo:war:1.0-SNAPSHOT
[INFO] +- javax.enterprise:cdi-api:jar:1.0-SP4:provided
[INFO] | +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Final:provided (version managed from 1.0.0.Beta1)
[INFO] | \- javax.inject:javax.inject:jar:1:provided
[INFO] +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] +- org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:provided
[INFO] +- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.1.Final:provided
[INFO] +- org.hibernate:hibernate-validator:jar:4.2.0.Final:provided
[INFO] | \- javax.validation:validation-api:jar:1.0.0.GA:provided
[INFO] +- org.hibernate:hibernate-jpamodelgen:jar:1.1.1.Final:provided
[INFO] +- junit:junit:jar:4.10:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- org.jboss.arquillian.junit:arquillian-junit-container:jar:1.0.0.CR4:test
[INFO] | +- org.jboss.arquillian.junit:arquillian-junit-core:jar:1.0.0.CR4:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-api:jar:1.0.0.CR4:test
[INFO] | | \- org.jboss.arquillian.core:arquillian-core-api:jar:1.0.0.CR4:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-spi:jar:1.0.0.CR4:test
[INFO] | | +- org.jboss.arquillian.core:arquillian-core-spi:jar:1.0.0.CR4:test
[INFO] | | \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.0.0-beta-5:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.0.0.CR4:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-spi:jar:1.0.0.CR4:test
[INFO] | +- org.jboss.arquillian.core:arquillian-core-impl-base:jar:1.0.0.CR4:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-impl-base:jar:1.0.0.CR4:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-impl-base:jar:1.0.0.CR4:test
[INFO] | | +- org.jboss.arquillian.config:arquillian-config-api:jar:1.0.0.CR4:test
[INFO] | | \- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.0.0.CR4:test
[INFO] | | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:1.1.0-alpha-2:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-impl-base:jar:1.0.0.CR4:test
[INFO] | \- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.0.0-beta-5:test
[INFO] | \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.0.0-beta-5:test
[INFO] +- org.jboss.arquillian.protocol:arquillian-protocol-servlet:jar:1.0.0.CR4:test
[INFO] | \- org.jboss.arquillian.container:arquillian-container-spi:jar:1.0.0.CR4:test
[INFO] | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api:jar:1.1.0-alpha-2:test
[INFO] +- org.owasp.esapi:esapi:jar:2.0.1:compile
[INFO] | +- commons-configuration:commons-configuration:jar:1.5:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.3:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.1:compile
[INFO] | | | +- logkit:logkit:jar:1.0.1:compile
[INFO] | | | +- avalon-framework:avalon-framework:jar:4.1.3:compile
[INFO] | | | \- javax.servlet:servlet-api:jar:2.3:compile
[INFO] | | \- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | +- commons-beanutils:commons-beanutils-core:jar:1.7.0:compile
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.2:compile
[INFO] | +- commons-collections:commons-collections:jar:3.2:compile
[INFO] | +- xom:xom:jar:1.1:compile
[INFO] | | +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] | | +- xerces:xercesImpl:jar:2.6.2:compile
[INFO] | | +- xalan:xalan:jar:2.7.0:compile
[INFO] | | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | | \- jaxen:jaxen:jar:1.1-beta-8:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- jdom:jdom:jar:1.0:compile
[INFO] | +- org.beanshell:bsh-core:jar:2.0b4:compile
[INFO] | \- org.owasp.antisamy:antisamy:jar:1.4.3:compile
[INFO] | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-util:jar:1.7:compile
[INFO] | | \- xml-apis:xml-apis-ext:jar:1.3.04:compile
[INFO] | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.12:compile
[INFO] | \- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | \- commons-codec:commons-codec:jar:1.2:compile
[INFO] +- com.sun.faces:jsf-api:jar:2.1.7:compile
[INFO] \- joda-time:joda-time:jar:1.6:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Wed Mar 14 23:17:07 CET 2012
[INFO] Final Memory: 29M/342M
[INFO] ------------------------------------------------------------------------
The search-results are not really helpful...
Anyone know this problem? (or can help anyway?)
thank you!
Change
org.owasp.esapi.reference.JavaEncryptor
to
org.owasp.esapi.reference.crypto.JavaEncryptor
This is a common mistake, but codepitbull nailed the answer.
The problem is generally caused by using an earlier version of the ESAPI.properties file. At some point (during one of the later 2.0 release candidates IIRC), I reorganized some of the ESAPI crypto classes and created the org.owasp.esapi.reference.crypto package and moved the JavaEncryptor class to it. In a way, that's a good thing, because it makes using the ESAPI 2.0.x crypto to fail in a generally obvious way if one tries to use a ESAPI.properties file from ESAPI 1.4.x. If the class names were still the same between ESAPI 2.0.x and 1.4.x, attempts at encryption / decryption would still fail, but it would fail in a much more subtle manner.