You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "markltodd@hotmail.com" <ma...@hotmail.com> on 2012/06/28 15:41:57 UTC
Pojo Web Services
If I've understood correctly it should be possible to use Tomee to create Web
Services that aren't EJBs. This seems to work to a point. However, resource
injection does not appear to work. Modifying the standard example to:
import javax.jws.WebService;
@WebService(
portName = "CalculatorPort",
serviceName = "CalculatorService",
targetNamespace = "http://superbiz.org/wsdl",
endpointInterface = "org.superbiz.calculator.ws.CalculatorWs")
public class Calculator implements CalculatorWs {
@Resource
WebServiceContext webServiceContext;
@Resource
UserTransaction userTransaction;
public int sum(int add1, int add2) {
return add1 + add2;
}
public int multiply(int mul1, int mul2) {
return mul1 * mul2;
}
}
results in the following error:
SEVERE: Error deploying CXF webservice for servlet CalculatorService
Throwable occurred: javax.xml.ws.WebServiceException: Service resource
injection failed
at
org.apache.openejb.server.cxf.pojo.PojoEndpoint.<init>(PojoEndpoint.java:63)
at
org.apache.openejb.server.cxf.pojo.PojoWsContainer.createEndpoint(PojoWsContainer.java:38)
at
org.apache.openejb.server.cxf.pojo.PojoWsContainer.createEndpoint(PojoWsContainer.java:26)
at
org.apache.openejb.server.cxf.CxfWsContainer.start(CxfWsContainer.java:53)
at
org.apache.openejb.server.cxf.CxfService.createPojoWsContainer(CxfService.java:70)
at
org.apache.openejb.server.webservices.WsService.afterApplicationCreated(WsService.java:326)
at
org.apache.tomee.webservices.TomeeJaxWsService.afterApplicationCreated(TomeeJaxWsService.java:56)
at
org.apache.tomee.catalina.WebDeploymentListeners.afterApplicationCreated(WebDeploymentListeners.java:38)
at
org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:818)
at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:103)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
Caused by: java.lang.NullPointerException
at
org.apache.openejb.InjectionProcessor.fillInjectionProperties(InjectionProcessor.java:182)
at
org.apache.openejb.InjectionProcessor.construct(InjectionProcessor.java:110)
at
org.apache.openejb.InjectionProcessor.createInstance(InjectionProcessor.java:83)
at
org.apache.openejb.server.cxf.pojo.PojoEndpoint.<init>(PojoEndpoint.java:59)
... 20 more
Should this be possible? Thanks in advance
--
View this message in context: http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Pojo Web Services
Posted by David Blevins <da...@gmail.com>.
On Jun 29, 2012, at 10:34 AM, markltodd wrote:
> That all works now and my whole app ported neatly. Any ideas what the
> timescales for the point release are?
I'd expect the release drum to start banging mid July. Usually takes about 2 weeks to get something up after that point.
-David
Re: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
ok, David you got me
- Romain
2012/6/29 Romain Manni-Bucau <rm...@gmail.com>
> great news!
>
> thank you to give us feedback
>
> i think we'll try to release in july
>
> - Romain
>
>
>
> 2012/6/29 markltodd <ma...@hotmail.com>
>
>> That all works now and my whole app ported neatly. Any ideas what the
>> timescales for the point release are?
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655895.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>
Re: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
great news!
thank you to give us feedback
i think we'll try to release in july
- Romain
2012/6/29 markltodd <ma...@hotmail.com>
> That all works now and my whole app ported neatly. Any ideas what the
> timescales for the point release are?
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655895.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Pojo Web Services
Posted by markltodd <ma...@hotmail.com>.
That all works now and my whole app ported neatly. Any ideas what the
timescales for the point release are?
--
View this message in context: http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655895.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Pojo Web Services
Posted by markltodd <ma...@hotmail.com>.
In uk so it's going to be tomorrow morning before I have a chance to test it. Will get on it first thing
On 28 Jun 2012, at 22:08, "Romain Manni-Bucau [via OpenEJB]" <ml...@n4.nabble.com> wrote:
> http://ci.apache.org/builders/openejb-trunk-deploy/builds/416 when it is
> green you can give it a try i think
>
> - Romain
>
>
> 2012/6/28 markltodd <[hidden email]>
>
> > Should be able to do that. Thanks for quick response!
> >
> > On 28 Jun 2012, at 20:30, "Romain Manni-Bucau [via OpenEJB]" <
> > [hidden email]> wrote:
> >
> > > created https://issues.apache.org/jira/browse/TOMEE-258
> > >
> > > starting to work on it, will you be able to test on the snapshot?
> > >
> > > - Romain
> > >
> > >
> > > 2012/6/28 Romain Manni-Bucau <[hidden email]>
> > >
> > > > the issue is in org.apache.openejb.server.cxf.pojo.PojoEndpoint
> > > >
> > > > and the usage of the injector, we should delegate more to cxf i think
> > > >
> > > > - Romain
> > > >
> > > >
> > > >
> > > > 2012/6/28 markltodd <[hidden email]>
> > > >
> > > >> That's a real shame. Trying to port an existing application from
> > > >> JBoss/Websphere so it would be very difficult to embrace the EJB
> > approach
> > > >> in
> > > >> the web services. Do you have any ideas on how to fixing this ( I
> > take it
> > > >> the problem area is in TomcatWebAppBuilder around line 772). I love
> > the
> > > >> Tomee idea and its so close to what we need...
> > > >>
> > > >> --
> > > >> View this message in context:
> > > >>
> > http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655873.html
> > > >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > >>
> > > >
> > > >
> > >
> > >
> > > If you reply to this email, your message will be added to the discussion
> > below:
> > >
> > http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655877.html
> > > To unsubscribe from Pojo Web Services, click here.
> > > NAML
> >
> >
> > --
> > View this message in context:
> > http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655879.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655880.html
> To unsubscribe from Pojo Web Services, click here.
> NAML
--
View this message in context: http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655881.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
http://ci.apache.org/builders/openejb-trunk-deploy/builds/416 when it is
green you can give it a try i think
- Romain
2012/6/28 markltodd <ma...@hotmail.com>
> Should be able to do that. Thanks for quick response!
>
> On 28 Jun 2012, at 20:30, "Romain Manni-Bucau [via OpenEJB]" <
> ml-node+s979440n4655877h4@n4.nabble.com> wrote:
>
> > created https://issues.apache.org/jira/browse/TOMEE-258
> >
> > starting to work on it, will you be able to test on the snapshot?
> >
> > - Romain
> >
> >
> > 2012/6/28 Romain Manni-Bucau <[hidden email]>
> >
> > > the issue is in org.apache.openejb.server.cxf.pojo.PojoEndpoint
> > >
> > > and the usage of the injector, we should delegate more to cxf i think
> > >
> > > - Romain
> > >
> > >
> > >
> > > 2012/6/28 markltodd <[hidden email]>
> > >
> > >> That's a real shame. Trying to port an existing application from
> > >> JBoss/Websphere so it would be very difficult to embrace the EJB
> approach
> > >> in
> > >> the web services. Do you have any ideas on how to fixing this ( I
> take it
> > >> the problem area is in TomcatWebAppBuilder around line 772). I love
> the
> > >> Tomee idea and its so close to what we need...
> > >>
> > >> --
> > >> View this message in context:
> > >>
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655873.html
> > >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >>
> > >
> > >
> >
> >
> > If you reply to this email, your message will be added to the discussion
> below:
> >
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655877.html
> > To unsubscribe from Pojo Web Services, click here.
> > NAML
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655879.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Pojo Web Services
Posted by markltodd <ma...@hotmail.com>.
Should be able to do that. Thanks for quick response!
On 28 Jun 2012, at 20:30, "Romain Manni-Bucau [via OpenEJB]" <ml...@n4.nabble.com> wrote:
> created https://issues.apache.org/jira/browse/TOMEE-258
>
> starting to work on it, will you be able to test on the snapshot?
>
> - Romain
>
>
> 2012/6/28 Romain Manni-Bucau <[hidden email]>
>
> > the issue is in org.apache.openejb.server.cxf.pojo.PojoEndpoint
> >
> > and the usage of the injector, we should delegate more to cxf i think
> >
> > - Romain
> >
> >
> >
> > 2012/6/28 markltodd <[hidden email]>
> >
> >> That's a real shame. Trying to port an existing application from
> >> JBoss/Websphere so it would be very difficult to embrace the EJB approach
> >> in
> >> the web services. Do you have any ideas on how to fixing this ( I take it
> >> the problem area is in TomcatWebAppBuilder around line 772). I love the
> >> Tomee idea and its so close to what we need...
> >>
> >> --
> >> View this message in context:
> >> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655873.html
> >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> >>
> >
> >
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655877.html
> To unsubscribe from Pojo Web Services, click here.
> NAML
--
View this message in context: http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655879.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Fwd: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,
Any volonteer to create (from pojo-webservice example) some arquillian
tests to check Pojo Webservices?
- Romain
---------- Forwarded message ----------
From: Romain Manni-Bucau <rm...@gmail.com>
Date: 2012/6/28
Subject: Re: Pojo Web Services
To: users@openejb.apache.org
created https://issues.apache.org/jira/browse/TOMEE-258
starting to work on it, will you be able to test on the snapshot?
- Romain
2012/6/28 Romain Manni-Bucau <rm...@gmail.com>
> the issue is in org.apache.openejb.server.cxf.pojo.PojoEndpoint
>
> and the usage of the injector, we should delegate more to cxf i think
>
> - Romain
>
>
>
> 2012/6/28 markltodd <ma...@hotmail.com>
>
>> That's a real shame. Trying to port an existing application from
>> JBoss/Websphere so it would be very difficult to embrace the EJB approach
>> in
>> the web services. Do you have any ideas on how to fixing this ( I take it
>> the problem area is in TomcatWebAppBuilder around line 772). I love the
>> Tomee idea and its so close to what we need...
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655873.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>
Re: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
created https://issues.apache.org/jira/browse/TOMEE-258
starting to work on it, will you be able to test on the snapshot?
- Romain
2012/6/28 Romain Manni-Bucau <rm...@gmail.com>
> the issue is in org.apache.openejb.server.cxf.pojo.PojoEndpoint
>
> and the usage of the injector, we should delegate more to cxf i think
>
> - Romain
>
>
>
> 2012/6/28 markltodd <ma...@hotmail.com>
>
>> That's a real shame. Trying to port an existing application from
>> JBoss/Websphere so it would be very difficult to embrace the EJB approach
>> in
>> the web services. Do you have any ideas on how to fixing this ( I take it
>> the problem area is in TomcatWebAppBuilder around line 772). I love the
>> Tomee idea and its so close to what we need...
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655873.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>
Re: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
the issue is in org.apache.openejb.server.cxf.pojo.PojoEndpoint
and the usage of the injector, we should delegate more to cxf i think
- Romain
2012/6/28 markltodd <ma...@hotmail.com>
> That's a real shame. Trying to port an existing application from
> JBoss/Websphere so it would be very difficult to embrace the EJB approach
> in
> the web services. Do you have any ideas on how to fixing this ( I take it
> the problem area is in TomcatWebAppBuilder around line 772). I love the
> Tomee idea and its so close to what we need...
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655873.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Pojo Web Services
Posted by markltodd <ma...@hotmail.com>.
That's a real shame. Trying to port an existing application from
JBoss/Websphere so it would be very difficult to embrace the EJB approach in
the web services. Do you have any ideas on how to fixing this ( I take it
the problem area is in TomcatWebAppBuilder around line 772). I love the
Tomee idea and its so close to what we need...
--
View this message in context: http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655873.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
ok,
so i think you can inject ejb but not resources which currently needs a
jndi tree linked to the object and i think we currently not manage it for
pojo webservices.
- Romain
2012/6/28 markltodd <ma...@hotmail.com>
> Exact same error. It does work without both resources though
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655871.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Pojo Web Services
Posted by markltodd <ma...@hotmail.com>.
Exact same error. It does work without both resources though
--
View this message in context: http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867p4655871.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Pojo Web Services
Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you test quickly removing WebServiceContext?
(i guess you'll test it faster than if i build up an environment)
- Romain
2012/6/28 markltodd@hotmail.com <ma...@hotmail.com>
> If I've understood correctly it should be possible to use Tomee to create
> Web
> Services that aren't EJBs. This seems to work to a point. However, resource
> injection does not appear to work. Modifying the standard example to:
>
> import javax.jws.WebService;
>
> @WebService(
> portName = "CalculatorPort",
> serviceName = "CalculatorService",
> targetNamespace = "http://superbiz.org/wsdl",
> endpointInterface = "org.superbiz.calculator.ws.CalculatorWs")
> public class Calculator implements CalculatorWs {
>
> @Resource
> WebServiceContext webServiceContext;
>
> @Resource
> UserTransaction userTransaction;
>
> public int sum(int add1, int add2) {
> return add1 + add2;
> }
>
> public int multiply(int mul1, int mul2) {
> return mul1 * mul2;
> }
> }
>
> results in the following error:
> SEVERE: Error deploying CXF webservice for servlet CalculatorService
> Throwable occurred: javax.xml.ws.WebServiceException: Service resource
> injection failed
> at
>
> org.apache.openejb.server.cxf.pojo.PojoEndpoint.<init>(PojoEndpoint.java:63)
> at
>
> org.apache.openejb.server.cxf.pojo.PojoWsContainer.createEndpoint(PojoWsContainer.java:38)
> at
>
> org.apache.openejb.server.cxf.pojo.PojoWsContainer.createEndpoint(PojoWsContainer.java:26)
> at
> org.apache.openejb.server.cxf.CxfWsContainer.start(CxfWsContainer.java:53)
> at
>
> org.apache.openejb.server.cxf.CxfService.createPojoWsContainer(CxfService.java:70)
> at
>
> org.apache.openejb.server.webservices.WsService.afterApplicationCreated(WsService.java:326)
> at
>
> org.apache.tomee.webservices.TomeeJaxWsService.afterApplicationCreated(TomeeJaxWsService.java:56)
> at
>
> org.apache.tomee.catalina.WebDeploymentListeners.afterApplicationCreated(WebDeploymentListeners.java:38)
> at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:818)
> at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:103)
> at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> at
>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
> at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
> at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
> at java.util.concurrent.FutureTask.run(FutureTask.java:149)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
> at java.lang.Thread.run(Thread.java:736)
> Caused by: java.lang.NullPointerException
> at
>
> org.apache.openejb.InjectionProcessor.fillInjectionProperties(InjectionProcessor.java:182)
> at
>
> org.apache.openejb.InjectionProcessor.construct(InjectionProcessor.java:110)
> at
>
> org.apache.openejb.InjectionProcessor.createInstance(InjectionProcessor.java:83)
> at
>
> org.apache.openejb.server.cxf.pojo.PojoEndpoint.<init>(PojoEndpoint.java:59)
> ... 20 more
>
> Should this be possible? Thanks in advance
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Pojo-Web-Services-tp4655867.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>