2

Deploying Weblogic 12 using Spring Boot 2.0.1, Jersey

Below is the log contents.

  • Weblogic Deploy Detail Log.

[Error] [HTTP] [BEA-101216] [Servlet]: "com.precursor.config.JerseyConfig" failed to preload on startup in Web application: "oasSvr2.war". java.lang.AbstractMethodError at org.glassfish.jersey.server.ApplicationHandler$4.get(ApplicationHandler.java:408) at org.glassfish.jersey.server.ApplicationHandler$4.get(ApplicationHandler.java:399) at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:340) at org.glassfish.jersey.server.ApplicationHandler.createApplication(ApplicationHandler.java:366) at org.glassfish.jersey.server.ApplicationHandler.(ApplicationHandler.java:342)

Truncated. see log file for complete stacktrace

Do you know why I get this error?

Somebody help me, please.

Below is the source code.

Here is pom.xml

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.1.RELEASE</version>
        <relativePath/>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <org.slf4j-version>1.7.25</org.slf4j-version>
        <logback.version>1.2.3</logback.version>
        <cxf.version>3.2.4</cxf.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jersey</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- guava -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>24.1-jre</version>
        </dependency>

        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-jersey2-jaxrs</artifactId>
            <version>1.5.0</version>
        </dependency>

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc8</artifactId>
            <version>12.2.0.1</version>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>   

        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>1.1-groovy-2.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>oasSvr2</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Here is Application.java

@ComponentScan
@SpringBootApplication
public class PilotJerseyCxfApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
    public static void main(String[] args) {
        SpringApplication.run(PilotJerseyCxfApplication.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(PilotJerseyCxfApplication.class);
    }
}

Here is Interface.java

@Path("/bank")
public interface ICustomerService {
    @GET
    @Path("/list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response getCustomerList();
}

Here is JerseyConfig.java

@Configuration
@ApplicationPath("/")
public class JerseyConfig extends ResourceConfig {
    public JerseyConfig(){
        register(WadlResource.class);
        register(CustomerService.class);
    }
}

Here is weblogic.xml

    <wls:container-descriptor>
        <wls:prefer-application-packages>
            <wls:package-name>org.slf4j.*</wls:package-name>
            <wls:package-name>org.springframework.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.*</wls:package-name>
        </wls:prefer-application-packages>
    </wls:container-descriptor>
SangHo Lee
  • 21
  • 5

1 Answers1

0

i had exactly the same issue. Try to exclude jersey from weblogic

how to disable Jersey from weblogic 12.2.1

It worked for me