You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Forrest_Xia <fo...@gmail.com> on 2009/01/06 16:43:19 UTC
Can we use JAX-RPC and JAX-WS in the same time in a JEE
application?
Recently I am trying to have a JAX-WS implementation for daytrader web
services access mode.
I can make it work when I disabled JAX-RPC in configuration files, but when
I try to make two web services access mode working in the same time, there
is a deployment exception appeared like this:
"Deployer operation failed: POJO web service: TradeImplwJAXWS not configured
by any web service builder
org.apache.geronimo.common.DeploymentException: POJO web service:
TradeImplwJAXWS not configured by any web service builder
at
org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:449)
at
org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:165)
at
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:662)
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130)
at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:850)
at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:237)
at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
at java.lang.Thread.run(Thread.java:735)"
I searched web and found a JIRA GERONIMO-3005 ->
https://issues.apache.org/jira/browse/GERONIMO-3005 related, seems it has
been fixed in the trunk. But still I got the similar exception, why?
Thanks in advance for any insight!
Forrest
--
View this message in context: http://www.nabble.com/Can-we-use-JAX-RPC-and-JAX-WS-in-the-same-time-in-a-JEE-application--tp21312861s134p21312861.html
Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
Re: Can we use JAX-RPC and JAX-WS in the same time in a JEE
application?
Posted by Forrest_Xia <fo...@gmail.com>.
Finally, I got through the problem I encountered. I add some configs to
web.war/web-inf/webservices.xml
<webservice-description>
<webservice-description-name>Trade JAX-WS
Impl</webservice-description-name>
<port-component>
<port-component-name>TradeJWSPort</port-component-name>
<wsdl-service
xmlns:p1="http://jaxws.daytrader.samples.geronimo.apache.org">p1:TradeJWSService</wsdl-service>
<wsdl-port
xmlns:p2="http://jaxws.daytrader.samples.geronimo.apache.org">p2:TradeJWSPort</wsdl-port>
<enable-mtom>false</enable-mtom>
<service-endpoint-interface>org.apache.geronimo.samples.daytrader.jaxws.Trade</service-endpoint-interface>
<service-impl-bean>
<servlet-link>TradeImplwJAXWS</servlet-link>
</service-impl-bean>
</port-component>
</webservice-description>
Then the code get working. But I still have a question is that why we need a
configuration like that. I tried disabling JAX-RPC impl of daytrader web
service, then no any configuration for the JAX-WS impl, the Geronimo can
work and generate correct web service wsdl to make daytrader work.
But when I want to use JAX-RPC and JAX-WS at the same time, why
configuration is needed?
Please anyone can light me on this?
Thanks in advance!
--
View this message in context: http://www.nabble.com/Can-we-use-JAX-RPC-and-JAX-WS-in-the-same-time-in-a-JEE-application--tp21312861s134p21386880.html
Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
Re: Can we use JAX-RPC and JAX-WS in the same time in a JEE
application?
Posted by Forrest_Xia <fo...@gmail.com>.
Jarek,
That testsuite samples do help, and I make progress. But I am stopped by a
new problem: how to code to access the jax-ws web service?
What I want to achieve is not to use static wsdl in any configuration file,
while let axis2 engine generate it at runtime. So I did following changes:
1. Add a webservice-description to WEB-INF/webservices.xml like this:
<webservice-description>
<webservice-description-name>Trade JAX-WS
Impl</webservice-description-name>
<port-component>
<port-component-name>TradeJWSPort</port-component-name>
<wsdl-service>TradeJWSService</wsdl-service>
<enable-mtom>false</enable-mtom>
<service-endpoint-interface>org.apache.geronimo.samples.daytrader.jaxws.Trade</service-endpoint-interface>
<service-impl-bean>
<servlet-link>TradeImplwJAXWS</servlet-link>
</service-impl-bean>
</port-component>
</webservice-description>
2. Then in a proxy code, I write as follows to try to get the web service
port.
<code>
Service service = null;
QName portName = null;
try {
URL wsdlLoc = new URL(TradeConfig.getSoapURL());
QName serviceName = new
QName("http://jaxws.daytrader.samples.geronimo.apache.org",
"TradeJWSService");
portName = new
QName("http://jaxws.daytrader.samples.geronimo.apache.org", "TradeJWSPort");
service = Service.create(wsdlLoc, serviceName); // line 45 of
TradeImplwJAXWSProxy.java
} catch (MalformedURLException e) {
Log.error(e, "TradeImplwJAXWSProxy throws MalformedURLException");
}
return
(org.apache.geronimo.samples.daytrader.jaxws.Trade)service.getPort(portName,
org.apache.geronimo.samples.daytrader.jaxws.Trade.class);
</code>
Then when I try to call it, an exception like this thrown out:
javax.xml.ws.WebServiceException: An attempt was made to construct the
ServiceDelegate object with an service name that is not valid:
{http://jaxws.daytrader.samples.geronimo.apache.org}TradeJWSService.
at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:172)
at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:69)
at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:117)
at
org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:92)
at
org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:45)
at javax.xml.ws.Service.<init>(Service.java:36)
at javax.xml.ws.Service.create(Service.java:88)
at
org.apache.geronimo.samples.daytrader.jaxws.TradeImplwJAXWSProxy.getTrade(TradeImplwJAXWSProxy.java:45)
at
org.apache.geronimo.samples.daytrader.jaxws.TradeImplwJAXWSProxy.<init>(TradeImplwJAXWSProxy.java:34)
at
org.apache.geronimo.samples.daytrader.web.TradeServletAction.<init>(TradeServletAction.java:52)
at
org.apache.geronimo.samples.daytrader.web.TradeAppServlet.performTask(TradeAppServlet.java:112)
at
org.apache.geronimo.samples.daytrader.web.TradeAppServlet.doGet(TradeAppServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
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.geronimo.samples.daytrader.web.OrdersAlertFilter.doFilter(OrdersAlertFilter.java:94)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
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:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:810)
I checked web services testsuite, but not find a sample about how to use
dynamic wsdl generation to get service port. Seems those samples all use
generated static wsdl and service-ref to get service port from JNDI.
Please advise, thanks!
Forrest
--
View this message in context: http://www.nabble.com/Can-we-use-JAX-RPC-and-JAX-WS-in-the-same-time-in-a-JEE-application--tp21312861s134p21325051.html
Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
Re: Can we use JAX-RPC and JAX-WS in the same time in a JEE application?
Posted by Jarek Gawor <jg...@gmail.com>.
Forrest,
Yes, that should work. Have you looked at
testsuite/webservices-testsuite/jaxrpc-jaxws-tests tests? Maybe that
will help.
Jarek
On Tue, Jan 6, 2009 at 10:43 AM, Forrest_Xia <fo...@gmail.com> wrote:
>
> Recently I am trying to have a JAX-WS implementation for daytrader web
> services access mode.
>
> I can make it work when I disabled JAX-RPC in configuration files, but when
> I try to make two web services access mode working in the same time, there
> is a deployment exception appeared like this:
> "Deployer operation failed: POJO web service: TradeImplwJAXWS not configured
> by any web service builder
> org.apache.geronimo.common.DeploymentException: POJO web service:
> TradeImplwJAXWS not configured by any web service builder
> at
> org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:449)
> at
> org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:165)
> at
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:662)
> at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
> at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:599)
> at
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
> at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130)
> at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:850)
> at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:237)
> at
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
> at
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
> at java.lang.Thread.run(Thread.java:735)"
>
> I searched web and found a JIRA GERONIMO-3005 ->
> https://issues.apache.org/jira/browse/GERONIMO-3005 related, seems it has
> been fixed in the trunk. But still I got the similar exception, why?
>
> Thanks in advance for any insight!
>
> Forrest
> --
> View this message in context: http://www.nabble.com/Can-we-use-JAX-RPC-and-JAX-WS-in-the-same-time-in-a-JEE-application--tp21312861s134p21312861.html
> Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
>
>