Hi,
in
spring + jaxrs 2.2 + cxf KO dependencies
<cxf.version>2.2.1</cxf.version>
<spring.version>2.5.5</spring.version>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.2</version>
</dependency>
can you please try to replace
<artifactId>cxf-bundle-jaxrs</artifactId>
with
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
?
cxf-bundle-jaxrs incorporates rt/core, cxf-rt-frontend-jaxrs, etc
cheers, Sergey
----- Original Message -----
From: "bruno tapdur" <[email protected]>
To: <[email protected]>
Sent: Tuesday, July 14, 2009 3:34 PM
Subject: Re: JAXRS : JAXRSInterceptor .No root resource matching request
no problem Sergey. Sorry for the mistake howerver, i downloaded a jaxrs
sample project and it works fine. so i resume my problem is due to jaxrs
integration with cxf.
spring + jaxrs 2.2 + cxf 2.2. 1 it is KO (due to JAXRSInterceptor no
resource matching)
spring + jaxrs 2.2 it is OK
spring + jaxrs 2.2 dependencies
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.cxf</groupId>-->
<!-- <artifactId>cxf-bundle-jaxrs</artifactId>-->
<!-- <version>2.2-SNAPSHOT</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
</exclusions>
</dependency>
spring + jaxrs 2.2 + cxf KO dependencies
<cxf.version>2.2.1</cxf.version>
<spring.version>2.5.5</spring.version>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-aegis</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-local</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</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-jms</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-management</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-common-utilities</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.6</version>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</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-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.opensymphony.quartz</groupId>
<artifactId>quartz</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager
</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
2009/7/14 Sergey Beryozkin <[email protected]>
Hi
Sorry for a delay, just saw your email this morning. Judging from
2009-07-13 17:30:37,519 : JAXRSInInterceptor.processRequest : .No root
resource matching request path **/state/idle**s found.
and
@Path("/status")
@Produces("application/xml")
public class WebStatusImpl {
@GET
@Path("/state/{action}")
@Produces("application/xml")
public StatusResponse getState(@PathParam("action") String action) {
it appears that '/status' is missing in your request URI ? Can you check it
please ?
cheers, Sergey
Hi all
i am getting crazy trying to implement a simple cxf/rest/jaxrs sample
----------------------------
Encoding: UTF-8
Content-Type:
Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
accept-language=[fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3], host=[
127.0.0.1:9000],
accept-charset=[ISO-8859-1,utf-8;q=0.7,*;q=0.7], user-a
gent=[Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.5)
Gecko/2008120122 Firefox/3.0.5],
cookie=[JSESSIONID=BA3E7DC589DD8205260B42A3588B1F49],
Accept=[text/html,application/xhtml+xml,applicatio
n/xml;q=0.9,*/*;q=0.8], keep-alive=[300]}
Payload:
--------------------------------------
2009-07-13 17:30:37,519 : JAXRSInInterceptor.processRequest : .No root
resource matching request path /state/idle is found.
2009-07-13 17:30:37,535 : WebApplicationExceptionMapper.toResponse :
WebApplicationException has been caught : no cause is available
2009-07-13 17:30:37,566 : LoggingOutInterceptor$LoggingCallback.onClose :
Outbound Message
any idea ?
thx
Bruno
i use cxf 2.2.3 + spring 2.5 + jaxrs 2.2
my class impl
@Path("/status")
@Produces("application/xml")
public class WebStatusImpl {
public WebCallManagerPcLineImpl() {
}
public Response getBadRequest() {
// TODO Auto-generated method stub
return null;
}
@GET
@Path("/state/{action}")
@Produces("application/xml")
public StatusResponse getState(@PathParam("action") String action) {
// TODO Auto-generated method stub
StatusResponse result = new statusResponse();
result.setStatus("idle");
return result;
}
}
and my cxf.xml
<?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:cxf="http://cxf.apache.org/core"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
default-lazy-init="false">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import
resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxrs:server id="status" address="/">
<jaxrs:features>
<cxf:logging/>
</jaxrs:features>
<jaxrs:serviceBeans>
<ref bean="statusserviceImpl" />
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="xml" value="application/xml" />
</jaxrs:extensionMappings>
</jaxrs:server>
<bean id="statusserviceImpl" class="com.service.StatusServiceImpl" />
</beans>
and my web.xml
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>cxf.rest.statusservice.root</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup> </servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
and my url enter in Firefox
http://127.0.0.1:9000/statusservice /status/state/idle