0

I want to deploy a Spring Boot .war application to a Weblogic 12c server. I have created the initializer as desrcibed in the documentation and have also added a weblogic.xml with the following structure:

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd"> 12.1.3

<wls:container-descriptor>
    <wls:prefer-application-packages>

        <wls:package-name>org.slf4j.*</wls:package-name>
        <wls:package-name>org.joda.*</wls:package-name>
        <wls:package-name>com.fasterxml.*</wls:package-name>
        <wls:package-name>org.apache.commons.*</wls:package-name>
        <wls:package-name>org.apache.xmlbeans.*</wls:package-name>

    </wls:prefer-application-packages>

    <wls:prefer-application-resources>
        <wls:resource-name>org.slf4j.*</wls:resource-name>
        <wls:resource-name>javax.persistence.*</wls:resource-name>
        <wls:resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</wls:resource-name>
        <wls:resource-name>com.fasterxml.*</wls:resource-name>

    </wls:prefer-application-resources>
</wls:container-descriptor>


<wls:context-root>myapp</wls:context-root>

I have also included the following dependencies in my pom.xml:

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-java8</artifactId>
    </dependency>

    <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-jsr310</artifactId>
    </dependency>

This type of configuration serializes dates normally on a Tomcat server. However it seems that the weblogic server does not include the JSR-310 library. Actually when I do this in a @Configuration file:

@Bean
public JavaTimeModule javaTimeModule() {
    return new JavaTimeModule();
}

I get the following exception:

weblogic.application.ModuleException: java.lang.ClassNotFoundException: com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:216)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:211)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
Truncated. see log file for complete stacktrace

So I said ok, lets just try with Joda Time. But even though as you can see I have declared it in my weblogic.xml, it cant even find the DateTime class.

So any idea what's wrong here?

ChrisGeo
  • 3,807
  • 13
  • 54
  • 92
  • You don't need Joda Time; you need Jackson JSON library, according to the error. If you use JDK 8 you shouldn't need Joda. – duffymo Oct 26 '16 at 09:58
  • I'm using Spring-Boot so the Jackson JSON library is already included. I have also added com.fasterxml.* preference in the weblogic.xml. So normally weblogic should prefer the .war libary rather than the default in it's classpath. I only used Joda as an alternative to see if it works, but there's the same problem. – ChrisGeo Oct 26 '16 at 10:00

0 Answers0