Thursday, 18 February 2010

"javax.naming.Name is an interface, and JAXB can't handle interfaces" - Deployment Issues when using Eclipse to Deploy a JavaBean Web Service in to SAP Java AS

Hit an issue today when deploying an Enterprise JavaBen (EJB) web service today via Eclipse. I was exposing the SAP UWL through the UWL API - but it wouldn't deploy. I kept getting the following error in the deployment trace:
[com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
javax.naming.Name is an interface, and JAXB can't handle interfaces.]

Looking at all my @WebMethod annotations, there didn't seem to be any obvious problem:

@WebMethod(operationName="Test", exclude=false)
public int Test() throws UWLException, NamingException
IUser user =;

I examined the Eclipse debug trace to about line 100, I found an issue - that there was a problem with serialization:
Unable to generate serialization framework for web service UWLFacadeService

Turns out the deployment exception was really trying to tell me that "NamingException" is not serializable - and so cannot be surfaced through a Web Service. I changed my method to handle the NamingException errors internally (via try..catching them), and removed the throws statement on the Method. Without the requirement to serialize the exception, the deployment errors for my test EJB web service went away!



Mike said...

Nice Blog, I got lot of knowledge from it. Keep it up.

repair outlook PST file

office said...

The Tax Return Crack-Up<4>
Realizing he might have dug himself in there,Microsoft Office 2010the general emphasized that Office 2010he had spent some time as a junior Office 2007officer working "very closely Microsoft Officewith the Israeli air force" and that heMicrosoft Office 2007had found that "more cosmopolitan,Office 2007 key liberal version of the Israeli population" Office 2007 downloadto be just chock full Office 2007 Professionalof that sort of "goodwill" necessary Windows 7to give a bunch of land back Microsoft outlook 2010to the Palestinians.

Sagar said...

Thank you!!