vadbch / orika

Automatically exported from code.google.com/p/orika
0 stars 0 forks source link

Declaring two ConfigurableDocumentMapper #153

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there,

I have an application that has define two ConfigurableDocumentMapper, when I 
try on my local using Jetty everything is ok and when the server is starting, 
Spring framework initialize my two mappers, and enter in the configureMapper 
method of both. But when I deploy my application into Tomcat, the first mapper 
it´s initialize, but when have to go to the second one, never enter in the 
configureMapper method and throw an exception.

15:49:05.040 [pool-2-thread-1] -- ERROR o.s.w.c.ContextLoader - Context 
initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'selectionReportMapper' defined in class path resource 
[spring/mapper-config.xml]: Instantiation of bean failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Could not instantiate 
bean class [com.greenvalley.etendering.document.mapper.SelectionReportMapper]: 
Constructor threw exception; nested exception is 
java.lang.IllegalArgumentException: utility implementation specified for 
ma.glasnost.orika.compilerStrategy was invalid
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1037) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:983) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779) [tomcat-catalina-7.0.26.jar:7.0.26]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273) [tomcat-catalina-7.0.26.jar:7.0.26]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-catalina-7.0.26.jar:7.0.26]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895) [tomcat-catalina-7.0.26.jar:7.0.26]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871) [tomcat-catalina-7.0.26.jar:7.0.26]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) [tomcat-catalina-7.0.26.jar:7.0.26]
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958) [tomcat-catalina-7.0.26.jar:7.0.26]
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599) [tomcat-catalina-7.0.26.jar:7.0.26]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [na:1.7.0_40]
Caused by: org.springframework.beans.BeanInstantiationException: Could not 
instantiate bean class 
[com.greenvalley.etendering.document.mapper.SelectionReportMapper]: Constructor 
threw exception; nested exception is java.lang.IllegalArgumentException: 
utility implementation specified for ma.glasnost.orika.compilerStrategy was 
invalid
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    ... 26 common frames omitted
Caused by: java.lang.IllegalArgumentException: utility implementation specified 
for ma.glasnost.orika.compilerStrategy was invalid
    at ma.glasnost.orika.impl.UtilityResolver.resolveUtility(UtilityResolver.java:126) ~[orika-core-1.4.4.jar:na]
    at ma.glasnost.orika.impl.UtilityResolver.getDefaultCompilerStrategy(UtilityResolver.java:51) ~[orika-core-1.4.4.jar:na]
    at ma.glasnost.orika.impl.DefaultMapperFactory$MapperFactoryBuilder.<init>(DefaultMapperFactory.java:279) ~[orika-core-1.4.4.jar:na]
    at ma.glasnost.orika.impl.DefaultMapperFactory$Builder.<init>(DefaultMapperFactory.java:489) ~[orika-core-1.4.4.jar:na]
    at ma.glasnost.orika.impl.ConfigurableMapper.init(ConfigurableMapper.java:102) ~[orika-core-1.4.4.jar:na]
    at ma.glasnost.orika.impl.ConfigurableMapper.<init>(ConfigurableMapper.java:91) ~[orika-core-1.4.4.jar:na]
    at com.greenvalley.etendering.document.mapper.ConfigurableDocumentMapper.<init>(ConfigurableDocumentMapper.java:17) ~[ConfigurableDocumentMapper.class:na]
    at com.greenvalley.etendering.document.mapper.SelectionReportMapper.<init>(SelectionReportMapper.java:25) ~[SelectionReportMapper.class:na]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_40]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_40]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_40]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_40]
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    ... 28 common frames omitted
Caused by: java.lang.IllegalStateException: 
ma.glasnost.orika.impl.generator.EclipseJdtCompiler or one of it's runtime 
dependencies was not available; is the 'orika-eclipse-tools' module included in 
your classpath?
    at ma.glasnost.orika.impl.generator.EclipseJdtCompilerStrategy.<init>(EclipseJdtCompilerStrategy.java:64) ~[orika-core-1.4.4.jar:na]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_40]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_40]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_40]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_40]
    at java.lang.Class.newInstance(Class.java:374) ~[na:1.7.0_40]
    at ma.glasnost.orika.impl.UtilityResolver.resolveUtility(UtilityResolver.java:123) ~[orika-core-1.4.4.jar:na]
    ... 40 common frames omitted

I´m using the version 1.4.4 any suggestion idea about what´s going on?

Regards.

Original issue reported on code.google.com by pablo.pe...@greenvalleybelgium.be on 28 Mar 2014 at 3:56