[英]Error During deploying Spring application on Weblogic 12.1.3.0
I am trying to deploy an application consisting of apache CXF
, Spring
and Hibernate
libraries on weblogic
server, the application leverages the JMS
and dataSource from weblogic
server. 我正在尝试在weblogic
服务器上部署一个由apache CXF
, Spring
和Hibernate
库组成的应用程序,该应用程序利用了weblogic
服务器上的JMS
和dataSource。
However when I am trying to deploy the application, the deployment is failing with error : 但是,当我尝试部署应用程序时,部署失败并显示错误:
java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object; java.lang.NoSuchMethodError:org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava / lang / Object;)Ljava / lang / Object;
I have researched this error on google but got nothing relevant to fix this. 我已经在Google上研究了此错误,但没有相关的解决方法。 Please help me to fix this. 请帮助我解决此问题。 Below is my pom.xml
and spring applicationContext.xml
下面是我的pom.xml
和spring applicationContext.xml
<dependencies>
<!-- CXF Dependencies -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf.xjc-utils</groupId>
<artifactId>cxf-xjc-runtime</artifactId>
<version>${cxf.xjc-utils.version}</version>
</dependency>
<!-- Spring Dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Hibernate Dependencies -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.1.Final</version><!-- Use the same version for EHCache -->
</dependency>
<!-- Hibernate annotation -->
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<!-- Hibernate Dependencies Above -->
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.0.GA</version>
</dependency>
<!-- Servlet API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servletapi.version}</version>
</dependency>
<!-- Active MQ, Weblogic JMS Dependencies -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.15.3</version>
</dependency>
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-t3thinclient</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
===================ApplicationContext.xml======================== =================== applicationContext.xml中========================
<context:component-scan base-package="com.wls.deployable.cxf"/>
<jee:jndi-lookup id="devUserDatasource" jndi-name="jdbc/devUserDatasource" expected-type="javax.sql.DataSource"/>
<bean id="stock" class="com.wls.deployable.cxf.stockquote.StockQuotePortTypeImpl" />
<jaxws:endpoint id="stockService" implementor="#stock" address="/StockService" />
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.provider.url">t3://localhost:7001</prop>
</props>
</property>
</bean>
<bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jndiTemplate" />
</property>
<property name="jndiName">
<value>/com/jms/dev/cf</value>
</property>
</bean>
<bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver">
<property name="jndiTemplate">
<ref bean="jndiTemplate" />
</property>
<property name="cache">
<value>true</value>
</property>
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory">
<ref bean="queueConnectionFactory" />
</property>
<property name="destinationResolver">
<ref bean="jmsDestinationResolver" />
</property>
</bean>
Please let me know if anything else is required. 如果需要其他任何条件,请告诉我。
java.lang.NoSuchMethodError主要是由于JAR版本冲突:另一个Spring AOP JAR在您的类路径上。
This error is because your web application is pulling in an older version of spring AOP, you need to pull spring-aop-5.0.5.RELEASE which contains the missing method. 该错误是因为您的Web应用程序正在拉入旧版本的spring AOP,所以您需要拉出包含缺少方法的spring-aop-5.0.5.RELEASE 。
How to get around the issue: 如何解决这个问题:
Spring AOP jar is being pulled into your application dependencies as a transitive dependency. Spring AOP jar被作为传递依赖项引入到您的应用程序依赖项中。 To see which dependency in your POM file is causing to pull spring AOP jar you can see dependency hierarchy for your web application by opening its pom file in eclipse(or other IDE) and then searching for spring-aop , once you have spotted the direct dependency in your application's POM that requires spring AOP, you need to then change its version to latest so that it would then pull correct version of sprint-aop ie the version which contains the missing method org.springframework.aop.framework.AopProxyUtils.getSingletonTarget 要查看POM文件中的哪个依赖关系导致拉出Spring AOP jar,可以通过在eclipse(或其他IDE)中打开其pom文件,然后搜索spring-aop来查看Web应用程序的依赖关系层次结构。依赖于需要Spring AOP的应用程序POM中的依赖项,然后需要将其版本更改为最新版本,以便随后将拉出sprint-aop的正确版本,即包含缺少方法org.springframework.aop.framework.AopProxyUtils.getSingletonTarget的版本
For example there is a dependency in your application's POM say abc which has dependency on spring AOP, you need to change the version of abc to latest to solve the problem. 例如,应用程序的POM中有一个依赖项abc ,它依赖于spring AOP,因此您需要将abc的版本更改为最新版本才能解决该问题。
Any queries/clarifications! 任何疑问/澄清! Please let me know! 请告诉我!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.