Hi! I’ve some little problems with Tamino Api4J.
Simple code:
public class inoTest{
protected TXMLObjectModel model = TDOMObjectModel.getInstance();
public static void main(String[] args) throws TException, IOException {
TXMLObject xml = TXMLObject.newInstance(model);
File f= new File("prop.xml");
FileInputStream fin = new FileInputStream(f);
xml.readFrom(fin);
fin.close();
xml.writeTo(System.out);
}
}
prop.xml contains:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="key">value</entry>
</properties>
For the record:
Exception in thread "main" com.softwareag.tamino.db.api.io.TStreamReadException( message: Problems during parsing input stream and building DOM document., tag: JavaTaminoAPI_4_2_0_53, java: 1.5.0_04, os: Windows XP 5.1 ):
at com.softwareag.tamino.db.api.objectModel.dom.TDOMAdapter.internalReadFrom(Unknown Source)
at com.softwareag.tamino.db.api.objectModel.dom.TDOMAdapter.readFrom(Unknown Source)
at com.softwareag.tamino.db.api.objectModel.dom.TDOMAdapter.readFrom(Unknown Source)
at inoTest.main(inoTest.java:10)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913)
at java.net.URL.openStream(URL.java:1007)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.softwareag.tamino.db.api.objectModel.dom.TDOMReader.read(Unknown Source)
at com.softwareag.tamino.db.api.objectModel.dom.TDOMReader.read(Unknown Source)
at com.softwareag.tamino.db.api.objectModel.dom.TDOMReader.read(Unknown Source)
... 4 more
Java Result: 1
I understand that the parser tries to resolve the DTD reference. Since I have no Internet connection in my computer, this takes me to an error. It’s imposible to me to change that XML, it’s the Java XML for Properties, generated with Properties.storeToXML().
Any suggestion?
Thanks
PD: I’ve also tried the other three XMLModels. SAX, JDOM, Stream