• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML content is not forming when running from server

 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I fix the exception block and even then i am not able to see any excpetion in the console.
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic