?
Solved

StreamResult on windows is fine but not in AIX

Posted on 2014-08-20
6
Medium Priority
?
109 Views
Last Modified: 2014-09-07
Hi;

I am doing xml manipulation. My code works fine on Windows but fails in AIX without throwing any exception. The idea is that it should create a file in a local directory but cannot for AIX..

expression = "/my/xpath";
            Node stateNode = (Node) xPath.compile(expression).evaluate(xmlResultDocument, XPathConstants.NODE);

            Transformer transformer = TransformerFactory.newInstance().newTransformer();

           Result  output = new StreamResult(new File("C:\\jazz.abc"));
           Source input = new DOMSource(stateNode);

            transformer.transform(input, output);

Open in new window

0
Comment
Question by:jazzIIIlove
  • 3
  • 3
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 40274984
Result  output = new StreamResult(new File("C:\\jazz.abc"));

Open in new window

Why would you use such a path on AIX?
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 40275639
Ah, my mistake. It is the same when i give /path/to/save
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 40275825
Make sure you're not ignoring any exceptions ( http://technojeeves.com/index.php/aliasjava1/94-ignoring-exceptions-is-dangerous
 ) and ensure the following returns true
new File("/path/to/save").canWrite() 

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 12

Author Comment

by:jazzIIIlove
ID: 40276171
Hi,

My catch block is detailed so no exception got lost on the way.

The code works fine on Windows but fails in AIX, both of which are JDK1.6
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 40276278
What boolean value did you get?
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 40276809
oh oh, sorry. I had checked your above comment, on my iphone and canWrite was trimmed there.

i find out that to the given path, there is no right to generate a file. I will come back next week for this case.

Regards.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question