StreamResult on windows is fine but not in AIX

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

LVL 12
jazzIIIloveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Result  output = new StreamResult(new File("C:\\jazz.abc"));

Open in new window

Why would you use such a path on AIX?
0
jazzIIIloveAuthor Commented:
Ah, my mistake. It is the same when i give /path/to/save
0
CEHJCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

jazzIIIloveAuthor Commented:
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
CEHJCommented:
What boolean value did you get?
0
jazzIIIloveAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.