处女座服务器抛出java.lang.NoClassDefFoundError:org / json / JSONException部署Java包时出错

时间:2013-09-20 13:42:19

标签: java json spring-tool-suite eclipse-virgo vsphere

创建vSphere Web客户端插件时,我从Java调用REST服务器并使用Jackson Library解析JSON数组

在我添加的Java服务项目build-java.ant文件中

<classpath>
            <!-- remove this if you are not using the SDK on the java side -->
            <pathelement path="${VSPHERE_SDK_HOME}/libs/vsphere-client-lib.jar"/>
            <pathelement path="C:\Users\vignesh\Desktop\plugins\jackson-annotations-2.2.0.jar"/>
            <pathelement path="C:\Users\vignesh\Desktop\plugins\jackson-core-2.2.0.jar"/>
            <pathelement path="C:\Users\vignesh\Desktop\plugins\jackson-databind-2.2.0.jar"/>

我尝试构建包,它正在运行文件..已成功构建

之后我尝试在处女座服务器中部署它 在vsphere web服务器拾取目录中,我添加了三个Jackson文件 我试图重新部署项目,那个时候它正在抛出

[2013-09-20 18:35:43.154] [ERROR] region-dm-3                   <AG0000E> Application context creation failure for bundle 'com.acme.xxx.xxxx' version '1.0.0'. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxx': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxx' defined in URL [bundleentry://274.fwk22736215/META-INF/spring/bundle-context.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/json/JSONException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
    at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
    at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)

我只导入了

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ObjectMapper;

并且只抛出IOException

2 个答案:

答案 0 :(得分:1)

在META-INF中添加导入的外部罐子 - &gt;您资源中的MANIFEST.MF

Import-Package: com.fasterxml.jackson;version="1.4.3"

答案 1 :(得分:1)

检查包裹的VIRGO STS兼容性

Jackson JSON映射器和解析器支持0.9.9.4到1.4.3版本

更多信息请查看http://ebr.springsource.com/repository/app/bundle?query=J