Bug 250478 - ConnectException with SPI if not connected to the internet
Summary: ConnectException with SPI if not connected to the internet
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Cosmos (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jason Losh CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-10 14:39 EDT by Josh Hester CLA
Modified: 2012-01-03 13:54 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Hester CLA 2008-10-10 14:39:50 EDT
If your internet connection is not working or the machine does not have an internet connection, you get an error with this line:

SPISession session = SPISession.DEFAULT_INSTANCE;

Here is the stack trace:


java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.net.NetworkClient.doConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.<init>(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SDDTypeResolver.loadDocumentFromSchema(SDDTypeResolver.java:109)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SDDTypeResolver.<init>(SDDTypeResolver.java:43)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SPISessionImpl.<init>(SPISessionImpl.java:92)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SPISessionImpl.getDefaultSession(SPISessionImpl.java:70)
	at org.eclipse.cosmos.me.provisional.deployment.sdd.common.spi.SPISession.<clinit>(SPISession.java:34)
Comment 1 Eric S Rose CLA 2008-10-22 23:50:07 EDT
The stack trace shown in the Description is what results when trying to get an SPISession instance on a machine that connects to the internet through a proxy server.  If the same code is run on a machine without internet access at all, this is the resulting stack trace:

java.net.UnknownHostException: www.w3.org
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:232)
	at java.net.Socket.connect(Socket.java:540)
	at java.net.Socket.connect(Socket.java:490)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:403)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:521)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
	at sun.net.www.http.HttpClient.New(HttpClient.java:320)
	at sun.net.www.http.HttpClient.New(HttpClient.java:337)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:822)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:774)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:699)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:943)
	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.XML11Configuration.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 javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SDDTypeResolver.loadDocumentFromSchema(SDDTypeResolver.java:109)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SDDTypeResolver.<init>(SDDTypeResolver.java:43)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SPISessionImpl.<init>(SPISessionImpl.java:92)
	at org.eclipse.cosmos.me.internal.deployment.sdd.common.spi.SPISessionImpl.getDefaultSession(SPISessionImpl.java:70)
	at org.eclipse.cosmos.me.provisional.deployment.sdd.common.spi.SPISession.<clinit>(SPISession.java:37)
	at java.lang.J9VMInternals.initializeImpl(Native Method)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
	at TempTest.main(TempTest.java:11)
Comment 2 Eric S Rose CLA 2008-10-22 23:52:50 EDT
A workaround for running java with a proxy server is documented here:

http://www.rgagnon.com/javadetails/java-0085.html

That should allow the SPI to run correctly on a machine that uses a proxy server.
Comment 3 Jason Losh CLA 2008-10-30 10:22:26 EDT
Setting target to 1.1.  Eric has a handle on the fix so assigning to him.
Comment 4 Ruth Lee CLA 2009-01-15 12:20:29 EST
Reassigning to the project lead of Management Enablement for assessment to determine if these should be triaged to someone else or canceled. 
Comment 5 David Whiteman CLA 2009-04-22 11:43:00 EDT
We need to select a specific iteration for this, so we can determine that there is time for this in 1.1.  Otherwise, this should be marked "future".
Comment 6 Josh Hester CLA 2009-04-22 14:13:17 EDT
If we are planning to move away from SPI to jaxb for the BTG in the future, I'm going to mark this future and close it once that is completed.