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 8988185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:57:53+00:00 2026-06-15T21:57:53+00:00

I am trying to implement Apache Qpid into our architecture and I am having

  • 0

I am trying to implement Apache Qpid into our architecture and I am having trouble reading in a properties file.

Properties props = new Properties();
props.loadFromXML(this.getClass().getResourceAsStream(“hello.properties”));

loadfromxml is throwing me an error, here is the stack trace:

> java.util.InvalidPropertiesFormatException:
> org.xml.sax.SAXParseException: Content is not allowed in prolog.  at
> java.util.XMLUtils.load(XMLUtils.java:56)     at
> java.util.Properties.loadFromXML(Properties.java:852)     at
> com.irad.message.system.HelloTest.runTest(HelloTest.java:29)  at
> com.irad.message.system.HelloTest.main(HelloTest.java:23) Caused by:
> org.xml.sax.SAXParseException: Content is not allowed in prolog.  at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
>   at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
>   at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
>   at
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1427)
>   at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1036)
>   at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
>   at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
>   at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
>   at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>   at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
>   at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
>   at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
>   at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:82)   at
> java.util.XMLUtils.load(XMLUtils.java:54)     ... 3 more

Here is the hello.properties file:

java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory
connectionfactory.qpidConnectionfactory= amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
destination.topicExchange = amq.topic

What am I doing wrong? I copied the code snippet from the documentation page of Qpid.

  • 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-15T21:57:54+00:00Added an answer on June 15, 2026 at 9:57 pm

    You are using Properties.loadFromXML to load a TEXT file as XML, and it’s telling you the XML file you’ve given it is malformed.

    Next time when you get errors like this, do a google search for ‘java loadfromxml’. It will take you to the javadocs manual on how to use it and you will see that the parameters you are feeding it is incorrect:

    http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html#loadFromXML%28java.io.InputStream%29

    The above link says:

    The XML document must have the following DOCTYPE declaration:

    <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
    

    Change your properties file to be of correct format, and then you’ll be on your way to figuring out the next error.

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

Sidebar

Related Questions

I've encounted an error trying to implement Apache commons-compress in my Java application: java.lang.ClassNotFoundException:
I am trying implement a most recent widget into my tumblr post. So far,
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
Trying to implement a search similar to here .This searches properties based on city,locality,property
I have the spring jars of spring-3.2.0.RC1.jar and trying to implement Apache ActiveMQ helloWorld
I am trying to implement some Apache rewrite rules to set the MIME type
Background I am trying to implement a RESTful web service using Apache-CXF that interacts
desperately trying to implement a new feature in the Lucene, I'm turning to you.
I'm trying to implement spring security acl into a project. After building the main
i am trying to implement a user system (php, apache) where the user can

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.