Java – use the classnotfound exception of Jackson objectmapper

I have a spring 3 MVC application and I'm setting up some Ajax actions

@RequestMapping(value="add",method=RequestMethod.POST)
@Secured("ROLE_USER")
@ResponseStatus(HttpStatus.CREATED)
public @ResponseBody Plan addPlan(@RequestBody Plan plan,Principal principal) {
     //Save the plan
}

When I publish plan data from the browser, the application will throw a classnotfound exception:

java.lang.ClassNotFoundException: org.joda.time.ReadableInstant not found by jackson-mapper-asl [176]
at org.apache.Felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
at org.apache.Felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
at org.apache.Felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

The plan object itself does not contain any joda date type Although it contains a set of objects Initially, I pulled joda date jar through my DOA jar, but even though I was in POM. Com of my web project A direct dependency has been added to the XML, and the error still exists I have no problem using joda classes elsewhere in this project

Additional information the following is my web POM Related dependencies in XML:

<dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>2.0</version>
</dependency>
<dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.9.3</version>
</dependency>
<dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.3</version>
</dependency>

Solution

I somehow encountered this problem: Apache FTP server is not seeing a logging jar package that exists in the class path

They set the < class loader delegate = "false" solution > in GlassFish web XML seems to fix my problem

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>