Dutsnattisuck
New Member
I am trying to implement Apache Qpid into our architecture and I am having trouble reading in a properties file. \[quote\] Properties props = new Properties(); props.loadFromXML(this.getClass().getResourceAsStream("hello.properties"));\[/quote\]loadfromxml is throwing me an error, here is the stack trace:\[code\]> 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\[/code\]Here is the hello.properties file:\[code\]java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactoryconnectionfactory.qpidConnectionfactory= amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'destination.topicExchange = amq.topic\[/code\]What am I doing wrong? I copied the code snippet from the documentation page of Qpid.