ClassNotFound exception using Jackson ObjectMapper

I have a Spring 3 MVC application for which I configure some ajax actions. My controller action looks like this:

@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 send Plan data from my browser, the application throws 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 joda-date types. Although it contains a collection of objects that do. I initially took the jod-date jar through my DOA banner, but the error persists even if I add a direct dependency on my pom.xml web project. I am using joda classes elsewhere in this project without any problems.

Additional Information The following are the respective dependencies on my pom.xml website:

 <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> 
+4
source share
2 answers

I somehow stumbled upon this question: Apache FTP server does not see the banner bank file that exists in the class path

Their solution to installing <class-loader delegate="false"> in glassfish-web.xml seems to fix my problems.

+1
source

I reported this to Glassfish JIRA https://java.net/jira/browse/GLASSFISH-20808

0
source

Source: https://habr.com/ru/post/1393160/


All Articles