For a simple 109 based service, checkout
http://blogs.sun.com/vijaysr
and read the blog titled "A Webservice and a Client in 5 simple steps
using Glassfish".
This tech tip may also be of use :
http://java.sun.com/developer/EJTechTips/2005/tt1220.html#1
Vijay
Antonio Goncalves wrote:
> Ok, I've taken out the sun-jaxws.xml from the war file. At deployment
> I've got an exception but I can see the WSDL through admin console
> (but not test the web service - HTTP 503 The requested service is not
> currently available).
>
> I have to be honest, I'm getting confused with the examples in the
> tutorial that use the sun-jaxws.xml file, the apt/wsgen/wsimport tool
> that I don't know in which order to use anymore, web.xml verion 2.5 vs
> 2.4... I have the impression that I cannot find a simple example that
> uses the fresh Glassfish V2b21 (and the 109 deployment). Is there any
> fresh example/tutorial/article about that ?
>
> Thank you for any help,
>
> Antonio
>
>
> PS : The exception stack trace
>
>
> [#|2006-10-19T10:38:33.273+0200|SEVERE|sun-appserver-pe9.1|javax.enterprise.resource.webservices.jaxws.server.http|_ThreadID=12;_ThreadName=httpWorkerThread-8282-1;_RequestID=933859d9-a70b-4c86-a3b1-9fcf93a8d360;|WSSERVLET11:
> failed to parse runtime descriptor: Unable to create StAX reader or
> writer
> Unable to create StAX reader or writer
> at
> com.sun.xml.ws.streaming.XMLStreamReaderFactory.createFreshXMLStreamReader(XMLStreamReaderFactory.java:107)
> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse
> (DeploymentDescriptorParser.java:129)
> at
> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:90)
> at org.apache.catalina.core.StandardContext.listenerStart
> (StandardContext.java:4236)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
> at com.sun.enterprise.web.WebModule.start(WebModule.java:297)
> at org.apache.catalina.core.ContainerBase.addChildInternal
> (ContainerBase.java:833)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:817)
> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
> at com.sun.enterprise.web.WebContainer.loadWebModule
> (WebContainer.java:1485)
> at
> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1149)
> at
> com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:171)
>
> at
> com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:275)
> at
> com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java
> :948)
> at
> com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:935)
> at
> com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java
> :448)
> at
> com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:160)
> at
> com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java
> :295)
> at
> com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:204)
> at
> com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java
> :285)
> at
> com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:119)
> at
> com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases
> (PEDeploymentService.java:871)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:541)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java
> :585)
> at
> com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:719)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean
> (MBeanHelper.java:353)
> at
> com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:336)
> at
> com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:448)
> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
> (DynamicMetaDataImpl.java:213)
> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
> (JmxMBeanServer.java:784)
> at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke (Method.java:585)
> at
> com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:77)
> at $Proxy1.invoke(Unknown Source)
> at
> com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java
> :297)
> at
> com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:56)
> at
> com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:142)
>
> at
> com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:109)
> at
> com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost
> (RemoteJmxConnectorServlet.java:180)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.apache.catalina.core.ApplicationFilterChain.servletService
> (ApplicationFilterChain.java:397)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at org.apache.catalina.core.StandardPipeline.invoke
> (StandardPipeline.java:556)
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:246)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :182)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at
> com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
> at org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:939)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at org.apache.catalina.core.StandardPipeline.invoke
> (StandardPipeline.java:556)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter
> (DefaultProcessorTask.java:618)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process
> (DefaultProcessorTask.java:789)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:328)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java
> :251)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
> at
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run
> (WorkerThreadImpl.java:103)
> Caused by: java.net.MalformedURLException
> at java.net.URL.<init>(URL.java:601)
> at java.net.URL.<init>(URL.java:464)
> at java.net.URL.<init>(URL.java:413)
> at
> com.sun.xml.ws.streaming.XMLStreamReaderFactory.createFreshXMLStreamReader(XMLStreamReaderFactory.java:102)
> ... 73 more
> |#]
>
> [#|2006-10-19T10:38:33.289+0200|SEVERE|sun-appserver-pe9.1|javax.enterprise.system.container.web|_ThreadID=12;_ThreadName=httpWorkerThread-8282-1;_RequestID=933859d9-a70b-4c86-a3b1-9fcf93a8d360;|WebModule[/barkbank]PWC1275:
> Exception sending context initialized event to listener instance of
> class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
> WSSERVLET11: failed to parse runtime descriptor: Unable to create StAX
> reader or writer
> at
> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized
> (WSServletContextListener.java:100)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4236)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
> at com.sun.enterprise.web.WebModule.start (WebModule.java:297)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:833)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:817)
> at org.apache.catalina.core.StandardHost.addChild (StandardHost.java:662)
> at
> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1485)
> at
> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1149)
> at
> com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed
> (WebModuleDeployEventListener.java:171)
> at
> com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:275)
> at
> com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener
> (AdminEventMulticaster.java:948)
> at
> com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:935)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent
> (AdminEventMulticaster.java:448)
> at
> com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:160)
> at
> com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent
> (DeploymentNotificationHelper.java:295)
> at
> com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:204)
> at
> com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent
> (ServerDeploymentTarget.java:285)
> at
> com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:119)
> at
> com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java
> :95)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:541)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:585)
> at
> com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:719)
> at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke (Method.java:585)
> at
> com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:353)
> at
> com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:336)
> at com.sun.enterprise.admin.config.BaseConfigMBean.invoke
> (BaseConfigMBean.java:448)
> at
> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
> (DefaultMBeanServerInterceptor.java:815)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
> at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:77)
> at $Proxy1.invoke(Unknown Source)
> at
> com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:297)
> at
> com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:56)
> at
> com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle
> (MBeanServerRequestHandler.java:142)
> at
> com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:109)
> at
> com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost
> (RemoteJmxConnectorServlet.java:180)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.apache.catalina.core.ApplicationFilterChain.servletService
> (ApplicationFilterChain.java:397)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at org.apache.catalina.core.StandardPipeline.invoke
> (StandardPipeline.java:556)
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:246)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :182)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at
> com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
> at org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:939)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at org.apache.catalina.core.StandardPipeline.invoke
> (StandardPipeline.java:556)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter
> (DefaultProcessorTask.java:618)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process
> (DefaultProcessorTask.java:789)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:328)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java
> :251)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
> at
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run
> (WorkerThreadImpl.java:103)
> Caused by: Unable to create StAX reader or writer
> at
> com.sun.xml.ws.streaming.XMLStreamReaderFactory.createFreshXMLStreamReader(XMLStreamReaderFactory.java:107)
> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse
> (DeploymentDescriptorParser.java:129)
> at
> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:90)
> ... 71 more
> Caused by: java.net.MalformedURLException
> at java.net.URL.<init>(URL.java:601)
> at java.net.URL.<init>(URL.java:464)
> at java.net.URL.<init>(URL.java:413)
> at
> com.sun.xml.ws.streaming.XMLStreamReaderFactory.createFreshXMLStreamReader
> (XMLStreamReaderFactory.java:102)
> ... 73 more
> |#]
>
> [#|2006-10-19T10:38:33.289+0200|SEVERE|sun-appserver-pe9.1|org.apache.catalina.core.StandardContext|_ThreadID=12;_ThreadName=httpWorkerThread-8282-1;_RequestID=933859d9-a70b-4c86-a3b1-9fcf93a8d360;|PWC1306:
> Context startup failed due to previous errors|#]
>
>
>
>
> 2006/10/18, Vijay Ramachandran <Vijay.Ramachandran_at_sun.com
> <mailto:Vijay.Ramachandran_at_sun.com>>:
>
> This is a bug which has been fixed in GFv2-b23
>
> Vijay
>
> Antonio Goncalves wrote:
> > Interesting. I've just moved from Glassfish V2b21 to V2b19 and
> > redeployed my WebService. This time, the link to the WSDL file works
> > but when I click on Test, instead of opening a popup, I've got the
> > folowing exception :
> >
> > javax.servlet.ServletException : PWC1244: Servlet execution threw an
> > exception
> > com.sun.xml.ws.util.ServiceConfigurationError:
> > com.sun.tools.ws.api.wsdl.TWSDLExtensionHandler: Provider
> > com.sun.tools.ws.addressing.jaxws.TWsaWSDLExtensionHandler not found
> >
> > Any idea ?
> >
> > 2006/10/17, Antonio Goncalves <antonio.mailing_at_gmail.com
> <mailto:antonio.mailing_at_gmail.com>
> > <mailto: antonio.mailing_at_gmail.com
> <mailto:antonio.mailing_at_gmail.com>>>:
> >
> > Hi,
> >
> > I've developed a simple WebService and I'm trying to test it
> with
> > the admin console but can't (Glassfish V2bv21). The admin
> console
> > display a "null" link for the WSDL file and clicking on "Test"
> > opens a popup window with the right menu of the admin console on
> > it... that's all.
> >
> > I don't know what I'm doing wrong. Here are my steps :
> >
> > 1 - Develop a simple web service
> >
> > @WebService
> > public class Validation {
> >
> > @WebMethod(operationName = "ValidateCard")
> > @WebResult(name = "isCardValid")
> > public boolean validateCreditCard(@WebParam
> > (name="creditCardNumber") String ccNumber,
> > @WebParam
> > (name="creditCardType") String ccType,
> > @WebParam
> > (name="expiryDate") String ccExpiryDate) {
> >
> > (...) business code (...)
> >
> > }
> >
> > 2 - Generate artifacts with WSGen (I have to say i got a bit
> > confused because I didn't know if I had to use apt or wsgen). I
> > get ValidateCreditCard.java and ValidateCreditCardResponse.java
> > classes
> > 3 - Package all these 3 classes with web.xml and sun-jaxws.xml
> > into a war file
> > --> sun-jaxw.xml
> > <endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime '
> > version='2.0'>
> > <endpoint
> > name='ValidationService'
> > implementation=' com.barkbank.validator.Validation'
> > url-pattern='/validation'/>
> > </endpoints>
> > --> web.xml
> >
> > <web-app version="2.5" (...) >
> >
> > <listener>
> >
> >
> <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener
> </listener-class>
> > </listener>
> > <servlet>
> > <servlet-name>ValidationService</servlet-name>
> >
> >
> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet
> </servlet-class>
> > </servlet>
> > <servlet-mapping>
> > <servlet-name>ValidationService</servlet-name>
> > <url-pattern>/validation</url-pattern>
> > </servlet-mapping>
> > </web-app>
> >
> > 4 - and deploy. I can see my web app and WebService in the
> > console... but I cannot test it or see the wsdl file.
> >
> > What am I doing wrong ?
> >
> > Thanks,
> >
> > Antonio
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> <mailto:users-unsubscribe_at_glassfish.dev.java.net>
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> <mailto:users-help_at_glassfish.dev.java.net>
>
>