在Weblogic 12.1.3.0上部署Spring应用程序时出错

时间:2018-05-03 04:12:13

标签: java spring hibernate maven weblogic

我正在尝试在<template> <md-field> <label>Username</label> <md-input v-model="username"></md-input> </md-field> <md-field> <label>Password</label> <md-input v-model="password"></md-input> </md-field> </template> 服务器上部署由apache CXFSpringHibernate库组成的应用程序,该应用程序利用weblogic和来自的JMS和dataSource weblogic服务器。

但是,当我尝试部署应用程序时,部署失败并显示错误:

  

java.lang.NoSuchMethodError:   org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava /郎/对象;)Ljava /郎/对象;

我在谷歌上研究过这个错误,但没有解决这个问题。请帮我解决这个问题。以下是我的pom.xmlapplicationContext.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 ======================== < / p>

<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>

如果需要其他任何内容,请告诉我。

2 个答案:

答案 0 :(得分:1)

java.lang.NoSuchMethodError主要是由于JAR版本冲突:另一个Spring AOP JAR在你之前的类路径上。

答案 1 :(得分:0)

此错误是因为您的Web应用程序正在使用旧版本 spring AOP,你需要拉 spring-aop-5.0.5.RELEASE ,其中包含缺少的方法。

如何解决问题:

Spring AOP jar作为传递依赖被引入您的应用程序依赖项。 要查看POM文件中的哪个依赖项导致弹簧AOP jar,您可以通过在eclipse(或其他IDE)中打开其pom文件然后搜索spring-aop来查看Web应用程序的依赖关系层次结构在你的应用程序需要弹簧AOP的POM中依赖,然后你需要将它的版本更改为最新版本,这样它就会拉出正确版本的sprint-aop,即包含缺失方法 org.springframework.aop.framework的版本。 AopProxyUtils.getSingletonTarget

例如,您的应用程序的POM中存在依赖于spring AOP的 abc 的依赖关系,您需要将 abc 的版本更改为最新版以解决问题

任何疑问/澄清!请告诉我!