try {
{
long startTime = System.currentTimeMillis();
String source="s";
String source1="s";
URL google = new URL("http://google.com/");
HttpURLConnection yc =(HttpURLConnection)google.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
source=source.concat(inputLine);
}
in.close();
yc.disconnect();
}
long endTime1 = System.currentTimeMillis();
System.out.println("Total elapsed time in execution of method callMethod() is :"+ (endTime1-startTime));
}
}
when i tried the above through command prompt
i got
java.net.UnknownHostException: google.com
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 ScagntJavaHttp.httpMakeRequest(ScagntJavaHttp.java:185)
at test.main(test.java:23)
Can any help me in resolving this one?
I believe it's a proxy problem.
Try to see if you have a proxy definition in your browser and then set it:
ProxySelector.setDefault(new ProxySelector() {
#Override
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
throw new RuntimeException("Proxy connect failed", ioe);
}
#Override
public List select(URI uri) {
return Arrays
.asList(new Proxy(Proxy.Type.HTTP,
new InetSocketAddress(proxyHost,
proxyPort)));
}
});
To see if you have proxy definition in IE, go to Tools - Internet Options -- Connections -- Lan Settings
Try removing http:// from your host url when you get java.net.UnknownHostException and check your internet connection and the host exists (probably safe with google . . .)
Related
I have standalone Java Server Socket application running on Java 1.8.40 as windows service, and we have a Spring web application as Client which performs SSL handshake with selfsigned SHA1 RSA 2048 certificate with the Server Socket application then performs other actions. We do have the same selfsigned SHA1 RSA 2048 cert in the Server Socket application keystore.jks.
Am seeing a weird issue with my Server Socket application in Production, randomly its throwing below exception and Java client is getting Peer not authenticated exception. if I restart the Server Socket application I dont see the below exception and Java client can perform the SSL handshake succesfully
com.ssltunnel.server.MainServerHandshakeThread | IO Error waiting for handshake
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ServerHandshaker.clientCertificate(Unknown Source)
at sun.security.ssl.ServerHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.ssltunnel.server.MainServerHandshakeThread.handshake(MainServerHandshakeThread.java:41)
at com.ssltunnel.server.MainServerHandshakeThread.run(MainServerHandshakeThread.java:71)
at com.ssltunnel.utilities.threading.ShutdownThreadPoolExecutor$1.run(ShutdownThreadPoolExecutor.java:37)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.validator.PKIXValidator.doValidate(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkClientTrusted(Unknown Source)
... 16 more
Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.provider.certpath.PKIXCertPathValidator.validate(Unknown Source)
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(Unknown Source)
at java.security.cert.CertPathValidator.validate(Unknown Source)
... 22 more
Below is my MainServerHandshakeThread
public class MainServerHandshakeThread implements Runnable {
private final Socket clientSocket;
private final MainServer server;
private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(MainServerHandshakeThread.class.getName());
private boolean done;
private static final long TIMEOUT= 10000000000L;
public static final int NSTOMS = 1000000;
public MainServerHandshakeThread(Socket clientSocket, MainServer server) {
this.clientSocket = clientSocket;
this.server = server;
}
private void handshake() throws IOException, InterruptedException, ClientNotFoundException {
long start = System.nanoTime();
// Changed to want to allow for diagnosing bad certificates
((SSLSocket) clientSocket).setNeedClientAuth(true);
MainServerHandshakeHandler handshake = new MainServerHandshakeHandler();
((SSLSocket) clientSocket).addHandshakeCompletedListener(handshake);
((SSLSocket) clientSocket).startHandshake(); //Line# 41
while (!handshake.isDone() && !done) {
Thread.sleep(10);
long duration = System.nanoTime() - start;
if (duration>TIMEOUT) {
done = true;
LOG.warn("Handshake timeout");
}
}
long stop = System.nanoTime();
LOG.debug("Handshake done in ms: " + ((stop - start) / NSTOMS) );
String serialNumber = handshake.getSerialNumber();
LOG.debug(serialNumber);
}
#Override
public void run() {
try {
handshake();
} catch (IOException ex) {
LOG.error("IO Error waiting for handshake", ex);
} catch (InterruptedException ex) {
LOG.error("Interrupted waiting for handshake", ex);
} catch (ClientNotFoundException ex) {
LOG.warn("Client not found",ex);
} finally {
LOG.debug("Handshake thread is done");
done = true;
}
}
#Override
public void shutdown() {
if (clientSocket!=null) {
SocketUtils.closeQuietly(clientSocket);
}
}
}
We do have the truststore and keystore configured in the Server Socket application as below
System.setProperty("javax.net.ssl.keyStore", "C:/server/conf/keystore.jks");
System.setProperty("javax.net.ssl.keyStorePassword", KEYSTOREPASS);
System.setProperty("javax.net.ssl.trustStore", "C:/server/conf/keystore.jks");
System.setProperty("javax.net.ssl.trustStorePassword", KEYSTOREPASS);
Since the issue is fixing with the restart we are doing restart whenever this issue happens in Production. We want to avoid this and fix this issue, can someone pleae help me how to fix this random issue?
I can't work out why the following program is unable to locate tables in my derby database:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
public class NdConnect
{
public final static String SETUP_FILE_PATH = "/AppData/Local/NewdawnTest";
private static final String CONNECTION_URL = "jdbc:derby:" + "C:/Users/" + System.getenv("USERNAME") + SETUP_FILE_PATH + "db" + ";create=true";
private static Connection conn = null;
private final static Properties dbProperties = new Properties();
private static PreparedStatement pstmtSelectTxns;
public static void connect() {
try {
conn = DriverManager.getConnection(CONNECTION_URL + ";create=true", dbProperties);
pstmtSelectTxns = conn.prepareStatement("SELECT * from TXNS");
System.out.println("Connected OK to " + CONNECTION_URL);
}
catch (SQLException sqle) {
System.out.println("SQL exception");
System.out.println("Connected NOK:The connection URL is " + CONNECTION_URL);
Logger.getLogger(NdConnect.class.getName()).log(Level.SEVERE, null, sqle);
}
}
public static void disconnect()
{
try {
if (conn != null) {
conn.close();
conn = null;
System.out.println("0048 NDC OK:DB closed ");
}
} catch (SQLException sqle) {
Logger.getLogger(NdConnect.class.getName()).log(Level.SEVERE, null, sqle);
}
}
public static void main(String[] args)
{
// NdConnect nd = new NdConnect();
NdConnect.connect();
NdConnect.disconnect();
// System.out.println("NdConnect finished");
}
}
The program throws a SQLSyntaxErrorException:
run:
SQL exception
Connected NOK:The connection URL is jdbc:derby:C:/Users/Administrator/AppData/Local/NewdawnTestdb;create=true
Nov 25, 2018 6:58:42 AM NdConnect connect
0048 NDC OK:DB closed
SEVERE: null
java.sql.SQLSyntaxErrorException: Table/View 'TXNS' does not exist.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement42.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver42.newEmbedPreparedStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
at NdConnect.connect(NdConnect.java:21)
at NdConnect.main(NdConnect.java:47)
Caused by: ERROR 42X05: Table/View 'TXNS' does not exist.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(Unknown Source)
at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown Source)
at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown Source)
at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
... 7 more
However the database and table do exist. I have verified this by creating a connection to the database in Netbeans > Services. When I run this command in Services:
SELECT * from TXNS
the desired table is correctly displayed and the output window returns:
Executed successfully in 0 s.
Fetching resultset took 0.016 s.
Line 1, column 1
Execution finished after 0.254 s, no errors occurred.
Looking at the properties of this connection via Netbeans services shows the following attribute values:
Display name NewDawn – TEST DB
Database URL jdbc:derby:C:\Users\Administrator\AppData\Local\NewdawnTest\db
Driver apache_derby_embedded
Driver class org.apache.derby.jdbc.EmbeddedDriver
This seems to correspond to the setup I have in the java code example so I don't understand why the code doesn't work.
The URL is not the same:
In Netbeans: jdbc:derby:C:\Users\Administrator\AppData\Local\NewdawnTest\db
In Java: jdbc:derby:C:/Users/Administrator/AppData/Local/NewdawnTestdb;create=true
Change the CONNECTION_URL line to:
private static final String CONNECTION_URL = "jdbc:derby:" + "C:/Users/" + System.getenv("USERNAME") + SETUP_FILE_PATH + "/db"
I am building a swing application to download multiple files over the internet and save to a windows fileshare. I have used SwingWroker which internally uses the ExecutorService which internally queues them and downloads 10 at a time, but for some reason after downloading say 2 - 3 MB of file it stops and moves to next downloading file, They are downloaded in a batch of 10 as SwingWorker has fixed it in number of Threads for the Executor Service.
I have to write these files in a windows file share and I am using nio.FileChannels to do that. There are files ranging from 50-60 each weighing around 300MB - 500MB. The file links are located on a webpage to where I get to by login in using credentials on a login page(with a post request) over the internet before that I specify CookieHandler.setDefault(new CookieManager()) at the beginning and so it behaves like a browser to me.
Another observation is when I download them locally (not to a windows server share) they do work fine.
This is the code I am using
import java.io.File;
import java.io.FileOutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import javax.swing.SwingWorker;
public class DownloadProcess extends SwingWorker<Boolean, String> {
private String urlPath, filePath;
public DownloadProcess(String urlPath, String filePath){
this.urlPath = urlPath;
this.filePath = filePath;
}
#Override
protected Boolean doInBackground() {
boolean taskState = true;
URLConnection httpConn = null;
ReadableByteChannel readableByteChannel = null;
FileOutputStream fileOutputStream = null;
FileChannel fileOutputChannel = null;
try{
//String filePath = "\\\\fileshare.server\\xyz.txt";
//String urlPath = "http://example.com/anyBigFile.1GB.docx";
File localFile = new File(filePath);//File share
boolean itsThere = localFile!=null && localFile.exists();
long done = itsThere ? localFile.length() : 0;
URL url = new URL(urlPath);
httpConn = url.openConnection();
httpConn.setRequestProperty("Connection", "keep-alive");
if(itsThere) {
httpConn.setRequestProperty("Range","bytes="+done+"-");
}
readableByteChannel = Channels.newChannel(httpConn.getInputStream());
fileOutputStream = itsThere ? new FileOutputStream(filePath) : new FileOutputStream(filePath,true);
fileOutputChannel = fileOutputStream.getChannel();
for (long position = done, size = httpConn.getContentLength(); position < size && !isCancelled(); ) {
position += fileOutputChannel.transferFrom(readableByteChannel, position, 1 << 16);
}
//done
}catch(Exception e){
taskState = false;
e.printStackTrace();
}finally{
//close streams conns etc
}
return taskState;
}
}
This is the error stack trace that I get after 5 - 10 mins of download
/*
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
at sun.security.ssl.SSLSocketImpl.checkEOF(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at java.nio.channels.Channels$ReadableByteChannelImpl.read(Unknown Source)
at com.objects.DownloadByteChannel.read(DownloadByteChannel.java:117)
at sun.nio.ch.FileChannelImpl.transferFromArbitraryChannel(Unknown Source)
at sun.nio.ch.FileChannelImpl.transferFrom(Unknown Source)
at com.core.DownloadTask.doInBackground(DownloadTask.java:154)
at com.core.DownloadTask.doInBackground(DownloadTask.java:59)
at com.util.ZSwingWorker$1.call(ZSwingWorker.java:286)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.util.ZSwingWorker.run(ZSwingWorker.java:325)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
... 18 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
... 18 more
*/
Usage:
public static void main(String[] args){
int counter = 1;
for(String url: urls){
new DownloadProcess(url,"\\\\fileshare.server\\xyz"+(counter++)+".txt").execute();
}
}
You are going to have to change your connection timeout serverside. I picked up a few links along the way if they are of any importance:
Modify Session Security settings
Lengthening salesforce session timeout
Hope this helps, good luck and let me know :)
Connection Reset means the remote side is closing the connection with a TCP RST (reset) packet. You need to find out what the remote side isn't liking and fix it.
If the remote side is Apache maybe you are running into the KeepAliveTimeout value. By default that is 5 seconds. It really sounds like you are running into some sort of configured limit on the remote side. When that happens the server is kicking you off with a reset.
I'm having an issue loading my Blazegraph properties file into an embedded instance. When I try to import my .properties file into my Java class, I get the following error:
Exception in thread "main" java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.Reader.read(Unknown Source)
at java.util.Properties$LineReader.readLine(Unknown Source)
at java.util.Properties.load0(Unknown Source)
at java.util.Properties.load(Unknown Source)
at blazegraph_tinkerpop_tryout.blazegraph_data_load.loadProperties(blazegraph_data_load.java:55)
at blazegraph_tinkerpop_tryout.blazegraph_data_load.main(blazegraph_data_load.java:32)
Call to loadProperties function from main:
Properties props = loadProperties("sampleprops.properties");
My loadProperties function (checking to see whether file path is valid, then sending to reader):
public static Properties loadProperties(String resource) throws IOException
{
Properties p = new Properties();
Path path = Paths.get(resource);
Boolean bool = Files.exists(path);
if (bool)
{
System.out.println("File was found. Attempting data load...");
InputStream is = blazegraph_data_load.class.getResourceAsStream(resource);
p.load(new InputStreamReader(new BufferedInputStream(is)));
return p;
}
System.out.println("The file you entered was not found.");
return null;
}
Here is what my file sampleprops.properties looks like:
com.bigdata.journal.AbstractJournal.bufferMode=DiskRW
com.bigdata.journal.AbstractJournal.file=blazegraph.jnl
I have been following the setup instructions from the sample Blazegraph app described here. If it makes a difference, I am using the Blazegraph/Tinkerpop3 implementation found here.
I found a workaround: I switched my getResourceAsStream method to a FileInputStream method.
The problem was with the placement of my properties file. The FileInputStream method seems more forgiving in where you place the file.
I am trying to read text contents of a webpage ( based on source ), but seem to be unable to make the connection. What could be the issue?
EDIT: updated stack trace
I ran this is debug mode and see the following:
JP_FetchWebPageHeader(Object).<init>()
Source not found
I was able to single setp in spite of the above error. is this a error message an issue?
I'm using eclipse on 64 bit windows and Java 1.7
The code is :
// **** Fetch web page or header
import java.io.*;
import java.net.*;
import java.util.Scanner;
public final class JP_FetchWebPageHeader {
/**
* #param aArgs
* <ul>
* <li> aArgs[0] : an HTTP URL
* <li> aArgs[1] : (header | content)
* </ul>
*/
public static void main(String...aArgs) throws MalformedURLException {
String url = aArgs[0];
String option = aArgs[1];
JP_FetchWebPageHeader fetcher = new JP_FetchWebPageHeader(url);
if (HEADER.equalsIgnoreCase(option)) {
log(fetcher.getPageHeader());
}else if (CONTENT.equalsIgnoreCase(option)) {
log(fetcher.getPageContent());
}else {
log("Unknown option.");
}
}
public JP_FetchWebPageHeader(URL aURL) {
if( ! HTTP.equals(aURL.getProtocol())) {
throw new IllegalArgumentException("URL isnt for HTTP protocol: " + aURL);
}
fURL = aURL;
}
public JP_FetchWebPageHeader(String aUrlName ) throws MalformedURLException {
this(new URL(aUrlName));
}
// Fetch the HTML content of the web page as simple text
public String getPageContent() {
String result = null;
URLConnection connection = null;
try {
connection = fURL.openConnection();
Scanner scanner = new Scanner(connection.getInputStream());
scanner.useDelimiter(END_OF_INPUT);
result = scanner.next();
} catch (IOException ex ) {
log("Cannot open connection to " + fURL.toString());
}
return result;
}
//Fetch HTML headers as simple text
public String getPageHeader() {
return null;
}
//PRIVATE
private URL fURL;
private static final String HTTP = "http";
private static final String HEADER = "header";
private static final String CONTENT = "content";
private static final String END_OF_INPUT = "\\Z";
private static final String NEWLINE = System.getProperty("line.separator");
private static void log(Object aObject){
System.out.println(aObject);
}
}
Arguments: http://www.google.com content
Result :
Cannot open connection to http://www.google.com
java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.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)
null
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 JP_FetchWebPageHeader.getPageContent(JP_FetchWebPageHeader.java:54)
at JP_FetchWebPageHeader.main(JP_FetchWebPageHeader.java:30)