File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Applet not loading due to IOException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet not loading due to IOException" Watch "Applet not loading due to IOException" New topic
Author

Applet not loading due to IOException

mustafa bamboat
Greenhorn

Joined: May 22, 2005
Posts: 8
Dear Gurus,

I have build appletServlet application by using Swing components, JDK1.5 update 11 and MySql database at backhand.

The problem is that, my applet is running fine with 4 classes but as I declare the structure of fifth class is not loading in a browser and throwing following error:

==========================================
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost/dmronline/dmronline.jar
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.plugin.net.protocol.http.HttpUtils.followRedirects(Unknown Source)
at sun.plugin.cache.CachedJarLoader.isUpToDate(Unknown Source)
at sun.plugin.cache.CachedJarLoader.loadFromCache(Unknown Source)
at sun.plugin.cache.CachedJarLoader.load(Unknown Source)
at sun.plugin.cache.JarCache.get(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
at sun.misc.URLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getResource(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
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)
load: class dmronline.frmMain.class not found.
java.lang.ClassNotFoundException: dmronline.frmMain.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)
... 10 more

=========================================

Here I am enclosing the structure of fifth class

public class table_sc{

public table_sc(){}//end constructor

}

Kindly, let me know why it is happening and how I can solve out this problem.

Looking forward to your kindly response

Regards,

bamboat_3@hotmail.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
Welcome to JavaRanch.

Where is the "http://localhost/dmronline/dmronline.jar" coming from - is that a file you're referencing in the applet tag? Does it exist on the server?


Ping & DNS - my free Android networking tools app
mustafa bamboat
Greenhorn

Joined: May 22, 2005
Posts: 8
Dear Ulf Dittmer,

Thanks for replying, yes it is exists on Server in a war form, here I am enclosing the project files with small modification i.e. excluding original password and Username

you may download the war file from the www.ppiusindh.org/myproject/

but the problem is that when you add one more class in a dmronline.jar and relaunch the war on a server it will give the error which I have mentioned in my previous post. Thou I am just adding simple class structure.


here I am enclosing the structure of a file which causing error

public class social_table{

public social_table(){}//end constructor

}//end class

Once again Thanks for replying and looking forward to your kind response

Regards,
M.A.Bamboat
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
What happens if you remove the codebase attribute? It is unnecessary if the jar file is in the same directory as the HTML/JSP file that contains the applet tag.
mustafa bamboat
Greenhorn

Joined: May 22, 2005
Posts: 8
Hi,

Thanks, yes after removing codebase tag from jsp file, its working but the same problem is still laying there.

Here I am also enclosing the Tomcat 5.5 Log:

===========================
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.NoSuchMethodError: org.apache.naming.resources.ResourceAttributes.getCanonicalPath()Ljava/lang/String;
at org.apache.catalina.servlets.DefaultServlet.checkSendfile(DefaultServlet.java:1521)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:839)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:348)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
======================================

I am confuse that it doesn't work when I declare simple structure class i.e. socialTable or declare any other classes except the previous 6 classes namely are: catchmentArea_table,createDMR,districtprofile_table,dmr_app,facilityprofile,and frmMain (you find these classes in a dmronline.jar)

looking forward to your kind response

regards,

M.A.Bamboat
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
This is a server exeption; it has nothing to do with the applet. It might be caused be mismatched libraries in the Tomcat server. Did you move around any of the jar files by any chance?
mustafa bamboat
Greenhorn

Joined: May 22, 2005
Posts: 8
Dear Ulf Dittmer ,

Hence the problem solved, it was a problem of servlet.service() in tomcat 5.5.20, but thanks to tomcat, that such a problem is resolved in tomcat 5.5.23, and my application is running fine over it.

Once again thanks a lot for your help and tomcat too.

Regards,

M.A.Bamboat
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Applet not loading due to IOException
 
Similar Threads
Problem running an applet
class not found exception ,open HTTP connection failed
Applet notinit...
Problem loading applet from servlet - load: xxx.class not found
Error in loading Applet from JSP