Java HTTP Connection Filed - It's a DNS problem
Hello all,
my first post is for talking about this infamuos error of java.
When i try to view a page that use Java for one of it's applet, the applet doesn't work and Java console report among other errors:
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
But if i nslookup the ip of the address and i try to download the applet by this way... all go fine.
I tryed also Java Web Start -> same errors, but referred to URL Resource downloading.
I's clearly that something in java or outside java is avoiding the NS resolution.
I disabled all the firewalls, all the antyspyware... ALL...
I try also Safe Mode with networking... eheh...
nothing... java doesn't do NS.
It's a big bug... i use the latest java 1.05_05.
I'm not behind a proxy, i use firfox 1.0.7 and ie 6.0 sp2.. and windows xp... All give the same errors.
If someone managed the error please could help me? I read the other posts but it seems to me this is a open bug.
Goodbye,
eTomm
It's not difficult understand the topic.
The actual DNS resolution implementation of Java is faulty.
It's the ONLY service in my Windows machine that couldn't do a correct DNS resolution, stand alone application, Internet Explorer and Mozzilla web pages with applet-
If i use IPs all go fine... when i use domain java fail.
ALL java... non only applet. Also Java Web Start fail.
I controlled proxy, there isn't. i say to java to do a direct connect.
The only thing in my net configuration of strange is the router, a zyxel 660hw... nothing else... my pc work fine with all the rest of the programs that use IPs. Only java is faulty.
Similar Messages
-
Safari not responding when HTTPS connections are unavailable
I'm using a 13" MBP with 10.7.2 installed, which is setup to sync calendar, address and bookmarks with iCloud. Since last week I've constantly encounter a problem that my Safari 5.1.1 would keep crashing, and I had to delete the ~/Library/Safari/extensions folder to get it back to work.
This situation happened whenever I've switch to wireless connection. In my office we've setup a limited wireless environment that all HTTP/HTTPS connections will be redirected through a proxy. Since last week the proxy server was malfunctioned. All HTTP connections are proceeded normally, but all HTTPS connections will be suspended. I'm not sure but I suspect it's the main reason for the crashing problem.
The syndromes are:
1. When I left Safari open, unplug the ethernet, and turn-on WiFi, everythings goes on normally, until I open an HTTPS web page, for example, https://www.icloud.com. Of course that HTTPS URL will not load, since our proxy is broken; but the connection itself will NOT timeout. I've tried to leave it connecting for 10 minuntes, and it's still there.
2. The statement above may due to a glitch in our proxy server and I can understand that. But the problem is: after I tried to open an HTTPS connection, the Safari will refuse to open any other URLs, including normal HTTP connections. It will just keep "connecting". Meanwhile the FireFox and Chrome can load these HTTP pages normally.
3. If I quit Safari in this situation, Safari will not be able to re-launce: the icon will keep bumping on the dock. I have to force quit Safari and delete extensions folder, so that it can be launched again. But even after Safari re-launced, it still refused to load HTTP pages.
4. Neither reconnecting WiFi, relogin, or switching back to ethernet can fix the problem. I have to restart the whole system to get it back to normal.
It seemed to me that some Safari-related process will keep in the system after Safari is quited. And that process may keep the inactivated HTTPS connections alive in its TCP pool, and blocked all sequence connections, including the iCloud synchronization. And while I force-quit Safari, the extensions.plist file is damaged. That's the only plausible explanation to this situation.
I'm sure this situation is introduced after 10.7.2: it's not the first time our proxy server breakdown, but I've never have this problem before.I've done some detailed test and now I can give a conclusion:
1. It's confirmed that sequence HTTPS connection will be blocked in Safari and Google Chrome after a failure HTTPS connection (due to proxy). And rebooting is the only way to recover connections.
2. My previous observation is wrong: this is NOT a system wide problem. FireFox is not affected. FireFox will return to normal and all sequence HTTPS connection can be proceeded without any problem when I reconnect to a valid network connection (i.e. ethernet), while the Safari and Google Chrome remained being blocked. And DropBox is NOT affected as well.
3. None of the solutions mentioned in other threads can solve this problem. Checking the "Auto proxy discovery" does not help. Delete ~/Library/Preferences/com.apple.security.revocation.plistfile does not help. Clean Keychain does not help either. I've created another account for testing.
4. It's apparently something related to some system built-in network services. Since the FireFox and DropBox both gets its' own Proxy implementation, while Safari and Google Chrome will take the system settings. It's also worth noting that the POP3-SSL connection in Mail.app is also blocked after a failure HTTPS connection.
Currently the ONLY valid solution is using FireFox instead. -
HTTP Connection for Solution manager
Dear Experts,
SAP support team asked to create a http connection for solution manager for service check.We already created a R/3 connection for solution manager.why they are asking for HTTP connection? Really they required HTTP connection ?,Is they are any problem with this type of connections.What are the transaction codes which are not run in SAP GUI. Please clarify my doubts.
Thanks and regards,
Patan Thavaheer.Hi Patan,
Solution Manager transaction codes open in http browser. You can check the behaviour yourself by making a login to solution manager and execute transaction code solman_setup.
For SAP support to open http browser within remote support, they need to have http connection opened along with HTTP url maintained.
Refer to the SAP help link above for the procedure.
Hope this helps.
Regards,
Deepak Kori -
Errors: "java.io.IOException: open HTTP connection failed"
I am trying to execute an applet, but ocorrs the following errors:
"Java.lang.ClassNotFoundException: InterfaceApplet.class Caused by: java.io.IOException: open HTTP connection failed"
Why don't open HTTP connection???
I already signed the applet and my applet.html is:
codebase='http://200.134.165.36/path' code= 'applet.class' archive='appletSigned.jar'
....It's not difficult understand the topic.
The actual DNS resolution implementation of Java is faulty.
It's the ONLY service in my Windows machine that couldn't do a correct DNS resolution, stand alone application, Internet Explorer and Mozzilla web pages with applet-
If i use IPs all go fine... when i use domain java fail.
ALL java... non only applet. Also Java Web Start fail.
I controlled proxy, there isn't. i say to java to do a direct connect.
The only thing in my net configuration of strange is the router, a zyxel 660hw... nothing else... my pc work fine with all the rest of the programs that use IPs. Only java is faulty. -
Making https: connection from java code loaded into Oracle 8i database
A bit of a blast from the past, really, as 8i provides a JVM at 1.2.2.
I need to provide an PL/SQL function which accesses a RESTful web service requiring https connection. Got the call working under 1.2 locally without much trouble using:
static {
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
}The trick is to get the Oracle database to run the code internally. What libraries do I need where? I get an extremely unhelpful NoClassDefFoundError, without mention of the offending class.
By doing loadjava with jcert.jar,. jnet.jar and jsse.jar (the libraries I'm using with the test program) I can get loadjava to accept and allegedly resolve the class.endasil wrote:
malcolmmc wrote:
Well, sadly look at the colour scheme.Yeah, sarcastic was I. The NoClassDef error seriously doesn't give a class name? I find it astonishing that any implementation would be that stupid.Seriously. The strange thing is that before I got to the NoClassDefFound I had a Initialization error (until I added a security rule for setting the Provider) and for that I got a full stack trace (in an obscure trace file, granted). -
Java.io.IOException: open HTTP connection failed
I got this error message when trying to load applets in a web page, with J2SDK_Forte:
==================================
load: class myClass.class not found.
java.lang.ClassNotFoundException: myClass.class
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:151)
at sun.plugin.security.PluginClassLoader.findClass(PluginClassLoader.java:189)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:112)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:478)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:548)
at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1621)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:477)
at sun.applet.AppletPanel.run(AppletPanel.java:290)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:224)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:40)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:141)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:138)
... 10 more
==================================
The applet is in the same directory as the ASP. It is a NT 4 (SP6) server. The applets loaded and ran fine with jdk1.3. Do I need to do something different in my ASP, or IIS setup to allow java applet HTTP connection in JDK1.4?
Thanks!I have the exact same problem but have yet to find a solution.
It works fine in 1.3 but fails occasionally in 1.4. If I refresh the browser several times it eventually
loads.
Scott -
Sometimes this error occurs :
load: class applet.OMcsAppletMeetMeConf...
java.lang.ClassNotFoundException: applet.OMcsAppletMeetMeConf
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://192.168.73.101/mcs/applet/applet/OMcsAppletMeetMeConf.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: applet.OMcsAppletMeetMeConf This error occurs sometimes while applet load. In most cases program work normally
I can not know the cause.
plz.. help me..
system info
- java version : 1.6.0_17
- browser : ie 8 (but this error also occurs to ie 7, ie 6)
- html source is :
<applet id="mm_app" alt="" codebase="/mcs/applet" code="applet.OMcsAppletMeetMeConf"
width="800px" height="400px" archive="signedApplet.jar">
</applet>namgung0718 wrote:
Sometimes this error occurs :
load: class applet.OMcsAppletMeetMeConf...
java.lang.ClassNotFoundException: applet.OMcsAppletMeetMeConf
Caused by: java.io.IOException: open HTTP connection failed:http://192.168.73.101/mcs/applet/applet/OMcsAppletMeetMeConf.class
- html source is :
<applet id="mm_app" alt="" codebase="/mcs/applet" code="applet.OMcsAppletMeetMeConf"
width="800px" height="400px" archive="signedApplet.jar">
</applet> As an aside. Since 'px' is the only valid unit for width and height, they should not be included in the applet element.
..This error occurs sometimes while applet load. In most cases program work normally
I can not know the cause.That applet element combined with the address would imply the JRE was (first) looking for the applet at..
[http://192.168.73.101/mcs/applet/signedApplet.jar]
When I try that link in FF, I get the message..
Network Timeout
The server at 192.168.73.101 is taking too long to respond.
plz.. help me..Please take the effort to spell all 6 letters of the word 'please'. -
Java.io.IOExcetion :open HTTP Connection Failed
Hi Everybody,
I'm getting the java.io.IOExcetion :open HTTP Connection Failed error when I'm trying run a html page with an embedded Applet in it.
We are having a proxy server and all our network traffic have to be done through proxy.
But in Browser we give exemption to local host.
When I run the html file outside JDeveloper keeping it in the same directory in which the Applets class file is : I'm getting the Applet running.
But If I run the html page From JDeveloper , I'm getting the above said error.
My JRE is configured to use Browser settings and the browser is set to use the proxy.
Why are applets not able to connnect to the sever?
How to make Jdeveloper connect to proxy?
Thanking you for the answer?
SambaOh ! I thought i could change in my pc control panel settings for rectify the error (java.io.IOException: open HTTP connection failed.)..
Ok now my name is displayed in forum..
Which trigger i have to call when a form is loaded? (Instead of When-New-Form-Instance ).
I am running samples which i downloaded from your website only.(A java input dialog box)
Input Dialog box is not displayed?
and also java.io.IOException: open HTTP connection failed error is displayed... -
Hi,
I'm using a pjc on my forms but on runtime i received an error: open HTTP connection failed.
The output of my java console is :
Oracle JInitiator: Version 1.3.1.22
Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
User home directory = D:\documents and settings\OFV7600
Proxy Configuration: Automatic Proxy Configuration
JAR cache enabled
Location: D:\documents and settings\OFV7600\Oracle Jar Cache
Maximum size: 50 MB
Compression level: 0
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
q: hide console
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
Loading http://do040001334/forms60java/f60all.jar from JAR cache
Loading http://do040001334/hsd65-java/hst65.jar from JAR cache
Loading http://do040001334/forms60java/classes12.jar.sig from JAR cache
Loading http://do040001334/forms60java/cadtest.jar.sig from JAR cache
Loading http://do040001334/forms60java/browser_jpkg.jar.sig from JAR cache
Loading http://do040001334/forms60java/TutoFichier.jar.sig from JAR cache
Loading http://do040001334/forms60java/stip.jar.sig from JAR cache
Loading http://do040001334/forms60java/pkg_scroll.jar.sig from JAR cache
Loading http://do040001334/forms60java/client.jar.sig from JAR cache
Loading http://do040001334/forms60java/pkg_geosoft.jar.sig from JAR cache
Loading http://do040001334/forms60java/cadtest20060320.jar.sig from JAR cache
connectMode=Socket
serverHost=DO040001334
serverPort=9000
Forms Applet version is : 60824
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Where is my problem ?
How to resolve my problem ?
Thanksthanks,
I had do the classpath
Now, I have another problem
Oracle JInitiator: Version 1.3.1.22
Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
User home directory = D:\documents and settings\OFV7600
Proxy Configuration: Automatic Proxy Configuration
JAR cache enabled
Location: D:\documents and settings\OFV7600\Oracle Jar Cache
Maximum size: 50 MB
Compression level: 0
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
q: hide console
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
Loading http://do040001334/forms60java/f60all.jar from JAR cache
Loading http://do040001334/hsd65-java/hst65.jar from JAR cache
Loading http://do040001334/forms60java/classes12.jar.sig from JAR cache
Loading http://do040001334/forms60java/cadtest.jar.sig from JAR cache
Loading http://do040001334/forms60java/browser_jpkg.jar.sig from JAR cache
Loading http://do040001334/forms60java/TutoFichier.jar.sig from JAR cache
Loading http://do040001334/forms60java/stip.jar.sig from JAR cache
Loading http://do040001334/forms60java/pkg_scroll.jar.sig from JAR cache
Loading http://do040001334/forms60java/client.jar.sig from JAR cache
Loading http://do040001334/forms60java/pkg_geosoft.jar.sig from JAR cache
Loading http://do040001334/forms60java/cadtest20060320.jar.sig from JAR cache
connectMode=Socket
serverHost=DO040001334
serverPort=9000
Forms Applet version is : 60824
_____START CADViewerWrapper() constructor_____
Running CADViewer 8.0.6d
Exception =java.security.AccessControlException: access denied (java.io.FilePermission viewer.cfg read)
java.security.AccessControlException: access denied (java.io.FilePermission viewer.cfg read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.isDirectory(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at com.cadviewer.be.a(Unknown Source)
at com.cadviewer.be.do(Unknown Source)
at com.cadviewer.e0.m(Unknown Source)
at com.cadviewer.e0.a(Unknown Source)
at com.cadviewer.ViewerAWT.<init>(Unknown Source)
at cadtest20060320.CADViewerWrapper2.<init>(CADViewerWrapper2.java:78)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
url=file:/d:/acad_B/es/cat/STIP/Extract/410009.dwf
url=file:/d:/acad_B/es/cat/STIP/Extract/410009.dwf
Netscape security model is no longer supported.
Please migrate to the Java 2 security model instead.
Netscape security model is no longer supported.
Please migrate to the Java 2 security model instead.
protocol=file,fileURL.getHost()=,fileURL.getPort()=-1,fileURL.getFile()=/d:/acad_B/es/cat/STIP/Extract/410009.dwf
FileToArray url=file:/d:/acad_B/es/cat/STIP/Extract/410009.dwf
longName=dummy.dwf
java.lang.NullPointerException
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at cadtest20060320.CADViewerWrapper2.<init>(CADViewerWrapper2.java:84)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
__START CadWrapper public void init
__END CadWrapper public void init
What about -
Error: java.io.IOException: open HTTP connection failed
When im trying to load ANY Java applet i get this error:
load: class y.po.0 not found.
java.lang.ClassNotFoundException: y.po.0
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 morePlease help me.. what can i do?
I tried to load the applet in IE and Firefox.. no luck.. :(Hi ,
Even Iam getting same error error message is as follows. I tried setting codebase to appropriately but still Iam getting the same error. I searched all the forums they were also talking abt proxy setting does has any idea is that is also one of the reason. Please let me know how can I fix this problem. same application works fine with MSJVM but not with SUN JVM 1.4.2_07.
Waiting for reply....
Thanks
Nagaraj
ERROR Message:
load: class EFileDownloadViewApplet.class not found.
java.lang.ClassNotFoundException: EFileDownloadViewApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method) -
I am using Oracle forms 10.1.2.0.2 on Windows Xp and using a java bean taken from following location:
http://forms.pjc.bean.over-blog.com/ext/http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf
Now when i deploy it in my development environment, then following errors is seen in Java Console:
>
Oracle JInitiator: Version 1.3.1.22
Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\mmunir
Proxy Configuration: no proxy
JAR cache enabled
Location: C:\Documents and Settings\mmunir\Oracle Jar Cache
Maximum size: 50 MB
Compression level: 0
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
q: hide console
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
Loading http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall_jinit.jar FormsProperties.jar from JAR cache
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.0
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.0
>
I have gone throug the following thread to fix this issue but to no avail.
Error oracle.forms.engine.Main not found.java.lang.ClassNotFoundException
Please help?Kindly find find below the required information:
<H1> formsweb.cfg file </H1>
>
[bean]
form=BEAN.fmx
userid=gl/xyz@orcl
baseHTMLjpi=basejpi.htm
baseHTMLJInitiator=basejpi.htm
jpi_download_page=http://java.sun.com/products/archive/j2se/1.4.2_06/index.html
archive=frmall.jar FormsProperties.jar
jpi_classid=clsid:CAFEEFAC-0014-0002-0006-ABCDEFFEDCBA
jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,06
jpi_mimetype=application/x-java-applet;jpi-version=1.4.2_06
em_mode=0
>
<H1> Java Console </H1>
>
Java Plug-in 1.6.0_22
Using JRE version 1.6.0_22-b04 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\mmunir
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
basic: Starting applet teardown
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9a3fdba952bbd446e914da8fd1a8d5ecd with proxy=DIRECT
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/ with proxy=DIRECT
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9a3fdba952bbd446e914da8fd1a8d5ecd with proxy=DIRECT
basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@7b7b11
basic: Plugin2ClassLoader.addURL parent called for http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 464428 us, pluginInit dt 53483491 us, TotalTime: 53947919 us
basic: Applet initialized
basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@7b7b11
basic: Applet made visible
basic: Starting applet
basic: completed perf rollup
Loaded image: jar:http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar!/oracle/forms/icons/splash.gif
Loaded image: jar:http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar!/oracle/forms/icons/oracle_logo.gif
Loaded image: jar:http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar!/oracle/forms/icons/bgnd.gif
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/oracle/forms/registry/Registry.dat, version: null]
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/oracle/forms/registry/Registry.dat with proxy=DIRECT
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/ with proxy=DIRECT
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/oracle/forms/registry/default.dat, version: null]
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/oracle/forms/registry/default.dat with proxy=DIRECT
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/frmservlet?Config=bean&acceptLanguage=en-us&ifcmd=startsession with proxy=DIRECT
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9788bf36fce964dcdab6dd331b3d189df?ifcmd=getinfo&ifhost=ssi-mmunir&ifip=172.18.1.185 with proxy=DIRECT
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9788bf36fce964dcdab6dd331b3d189df with proxy=DIRECT
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Finished applet teardown
Forms Applet version is : 10.1.2.0
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9788bf36fce964dcdab6dd331b3d189df with proxy=DIRECT
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/oracle/forms/demo/GetCanvasProp.class, version: null]
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/oracle/forms/demo/GetCanvasProp.class with proxy=DIRECT
java.lang.ClassNotFoundException: oracle.forms.demo.GetCanvasProp
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/oracle/forms/demo/GetCanvasProp.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 21 more
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9788bf36fce964dcdab6dd331b3d189df with proxy=DIRECT
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9788bf36fce964dcdab6dd331b3d189df with proxy=DIRECT
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9788bf36fce964dcdab6dd331b3d189df with proxy=DIRECT
basic: Applet started
basic: Told clients applet is started
network: Connecting http://ssi-mmunir.ssilhr.com.pk:8889/forms/lservlet;jsessionid=ac1201b922b9788bf36fce964dcdab6dd331b3d189df with proxy=DIRECT
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null]
network: Cache entry not found [url: http://ssi-mmunir.ssilhr.com.pk:8889/forms/java/frmall.jar FormsProperties.jar, version: null] -
Https Connection from servlets using JSSE.
Hi all,
Although my question is the same as the QOW for this week, there is an error "unsupported keyword EMAIL" returned when i try to establish a https connection using servlet. The error log is as follow:
=====================================
java.io.IOException: unsupported keyword EMAIL
at com.sun.net.ssl.internal.ssl.AVA.<init>([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.ssl.RDN.<init>([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.ssl.X500Name.a([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.ssl.X500Name.<init>([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream([DashoPro-V1.2-120198])
at URLReader.doGet(URLReader.java:78)
===================================
Does anyone know the meaning of this error?
I try to write a java application using the similar code and it totally works fine(i can connect to the server and obtain the page). Does JSSE support Java Servlet? Or this is the problem of tomcat server? FYI, I'm using
Tomcat 3.2.2
Java SDK 1.3
Many thanks!
Ethan
p.s. Here is the source for my program
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.net.*;
import javax.net.ssl.*;
import com.sun.net.ssl.*;
public class URLReader extends HttpServlet{
private PrintWriter out = null;
public void doGet(HttpServletRequest req, HttpServletResponse res){
res.setContentType("text/html");
res.setHeader("Cache-Control", "no-cache");
res.setHeader("Progma", "no-cache");
out = res.getWriter();
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("javax.net.ssl.trustStore", "File_for_keyStore");
System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
try {
URL url = new URL("https://server_name:port/index.htm");
HttpsURLConnection urlconnection = (HttpsURLConnection)url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(urlconnection.getInputStream()));
String outputLine ;
while ( (outputLine = in.readLine()) != null){
out.println("There is the result: "+outputLine);
in.close();
catch(Exception e){
public void doPost(HttpServletRequest req, HttpServletResponse res){
}I was just having this issue, after months of error-free ssl behavior, on a new machine i was installing (Note: that I was running the IBM jdk1.3) It turns out that when I was editing the java.security file to know about JCE/JSSE providers i had the providers in the wrong order. The Error causing sequence was:
security.provider.1=com.sun.net.ssl.internal.ssl.Provider
security.provider.2=com.ibm.crypto.provider.IBMJCA
# Extra provider added ibm@33894
security.provider.3=com.ibm.crypto.provider.IBMJCE
# extra provider i added
security.provider.4=sun.security.provider.Sun
The issue disappeared when i changed the order to:
security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=com.ibm.crypto.provider.IBMJCA
# Extra provider added ibm@33894
security.provider.4=com.ibm.crypto.provider.IBMJCE
hope that helps!
--john molnar
Trellis Network Security -
HTTPS connection from servlet to another webserver
Hi,
We want to make a https connection from a servlet in weblogic server to another
web server (not necessarily weblogic). We also need dual authentication. But whenever
we use URL.openConnection(), it always returns us weblogic's internal https and
SSL implementation. Since weblogic has no documentation about how to use these
internal classes, such as how to set trusted server certificate, and how to set
client certificate (servlet is a client of another web server). We want to use
jsse, after setting JSSE required system properties, I still get a weblogic's
httpsURLConnection. Can any of you tell me how to resolve this issue?
Thanks.
XinshiYeah, I'm using JSSE now. Here is what I did:
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provide());
Provider prov = new SimpleSecureProvider();
prov.setProperty("SecureRandom.efficient", "test.EfficientSecureRandom");
Security.insertProviderAt(prov, 1);
You don't really need the provider stuff to get the example working. I use it
to get around a quick in JSSE where the random number generator takes 15-30 seconds
to generate a random sequence at start up.
SimpleSecureProvider looks like this:
public class SimpleSecureProvider extends Provider
public SimpleSecureProvider()
super("SimpleSecureProvider-", 1.0, "Hack to enable more efficient random
seed generator");
test.EfficientSecureRandom is bascially an exact copy of Sun's SecureRandom.java
with the only difference that I used my own random number generator.
Anyway, rest of the code you need looks like this:
URL url= new URL("htps://someplace.com");
URLConnection sconnection = url.openConnection();
Do whatever.
I also stored jcert.jar, jnet.jar, jsse.jar in /usr/java/jdk1.3/lib/ext
I think that is everything.
I just noticed that service pack 9 has a security example that does not require
all these jsse hacks. I'm trying to get it to work, but not having much luck.
Anybody got this working right?
"Jayesh Patel" <[email protected]> wrote:
See if this works,
1. Add the 'j2ee.jar' to CALSSPATH in weblogic startup script.
2. Set the property SSLHandlerEnabled flase in config.xml
3. Add the following property permission to the
weblogic.policy' file under a 'grant' directive
for all codebases (bottom): 'permission java.security.AllPermission'
4. Use the following bit of source code to create an https connection:
import com.sun.net.ssl.*; ....
com.sun.net.ssl.HttpsURLConnection connection;
System.setProperty ("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
java.security.Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider() );
URL url = new URL( "https", hostname, query );
-Jayesh
connection = (com.sun.net.ssl.HttpsURLConnection )url.openConnection(
"Xinshi Sha" <[email protected]> wrote in message
news:[email protected]...
Hi,
We want to make a https connection from a servlet in weblogic serverto
another
web server (not necessarily weblogic). We also need dual authentication.But whenever
we use URL.openConnection(), it always returns us weblogic's internalhttps and
SSL implementation. Since weblogic has no documentation about how
to
use
these
internal classes, such as how to set trusted server certificate, andhow
to set
client certificate (servlet is a client of another web server). Wewant to
use
jsse, after setting JSSE required system properties, I still get aweblogic's
httpsURLConnection. Can any of you tell me how to resolve this issue?
Thanks.
Xinshi -
HTTPS connection from portal to external webserver
Hi,
I am looking for a way to open a HTTPS connection from portal server to an external webserver. According to <a href="http://help.sap.com/saphelp_nw04/helpdata/en/e2/71c83edf72e16be10000000a114084/content.htm">SAP</a> the code should look like
KeyStore keystoreCAs = ...
SecureConnectionFactory factory = new SecureConnectionFactory(keystoreCAs, null);
HttpURLConnection con = factory.createURLConnection("https://www.mycompany.com");
Does not look difficult, <b>but how do I create the keystore object</b>? The keystore object should somehow be connected to the portal server's keystore which manages the certificates of trusted Certificate Authorities.
Any ideas?
Regards,
MartinHi,
meanwhile I solved the problem by my own. The solution slightly simplified is given below.
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
java.lang.Object o = ctx.lookup("keystore");
com.sap.engine.services.keystore.interfaces.KeystoreManagerWrapper_Stub manager = (com.sap.engine.services.keystore.interfaces.KeystoreManagerWrapper_Stub) o;
java.security.KeyStore keystoreCAs = manager.getKeystore("TrustedCAs");
com.sap.security.core.server.https.SecureConnectionFactory factory = new SecureConnectionFactory(keystoreCAs, null);
java.net.HttpURLConnection con = factory.createURLConnection("https://www.mycompany.com");
For connecting via a proxy the host name and port number of the proxy have to be set as System properties using "https.proxyHost" and "https.proxyPort".
java.util.Properties systemSettings = System.getProperties();
systemSettings.put("proxySet", "true");
systemSettings.put("https.proxyHost","192.168.0.1") ;
systemSettings.put("https.proxyPort", "80") ;
Additionally you have to make sure that the server's certificate is issued by a trusted Certification Authority (Must have an entry in your Keystore "TrustedCAs"). To verify this use the Visual Administrator and view service "Key Storage".
Regards,
Martin -
Connection refused when trying to getOutputStream from https connection
Hi all !
I want to make an https connection with a server to send/get the request/response
What can be the cause of the following error in the following code testHttps.java?
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.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.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.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
at Test.testHttps.main(testHttps.java:46)
Exception in thread "main" 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.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.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.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at Test.testHttps.main(testHttps.java:51)
testHttps.java
package Test;
import java.io.;
import java.net.;
import javax.net.ssl.*;
public class testHttps {
public static void main(String args[]) throws Exception {
//System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
// Install the all-trusting trust manager
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (Exception e) {
System.out.println("Error" e);
// Now you can access an https URL without having the certificate in the truststore
try {
URL url = new URL("https://..............");-->//address of the server given here
URLConnection conn = url.openConnection();
HttpsURLConnection urlConn = (HttpsURLConnection) conn;
urlConn.setDoOutput(true);
OutputStreamWriter wr = null;
try{
wr = new OutputStreamWriter(conn.getOutputStream());
catch(Exception e){
e.printStackTrace();
BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String str;
while( (str=in.readLine()) != null) {
System.out.println(str);
} catch (MalformedURLException e) {
System.out.println("Error in SLL Connetion" +e);
HostnameVerifier hv = new HostnameVerifier()
public boolean verify(String urlHostName, SSLSession session)
System.out.println("Warning: URL Host: " urlHostName " vs. "
session.getPeerHost());
return true;
want to ignore certificate validation.
plese help me..
hi brucechapman, as you suggested me, i posted in Core API- networking forum, now please gimme a solution
Thanks in advance.hi brucechapman,
ran the NetTest program, got the following exception:
trigger seeding of SecureRandom
done seeding SecureRandom
Exception in thread "main" 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.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.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.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at Test.NetTest.main(NetTest.java:40)
NetTest.java:40 -- InputStream is = url.openStream(); at this ling throwing exception.
For the following program, i have added the argument -Djavax.net.ssl.trustStore=cacerts
i have exported the certificate from IE and added to the keystore.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.security.Security;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
public class Communicator {
public static void main(String[] args) {
try {
int port = 34443;
String strReq = "xml content ";
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) factory.createSocket("jyoti-win2k8-32", port);
//Writer out = new OutputStreamWriter(socket.getOutputStream());
//out.write("GET http://" + "hostname" + "/ HTTP 1.1\r\n");
// out.write("\r\n");
//out.write(strReq);
//out.flush();
OutputStreamWriter wr = null;
try{
wr = new OutputStreamWriter(socket.getOutputStream());
catch(Exception e){
e.printStackTrace();
System.out.println("got output stream");
try{
wr.write(strReq);
//System.out.println("response code : "+conn.getResponseCode());
System.out.println("written");
wr.flush();
catch(IOException e){
e.printStackTrace();
InputStreamReader is = new InputStreamReader(socket.getInputStream(),"UTF8") ;
BufferedReader rd = new BufferedReader(is);
String line;int count=0;
System.out.println("rd "+rd);
while ((line = rd.readLine()) != null) {
System.out.println("line "+line );
System.out.println(count++);
// Process line...
System.out.println(count);
rd.close();
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
int c;
while ((c = in.read()) != -1) {
System.out.write(c);
//out.close();
in.close();
socket.close();
} catch(IOException ex) {
ex.printStackTrace();
Exception :
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
at sun.nio.cs.StreamEncoder.flush(Unknown Source)
at java.io.OutputStreamWriter.flush(Unknown Source)
at Test.Communicator.main(Communicator.java:55)
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.validator.PKIXValidator.<init>(Unknown Source)
at sun.security.validator.Validator.getInstance(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.getValidator(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
... 7 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(Unknown Source)
at java.security.cert.PKIXParameters.<init>(Unknown Source)
at java.security.cert.PKIXBuilderParameters.<init>(Unknown Source)
... 19 more
java.net.SocketException: Socket is closed
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getInputStream(Unknown Source)
at Test.Communicator.main(Communicator.java:66)
please help me and provide me suggestion/solution. how to get rid off this trustanchor paramater exception
what is it actualy?
Thanks in advance.
Maybe you are looking for
-
What's wrong with skype and banning my accounts?
I've had many accounts 8+ banned, I've had to switch aliases multiple times including [Removed for privacy] and others, I make an account and within a week it get's banned, idk if its a ban but when it happens my client crashes then when I try to rec
-
Can anybody tell me how to overcome the below issue. advance thanks. Job started Step 001 started (program RSDBAJOB, variant &0000000000011, user ID WILBASIS) Execute logical command BRCONNECT On host SAPIDES Parameters: -u / -jid CHECK20091116185555
-
Problem with Mail in Snow Leopard
I have iOS10.6.8. My mail program keeps recovering an email that I sent a week ago. It included photos. I delete them, but they just keep returning. Worse, no new emails from that account appear. I can send, but not receive unless I go to my iClo
-
XML having a JSP as XSL stylesheet ...
Hi, In WLS 5.1 SP6, I have a XML which uses as XSL stylesheet a JSP served by WebLogic (<?xml/stylesheet href="style.jsp?order=3"?> It appears that, when I try to pass more than one parameter to my JSP (i.e. "style.jsp?order=3&value=1"), the XML page
-
I want to replace "\" with "/" in a string.
I tried this... String whatever = myString.replace("\\", "/"); ...and this... String whatever = myString.replace("\", "/"); ...but I get an error. I was able to get it to work doing it this way... String slashStr = "\\/"; char slashArr[] = slashStr.t