Hi
There's no thread local ServletContext support available in 2.1.2, I just added it to the trunk, so it should also be available in
the soon to be released 2.1.3.
What kind of context info is needed ? Perhaps injecting UriInfo or
HttpServletRequest, or SecurityContext can do ?
I'd also like to clarify what exactly happening when you have a single interface ? Is (SOAP) WebServiceContext actually availbale at
runtime, when SOAP invocations are made (despite that INFO message) ? Is it what the single problem is when you combine both styles
?
Can you please post a sample class which shows both JAX-WS& JAX-RS annotations
and explain what is the problem you're seeing ?
Cheers, Sergey
Hi again,
I've still my injection problem even if I move the annotation to a setter.
First of all, I have duplicated my service's interface in order to have one interface dediacted to SOAP (with soap annotations)
and one to REST (with rest annotation). In that (dirty) way, I have no injection problem for the soap service with :
@Resource
private WebServiceContext context;
It works fine.
But for the REST service, in order to test where is the problem, I have put
this setter in my implementation class :
private ServletContext wAppCxt;
@Context
public void setServletContext(ServletContext ctx) {
System.out.println("Injecting servlet context : " + ctx);
this.wAppCxt = ctx;
}
While starting Tomcat with the webapp inside, I have this log :
Injecting servlet context : null
So, it seems that the injection process is called but that the context variable
is null. :-(
Do you have any idea?
Sergey Beryozkin a écrit :
Hi,
Not sure what the problem is, looks like the JAX-WS injection mechanism may
need some hints.
Can you please try to inject WebServiceContext as a bean property instead through a setter method, with @Resource annotation
movbed to the method and removed from a field and see if it helps,
Cheers, Sergey
Hi!
I have a soap web service in my webapp.
While using injection in that web service implementation class to get the
current context like this :
@Resource
private WebServiceContext context;
it works fine. :-)
Now, I want the same service to be accessible via REST too. So I add some REST annotations in my code and I add in my spring
config file beans.xml :
the declaration as follow :
<jaxrs:server id="restfulAminService" address="/rest/Admin">
<jaxrs:serviceBeans>
<ref bean="RestAminService" />
</jaxrs:serviceBeans>
</jaxrs:server>
<bean id="RestAminService" class="my.package.AdminServiceImpl" />
and while starting the server I get this error :
15 oct. 2008 16:22:35 org.apache.cxf.common.injection.ResourceInjector
visitField
INFO: failed to resolve resource my.package.AdminServiceImpl/context
Why?
--
---------------------------------------------
Priscille DURVILLE
INRIA
Equipe Edelweiss (ex Acacia)
[EMAIL PROTECTED]
Tél : 01 39 63 52 77 (Paris - Rocquencourt)
Tél : 04 92 38 50 23 (Sophia Antipolis)
Fax : 04 92 38 77 83
I.N.R.I.A.
Unité de Recherche Sophia-Antipolis
2004 route des Lucioles - B.P. 93
06902 Sophia-Antipolis Cedex
FRANCE
---------------------------------------------