反序列化对象时获取classnotfound异常错误

时间:2012-10-26 18:00:23

标签: java serialization deserialization classnotfoundexception xml-deserialization

我在deSerializing和object时遇到错误。

13:47:00,679 INFO  [stdout] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-1) 2012-10-26 13:47:00,679 () DEBUG com.dipp.testMap - Error while reading the object to HashMap
13:47:00,680 ERROR [stderr] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-1) java.lang.ClassNotFoundException: org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl from [Module "deployment.DIPP.war:main" from Service Module Loader]
13:47:00,682 ERROR [stderr] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-1)     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
13:47:00,682 ERROR [stderr] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-1)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

这是我的代码。

        try{
         transferObject = (HashMap)o.readObject();
            }
         catch(Exception e)
         {
             log.debug("Error while reading the object to HashMap");
             e.printStackTrace();
         }

我有一个名为EPOCHDATE的字段,它位于transferObject中并且具有XMLGregorianCalendar数据类型。有什么想法可以解决这个问题吗?我得到classNotFound异常。我相信,我必须在POM文件中添加依赖项。

提前致谢

Gendaful

1 个答案:

答案 0 :(得分:0)

我遇到了这个问题。我已将下面的依赖项添加到我的POM.xml

<dependency>

的xerces    xercesImpl    2.8.1