Hi Ben, nice message to the list. I smiled and thought 'fine, I'm not alone on this planet ...' ;) But for your FAQ-question; have a look at the knowledge base of wso2 http://wso2.net/kb There are really some usefull articles / comments. Nearly the first thing I start my axis-work a day, is having a look at this :)
HTH Bille > -----Ursprüngliche Nachricht----- > Von: [email protected] > Gesendet: 19.06.06 23:38:40 > An: <[email protected]> > Betreff: A Solution to the Ubiquitious InvocationTargetException > > > Hi, everyone. > > > > > > This is a solution to a problem that Ive > seen a lot of people have with Axis, especially people just starting out with > it, who have not yet gone through the painJ > > > > > > Oh the pain, the pain... - Dr. > Smith on the old TV series Lost In Space. Anyway, back to > reality.... > > > > > > Google userException > InvocationTargetException hostname axis and youll see what I > mean. A lot of questions on this exception pattern without an answer. > > > > > > Anyway, since I found the answer (an > answer?), I thought Id post it for the group. Probably belongs in > some kind of FAQ for Axis if you agree. (Is there such?) > > > > > > Here is the symptom you will see in your > axis response: > > > > > > <?xml version="1.0" encoding="utf-8"?> > > > <soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > > > <soapenv:Body> > > > > <soapenv:Fault> > > > > <faultcode>soapenv:Server.userException</faultcode> > > > > <faultstring>java.lang.reflect.InvocationTargetException</faultstring> > > > > <detail> > > > > <ns1:hostname > xmlns:ns1="http://xml.apache.org/axis/">DEVED01</ns1:hostname> > > > > </detail> > > > > </soapenv:Fault> > > > > </soapenv:Body> > > > </soapenv:Envelope> > > > > > > Key parts of the symptom pattern are: > > > > > > (1) InvocationTargetException and > > > (2) The hostname is returned in the detail (and thats about > all). > > > > > > The essential problem is that Axis doesnt > give you a clue as to what is the underlying problem (as several people have > reported). Whats worse is that it appears to me that Axis is > swallowing the underlying error, since you have to actively trap it in your > code in order to see it. Specifically... > > > > > > The way to find the underlying error is to > add a catch for Throwable around the point where your server-side code first > starts running. (If you just catch Exception, Axis will still swallow > many of the common errors, and youre still left clueless.) Just beneath > your catch, you can, of course, add a printStackTrace and whatever other debug > info you would like for your app server (Tomcat in my case) to spit out to the > stdout (standard output) log (catalina.out or log4j log or whatever). Example: > > > > > > > > > In your generated <whatever>SOAPBindingImpl.java, > method, hand-modify it like so: > > > > > > try > { > > > //Your > app logic > > > } > catch (Throwable e) { > > > /* > > > * > Note: This is last-ditch attempt to catch anything throwable, > > > * > since Axis is apparently swallowing exceptions and not reporting them. > > > */ > > > e.printStackTrace(); > > > } > > > > > > Ben > This e-mail message may contain confidential and/or privileged information. > If you are not an addressee or otherwise authorized to receive this message, > you should not use, copy, disclose or take any action based on this e-mail or > any information contained in the message. If you have received this material > in error, please advise the sender immediately by reply e-mail and delete > this message. Thank you. > _____________________________________________________________________ Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! http://smartsurfer.web.de/?mc=100071&distributionid=000000000071 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
