开发者

Web Service conflict among cxf2.2.4 Spring2.5.6 and jboss 7?

How do I want to set up web service on Spring 2.5.6 cxf2.2.4 and jboss7?

I know jboss 7 has web service package natively. My codes already heavily rely on apache cxf2.2.4 framework, I just don't want to change a lot due to tight deadline. I put this under webapp/META-INFO/ to exclude embeded cxf2.4 in jboss7, what else should I do?

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
  <deployment>
    <exclusions>
       <module name="org.apache.cxf"/>
    </exclusions>
  </deployment>
</jboss-deployment-structure>

Something really blocking me is when I want to use current cxf2.2.4, it seems that jboss7 requires me to add MappedName attribute to @Resource in it. I downloaded cxf2.2.4 from SVN and tried to change the source code, but I failed to make a new jar because lack of some dependencies(they may be too old to get).

Or I need to upgrade to cxf 2.4.1 natively on jboss7, which may take quite a long time.

ERROR MESSAGE I got with cxf2.2.4:

03:04:51,418 INFO  [org.jboss.modules] JBoss Modules version

1.0.1.GA 03:04:52,219 INFO [org.jboss.msc] JBoss MSC version 1.0.0.GA 03:04:52,303 INFO [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting 03:04:54,194 INFO [org.jboss.as] creating http management service using network interface (management) port (9990) securePort (-1) 03:04:54,209 INFO [org.jboss.as.logging] Removing bootstrap log handlers 03:04:54,246 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2) 03:04:54,266 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1) 03:04:54,282 INFO [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem. 03:04:54,472 INFO [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem 03:04:54,490 INFO [org.jboss.as.naming] (MSC service thread 1-4) Starting Naming Service 03:04:54,496 INFO [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem 03:04:54,522 INFO [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem 03:04:54,529 INFO [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 3.2.0.Beta2 03:04:54,561 INFO [org.xnio] (MSC service thread 1-4) XNIO Version 3.0.0.Beta3 03:04:54,588 INFO [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.0.0.Beta3 03:04:55,006 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem 03:04:55,141 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-7) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jdk1.6.0_23\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program Files (x86)/Java/jdk1.6.0_23/bin/../jre/bin/client;C:/Program Files (x86)/Java/jdk1.6.0_23/bin/../jre/bin;C:/Program Files (x86)/Java/jdk1.6.0_23/bin/../jre/lib/i386;C:\Program Files (x86)\Java\jdk1.6.0_23;C:\Program Files (x86)\Java\jdk1.6.0_23\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\SlikSvn\bin\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Windows7Master;C:\Program Files (x86)\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\SlikSvn\bin\;C:\Program Files (x86)\PuTTY;C:\Program Files (x86)\jboss-4.2.3.GA\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\EasyPHP-5.3.5.0\mysql\bin;C:\Program Files\TortoiseSVN\bin;D:\maven303\;D:\maven303\bin;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;D:\FuhuAppStore\software\eclipse-jee-indigo-win32\eclipse; 03:04:55,178 INFO [org.jboss.as.remoting] (MSC service thread 1-7) Listening on /127.0.0.1:9999 03:04:55,181 INFO [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-2) Starting remote JMX connector 03:04:55,251 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080 03:04:55,468 INFO [org.jboss.as.connector] (MSC service thread 1-1) Starting JCA Subsystem (JBoss IronJacamar 1.0.0.CR2) 03:04:55,524 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/ExampleDS] 03:04:55,524 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:jboss/datasources/musicstore] 03:04:55,525 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) Bound data source [java:jdbc/mysql/appstore] 03:04:55,525 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:jdbc/mysql/appsubmission] 03:04:55,912 INFO [org.jboss.as.deployment] (MSC service thread 1-6) Started FileSystemDeploymentService for directory D:\jboss-as-7.0.0.Final\standalone\deployments 03:04:55,948 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.Final "Lightning" started in 5221ms - Started 105 of 160 services (55 services are passive or on-demand) 03:04:55,959 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) Starting deployment of "asweb.war" 03:05:08,589 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry xbean.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/js.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,590 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jaxp-api.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/saaj-api-1.3.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,590 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jax-qname.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/saaj-api-1.3.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,590 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry activation.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/li开发者_Go百科b/saaj-api-1.3.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,591 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry servlet.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/saaj-api-1.3.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,591 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry saaj-api.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/saaj-impl-1.3.2.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,591 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry activation.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/saaj-impl-1.3.2.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,592 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry xercesImpl.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/xalan.jar" does not point to a valid jar for a Class-Path reference. 03:05:08,592 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry xml-apis.jar in "/D:/jboss-as-7.0.0.Final/bin/content/asweb.war/WEB-INF/lib/xalan.jar" does not point to a valid jar for a Class-Path reference. 03:05:09,035 INFO [org.jboss.jpa] (MSC service thread 1-2) read persistence.xml for asjpa 03:05:09,473 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.headers.HeaderManagerImpl/bus on class org.apache.cxf.headers.HeaderManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,473 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.bus.resource.ResourceManagerImpl/bus on class org.apache.cxf.bus.resource.ResourceManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,473 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.wsdl11.WSDLManagerImpl/bus on class org.apache.cxf.wsdl11.WSDLManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,474 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.buslifecycle.CXFBusLifeCycleManager/bus on class org.apache.cxf.buslifecycle.CXFBusLifeCycleManager since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,475 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.jaxws.context.WebServiceContextResourceResolver/bus on class org.apache.cxf.jaxws.context.WebServiceContextResourceResolver since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,475 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.catalog.OASISCatalogManager/bus on class org.apache.cxf.catalog.OASISCatalogManager since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,475 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.ws.rm.RMManager/bus on class org.apache.cxf.ws.rm.RMManager since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,476 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.ws.security.policy.WSSecurityPolicyLoader since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,476 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.endpoint.ServerRegistryImpl/bus on class org.apache.cxf.endpoint.ServerRegistryImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,477 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.workqueue.WorkQueueManagerImpl/bus on class org.apache.cxf.workqueue.WorkQueueManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,478 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.workqueue.WorkQueueManager on class org.apache.cxf.workqueue.AutomaticWorkQueueImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,478 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.jaxrs.interceptor.AttachmentInputInterceptor/supportedTypes on class org.apache.cxf.jaxrs.interceptor.AttachmentInputInterceptor since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,479 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.binding.BindingFactoryManagerImpl/bus on class org.apache.cxf.binding.BindingFactoryManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,479 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.binding.corba.wsdl.WSDLExtensionRegister/bus on class org.apache.cxf.binding.corba.wsdl.WSDLExtensionRegister since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,479 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: transportIds on class org.apache.cxf.binding.corba.CorbaBindingFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,480 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.binding.soap.SoapTransportFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,480 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.binding.AbstractBindingFactory/bus on class org.apache.cxf.binding.AbstractBindingFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,480 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: activationNamespaces on class org.apache.cxf.binding.AbstractBindingFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,481 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.management.jmx.InstrumentationManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,481 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.management.counters.CounterRepository since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,481 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.databinding.AbstractDataBinding since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,481 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.transport.jms.JMSTransportFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,482 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.transport.DestinationFactoryManagerImpl/bus on class org.apache.cxf.transport.DestinationFactoryManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,482 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,482 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,483 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,483 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.transport.ConduitInitiatorManagerImpl/bus on class org.apache.cxf.transport.ConduitInitiatorManagerImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,483 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.transport.servlet.ServletTransportFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,484 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: org.apache.cxf.transport.http.QueryHandlerRegistryImpl/bus on class org.apache.cxf.transport.http.QueryHandlerRegistryImpl since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,484 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.transport.http.AbstractHTTPTransportFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:09,484 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-4) Can't handle @Resource for ENC name: cxf on class org.apache.cxf.transport.local.LocalTransportFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type 03:05:11,089 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1) 03:05:11,383 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "asweb.war" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"asweb.war#asjpa\" missing [ jboss.data-source.java:/ ]"]} 03:05:11,384 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) Service status report New missing/unsatisfied dependencies: service jboss.data-source.java:/ (missing)

03:05:11,386 ERROR [org.jboss.as.deployment]

(DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"asweb.war#asjpa\" missing [ jboss.data-source.java:/ ]"]}}} 03:05:20,618 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment asweb.war in 9226ms 03:05:20,619 INFO [org.jboss.as.controller] (MSC service thread 1-8) Service status report Newly corrected services: service jboss.data-source.java:/ (no longer required)


I had the same issue as I was deploying a standalone WAR in Tomcat but was moving to Jboss7AS. After all the sesarching and even Jboss employee support telling me "don't use CXF in your WAR use the Jboss Jax-WS" I got it working. In my /WEB-INF/jboss-deployment-structure.xml I chose to exclude all EE packages and this made my WAR work just find that was deploying in Tomcat deploy on Jboss7 AS.

<jboss-deployment-structure>
    <!-- For JBoss7AS and WS-Security/CXF to play nice must exclude the EEjars -->
    <deployment>
        <exclusions>
            <module name="javaee.api" />
        </exclusions>
    </deployment>
</jboss-deployment-structure>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜