File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes jax-ws in glassfish server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "jax-ws in glassfish server" Watch "jax-ws in glassfish server" New topic

jax-ws in glassfish server

aruna sydu
Ranch Hand

Joined: Jan 21, 2008
Posts: 98

Hi ,

I am new to webservices, trying to deploy Calculator webservice in Glassfish.But getting exceptions.

1.Wrote the implementation bean with annotations..

2.Compiled the implementation Class
3.Used wsgen command to generate Artifacts.
4.In web.xml created the impl class as an servlet

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns=""
xmlns:xsi="" version="2.5"

<description>WebTier for the Calculator Service</description>

<description>Endpoint for Calculator Web Service</description>



5.packaged into a war file.

6.deployed into the glassfish as a war file from admin console.

Now after deploying i see the following exception

Exception while deploying the app :
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: java.lang.ClassCastException: endpoint.Calculator

Did i miss anything during the deployment...
Please let me know.

Thanks in Advance.


Attitude Determines Altitude

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
I see some errors in the procedure you described, so I suggest you to follow a tutorial, at least until you familiarized yourself with the basic process of developing web services. Take a look at:
Best wishes!
aruna sydu
Ranch Hand

Joined: Jan 21, 2008
Posts: 98

Hi Ivan,

Does declared in the web.xml have any impact ...!

When i remove that from the deployment descriptor it is not throwing any error..
However i am not able to see the WSDL in the browser...
when i say http://localhost:8080/CalculatorService/CalculatorService?WSDL...

ALSO i am using eclipse ide for webservices and not netbeans.
Can you please point me an example that is developed and deployed using eclipse if you can.

Thanks for the support.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
If you are developing JAX-WS on GlassFish, there is no need whatsoever to use a web.xml deployment descriptor file, GlassFish will automatically generate this for you when you deploy your web service.
Take a look at my SCDJWS 5 notes - there are a lot of code examples in there and everything was developed using Eclipse and GlassFish.
Best wishes!
aruna sydu
Ranch Hand

Joined: Jan 21, 2008
Posts: 98

Hi Ivan,

Thanks for the prompt reply and support.
I was able to deploy the sample application.

I agree. Here's the link:
subject: jax-ws in glassfish server
jQuery in Action, 3rd edition