• 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

Parse file exception

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a java class which is going to parse a XML file. Whenever I want to parse a XML file over the Internet I got an error when creating this object:

org.jdom.Document doc = parser.build("http://www.myDomain.com/myFiles/test.xml");

500 Servlet Exception
java.lang.StackOverflowError

If I choose to parse a file stored on my local machine it works. Why do I get this java.lang.StackOverflowError exception?


[ May 30, 2006: Message edited by: Jeppe Fjord ]
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try passing a url (java.net.URL) , instead of a string
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, it didn�t help to use a java.net.URL. I still get this exception:

500 Servlet Exception
java.lang.StackOverflowError


[ May 30, 2006: Message edited by: Jeppe Fjord ]
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at the stack trace and see what lines of code are involved in the problem.
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes that is my problem, because I don�t get any stackTrace???

JSP call:

Java method:


[ May 30, 2006: Message edited by: Jeppe Fjord ]
[ May 30, 2006: Message edited by: Jeppe Fjord ]
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're running this in a servlet. So "System.out" goes to some log file in your servlet container. Look there for the stack trace.
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Why do you think I am running the code in a servlet?

I call an ordinary Java class from a JSP page.

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP is Java Server Pages that get compiled into servlets. The fact that you are using Java code within the JSP makes it especially so, although anything with a suffix of .jsp will be compiled as a servlet regardless of whether there is any <% %> code. That's why he thinks you are running this in a servlet.
[ June 02, 2006: Message edited by: Pat Flickner ]
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I haven�t solved the problem...

I still got this Exception printed out in the browser:

500 Servlet Exception
java.lang.StackOverflowError

I am running the app on resin. Do you know where I can find the log file in the servlet container?
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the solution:

I just added which parser to use in the constructor:

org.jdom.input.SAXBuilder parser = new org.jdom.input.SAXBuilder("org.apache.xerces.parsers.SAXParser");

Now I also get the JDOM Exceptions.
 
What does a metric clock look like? I bet it is nothing like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic