Skip to main content

Web Service Creation error with Glassfish 2

Posted by ddevore on February 28, 2008 at 5:40 PM PST

Lately I have been working with EJB 3.0, and I love it. For quick tests and to see what is being returned I threw web services around them. The services ended up being a really nice and easy test though it pointed out a bug in Glassfish 2. The bug has beenentered as an issue in Glassfish here if you are interested. Basically the problem is that if you have two services with operations that have the same name the WSDL generation becomes confused and creates the WSDL definition for one of the operations and uses it for both of the services. This leads to a problem that one of the operations will always throw an exception. If this isn't bad enough the duplicated operation is not always the same one, this took a while to track down why my service was erroring because sometimes it would throw an exception and sometimes it wouldn't.

Anyway I posted the problem to the Glassfish mail group and Bhakti Mehta replied and confirmed the bug and submitted it as an issue for me. He also found a workaround for me. So if you are having a problem simply add the following two annotations to the operations that are having the problem.


Thanks Bhakti for the help.

Related Topics >>