aspose file tools*
The moose likes Tomcat and the fly likes Could not initialize class java.net.ProxySelector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Could not initialize class java.net.ProxySelector" Watch "Could not initialize class java.net.ProxySelector" New topic
Author

Could not initialize class java.net.ProxySelector

yingxin wu
Greenhorn

Joined: Apr 17, 2013
Posts: 1
I am developing an tomcat web application, the application will call another axis2 Soap web service. I generated a axis2 web service client using the axis2 code generator. If I run the the client from command line, it can invoke the web service and return results correctly.
Once I placed the client in Tomcat, error occurs and complaining that it cannot initialize the java.net.ProxySelector. Please help!


Here is the stack trace:

Exception in thread "pool-1-thread-1" java.lang.NoClassDefFoundError: Could not initialize class java.net.ProxySelector
at java.net.SocksSocketImpl$3.run(SocksSocketImpl.java:355)
at java.net.SocksSocketImpl$3.run(SocksSocketImpl.java:353)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:352)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:280)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

The ProxySelector class was added to Java in the Java 5 release. So that suggests to me that you're running Tomcat under Java 1.4.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Could not initialize class java.net.ProxySelector