Results 1 to 7 of 7
- 10-09-2008, 10:08 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 19
- Rep Power
- 0
java: xml/html file with doctype trying to connect to site
I've html/xml files that contain the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
The Java program that I create parses this file however it won't compile b/c it's trying to visit the w3 site for the DTD info. Any idea if this function can be turned of in Java/Eclipse?
- 10-09-2008, 11:20 PM #2
Do you get compiler errors? Or are they runtime errors?it won't compile
Copy and paste full text of the error messages here.
- 10-10-2008, 04:28 PM #3
Member
- Join Date
- Oct 2008
- Posts
- 19
- Rep Power
- 0
connection timed out: connect
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(PlainSoc ketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
at java.net.Socket.connect(Socket.java:516)
at java.net.Socket.connect(Socket.java:466)
at sun.net.NetworkClient.doConnect(NetworkClient.java :157)
at sun.net.http.HttpClient.openServer(HttpClient.java :365)
at sun.net.http.HttpClient.openServer(HttpClient.java :477)
at sun.net.http.HttpClient.<init>(HttpClient.java:214 )
at sun.net.http.HttpClient.New(HttpClient.java:287)
at sun.net.http.HttpClient.New(HttpClient.java:299)
at sun.net.protocol.http.HttpURLConnection.getNewHttp Client(HttpURLConnection.java:796)
at sun.net.protocol.http.HttpURLConnection.plainConne ct(HttpURLConnection.java:748)
at sun.net.protocol.http.HttpURLConnection.connect(Ht tpURLConnection.java:673)
at sun.net.protocol.http.HttpURLConnection.getInputSt ream(HttpURLConnection.java:917)
at com.sun.org.apache.xerces.internal.impl.XMLEntityM anager.setupCurrentEntity(XMLEntityManager.java:97 3)
at com.sun.org.apache.xerces.internal.impl.XMLEntityM anager.startEntity(XMLEntityManager.java:905)
at com.sun.org.apache.xerces.internal.impl.XMLEntityM anager.startDTDEntity(XMLEntityManager.java:872)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScan nerImpl.setInputSource(XMLDTDScannerImpl.java:282)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl$DTDDispatcher.dispatch(XMLDocumentSca nnerImpl.java:1021)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(XMLDocumentFragm entScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(DOMParser.java:250)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(DocumentBuilderImpl.java:292)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBu ilder.java:172)
at testingWriteToHTML.main(testingWriteToHTML.java:33 )[/CODE]
- 10-10-2008, 04:56 PM #4
Ok that's called an execution error. Compile errors come from the javac command.
How are you executing the program?
What happens if you load that URL into your browser? Are you able to read anything from it?
- 10-10-2008, 05:00 PM #5
Member
- Join Date
- Oct 2008
- Posts
- 19
- Rep Power
- 0
I do a 'run as' java app in Eclipse.
When I try the link in the browser it downloads a dtd file. I do not want it to connect nor download info. I just want it to ignore the doctype line and this url in particular.
- 10-10-2008, 05:04 PM #6
That's interesting. I get the following error:
Forbidden due to abuse
With: http://w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
- 10-10-2008, 05:07 PM #7
Member
- Join Date
- Oct 2008
- Posts
- 19
- Rep Power
- 0
Similar Threads
-
How to print a HTML file in browser look using JAVA
By ammameiya in forum Advanced JavaReplies: 5Last Post: 06-25-2010, 02:36 AM -
How can I include a html file in html textarea?
By surya_dks in forum New To JavaReplies: 2Last Post: 10-04-2008, 07:20 AM -
Include Java file in HTML Page
By kathyc in forum New To JavaReplies: 2Last Post: 03-07-2008, 03:51 AM -
Code to connect to a web site
By suji in forum NetworkingReplies: 1Last Post: 02-15-2008, 04:05 PM -
How can I get a RealMedia file from a web site?
By emesol0 in forum NetworkingReplies: 0Last Post: 01-24-2008, 07:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks