Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes XML content is not forming when running from server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML content is not forming when running from server" Watch "XML content is not forming when running from server" New topic
Author

XML content is not forming when running from server

vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
My project requires of creating a xml file by reading partial datas from EXcel file and another partial datas from Database.

When i try running a program as a standalone, XML was created with no issues, but when i run from server its not thorwing any error. File was created but no content was present in it.



Did i miss anything.....Few chunks of code i had pasted.

Any ideas/suggestions are welcome.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10263
    
168

I did not look at your code in detail, but looks like you are catching the exception and just calling printStacktrace(). This is not a good thing to do (specially in a server environment). The code is effectively eating up the exception.



You might want to first fix that and see if there are any errors thrown during the program execution.

[My Blog] [JavaRanch Journal]
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
I fix the exception block and even then i am not able to see any excpetion in the console.
Aneesh Vijendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 125
HI,

Are you only catching :



There could be some other exception rather than this ones caught. Just put the:
catch(Throwable e)


Also try to put debug statements in every line inside the writeXML- for the time being just use:



But make sure you use log4j or other logging framework.

Cheers
Aneesh
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Catching throwable also not helping me(No errors displayed).

i am assuming my problem may be similar to the problem posted here.

http://forums.sun.com/thread.jspa?threadID=615318

please tell me how to force websphere to use xml-apis.jar provided by sun jdk.

I placed the xml-apis under web-inf/lib which was not working.

Thanks in advance

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10263
    
168

I don't know how that thread is related to your question. But to find out what's going on, you can attach a debugger (if you are using some IDE) and run your code.
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
To make code easier for others to understand, below is compact code



By running the above code as a standalone application the output was
Output : <?xml version="1.0" encoding="UTF-8"?>
<Document>
<Docid>1</Docid>
</Document>

But by running the above code in Websphere6.1, the output was
Output :

Nothing got printed in websphere console after the word output.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML content is not forming when running from server