从Oracle 10g迁移到Weblogic时的IllegalAnnotationException(10.3.6)

时间:2015-07-08 00:28:53

标签: java oracle maven

我们正在将一个Web应用程序从Oracle 10g OC4J迁移到Weblogic 10.3.6,我们仍然遇到以下IllegalAnnotationException:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
..........
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions
Class has two properties of the same name "arg0"
this problem is related to the following location:
    at public java.lang.String com.xyz.service.jaxws_asm.GetUserByUsername.getArg0()
    at com.xyz.service.jaxws_asm.GetUserByUsername
this problem is related to the following location:
    at private java.lang.String com.xyz.service.jaxws_asm.GetUserByUsername.arg0
    at com.xyz.service.jaxws_asm.GetUserByUsername
Class has two properties of the same name "arg0".....

UserService类:

import com.xyz.model.AppUser;
import javax.jws.WebService;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import java.util.List;

/**
* Web Service interface so hierarchy of Generic Manager isn't carried   through.
*/
@WebService
@Path("/")
@Produces({"application/json", "application/xml"})

public interface UserService {

@GET
@Path("/user/{id}")
AppUser getUser(@PathParam("id") String userId);

AppUser getUserByUsername(@PathParam("username") String username);

@GET
@Path("/users")
List<AppUser> getUsers();

@POST
@Path("/user")
AppUser saveUser(AppUser user) throws UserExistsException;

@DELETE
@Path("/user")
void removeUser(String userId);
}

看看与此类似的其他问题,我们想知道它是否与javax.xml.bind有关,但到目前为止我们还没有找到正确的解决方案。以防万一,这是pom的相关依赖:

<dependency>
  <groupId>javax.xml.bind</groupId>
  <artifactId>jaxb-api</artifactId>
  <version>2.2</version>
  <scope>compile</scope>
  <exclusions>
    <exclusion>
      <artifactId>stax-api</artifactId>
      <groupId>stax</groupId>
    </exclusion>
  </exclusions>
</dependency>

在我们仍然在研究问题时发布依赖关系树。依赖项,Java 6和Weblogic 10.3.5可能存在问题吗?

[INFO] [dependency:tree {execution: default-cli}]
[INFO] com.xyz:proj_1:war:1.0
[INFO] +- com.oracle:oracle:jar:11.2.0.3.0:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- commons-dbcp:commons-dbcp:jar:1.3:compile
[INFO] |  \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- commons-el:commons-el:jar:1.0:compile
[INFO] +- displaytag:displaytag:jar:1.2:compile
[INFO] |  \- com.lowagie:itext:jar:1.3:compile
[INFO] +- javax.mail:mail:jar:1.4.1:compile
[INFO] |  \- javax.activation:activation:jar:1.1:compile
[INFO] +- javax.servlet:servlet-api:jar:2.4:provided
[INFO] +- javax.servlet:jstl:jar:1.1.2:compile
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.0:provided
[INFO] +- javax.xml.bind:jaxb-api:jar:2.2.12:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- net.sf.ehcache:ehcache-core:jar:2.3.1:compile
[INFO] +- net.sf.ehcache:ehcache-web:jar:2.0.3:compile
[INFO] +- opensymphony:sitemesh:jar:2.4.2:compile
[INFO] +- org.apache.commons:commons-io:jar:1.3.2:compile
[INFO] +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:2.3.3:compile
[INFO] |  +- org.apache.cxf:cxf-api:jar:2.3.3:compile
[INFO] |  |  +- org.apache.neethi:neethi:jar:2.0.4:compile
[INFO] |  |  |  \- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] |  |  \- org.apache.cxf:cxf-common-schemas:jar:2.3.3:compile
[INFO] |  +- org.apache.cxf:cxf-rt-core:jar:2.3.3:compile
[INFO] |  |  +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
[INFO] |  |  \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
[INFO] |  +- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] |  +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.3.3:compile
[INFO] |  \- org.codehaus.jettison:jettison:jar:1.2:compile
[INFO] +- org.apache.cxf:cxf-common-utilities:jar:2.3.3:compile
[INFO] |  \- org.apache.ws.commons.schema:XmlSchema:jar:1.4.7:compile
[INFO] +- org.apache.cxf:cxf-rt-transports-http:jar:2.3.3:compile
[INFO] |  \- org.apache.cxf:cxf-rt-transports-common:jar:2.3.3:compile
[INFO] +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.3.3:compile
[INFO] |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  +- asm:asm:jar:3.3:compile
[INFO] |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.3.3:compile
[INFO] |  |  +- org.apache.cxf:cxf-tools-common:jar:2.3.3:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.3.3:compile
[INFO] |  +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.3.3:compile
[INFO] |  \- org.apache.cxf:cxf-rt-ws-addr:jar:2.3.3:compile
[INFO] +- org.apache.ibatis:ibatis-sqlmap:jar:2.3.4.726:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.6.10:compile
[INFO] +- org.aspectj:aspectjrt:jar:1.6.10:compile
[INFO] +- org.codehaus.jackson:jackson-jaxrs:jar:1.7.1:compile
[INFO] |  +- org.codehaus.jackson:jackson-core-asl:jar:1.7.1:compile
[INFO] |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.7.1:compile
[INFO] +- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.1:compile
[INFO] |  +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  \- org.codehaus.woodstox:stax2-api:jar:3.1.1:compile
[INFO] +- org.hibernate.java-persistence:jpa-api:jar:2.0-cr-1:compile
[INFO] +- org.jmock:jmock:jar:2.5.1:compile
[INFO] |  +- org.hamcrest:hamcrest-core:jar:1.1:compile
[INFO] |  \- org.hamcrest:hamcrest-library:jar:1.1:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
[INFO] |  \- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile
[INFO] |  \- org.springframework:spring-tx:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-aspects:jar:3.0.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
[INFO] |  \- org.springframework:spring-test:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
[INFO] |  \- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-core:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.0.5.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-web:jar:3.0.5.RELEASE:compile
[INFO] |  \- org.springframework.security:spring-security-acl:jar:3.0.5.RELEASE:compile
[INFO] +- org.springmodules:spring-modules-validation:jar:0.8:compile
[INFO] |  +- commons-validator:commons-validator:jar:1.3.0:compile
[INFO] |  |  \- oro:oro:jar:2.0.8:compile
[INFO] |  +- commons-digester:commons-digester:jar:1.7:compile
[INFO] |  +- antlr:antlr:jar:2.7.6:compile
[INFO] |  \- rhino:js:jar:1.6R2:compile
[INFO] +- struts-menu:struts-menu:jar:2.4.3:compile
[INFO] |  \- velocity-tools:velocity-tools-view:jar:1.0:compile
[INFO] +- taglibs:standard:jar:1.1.2:compile
[INFO] +- velocity:velocity:jar:1.4:compile
[INFO] |  \- velocity:velocity-dep:jar:1.4:runtime
[INFO] +- org.apache.poi:poi:jar:3.10-FINAL:compile
[INFO] +- org.apache.poi:poi-ooxml:jar:3.10-FINAL:compile
[INFO] |  \- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- org.apache.poi:poi-ooxml-schemas:jar:3.10-FINAL:compile
[INFO] |  \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] |     \- stax:stax-api:jar:1.0.1:compile
[INFO] +- commons-codec:commons-codec:jar:1.6:compile
[INFO] +- cglib:cglib-nodep:jar:2.2:compile
[INFO] \- com.googlecode.htmlcompressor:htmlcompressor:jar:1.5.2:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

感谢任何帮助/见解。

0 个答案:

没有答案
相关问题