File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes xslt transformation not working in WAS6.1 server start mode Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "xslt transformation not working in WAS6.1 server start mode" Watch "xslt transformation not working in WAS6.1 server start mode" New topic
Author

xslt transformation not working in WAS6.1 server start mode

priya verma
Greenhorn

Joined: May 09, 2007
Posts: 13
Hi All,

I have a xslt transformation code. In RAD 7.0 (on WAS 6.1 or WAS 7), when I start my server in debug mode, the xslt transformation is happening properly without errors. However when I start my server in normal(start) mode, the xslt transformation code throughs following error:

[i]wsjar:file:/C:/MyApp/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/MyApp.ear/WebSrv.jar!/XSL/Response.xsl; Line #12; Column #58; java.lang.ClassCastException: org.apache.xpath.objects.XString incompatible with org.apache.xpath.objects.XNodeSet


When I run the same xslt transformation in RAD 6.0 ( WAS 5.1 ), it works correctly in server start and debug mode.As xslt code is running fine in server debug mode, I think there is no problem in the code. I am not able to make out what is the difference between the WAS 5.1 and WAS 6.1/7 and the difference between WAS server start and debug mode, that is causing this error?

Could anybody please help me in the same!

Thanks in advance!

Priya
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

You likely have a classloader issue.

Different versions of WebSphere gets packaged with different versions of various files. If a newer version of WebSphere has updated their libraries, the old libraries you are depending upon might cause problems.

What is the name of that jar file your problem class is packaged in? Look on your classpath for similar named jar files. Perhaps you can find another implementation of these class files somewhere else on the classloader hierarchy.

Alternatively, sometimes just switchning the classloader to parent-last, especially if you have the jar files packaged within the web application, will force WebSphere to use your own version, rather than the servers version.

Here's a little tutorial I put together on classloading and application packaging with WebSphere. You might find it helps to explain what is happening with your varous classloaders:

Understanding WebSphere Classloaders: Classloaders Demystified

-Cameron McKenzie


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

And if your application includes a jar file containing Apache's implementation of XPath -- or any other apparently related jar file -- try not including that jar file.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: xslt transformation not working in WAS6.1 server start mode
 
Similar Threads
RAD: XSL translation does work when server is started in start mode
XSLT : java.lang.ClassCastException: XString incompatible with xNodeSet
not able to add project to my server
Difference between Test Environment and Stand alone server
Code works in debug but does not work in regular run