2

I am troubling with classloading issue on weblogic 10.3.6 on classnotfound exception regarding org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl. Tried to put <wls:package-name>org.apache.xerces.*</wls:package-name> in weblogic-application.xml. Made sure that xercesImpl-2.10.0.jar is placed at root of ear, but weblogic ignores this fact :( XMLGregorianCalendarImpl is apparently used in XMLStreamReader functionality.

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

How to make weblogic accept the filtering approach? The application has apache cxf and jaxws webservices. Im stuck, plz help :( See whole stacktrace here:

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)
1
  • Can you post the entire weblogic-application.xml section? Commented Jun 9, 2015 at 21:41

1 Answer 1

1

Found a workaround. The application is using xmlbeans and now jaxb. Created a DateAdapter and inherited from XMLAdapter specifying the how date should be marshalled. Then added it to my xjb configuration.

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);
    }

}
Sign up to request clarification or add additional context in comments.

1 Comment

kudos for answering your own question. I'm currently having problems with this myself

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.