Quantcast
Viewing all articles
Browse latest Browse all 2218

Using Jackson library to parse JSON array in STS

While creating a vSphere web client plugin am calling a REST server from Java and parse the JSON Array using the Jackson Library


In the Java Service project build-java.ant file i added


 

<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"/>

 

 

I tried to build the package and it is working file .. builded successfully

After that i tried to deploy that in virgo server In the vsphere web server pickup directory i added three jar files of Jackson i tried to redeploy the project , that time it is throwing

 

[2013-09-2018: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)

 

and added

Import-Package: com.fasterxml.jackson.annotation;version="2.2.0",
 com.fasterxml.jackson.core.json;version="2.2.0",
 com.fasterxml.jackson.databind;version="2.2.0",
 javax.net.ssl,
 org.apache.commons.logging

 

in MANIFEST.MF


Viewing all articles
Browse latest Browse all 2218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>