|
View:
New views
17 Messages
—
Rating Filter:
Alert me
|
|
|
Broken Fault handling in MetroI have a Fault containing a data object. If I deploy my service to Tomcat using Metro 1.5, the returned SOAP message looks like this:
<S:Body> <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"> <faultcode>S:Server</faultcode> <faultstring>Book already present with matching ISBN</faultstring> <detail> <addDuplicate:addDuplicate xmlns:addDuplicate="http://ws.sosnoski.com/library/wsdl" xmlns="http://ws.sosnoski.com/library/wsdl" xmlns:ns2="http://ws.sosnoski.com/library/types"> <book xmlns:ns8="http://ws.sosnoski.com/library/wsdl" xmlns="" isbn="0445203498" type="scifi"> <ns2:author>Cook, Glen</ns2:author> <ns2:title>The Dragon Never Sleeps</ns2:title> </book> </addDuplicate:addDuplicate> <ns2:exception xmlns:ns2="http://jax-ws.dev.java.net/" class="com.sosnoski.ws.library.metro.AddDuplicateFault" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false"> <message>Book already present with matching ISBN</message> <ns2:stackTrace> <ns2:frame class="com.sosnoski.ws.library.metro.MetroLibraryImpl" file="MetroLibraryImpl.java" line="48" method="addBook"/> <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/> <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke"/> <ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke"/> <ns2:frame class="java.lang.reflect.Method" file="Method.java" line="585" method="invoke"/> ... The Fault object returned on the client is missing any data in this case - the expected addDuplicate component of the Fault detail appears to be discarded. Is this by design? I've verified that setting -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace=false on the server prevents the stack trace from being sent, and in that case the Fault data is correctly returned to the client. [Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=369786 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroThis is odd behavior. Does the fromwsdl sample (that has wsdl faults) in Metro 1.5 work fine in your environment?
Also, We made some changes to embedding the stack trace in JAX-WS 2.2/Metro 2.0 due to interop issues. See https://jax-ws.dev.java.net/issues/show_bug.cgi?id=761 for more details. [Message sent by forum member 'ramapulavarthi' (rama.pulavarthi@...)] http://forums.java.net/jive/thread.jspa?messageID=370550 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroI've verified the behavior of the code on my system, using J2SE 1.5 which avoids any potential classpath conflicts with the 1.6 bundled versions of JAXB and JAX-WS. The Fault exception (AddDuplicateFault) is thrown with an AddDuplicate object as the faultInfo value, but this AddDuplicate object does not contain the expected book information from the Fault/detail. If I set the property on the server so that the stack trace is not included in the detail, the book information is returned as expected.
[Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=370643 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroI tried various JDK and Tomcat versions with Metro 1.5 and your sample application and cannot reproduce the issue. I am consistently getting this:
run: [java] Connecting to http://localhost:8080/metro-library/ [java] Retrieved 'Infinity Beach' [java] Retrieved 3 types: [java] 'java' with 3 books [java] 'scifi' with 4 books [java] 'xml' with 2 books [java] Failed adding 'The Dragon Never Sleeps' with ISBN '0445203498' - matches existing title 'The Dragon Never Sleeps' [java] Retrieved 4 books of type 'scifi': [java] 'Infinity Beach' [java] 'Aristoi' [java] 'Roadmarks' [java] 'The Dragon Never Sleeps' [Message sent by forum member 'ritzmann' (Fabian.Ritzmann@...)] http://forums.java.net/jive/thread.jspa?messageID=370645 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroOK, let's see if I can reproduce your environment:
- What version of Tomcat are you running exactly? - What libraries do you have in <CATALINA_HOME>/common/endorsed, shared/lib and endorsed? - What JDK are you using to run Tomcat - What JDK are you using to build server and client and run the client? [Message sent by forum member 'ritzmann' (Fabian.Ritzmann@...)] http://forums.java.net/jive/thread.jspa?messageID=370647 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroI can't reproduce the issue. I suspect that saaj or jax-ws implementation is picked up from somewhere other than Metro. Please run with ant -verbose and check the classpath. Is it possible to test the fromwsdl sample in Metro that has the wsdl faults?
[Message sent by forum member 'ramapulavarthi' (rama.pulavarthi@...)] http://forums.java.net/jive/thread.jspa?messageID=370732 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroI've tried it on another system with the same results. Both systems are running Mandriva Linux 2009.1. Here's the ant -verbose output from the second system:
Apache Ant version 1.6.5 compiled on June 2 2005 Buildfile: build.xml Detected Java version: 1.5 in: /usr/java/jdk1.5.0_16/jre Detected OS: Linux parsing buildfile /home/dennis/devworks/jws09/configuredcode/build.xml with URI = file:///home/dennis/devworks/jws09/configuredcode/build.xml Project base dir set to: /home/dennis/devworks/jws09/configuredcode [property] Loading /home/dennis/devworks/jws09/configuredcode/build.properties Build sequence for target(s) `run' is [run] Complete build sequence is [run, compile-server, clean, generate, compile-client, build-client, package, build-server, prepare, ] run: [java] Executing '/usr/java/jdk1.5.0_16/jre/bin/java' with arguments: [java] '-classpath' [java] '/home/dennis/devworks/jws09/configuredcode/gen/bin:/home/dennis/devworks/jws09/configuredcode/client/bin:/home/dennis/tools/metro-1.5/lib/webservices-api.jar:/home/dennis/tools/metro-1.5/lib/webservices-extra-api.jar:/home/dennis/tools/metro-1.5/lib/webservices-extra.jar:/home/dennis/tools/metro-1.5/lib/webservices-rt.jar:/home/dennis/tools/metro-1.5/lib/webservices-tools.jar' [java] 'com.sosnoski.ws.library.metro.WebServiceClient' [java] 'localhost' [java] '8080' [java] '/metro-library/' [java] [java] The ' characters around the executable and arguments are [java] not part of the command. [java] Connecting to http://localhost:8080/metro-library/ [java] Retrieved 'Infinity Beach' [java] Retrieved 3 types: [java] 'java' with 3 books [java] 'scifi' with 4 books [java] 'xml' with 2 books [java] Exception in thread "main" java.lang.NullPointerException [java] at com.sosnoski.ws.library.metro.WebServiceClient.main(WebServiceClient.java:85) BUILD FAILED My JRE lib directory does not have an endorsed directory present, so nothing's coming from there. On the server side, I'm using Tomcat 6.0.20, started via bin/startup.sh, with only the lib directory present (no common, shared, or endorsed directories). If you monitor what's actually sent over the line, do you see the stack trace information? That seems to be the cause of the client problem in my tests, since when I disable sending the stack trace the client works without a problem. [Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=370759 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroOh, and this second system is a 64 bit Linux and JVM, vs 32 bit Linux and JVM on the original.
[Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=370760 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroAnd yet another thing - I'm using a Sun JVM downloaded directly from Sun, not the one that comes with the Mandriva installation:
java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-b02, mixed mode) The download file name (I keep them around for multiple installs without re-downloading) is jdk-1_5_0_16-linux-amd64.bin [Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=370761 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroI've now gotten this working correctly, but I have no idea how. I tried first removing all other web applications from the Tomcat installation (there had been an Axis2 installation, as well as a couple of other Metro applications), but still saw the problem. I then reinstalled Metro and rebuilt, and the test started working - but when I compared the jars in the old and new Metro installation they were all identical, and when I switched back to the original installation of Metro 1.5 and rebuilt again it [i]still[/i] worked.
The key difference in the XML sent over the wire is that the broken version had no namespace for the <book> element within the Fault/detail data, which did not match the schema - so that explains why the client returned a null for the book information. Anyone have any idea what could possibly have caused this namespace issue on the server, only in the case where a stack trace was being sent? Since this appears to have been a fluke issue (definitely a server problem, but since the Tomcat installation on the second system, including web applications, was a copy of that on the first it wasn't an independent recreation of the problem), I'll remove discussion of it from the developerWorks article. [Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=370770 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroMy guess would be that Tomcat had picked up an outdated JAXP implementation from the Axis installation and removing Axis resolved that issue.
One thing I noticed is that you are including the Metro libraries in the web application. Generally, I would advise to install Metro in Tomcat and not include the libraries in the web application itself. The reason is that this is the only way to make sure the Metro implementation is picked up under JDK 6 and not the JDK internal code. [Message sent by forum member 'ritzmann' (Fabian.Ritzmann@...)] http://forums.java.net/jive/thread.jspa?messageID=370890 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in Metro> My guess would be that Tomcat had picked up an
> outdated JAXP implementation from the Axis > installation and removing Axis resolved that issue. That sounds plausible, but surprising - Tomcat should be isolating different web applications from each other. > One thing I noticed is that you are including the > Metro libraries in the web application. Generally, I > would advise to install Metro in Tomcat and not > include the libraries in the web application itself. > The reason is that this is the only way to make sure > the Metro implementation is picked up by Tomcat under > JDK 6 and not the JDK internal code. That's one of the issues with bundling tools like JAXB and JAX-WS into the JRE, and one of the major drawbacks with using these tools rather than open source equivalents - at least if you're using J2SE 1.6 rather than 1.5. Production environments may involve many different applications running on the same web server. It can be very difficult to change all these applications over to use a new version of a particular software component at one time. Having the jars in the web application rather than in the web server itself makes it possible to independently upgrade the applications, so generally I recommend this approach. It's certainly difficult if not impossible to use this kind of independent approach with JAXB/JAX-WS and J2SE 1.6+, though. > If I recall right, unfortunately the Metro 1.5 > installation scripts don't support Tomcat 6. Tomcat 6 > uses a different (undocumented) endorsed directory by > default and the Metro 1.5 installation will miss > that. Metro 2.0 does not have that issue. Metro 2.0 > has not been released thus far but is very stable and > well tested. I'll definitely take a look at the improvements in Metro 2.0 when that's released. I do tend to stay with released versions of projects, though, since many organizations have a policy of only working with official releases. [Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=370970 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in Metro> That's one of the issues with bundling tools like
> JAXB and JAX-WS into the JRE, and one of the major > drawbacks with using these tools rather than open > source equivalents - at least if you're using J2SE > 1.6 rather than 1.5. > > Production environments may involve many different > applications running on the same web server. It can > be very difficult to change all these applications > over to use a new version of a particular software > component at one time. Having the jars in the web > application rather than in the web server itself > makes it possible to independently upgrade the > applications, so generally I recommend this approach. > It's certainly difficult if not impossible to use > this kind of independent approach with JAXB/JAX-WS > and J2SE 1.6+, though. FWIW... This was precisely the issue we had last year deploying some of our first JAX-WS services on Websphere 6.1 (without its [u]FeaturePack[/u] add-on). It was however, JDK 5. We used the JAX-WS RI 2.1.5 (not the full Metro distribution), had the build process copy the JARs from that distribution into WEB-INF/lib of the WAR file we were building. We then adjusted the WAS 6.1 classloader policy to use PARENT_LAST and classloader per WAR and we were able to successfully deploy a number of JAX-WS endpoints this way. Another team using WAS 6.1, this time [u]with[/u] the FeaturePack add-on that included Axis2 was not so lucky. No matter what they tried, class collisions and other issues kept occurring preventing the enpoint was ever working. Fortunately, it appears that with WAS [b]7[/b] (JDK 6), fixes were made so that using the classloader policy adjustment, JAX-WS endpoints deployed w/ the Sun JAX-WS RI JARs in the WEB-INF/lib of the WAR itself will work along side those deployed as JAX-WS endpoint services developed using the OOTB WAS 7/JDK6 tooling that relies uses the Axis2 runtime. The other thing we insured was that the application build process used the [i]wsimport[/i] and [i]wsgen[/i] tools that were in [u]JAX-WS RI distribution[/u] and not the IBM JDK 6 bundled in WAS 7. [Message sent by forum member 'mcs130' (mcs130@...)] http://forums.java.net/jive/thread.jspa?messageID=370976 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroYes, bundling at the application server level can be just as bad as at the JRE level. Either way, you're stuck with using a particular version of the software for all your applications - and that version isn't even under your direct control. I generally prefer to just use a minimal servlet engine and then add in whatever components are necessary at the individual application level.
[Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=371025 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroYes, as you know, there is not much we can do with a technology like the JAX-WS reference implementation once it is included in the JRE. Some application servers provide very fine-grained classloading options that may allow to override these classes per web application. The Servlet specification does not actually allow to override system classes per web application but that may be preferable over setting endorsed libraries for the entire server.
[Message sent by forum member 'ritzmann' (Fabian.Ritzmann@...)] http://forums.java.net/jive/thread.jspa?messageID=371130 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in Metro>> My guess would be that Tomcat had picked up an
>> outdated JAXP implementation from the Axis >> installation and removing Axis resolved that issue. >That sounds plausible, but surprising - Tomcat should be isolating different web applications from each other. From your earlier posts, I understand as you installed Axis on Tomcat. Though you bundle Metro libraries in Metro application, It would still up the libraries from Axis in Tomcat and not from WebApp unless you set <Loader delegate=false> in the Tomcat configuration. Did you set this? To me it sounds like its picking up from Axis and a bug in it with handling fault messages, Can you paste the SOAP Fault message generated in that environment. [Message sent by forum member 'ramapulavarthi' (rama.pulavarthi@...)] http://forums.java.net/jive/thread.jspa?messageID=371180 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Broken Fault handling in MetroWhen I referred to an Axis2 installation, I just meant that an axis2.war file was present as a web application, with the Axis2 jars in the .war file - not that the Axis2 jars had been added to the Tomcat classpath.
The original posting in this thread had the SOAP Fault message I was seeing generated. I later realized that the problem with the Fault was that the <book> element was somehow being written without a namespace, and hence was not recognized by the client. Setting -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace=false on the server eliminated the problem, which was why I thought it was caused by the stack trace information being included in the Fault/detail. And I could see from the stack trace details in the Fault that the Metro classes were being used for the actual processing, at least for those classes with stack frames. [Message sent by forum member 'dsosnoski' (dms@...)] http://forums.java.net/jive/thread.jspa?messageID=371215 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |