commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lingan <sathya78.g...@gmail.com>
Subject Betwixt 7 Reading problem
Date Thu, 09 Aug 2007 16:24:38 GMT

Hi I am trying to convert the XML to Java Object . I am getting the following
excpetion . Any help is highly appreciated.

java.net.MalformedURLException: no protocol:   Successful  56263  4 
	at java.net.URL.(URL.java(Compiled Code))
	at java.net.URL.(URL.java:463)
	at java.net.URL.(URL.java:412)
	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
	at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.commons.digester.Digester.parse(Digester.java:1605)
	at
com.physiciansmutual.service.sircon.SirconMockTest.extractPacketData(SirconMockTest.java:86)
	at
com.physiciansmutual.service.sircon.SirconMockTest.main(SirconMockTest.java:127)
null


Here is my code .

BufferedReader reader = new BufferedReader(new
InputStreamReader(SirconMockTest.class.getResourceAsStream(batchId +
".xml")));
		 	StringBuffer buffer = new StringBuffer(); 
			String thisLine = "";
			while ((thisLine = reader.readLine()) != null) { 
				buffer.append(thisLine);
			}  	
			StringReader xmlReader = new StringReader(buffer.toString());
		    BeanReader beanReader = new BeanReader();
		    beanReader.getBindingConfiguration().setMapIDs(false);
		
beanReader.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(false);
			beanReader.registerBeanClass("ContractDataExtractResponse",
ContractDataExtractResponseType.class);
			beanReader.registerBeanClass("Status", StatusType.class);
			beanReader.registerBeanClass("BatchID", BatchIDType.class);
			beanReader.registerBeanClass("RecordCount",
ContractDataExtractResponseType_RecordCount.class);
			System.out.println("String from XMLReader : " + buffer.toString());
			//StringEscapeUtils.escapeJava(
			conData =
(ContractDataExtractResponseType)beanReader.parse(buffer.toString());

Thanks.
-- 
View this message in context: http://www.nabble.com/Betwixt-7-Reading-problem-tf4243596.html#a12075613
Sent from the Commons - User mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message