|
From: Clemens E. <lin...@gm...> - 2011-06-03 14:23:39
|
Hi Jozef,
I tried to annotate it with @Name, but unfourtunatly it didn't change a thing.
This is the full source, of both the interface and the implementation:
//Interface:
@Path("/async")
public interface AsyncTestBean {
@GET
@Path("/{message}")
public Response echoService();
}
//Implementation:
@Name("async")
@Scope(ScopeType.SESSION)
public class AsyncTest implements AsyncTestBean {
@Logger
Log log;
public Response echoService(){
log.info("polling map");
return Response.status(200).entity("hello").build();
}
}
The exception I get is:
javax.servlet.ServletException: java.lang.IllegalArgumentException: no
file extension in servlet path: /async/message
org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:126)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
Without the log-statement everything works as expected.
Thanks a lot for your help, Clemens
2011/6/3 Jozef Hartinger <joz...@gm...>:
> The problem is that you're using Seam 2 injection (@Logger) in an object
> which is not a Seam component. Add @Name to turn AsyncResourceBean into a
> Seam component.
>
> On 06/01/2011 03:13 PM, Clemens Eisserer wrote:
>>
>> Hi,
>>
>> I would like to use RestEasy's EJB integration in a
>> jboss6/seam/richfaces webapp.
>> Everything seems to work file, except injection of other EJBs.
>>
>> I basically did the following:
>>
>> @Path("/async")
>> public interface AsyncResource {
>>
>> @GET
>> @Path("/{message}")
>> public Response doSomething();
>> }
>>
>>
>> @Stateless
>> public class AsyncResourceBean implements AsyncResource {
>>
>> @Logger
>> Log log;
>>
>> public Response doSomething(){
>> log.info("polling map"); //NPE
>> return Response.status(200).entity("hello").build();
>> }
>> }
>>
>> When log variable is accessed, I get the following exception, guess
>> its just caused by a NullPointerException:
>> 17:02:21,192 ERROR [org.ajax4jsf.webapp.BaseXMLFilter] Exception in
>> the filter chain: javax.servlet.ServletException:
>> java.lang.IllegalArgumentException: no file extension in servlet path:
>> /async/message
>>
>> If I remove the log statement, everything works fine again.
>>
>> Any ideas what could be wrong?
>>
>>
>> Thank you in advance, Clemens
>>
>>
>> ------------------------------------------------------------------------------
>> Simplify data backup and recovery for your virtual environment with
>> vRanger.
>> Installation's a snap, and flexible recovery options mean your data is
>> safe,
>> secure and there when you need it. Data protection magic?
>> Nope - It's vRanger. Get your free trial download today.
>> http://p.sf.net/sfu/quest-sfdev2dev
>> _______________________________________________
>> Resteasy-users mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
|