Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

xml parer error

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fatal Error] :-1:-1: Premature end of file.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
[Fatal Error] :1:23: Content is not allowed in prolog.
.........................................
vidya raj: [Fatal Error] :1:27: The markup in the document preceding the root element must be well-formed.
[Fatal Error] :1:23: The markup in the document preceding the root element must be well-formed.
[Fatal Error] :1:32: XML document structures must start and end within the same entity.
[Fatal Error] :1:72: XML document structures must start and end within the same entity.



In the weblogic managed server error , we are facing this error after restarting the server. I am not able to identify which xml is giving this problem. There are 1000s of xml , is there any way to trouble shoot which xml is giving ths problem.

Thanks

vidyaraj
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about writing a simple DOM reader to scan all the files. It can be located very quickly

Lin
 
vidyaraj sarma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you have any code to read the folder, please send the same.
thanks
vidyaraj
 
Lin Feng
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can follow any xml parser samples to do it.

Lin
 
vidyaraj sarma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to xml that why i am seeking your kind help.
if you have just paste the same.
 
Lin Feng
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
using jdk 1.4 above

import javax.xml.parsers ;
import java.io.*;
public class XmlValidator
{
public static void main (String args[])
{
// suppose the argument passing the file name

try
{
DocumentBuilderFactory factory ;
DocumentBuilder builder;
factory = DocumentBuilderFactory.newInstance();
builder = factory.newDocumentBuilder();
builder.parse(new File(args[0]);
}
catch(Exception ex)
{
System.out.println("Something wrong");
ex.printStackTrace();
}
}


}
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic