File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IoException when opening stream from Url in WL 8.1 SP3

 
meka toka
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an application perfectly deployed on WL 8.1 SP1 but when I deploy the same on WL 8.1 SP3 it fails.

It is failing when I try to open a stream from a Url, that in turn has been created from a String (path of the file). Now the required resource is inside a WAR. Following is sample of code

java.io.InputStream stream = new URL(resourcePath).openStream());

The resourcePath is path to a file properties.xml to which I am trying to open and it is located in a mywar.war

WL is trying to access the jar file as zip:C:/bea/user_projects/domains/mydomain/myserver/.wlnotdelete/myproj/mywar.war!/webapp/xml/common/properties.xml

I havent come across any change in SP3 that can lead to the above error.
[ March 16, 2005: Message edited by: meka toka ]
 
meka toka
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok it seems that its not an IOException, I am getting the following error

javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: A location step was expected following the '/' or '//' token.

when doing the following

javax.xml.transform.Templates templates = transFact.newTemplates(xslSource);

where transFact is a javax.xml.tranform.TransformFactory and xslSource is a InputSpurce created as said in the first post earlier.

On doing some research its says its because of some bug fixes in Xalan, but then some point its with JDK1.4.2

if any one experienced this please post how you solved it
 
meka toka
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the answer myself.

I had some XSL files which had the nodes selecting using something like below




Looks like the above way of selecting nodes was fine with JDK1.4.1 but with JDK 1.4.2 it wouldnt work as it was having problem finding a location path stop.

All I had to do was remove the trailing slash. SO I changed it to




When doing research for this, I came across alot of people looking for solutions in similar situations and are confused that its because of some problem with WL 8.1 SP3. But the main reason is because the working of the TransformerFactory has changed from JDK1.4.1 to JDK 1.4.2

Hope this helps
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic