Can't handle @Resource for ENC name
samwun9988 Aug 30, 2011 6:15 AMHi,
I managed to go deploy the WAR file in JBOSS AS7, the WAR file is based on CXF2 and Spring 3.0.5.
However I think the web service is (WSDL) is failed to publish.
Here is the error:
04:32:08,670 INFO [org.jboss.as.jpa] (MSC service thread 1-2) added javax.persistence.api dependency to order-ws-0.0.1-SNAPSHOT.war
04:32:08,729 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,729 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,730 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,730 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,730 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,730 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,731 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,731 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,731 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,731 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,731 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,732 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,732 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,732 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) Can't handle @Resource for ENC name: org.apache.cxf.service.factory.FactoryBeanListenerManager/bus on class org.apache.cxf.service.factory.FactoryBeanListenerManager since it's missing a "lookup" (or "mappedName") value and isn't of any known type
04:32:08,733 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,733 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) Can't handle @Resource for ENC name: org.apache.cxf.binding.AbstractBaseBindingFactory/bus on class org.apache.cxf.binding.AbstractBaseBindingFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type
04:32:08,733 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,733 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) Can't handle @Resource for ENC name: org.apache.cxf.transport.http.HTTPTransportFactory/bus on class org.apache.cxf.transport.http.HTTPTransportFactory since it's missing a "lookup" (or "mappedName") value and isn't of any known type
04:32:08,733 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,734 WARN [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-7) 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
04:32:08,739 INFO [org.jboss.weld] (MSC service thread 1-7) Processing CDI deployment: order-ws-0.0.1-SNAPSHOT.war
04:32:08,916 INFO [org.jboss.weld] (MSC service thread 1-6) Starting Services for CDI deployment: order-ws-0.0.1-SNAPSHOT.war
04:32:08,937 INFO [org.jboss.weld.Version] (MSC service thread 1-6) WELD-000900 1.1.2 (Final)
04:32:08,958 INFO [org.jboss.weld] (MSC service thread 1-1) Starting weld service
04:32:09,298 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/order-ws-0.0.1-SNAPSHOT]] (MSC service thread 1-2) Initializing Spring root WebApplicationContext
04:32:09,298 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Root WebApplicationContext: initialization started
04:32:09,321 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (MSC service thread 1-2) Refreshing Root WebApplicationContext: startup date [Tue Aug 30 04:32:09 GMT 2011]; root of context hierarchy
04:32:09,352 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-2) Loading XML bean definitions from ServletContext resource [/WEB-INF/beans.xml]
04:32:09,397 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-2) Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
04:32:09,421 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-2) Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
04:32:09,441 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-2) Loading XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.xml]
04:32:09,546 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-2) Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@42b1b290: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,orderProcess]; root of factory hierarchy
04:32:09,652 WARNING [org.apache.cxf.bus.spring.OldSpringSupport] (MSC service thread 1-2) Import of META-INF/cxf/cxf-extension-soap.xml has been deprecated and is unnecessary.
04:32:09,660 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {http://service.order.service.ix/}OrderProcessImplService from class ix.service.order.service.OrderProcess
04:32:10,150 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-2) Setting the server's publish address to be /orderprocess
04:32:10,161 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Root WebApplicationContext: initialization completed in 862 ms
04:32:10,218 INFO [org.jboss.web] (MSC service thread 1-2) registering web context: /order-ws-0.0.1-SNAPSHOT
pom.xml file:
<!-- Jetty is needed if you're are not using the CXFServlet -->
<!--
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
-->
<!-- Apache 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>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<includes>
<include>web.xml</include>
</includes>
<filtering>true</filtering>
<targetPath>${project.build.directory}</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<workingDirectory>src/main/webapp</workingDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<configuration>
<goalPrefix>embedded-glassfish</goalPrefix>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<version>${cxf.version}</version>
<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-frontend-simple</artifactId>
<version>${cxf.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-test-sources</id>
<phase>generate-test-sources</phase>
<configuration>
<sourceRoot>generated/wsdl</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>Order-Process.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
<className>ix.service.order.service.OrderProcess</className>
<genWsdl>true</genWsdl>
<keep>true</keep>
<verbose>true</verbose>
<!-- <tasks>
<copy file="${basedir}/generated/wsdl/OrderProcess.wsdl"
tofile="${basedir}/src/main/resources/wsdl/OrderProcess.wsdl"/>
</tasks> -->
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.15</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
</connector>
</connectors>
<webXml>${project.build.directory}/web.xml</webXml>
<webAppConfig>
<contextPath>/</contextPath>
</webAppConfig>
</configuration>
</plugin>
Thanks
Sam