Home » Eclipse Projects » Virgo » Problem with Virgo 3.6.4 + Spring 3.1.3 + Jackson 2
Problem with Virgo 3.6.4 + Spring 3.1.3 + Jackson 2 [message #1751093] |
Wed, 04 January 2017 12:33 |
Matteo Cantarelli Messages: 30 Registered: June 2012 |
Member |
|
|
Hello and happy new year!
We have recently had to update some libraries in our application which as a consequence required us to move to Jackson 2.
In order to get Spring 3.1.0 (shipped with Virgo 3.6.4) to work with Jackson 2 following different posts we have added the following configuration to our app-config.xml
<mvc:annotation-driven>
<mvc:message-converters>
<bean
class="org.geppetto.frontend.controllers.MappingJackson2HttpMessageConverter">
<property name="objectMapper">
<bean class="org.geppetto.frontend.controllers.GeppettoObjectMapper" />
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
which specifies a custom converter which in turns uses Jackson 2.
The above worked and we moved on with our lives.
After weeks I have however found a problem. If in the pickup folder we don't have the JARs for the admin console
org.eclipse.virgo.management.console_3.6.4.RELEASE
org.eclipse.virgo.apps.splash_3.6.4.RELEASE.jar
org.eclipse.virgo.apps.repository_3.6.4.RELEASE.par
(which we don't for production deployments) the above configuration stops to work throwing the following exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#8': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:271)
... 40 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
... 44 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.<init>(MappingJackson2HttpMessageConverter.java:55)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
the MANIFEST file looks like this
Manifest-Version: 1.0
Bnd-LastModified: 1483531510490
Build-Jdk: 1.7.0_51
Built-By: matteocantarelli
Bundle-ClassPath: .,WEB-INF/classes
Bundle-ManifestVersion: 2
Bundle-Name: Geppetto Frontend
Bundle-SymbolicName: org.geppetto.frontend
Bundle-Version: 0.3.3
Created-By: Apache Maven Bundle Plugin
Export-Package: org.geppetto.frontend;uses:="org.springframework.context
,org.springframework.context.event";version="0.3.3",org.geppetto.fronte
nd.controllers;uses:="org.geppetto.core.data,org.geppetto.core.data.mod
el,org.apache.commons.logging,org.apache.shiro,org.springframework.bean
s.factory.annotation,org.apache.shiro.subject,org.geppetto.core.utiliti
es,org.springframework.web.bind.annotation,org.geppetto.core.manager,or
g.geppetto.core.common,org.geppetto.core.auth,org.springframework.stere
otype,com.google.gson,org.geppetto.frontend.tests,javax.servlet.http,or
g.osgi.framework,org.geppetto.model.util,org.geppetto.model.datasources
,org.geppetto.core.datasources,org.eclipse.emf.ecore,org.geppetto.core.
services.registry,org.geppetto.frontend,org.geppetto.simulation.manager
,org.geppetto.core.beans,org.geppetto.frontend.messages,com.fasterxml.j
ackson.databind,com.fasterxml.jackson.core.type,org.geppetto.core.simul
ation,org.geppetto.core.model,com.fasterxml.jackson.core,org.geppetto.m
odel,org.apache.catalina.websocket,org.apache.shiro.authc,org.apache.sh
iro.realm,javax.servlet,org.springframework.http.converter,org.springfr
amework.util,org.springframework.http,com.google.gson.reflect,org.eclip
se.emf.common.util,org.springframework.context,org.geppetto.frontend.me
ssaging,org.springframework.web.context.support";version="0.3.3",org.ge
ppetto.frontend.dashboard.service;uses:="org.geppetto.core.data,org.gep
petto.core.data.model,org.springframework.beans.factory.annotation,org.
springframework.core.io,org.geppetto.core.utilities,org.springframework
.web.bind.annotation,org.geppetto.core.manager,org.geppetto.core.common
,org.geppetto.core.beans,org.springframework.stereotype,org.geppetto.si
mulation.visitor,org.geppetto.model.util,org.geppetto.core.model,org.ec
lipse.emf.ecore.util,org.eclipse.emf.ecore,org.geppetto.model,org.apach
e.commons.logging,org.apache.shiro,org.apache.shiro.subject";version="0
.3.3",org.geppetto.frontend.messages;uses:="org.geppetto.frontend,com.g
oogle.gson";version="0.3.3",org.geppetto.frontend.messaging;uses:="org.
apache.commons.logging,org.geppetto.frontend.messages,org.apache.catali
na.websocket,com.google.gson";version="0.3.3",org.geppetto.frontend.tes
ts;uses:="com.google.gson.annotations";version="0.3.3"
Import-Bundle: org.springframework.aop;version="3.1.3.RELEASE"
Import-Library: org.springframework.spring;version="3.1.3.RELEASE"
Import-Package: com.fasterxml.jackson.core;version="[2.8,3)",com.fasterx
ml.jackson.core.type;version="[2.8,3)",com.fasterxml.jackson.databind;v
ersion="[2.8,3)",com.google.gson;version="[2.2,3)",com.google.gson.anno
tations;version="[2.2,3)",com.google.gson.reflect;version="[2.2,3)",jav
ax.servlet;version="[2.4,3)",javax.servlet.http;version="[2.4,3)",net.s
f.cglib.beans;version="[2.2,3)",net.sf.cglib.core;version="[2.2,3)",net
.sf.cglib.proxy;version="[2.2,3)",net.sf.cglib.reflect;version="[2.2,3)
",net.sf.cglib.transform;version="[2.2,3)",net.sf.cglib.util;version="[
2.2,3)",org.apache.catalina.websocket,org.apache.commons.logging;versio
n="[1.1,2)",org.apache.shiro;version="[1.2,2)",org.apache.shiro.authc;v
ersion="[1.2,2)",org.apache.shiro.realm;version="[1.2,2)",org.apache.sh
iro.subject;version="[1.2,2)",org.apache.shiro.web.env;version="[1.2,2)
",org.apache.shiro.web.servlet;version="[1.2,2)",org.eclipse.emf.common
.util,org.eclipse.emf.ecore,org.eclipse.emf.ecore.util,org.eclipse.virg
o.web.dm;version="2.1.1.RELEASE",org.geppetto.core.auth;version="[0.3,1
)",org.geppetto.core.beans;version="[0.3,1)",org.geppetto.core.common;v
ersion="[0.3,1)",org.geppetto.core.data;version="[0.3,1)",org.geppetto.
core.data.model;version="[0.3,1)",org.geppetto.core.datasources;version
="[0.3,1)",org.geppetto.core.manager;version="[0.3,1)",org.geppetto.cor
e.model;version="[0.3,1)",org.geppetto.core.s3;version="[0.3,1)",org.ge
ppetto.core.services.registry;version="[0.3,1)",org.geppetto.core.simul
ation;version="[0.3,1)",org.geppetto.core.utilities;version="[0.3,1)",o
rg.geppetto.model;version="[0.3,1)",org.geppetto.model.datasources;vers
ion="[0.3,1)",org.geppetto.model.util;version="[0.3,1)",org.geppetto.si
mulation;version="[0.3,1)",org.geppetto.simulation.manager;version="[0.
3,1)",org.geppetto.simulation.visitor;version="[0.3,1)",org.osgi.framew
ork;version="[1.7,2)",org.springframework.beans.factory.annotation;vers
ion="[3.1,4)",org.springframework.context;version="[3.1,4)",org.springf
ramework.context.event;version="[3.1,4)",org.springframework.core.io;ve
rsion="[3.1,4)",org.springframework.http;version="[3.1,4)",org.springfr
amework.http.converter;version="[3.1,4)",org.springframework.stereotype
;version="[3.1,4)",org.springframework.util;version="[3.1,4)",org.sprin
gframework.web.bind.annotation;version="[3.1,4)",org.springframework.we
b.context.support;version="[3.1,4)"
Tool: Bnd-1.50.0
Web-ContextPath: org.geppetto.frontend
It seems to me a problem maybe related to the order bundle gets loaded in, having the virgo console in the pickup folder somehow seems to ensure the correct order. Reading some of the posts on here related to similar situations I tried to copy the jackson JARs in the repository/ext folder but it didn't help.
I know newer versions of Spring will take care of this since they use Jackson 2 but that's too much of a transition right now and I'd like to find a way to get this to work.
Does anyone have suggestions? Thanks a lot in advance.
Best,
Matteo
[Updated on: Wed, 04 January 2017 12:34] Report message to a moderator
|
|
| | | | | | |
Goto Forum:
Current Time: Fri Nov 08 18:02:52 GMT 2024
Powered by FUDForum. Page generated in 0.03290 seconds
|