gpt4 book ai didi

java.lang.NoClassDefFoundError : org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl weblogic 10. 3.6

转载 作者:行者123 更新时间:2023-11-30 11:03:19 31 4
gpt4 key购买 nike

关于 org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl 的 classnotfound 异常,我在 weblogic 10.3.6 上遇到类加载问题.试图把 <wls:package-name>org.apache.xerces.*</wls:package-name>weblogic-application.xml .确保 xercesImpl-2.10.0.jar被放置在耳朵的根部,但 weblogic 忽略了这个事实:( XMLGregorianCalendarImpl显然用于 XMLStreamReader功能。

    final JAXBContext context = JAXBContext.newInstance(typeClass);
final Unmarshaller unmarshaller = context.createUnmarshaller();
final XMLStreamReader xmlr = XMLInputFactory.newInstance().createXMLStreamReader(reader);

如何让weblogic接受过滤方式?该应用程序具有 apache cxf 和 jaxws web 服务。我卡住了,请帮助:(在此处查看整个堆栈跟踪:

java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl
at org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.newXMLGregorianCalendar(Unknown Source)
at com.sun.xml.bind.DatatypeConverterImpl._parseDateTime(DatatypeConverterImpl.java:408)
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$4.parse(RuntimeBuiltinLeafInfoImpl.java:288)
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$4.parse(RuntimeBuiltinLeafInfoImpl.java:290)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:247)
at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:65)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:515)
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:339)
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:217)
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:186)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:368)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:347)
at dk.skat.efi.wls.bebb.common.util.LargeXmlFileProcessorHandler.process(LargeXmlFileProcessorHandler.java:83)
at dk.skat.efi.wls.bebb.common.util.LargeXmlFileProcessorHandler.validate(LargeXmlFileProcessorHandler.java:38)
at dk.skat.efi.wls.bebb.bum.processor.BumFTPFileProcessor.downloadFileAndSave(BumFTPFileProcessor.java:102)
at dk.skat.efi.wls.bebb.bum.processor.BumFTPFileProcessor.process(BumFTPFileProcessor.java:91)
at dk.skat.efi.wls.bebb.bum.processor.BumFTPFileProcessor.process(BumFTPFileProcessor.java:35)
at dk.skat.efi.wls.bebb.common.integration.FTPClientManager.handleFiles(FTPClientManager.java:142)
at dk.skat.efi.wls.bebb.bum.job.BumHentFraUdbetalingDkWorkerExecutorImpl.doWork(BumHentFraUdbetalingDkWorkerExecutorImpl.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy1828.doWork(Unknown Source)
at dk.skat.efi.wls.bebb.scheduler.BumHentFraUdbetalingDkTaskImpl.execute(BumHentFraUdbetalingDkTaskImpl.java:35)
at dk.skat.efi.common.scheduling.AbstractScheduledTask.execute(AbstractScheduledTask.java:320)
at dk.skat.efi.common.scheduling.AbstractScheduledTask$PrivilegedTaskAction$1.doInTransactionWithoutResult(AbstractScheduledTask.java:253)
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at dk.skat.efi.common.scheduling.AbstractScheduledTask$PrivilegedTaskAction.run(AbstractScheduledTask.java:251)
at dk.skat.efi.common.scheduling.AbstractScheduledTask$PrivilegedTaskAction.run(AbstractScheduledTask.java:235)

最佳答案

找到解决方法。该应用程序使用 xmlbeans,现在使用 jaxb。创建了一个 DateAdapter 并继承自 XMLAdapter,指定了日期的编码方式。然后将其添加到我的 xjb 配置中。

public class XmlToDateAdapter extends XmlAdapter<String, Date> {
public static final DateFormat SKAT_DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd");

@Override
public Date unmarshal(String v) throws Exception {
Date date = SKAT_DATE_FORMATTER.parse(v);
return date;
}

@Override
public String marshal(Date v) throws Exception {
return SKAT_DATE_FORMATTER.format(v);
}

}

关于java.lang.NoClassDefFoundError : org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl weblogic 10. 3.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30438648/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com