org.xml.sax.SAXParseException: Content is not allowed in prolog

前端 未结 30 2322
别那么骄傲
别那么骄傲 2020-11-22 02:54

I have a Java based web service client connected to Java web service (implemented on the Axis1 framework).

I am getting following exception in my log file:

30条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 03:42

    For the same issues, I have removed the following line,

      File file = new File("c:\\file.xml");
      InputStream inputStream= new FileInputStream(file);
      Reader reader = new InputStreamReader(inputStream,"UTF-8");
      InputSource is = new InputSource(reader);
      is.setEncoding("UTF-8");
    

    It is working fine. Not so sure why that UTF-8 gives problem. To keep me in shock, it works fine for UTF-8 also.

    Am using Windows-7 32 bit and Netbeans IDE with Java *jdk1.6.0_13*. No idea how it works.

提交回复
热议问题