• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unknown source while parsing XML

 
Deepak Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I get the following exception while trying to parse an xml file. The XMl file is :

<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>ProcessEngineBean</ejb-name>
<home>com.interworld.frameworks.processenginebean.IWProcessEngineHome</home>
<remote>com.interworld.frameworks.processenginebean.IWProcessEngine</remote>
<ejb-class>com.interworld.frameworks.processenginebean.IWProcessEngineBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>

The code used for the parsin is:

ZipEntry aEJBxmlEntry = ejbJarFile.getEntry("META-INF/ejb-jar.xml");
InputStream aEJBxmlDescInput = ejbJarFile.getInputStream(aEJBxmlEntry);
docBuilder = docBuilderFactory.newDocumentBuilder();
//THIS IS THE LINE WHERE EXCEPTION IS POINTED TO
Document ejbdoc = docBuilder.parse(aEJBxmlDescInput);
Element aEJBRootDocElement = ejbdoc.getDocumentElement();
aEJBRootDocElement.normalize();
EjbRefMetaData ejbMetaData = new EjbRefMetaData();
ejbMetaData.importEjbJarXml(aEJBRootDocElement);
ejbMetaData.importJbossXml(aEJBRootDocElement);


The stack trace generated is given below for you reference.
java.net.SocketException: connect (code=10051)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at sun.net.NetworkClient.doConnect(NetworkClient.java:45)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:334)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:520)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:270)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
at sun.net.www.http.HttpClient.New(HttpClient.java:292)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:417)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:510)
at java.net.URL.openStream(URL.java:793)
at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:740)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:700)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:258)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:811)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:221)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at com.interworld.tools.devstation.jboss.AppServerPropertiesImp.getEJBList(AppServerPropertiesImp.java:212)

Please advice where the problem is.
Thanks a load in advance.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
time bound,

Thanks for joining JavaRanch.
Unfortunately your name violates our naming policy. Please take a quick look at the rules and edit your profile accordingly.

Thank you!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!