JBossws doesn't read my jbossws-cxf file ?
tgirard Jul 9, 2013 5:31 AMHi everyone.
I'm trying to deploy a web service using jbossws (+Spring). Here's what happens when I deploy (I had to replace some info with *** because of my company's absurdly strict policy about confidentiality, sorry. But if something's missing I can probably give more detail) :
10:58:06,470 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "***-ws-web-2.1-SNAPSHOT.war"
10:58:11,845 WARN [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.***-ws-web-2.1-SNAPSHOT.war" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.
10:58:11,845 WARN [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.***-ws-web-2.1-SNAPSHOT.war" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.
10:58:11,845 WARN [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.***-ws-web-2.1-SNAPSHOT.war" is using a private module ("org.jboss.ws.cxf.jbossws-cxf-client:main") which may be changed or removed in future versions without notice.
10:58:11,861 WARN [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.***-ws-web-2.1-SNAPSHOT.war" is using a private module ("org.jboss.ws.cxf.jbossws-cxf-client:main") which may be changed or removed in future versions without notice.
10:58:11,908 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/***-ws-web-2.1-SNAPSHOT]] (MSC service thread 1-4) Initializing Spring root WebApplicationContext
10:58:11,908 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-4) Root WebApplicationContext: initialization started
10:58:11,908 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (MSC service thread 1-4) Refreshing Root WebApplicationContext: startup date [Tue Jul 09 10:58:11 CEST 2013]; root of context hierarchy
10:58:11,923 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-4) Loading XML bean definitions from ServletContext resource [/WEB-INF/application-context.xml]
10:58:11,939 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-4) Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@ca1272: defining beans []; root of factory hierarchy
10:58:11,939 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-4) Root WebApplicationContext: initialization completed in 31 ms
10:58:11,954 INFO [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /***-ws-web-2.1-SNAPSHOT
10:58:12,392 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "***-ws-web-2.1-SNAPSHOT.war"
1) As you can see, JBoss reads my spring application-context.xml file (declared from web.xml, empty for now). But it never reads my jbossws-cxf file and thus doesn't deploy the web service. The file is in WEB-INF/ I think that's where it should be, so I don't know why it isn't read. For reference here are the contents of the file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<context:spring-configured />
<!-- Create service beans (should be moved to serviceImpl later) -->
<context:annotation-config />
<context:component-scan base-package="***.ws.service" />
<!-- Web services endpoints -->
<jaxws:endpoint id="***ServiceEndpoint"
implementor="#***ServiceV1"
implementorClass="***.ws.service.impl.v1.***Impl"
serviceName="v1:***ServiceV1" endpointName="v1:***ServiceV1"
wsdlLocation="wsdl/***ServiceV1.wsdl" address="/***ServiceV1">
</jaxws:endpoint>
</beans>
2) Are the 4 warnings in the log about private modules ok ? Should I do something about that ?
3) There's a thing I don't understand about the behavior of integrating with jbossws vs. spring. When not using jboss-ws, I would have my endpoint declared in the spring context, and my service beans autowired into the endpoint bean. Will that work the same with jboss-ws ? Is my config above correct: should I declare the context (especially component-scan) here in the jbossws-cxf file, or in my application-context ? Do those 2 files actually describe the same context ?
All this is on JBoss 7.1.1 final, cxf 2.4.6 (the one bundled with jboss) and Spring 3.0.5 (installed manually as module).
Hope you can help, thanks in advance.
Thomas
EDIT: here's also my web.xml, I guess that might be useful
<web-app id="***_ws_web">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/application-context.xml</param-value>
</context-param>
<filter>
<filter-name>requestContextFilterChain</filter-name>
<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>requestContextFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>