geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Gawor" <jga...@gmail.com>
Subject Re: Webservices injections failing
Date Fri, 18 Apr 2008 19:35:30 GMT
Rafael,

You cannot use WTP plugin to create and deploy JAX-WS web services.
WTP plugin is very Axis2 specific and right now is not very JAX-WS
aware. Also, when you develop a web service in WTP and deploy it to
your application server, it actaully deploys the entire Axis2 engine
with it. Since the entire Axis2 engine is deployed with your Axis2 web
service using its own custom deployment descriptors, the application
server has no knowledge of your web service and therefore cannot
perform injection. If the tooling would use standard deployment
descriptors and relied on the web service engine provided by the
application server injection would (and will) work.
You can still do the usual JNDI lookup to get the EJB reference in
this case, but if you need injection working you can't really use WTP.
I think NetBeans has some support for JAX-WS web services but I'm not
100% sure about it.

Hope this helps,
Jarek

On Fri, Apr 18, 2008 at 2:42 PM, Rafael Coutinho
<rafael.coutinho@gmail.com> wrote:
>
>  Hi there,
>
>  i'm having an issue trying to call an EJB from a webservices. I have 3
>  modules, one EJB, one EAR and one WAR. In the WAR i have the webservices and
>  a test servlet. The test servlet works fine.
>  The Webservicesis like:
>
>  [...]
>  @WebService()
>  public class WSInterface {
>         @EJB
>         DonateInterface donateSession;
>
>          public Funds getFund(String name) {
>                 System.out.println("Name: " + name);
>                 System.out.println("donateSession: " + donateSession);
>
>                 Funds fund = donateSession.getFund(name);
>                 System.out.println(fund);
>                 return fund;
>         }
>  [...]
>
>  I can successfully call that webservices but it looks like the session bean
>  is never injected, here is the logs:
>
>  Name: sasdfas
>  donateSession: null
>  11:11:14,544 ERROR [RPCMessageReceiver] Exception occurred while trying to
>  invoke service method getFund
>  java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
>         at
>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:618)
>         at
>  org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
>         at
>  org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
>         at
>  org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
>         at
>  org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
>         at
>  org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
>         at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>         at
>  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
>  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
>  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>         at
>  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at
>  org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
>         at
>  org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:401)
>         at
>  org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
>         at
>  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at
>  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>         at
>  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at
>  org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>         at
>  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
>         at
>  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at
>  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:810)
>  Caused by:
>  java.lang.NullPointerException
>         at br.learn.WSInterface.getFund(WSInterface.java:24)
>         ... 29 more
>
>  Anyone knows what's wrong? Why i can't get the injections in it?
>
>
>  --
>  View this message in context: http://www.nabble.com/Webservices-injections-failing-tp16764007s134p16764007.html
>  Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
>
>

Mime
View raw message