我试图在Weblogic 12c上部署Spring启动Web应用程序(WAR)。该应用程序使用Apache CXF和Camel发布SOAP Web服务。
但是,当我尝试部署WAR时,我收到以下异常
java.lang.NoClassDefFoundError: javax/cache/configuration/Configuration
我尝试将以下内容添加到weblogic.xml
但没有效果
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.0/weblogic-application.xsd"> <wls:prefer-application-packages>
<wls:package-name>javax.persistence.*</wls:package-name>
<wls:package-name>com.ctc.wstx.*</wls:package-name>
<wls:package-name>org.apache.commons.lang.*</wls:package-name>
</wls:prefer-application-packages>
</wls:weblogic-application>
添加依赖项
之后<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.0.0</version>
</dependency>
我收到了另一个错误
javax.cache.CacheException: No CachingProviders have been configured
我认为根本不需要这种依赖,但Weblogic试图接管应用程序库(但如果是这种情况,我仍然想知道为什么Weblogic没有提供这种依赖)。在检查POM依赖关系层次结构时,至少我找不到对此特定依赖项的任何引用。
以下是该项目的其他依赖项。它使用的是Spring boot starter parent。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tutoivon</groupId>
<artifactId>Messaging</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Messaging Maven Webapp</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
</parent>
<modules>
<module>ApiComponent</module>
<module>ServiceAComponent</module>
<module>ServiceBComponent</module>
<module>Broker</module>
<module>BrokerB</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<finalName>Messaging-parent</finalName>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.2.1</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
<version>9.4.6.v20170531</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version>9.4.6.v20170531</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
<version>9.4.6.v20170531</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
<version>9.4.6.v20170531</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.6.v20170531</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>9.4.6.v20170531</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.20.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.20.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
<version>2.20.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf-transport</artifactId>
<version>2.20.1</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
</dependency>
</dependencies>
</project>
最后,这是特定WAR的依赖树(请注意,Cache API只是因为我之前解释过它而添加了它)
[INFO] tutoivon:ApiComponent:war:1.0-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.8.RELEASE:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:provided
[INFO] | | \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:provided
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:provided
[INFO] +- javax.cache:cache-api:jar:1.0.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.8.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.5.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.12.RELEASE:compile
[INFO] | | \- org.springframework:spring-aop:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.12.RELEASE:compile
[INFO] +- org.apache.cxf:cxf-core:jar:3.2.1:compile
[INFO] | +- com.fasterxml.woodstox:woodstox-core:jar:5.0.3:compile
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] | \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.2:compile
[INFO] +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.2.1:compile
[INFO] | +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] | +- org.ow2.asm:asm:jar:5.2:compile
[INFO] | +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.2.1:compile
[INFO] | | +- org.apache.cxf:cxf-rt-wsdl:jar:3.2.1:compile
[INFO] | | | \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] | | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.2.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.2.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.2.1:compile
[INFO] | \- org.apache.cxf:cxf-rt-ws-addr:jar:3.2.1:compile
[INFO] | \- org.apache.cxf:cxf-rt-ws-policy:jar:3.2.1:compile
[INFO] | \- org.apache.neethi:neethi:jar:3.1.0:compile
[INFO] +- org.apache.cxf:cxf-rt-transports-http:jar:3.2.1:compile
[INFO] +- org.apache.cxf:cxf-rt-transports-http-jetty:jar:3.2.1:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.eclipse.jetty:jetty-continuation:jar:9.4.6.v20170531:compile
[INFO] +- org.eclipse.jetty:jetty-http:jar:9.4.6.v20170531:compile
[INFO] +- org.eclipse.jetty:jetty-io:jar:9.4.6.v20170531:compile
[INFO] +- org.eclipse.jetty:jetty-security:jar:9.4.6.v20170531:compile
[INFO] +- org.eclipse.jetty:jetty-server:jar:9.4.6.v20170531:compile
[INFO] | \- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] +- org.eclipse.jetty:jetty-util:jar:9.4.6.v20170531:compile
[INFO] +- org.apache.camel:camel-core:jar:2.20.1:compile
[INFO] | +- com.sun.xml.bind:jaxb-core:jar:2.2.11:compile
[INFO] | \- com.sun.xml.bind:jaxb-impl:jar:2.2.11:compile
[INFO] +- org.apache.camel:camel-cxf:jar:2.20.1:compile
[INFO] | +- org.apache.camel:camel-spring:jar:2.20.1:compile
[INFO] | | \- org.springframework:spring-tx:jar:4.3.12.RELEASE:compile
[INFO] | +- org.apache.camel:camel-http-common:jar:2.20.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.2.1:compile
[INFO] | | +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
[INFO] | | \- javax.annotation:javax.annotation-api:jar:1.3:compile
[INFO] | +- org.apache.cxf:cxf-rt-rs-client:jar:3.2.1:compile
[INFO] | +- org.springframework:spring-core:jar:4.3.12.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:4.3.12.RELEASE:compile
[INFO] +- org.apache.camel:camel-jaxb:jar:2.20.1:compile
[INFO] +- org.apache.camel:camel-cxf-transport:jar:2.20.1:compile
[INFO] +- org.apache.activemq:activemq-camel:jar:5.14.5:compile
[INFO] | +- org.apache.camel:camel-jms:jar:2.16.3:compile
[INFO] | | \- org.springframework:spring-jms:jar:4.3.12.RELEASE:compile
[INFO] | | \- org.springframework:spring-messaging:jar:4.3.12.RELEASE:compile
[INFO] | \- org.apache.activemq:activemq-pool:jar:5.14.5:compile
[INFO] | \- org.apache.activemq:activemq-jms-pool:jar:5.14.5:compile
[INFO] +- org.apache.activemq:activemq-spring:jar:5.14.5:compile
[INFO] | +- org.apache.xbean:xbean-spring:jar:4.2:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:compile
[INFO] | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] +- org.apache.activemq:activemq-broker:jar:5.14.5:compile
[INFO] | +- org.apache.activemq:activemq-client:jar:5.14.5:compile
[INFO] | | +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO] | | \- org.fusesource.hawtbuf:hawtbuf:jar:1.11:compile
[INFO] | \- org.apache.activemq:activemq-openwire-legacy:jar:5.14.5:compile
[INFO] \- org.apache.activemq:activemq-kahadb-store:jar:5.14.5:compile
[INFO] +- org.apache.activemq.protobuf:activemq-protobuf:jar:1.1:compile
[INFO] +- org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile
[INFO] \- commons-net:commons-net:jar:3.5:compile
问题:
答案 0 :(得分:0)
javax.cache
只是参考实现。
您实际上需要导入像hazelcast
这样的jcache库,并且还提供缓存提供程序配置。
答案 1 :(得分:0)
在camelContext xml中将streamCache设置为false。
<!-- Camel Context Router Definitions -->
<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" streamCache="false">