Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8777659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:19:42+00:00 2026-06-13T19:19:42+00:00

I am getting the following exception while parsing my xml using dom parser. The

  • 0

I am getting the following exception while parsing my xml using dom parser.
The url
“http://www.xyz.com/ABC.aspx?accessCode=……&vin=GJHHFJHFJHFGF6788&reportType=3”
returns a xml for every vin parameter.

Here is the xml returned by above url

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<VINdecode Version="1.0.0" Report_Type="LITE" Date="11/1/2012">
    <VIN Number="GJHHFJHFJHFGF6788" Status="SUCCESS">
        <Vehicle VINdecode_Vehicle_ID="26870" Model_Year="2004" Make="Volkswagen" Model="Touareg" Trim_Level="V6">
            <Item Key="Model Year" Value="2004" Unit="" />
            <Item Key="Make" Value="Volkswagen" Unit="" />
            <Item Key="Model" Value="Touareg" Unit="" />
            <Item Key="Trim Level" Value="V6" Unit="" />
            <Item Key="Manufactured in" Value="GERMANY" Unit="" />
            <Item Key="Body Style" Value="SPORT UTILITY 2-DR" Unit="" />
            <Item Key="Engine Type" Value="3.2L V6 DOHC 24V" Unit="" />
        </Vehicle>
    </VIN>
</VINdecode>

Here is the code which i use to parse xml returned from the url with vin.

 public VIN getVINExpansion(String vin) 
    {
        if(vin.length() != 17)
           return null;
        VIN vehicle = null;

        try 
        {

               String url="http://www.xyz.com/ABC.aspx?accessCode=........&vin="
                    + vin + "&reportType=3";
               DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
               DocumentBuilder db = dbf.newDocumentBuilder();
               Document doc = db.parse(url);  **// I get Exception in this line**
               NodeList vinlist = doc.getElementsByTagName("VIN");

               // rest goes here

         }
         catch(Exception e)
         {
           e.printStackTrace();
         }
        return vin;
    }

When I pass a “vin” parameter to above function from my client side through rpc call, I get correct response. But after few hours (say 4-5) hours when I pass the same vin parameter,I get exception. After that I keep on getting this exception till i restart my tomcat server. After restarting tomcat server, again i get correct response for 4-5 hours till it starts failing.

Exception I get :

[Fatal Error] xml_ABC.aspx?accessCode=.......&vin=GJHHFJHFJHFGF6788&reportType=3:4:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
org.xml.sax.SAXParseException;


 systemId: http://www.xyz.com/ABC.aspx?accessCode=......&vin=GJHHFJHFJHFGF6788&reportType=3; lineNumber: 4; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:19:44+00:00Added an answer on June 13, 2026 at 7:19 pm

    I don’t know the exact reason why it is failing but the same problem was with me:
    When I was trying to parse url response xml using DocumentBuilder.parse(url), parsing fails after few trials.

    When I fetched response xml using the following function:

    public String getHttpGetResponseString(String url) throws Exception
        {
            HttpClient httpclient = new DefaultHttpClient();
            String responseBody ="";
            try {
                HttpGet httpget = new HttpGet(url);
    
                System.out.println("executing request " + httpget.getURI());
    
                // Create a response handler
                ResponseHandler<String> responseHandler = new BasicResponseHandler();
                responseBody = httpclient.execute(httpget, responseHandler);
    
    
            }
            finally {
                // When HttpClient instance is no longer needed,
                // shut down the connection manager to ensure
                // immediate deallocation of all system resources
                httpclient.getConnectionManager().shutdown();
    
            }
            return responseBody;
        }
    

    And then loaded the xml into dom, i got rid of the exception.
    Hope this may solve your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi i am getting the following exception while running my application and my applicationContext.xml
Hi I am getting the following invalid liscence exception while calling a secured URL
While using a third party dll I was getting the following exception: exePath must
While building the android app using ant am getting the following exception. Couldn't figure
I am getting the following exception while trying to write an .xlsx file using
I am getting Following Exception while configuring the Connection Pool in Tomcat This is
I am getting he following Exception while running my Quartz Schdular program. Below is
I am getting the following exception while adding data into database: org.hibernate.HibernateException: The database
I am getting following exception while implementing mail feature for my local machine please
I am getting following exception while running BIRT from a Linux OS. Caused by:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.