Active3 months ago
- Org.xml.sax.saxexception Input Stream Is Not A Checkstyle Files
- Org.xml.sax.saxexception Inputstream Is Not A Checkstyle File
- Org.xml.sax.saxexception Input Stream Is Not A Checkstyle File Free
Is there an easy way to output the report in checkstyle format, for integration with Jenkins? Org.xml.sax.SAXException: Input stream is not a Checkstyle file. New Document From InputStream: DOM Document « XML « Java. Import org.xml.sax.SAXException. You may not * use this file except in compliance with the License. I am using sonar to generate Findbugs, Checkstyle and PMD reports, then feeding those reports to jenkins to generate graphs based on the xml files, but i get the.
I have been looking into this checkstyle plugin related gradle issue gradle/gradle#1416.One of the issues the original author has is a problem with the import-control.xml file remaining open after gradle has finished execution. Jenkins checkstyle plugin. Contribute to jenkinsci/checkstyle-plugin development by creating an account on GitHub. Also whats strange is that the report file generated is weird a combination of pmd rule set and the warnings generated. I am attaching the report as well and snapshots of pmd_report.xml as generated in jenkins workspace.
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:
abhi1,30111 gold badge1616 silver badges3030 bronze badges
ag112ag1123,96722 gold badges1515 silver badges4242 bronze badges
29 Answers
This is often caused by a white space before the XML declaration, but it could be any text, like a dash or any character. I say often caused by white space because people assume white space is always ignorable, but that's not the case here.
Another thing that often happens is a UTF-8 BOM (byte order mark), which is allowed before the XML declaration can be treated as whitespace if the document is handed as a stream of characters to an XML parser rather than as a stream of bytes.
The same can happen if schema files (.xsd) are used to validate the xml file and one of the schema files has an UTF-8 BOM.
ParkerHalo3,56288 gold badges2121 silver badges4444 bronze badges
Mike Sokolov5,91722 gold badges1818 silver badges3030 bronze badges
Actually in addition to Yuriy Zubarev's Post
When you pass a nonexistent xml file to parser. For example you pass
when only C:/temp/abc.xml file exists on your file system
In either case
or
All give the same error message.
Very disappointing bug, because the following trace
doesn't say anything about the fact of 'file name is incorrect' or 'such a file does not exist'. In my case I had absolutely correct xml file and had to spent 2 days to determine the real problem.
rogerdpack37.7k1919 gold badges145145 silver badges269269 bronze badges
EgorEgor
Try adding a space between the
encoding='UTF-8'
string in the prolog and the terminating ?>
. In XML the prolog designates this bracket-question mark delimited element at the start of the document (while the tag prolog in stackoverflow refers to the programming language).Added: Is that dash in front of your prolog part of the document? That would be the error there, having data in front of the prolog,
hardmathhardmath-<?xml version='1.0' encoding='UTF-8'?>
.7,99322 gold badges2828 silver badges5757 bronze badges
I had the same problem (and solved it) while trying to parse an XML document with freemarker.
I had no spaces before the header of XML file.
The problem occurs when and only when the file encoding and the XML encoding attribute are different. (ex: UTF-8 file with UTF-16 attribute in header).
So I had two ways of solving the problem:
- changing the encoding of the file itself
- changing the header UTF-16 to UTF-8
3,89466 gold badges3636 silver badges6666 bronze badges
user2575850
It means XML is malformed or the response body is not XML document at all.
Yuriy ZubarevYuriy Zubarev
Just spent 4 hours tracking down a similar problem in a WSDL. Turns out the WSDL used an XSD which imports another namespace XSD. This imported XSD contained the following:
Note the empty
include
element! This was the root of my woes. I guess this is a variation on Egor's file not found problem above. +1 to disappointing error reporting.
colin_froggattcolin_froggatt
In my case, removing the 'encoding='UTF-8' attribute altogether worked.
It looks like a character set encoding issue, maybe because your file isn't really in UTF-8.
Jerome LouvelJerome Louvel
My answer wouldn't help you probably, but it help with this problem generally.
Polyester yarn dyeing process pdf. When you see this kind of exception you should try to open your xml file in any Hex Editor and sometime you can see additional bytes at the beginning of the file which text-editor doesn't show.
Delete them and your xml will be parsed.
Igor KustovIgor Kustov
First clean project, then rebuild project. I was also facing the same issue. Everything came alright after this.
Bibin JohnyBibin Johny1,85911 gold badge66 silver badges1414 bronze badges
If all else fails, open the file in binary to make sure there are no funny characters [3 non printable characters at the beginning of the file that identify the file as utf-8] at the beginning of the file. We did this and found some. so we converted the file from utf-8 to ascii and it worked.
RalphRalph
For the same issues, I have removed the following line,
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.
Dineshkumar PonnusamyDineshkumar Ponnusamy87522 gold badges1616 silver badges3737 bronze badges
As Mike Sokolov has already pointed it out, one of the possible reasons is presence of some character/s (such as a whitespace) before the tag.
If your input XML is being read as a String (as opposed to byte array) then youcan use replace your input string with the below code to make sure that all 'un-necessary'characters before the xml tag are wiped off.
You need to be sure that the input xml starts with the xml tag though.
Sahil JSahil J
I followed the instructions found here and i got the same error.
I tried several things to solve it (ie changing the encoding, typing the XML file rather than copy-pasting it ect) in Notepad and XML Notepad but nothing worked.
The problem got solved when I edited and saved my XML file in Notepad++ (encoding --> utf-8 without BOM)
BitCollectorBitCollector
For all those that get this error:WARNING: Catalina.start using conf/server.xml: Content is not allowed in prolog.
Not very informative. but what this actually means is that there is garbage in your conf/server.xml file.
Daniel eric gold. I have seen this exact error in other XML files. this error can be caused by making changes with a text editor which introduces the garbage.
The way you can verify whether or not you have garbage in the file is to open it with a 'HEX Editor' If you see any character before this string
like this would be garbage
that is your problem..The Solution is to use a good HEX Editor. One that will allow you to save files with differing types of encoding.
Then just save it as UTF-8.Some systems that use XML files may need it saved as UTF NO BOM Which means with 'NO Byte Order Mark'
Hope this helps someone out there!!
CA MartinCA Martin
Sometimes it's the code, not the XML
The following code,
will also result in this error,
[Fatal Error] :1:1: Content is not allowed in prolog.org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
This page contains the list of device drivers for Hcl Infosystems HCL Laptop. To download the proper driver, first choose your operating system, then find your device name and click the download button. Hcl me icon l 1044 drivers for windows 8. Win7 HCL ME 1044 Series Windows 7 32Bit/64Bit Driver Model Device Type OS Download Series 1044 Chipset Windows 7 32 Bit. Toshiba Satellite L745 Notebook for Windows XP Vista 7 XP Vista 7 Toshiba Satellite L745 Notebook Drivers for Windows XP Vista 7 Download Driver Toshiba Satellite L745 for. Maintaining updated HCL ME Laptop 1044 software prevents crashes and maximizes hardware and system performance. Using outdated or corrupt HCL ME Laptop 1044 drivers can cause system errors, crashes, and cause your computer or hardware to fail. Furthermore, installing the wrong HCL drivers can make these problems even worse.
because it's attempting to parse the string literal,
'file.xml'
(not the contents of the file.xml
file) and failing because 'file.xml'
as a string is not well-formed XML.Fix: Remove
StringReader()
:Similarly, dirty buffer problems can leave residual junk ahead of the actual XML. If you've carefully checked your XML and are still getting this error, log the exact contents being passed to the parser; sometimes what's actually being (tried to be) parsed is surprising.
kjhugheskjhughes71.3k1414 gold badges103103 silver badges147147 bronze badges
In my case the web.xml in my application has extra space even after i deleted did not work i had to revert chages and its fixesand yes i was playing with logging.properties and web.xml in my tomcat but even after i reverted the error kept showing so this fixed it )).
To be specific i tried do addingorg.apache.catalina.filters.ExpiresFilter.level = FINEstack over flow something about logging.properties
shareefshareef5,56188 gold badges4545 silver badges7474 bronze badges
FabioLuxFabioLux
To fix the BOM issue on Unix / Linux systems:
- Check if there's an unwanted BOM character:
hexdump -C myfile.xml | more
An unwanted BOM character will appear at the start of the file as..<?xml>
- Alternatively, do
file myfile.xml
. A file with a BOM character will appear as:myfile.xml: XML 1.0 document text, UTF-8 Unicode (with BOM) text
- Fix a single file with:
tail -c +4 myfile.xml > temp.xml && mv temp.xml myfile.xml
- Repeat 1 or 2 to check the file has been sanitised. Probably also sensible to do
view myfile.xml
to check contents have stayed.
Here's a bash script to sanitise a whole folder of XML files:
Lydia RalphLydia Ralph80911 gold badge1414 silver badges2727 bronze badges
Just an additional thought on this one for the future. Getting this bug could be the case that one simply hits the delete key or some other key randomly when they have an XML window as the active display and are not paying attention. This has happened to me before with the struts.xml file in my web application. Clumsy elbows ..
demongolemdemongolemOrg.xml.sax.saxexception Input Stream Is Not A Checkstyle Files
7,1331212 gold badges7474 silver badges9494 bronze badges
I was also getting the same
XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,2] Message: Reference is not allowed in prolog.
, when my application was creating a XML response for a RestFull Webservice call. While creating the XML format String I replaced the < and > with < and > then the error went off, and I was getting proper response. Not sure how it worked but it worked.
sample:
shareef5,56188 gold badges4545 silver badges7474 bronze badges
Satish MSatish M
I had the same issue.
First I downloaded the XML file to local desktop and I got
Content is not allowed in prolog
during the importing file to portal server. Even visually file was looking good to me but somehow it's was corrupted. So I re-download the same file and tried the same and it worked.
Marko16k1010 gold badges4141 silver badges6060 bronze badges
pareshparesh
We had the same problem recently and it turned out to be the case of a bad URL and consequently a standard 403 HTTP response (which obviously isn't the valid XML the client was looking for). I'm going to share the detail in case someone within the same context run into this problem:
Org.xml.sax.saxexception Inputstream Is Not A Checkstyle File
This was a Spring based web application in which a 'JaxWsPortProxyFactoryBean' bean was configured to expose a proxy for a remote port.
The 'END_POINT_BASE_URL' is an environment variable configured in 'setenv.sh' of the Tomcat instance that hosts the web application. The content of the file is something like this:
The missing ';' after each line caused the malformed URL and thus the bad response. That is, instead of 'BusinessAppServices/OurService?wsdl' the URL had a CR before '/'. 'TCP/IP Monitor' was quite handy while troubleshooting the problem.
Amir KeibiAmir Keibi
In my case I got this error because the API I used could return the data either in XML or in JSON format. When I tested it using a browser, it defaulted to the XML format, but when I invoked the same call from a Java application, the API returned the JSON formatted response, that naturally triggered a parsing error.
zovitszovits
Even I had faced a similar problem. Reason was some garbage character at the beginning of the file.
Fix : Just open the file in a text editor(tested on Sublime text) remove any indent if any in the file and copy paste all the content of the file in a new file and save it. Thats it!. When I ran the new file it ran without any parsing errors.
Aditya GaykarAditya Gaykar
I took code of Dineshkumar and modified to Validate my XML file correctly:
Org.xml.sax.saxexception Input Stream Is Not A Checkstyle File Free
RodHRodH
Laurel4,8771010 gold badges2222 silver badges4040 bronze badges
PavelPavel2,09977 gold badges3333 silver badges5959 bronze badges
I had the same issue with spring
MarshallingMessageConverter
and by pre-proccess code.
Mayby someone will need reason:BytesMessage #readBytes - reading bytes. and i forgot that reading is one direction operation.You can not read twice.
Learning Always1,03122 gold badges1818 silver badges3535 bronze badges
Artem PtushkinArtem Ptushkin
Giuseppe MilazzoGiuseppe Milazzo
I was having the same problem while parsing the
info.plist
file in my mac. However, the problem was fixed using the following command which turned the file into an XML. Hope that helps someone.
Reaz MurshedReaz Murshed16k99 gold badges5050 silver badges6767 bronze badges
protected by Community♦May 1 at 11:09
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?