WebSphere Application Server - java.lang.ClassNotFoundException using calling applet from jsp via jsp:plugin

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > June 2004 > java.lang.ClassNotFoundException using calling applet from jsp via jsp:plugin





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author java.lang.ClassNotFoundException using calling applet from jsp via jsp:plugin
Jimmy Pearson

2004-06-26, 10:02 am

I am getting a java.lang.ClassNotFoundException when calling my Java
applet from my jsp.

Following is code from jsp:

<BODY>
<P>Applet used to download files</P>
<%

// Grab the variables from the form.
String downloadURL = request.getParameter("downloadURL");
%>

<jsp:plugin type="applet"
code="com.ibm.etcbuild.jdownload.TestJDownloadApplet"
codebase="." width="600" height="300" archive="JDownload.jar">
<jsp:params>
<jsp:param name="downloadURL" value="<%=downloadURL%>" />
</jsp:params>
<jsp:fallback>Unable to load applet. Contact Build
Team.</jsp:fallback>
</jsp:plugin>

</BODY>

Following is dump from Java console:
----------------------------------------------------
load: class com.ibm.etcbuild.jdownload.TestJDownloadApplet.class not
found.
java.lang.ClassNotFoundException:
com.ibm.etcbuild.jdownload.TestJDownloadApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
....
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
....

I have my jar file stored in same location as jsp file. I am running
this on a WAS 5.1 server. It works when I use the test server included
with WSAD 5.1. I have also tried just copying the class files to the
web-inf/classes folder on the server and removed the reference to the
jar file. However, that still didn't work.

I do not know what else to try. What am I missing? I am using the java
1.4.2 plugin with my IE 6 browser.
George Chorny

2004-06-27, 2:48 am

Hi,

Try putting your TestJDownloadApplet.jar in the root of your app...
i.e. in the root of your WAR directory.

- George C.

Jimmy Pearson wrote:

> I am getting a java.lang.ClassNotFoundException when calling my Java
> applet from my jsp.
>
> Following is code from jsp:
>
> <BODY>
> <P>Applet used to download files</P>
> <%
>
> // Grab the variables from the form.
> String downloadURL = request.getParameter("downloadURL");
> %>
>
> <jsp:plugin type="applet"
> code="com.ibm.etcbuild.jdownload.TestJDownloadApplet"
> codebase="." width="600" height="300" archive="JDownload.jar">
> <jsp:params>
> <jsp:param name="downloadURL" value="<%=downloadURL%>" />
> </jsp:params>
> <jsp:fallback>Unable to load applet. Contact Build
> Team.</jsp:fallback>
> </jsp:plugin>
>
> </BODY>
>
> Following is dump from Java console:
> ----------------------------------------------------
> load: class com.ibm.etcbuild.jdownload.TestJDownloadApplet.class not
> found.
> java.lang.ClassNotFoundException:
> com.ibm.etcbuild.jdownload.TestJDownloadApplet.class
> at sun.applet.AppletClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ...
> Caused by: java.io.IOException: open HTTP connection failed.
> at sun.applet.AppletClassLoader.getBytes(Unknown Source)
> ...
>
> I have my jar file stored in same location as jsp file. I am running
> this on a WAS 5.1 server. It works when I use the test server included
> with WSAD 5.1. I have also tried just copying the class files to the
> web-inf/classes folder on the server and removed the reference to the
> jar file. However, that still didn't work.
>
> I do not know what else to try. What am I missing? I am using the java
> 1.4.2 plugin with my IE 6 browser.


Jimmy Pearson

2004-06-28, 9:01 am

George, thanks for the reply. That is where the jar file is located
now. Following is a listing of the directory:

Directory of C:\Program
Files\WebSphere\AppServer\installedApps\
build24\JDownl
adEAR.ear\JDownloadWeb.war

06/25/2004 08:54a <DIR> .
06/25/2004 08:54a <DIR> ..
06/23/2004 04:28p 606 JDownload.html
06/23/2004 04:26p 309,655 JDownload.jar
06/24/2004 11:16p <DIR> META-INF
06/25/2004 03:42p 865 TestJSP.jsp
06/25/2004 09:38a <DIR> WEB-INF

Notice that the jsp file and the jar file are in the same war
directory. In my mind, this should work. Any other suggestions or
examples that you have of a jsp calling and applet with a jar file. I
also tried copying the contents of the jar file to the web-inf/classes
directory and got the same result.

George Chorny <gchorny@ravatech.com> wrote in message news:<0mtDc.12552$OT6.8065207@news4.srv.hcvlny.cv.net>...[vbcol=seagreen]
> Hi,
>
> Try putting your TestJDownloadApplet.jar in the root of your app...
> i.e. in the root of your WAR directory.
>
> - George C.
>
> Jimmy Pearson wrote:
>
George Chorny

2004-06-28, 9:01 am

Hi,

I'm sure you've already seen this.. but if not, take a look here
http://java.sun.com/products/jsp/ta...ref11.fm12.html

Also, try getting rid of the "codebase" tag... that'll ensure that JSP is
looking for the jar in the same dir as .jsp file is located

- George

Jimmy Pearson wrote:
[vbcol=seagreen]
> George, thanks for the reply. That is where the jar file is located
> now. Following is a listing of the directory:
>
> Directory of C:\Program
> Files\WebSphere\AppServer\installedApps\
build24\JDownl
> adEAR.ear\JDownloadWeb.war
>
> 06/25/2004 08:54a <DIR> .
> 06/25/2004 08:54a <DIR> ..
> 06/23/2004 04:28p 606 JDownload.html
> 06/23/2004 04:26p 309,655 JDownload.jar
> 06/24/2004 11:16p <DIR> META-INF
> 06/25/2004 03:42p 865 TestJSP.jsp
> 06/25/2004 09:38a <DIR> WEB-INF
>
> Notice that the jsp file and the jar file are in the same war
> directory. In my mind, this should work. Any other suggestions or
> examples that you have of a jsp calling and applet with a jar file. I
> also tried copying the contents of the jar file to the web-inf/classes
> directory and got the same result.
>
> George Chorny <gchorny@ravatech.com> wrote in message
> news:<0mtDc.12552$OT6.8065207@news4.srv.hcvlny.cv.net>...

Jimmy Pearson

2004-06-28, 7:35 pm

Instead of my issue being a JSP calling an applet problem, I think my
issue is really configuring IHS 2.0 to call my Websphere server
application. When I use the 9080 port on my server, my applet works.
Therefore, I am researching how to configure my IHS to connect to my
websphere server. If anyone has any advice, let me know. I have
deployed an application before and I didn't have any issues. I did not
have any jar files in that example. It was all jsp files calling java
beans.
Jimmy Pearson

2004-06-28, 7:35 pm

Yes I had looked at this page. I finally figured out today that my
Websphere server was working (9080) but the problem was with the IHS
server working with the Webpshere plugin. Since I'm a novice, I did
not know to go to Environment in Websphere admin page and regenerate
the Web server plugin. I won't forget that again. Basically any time I
add an application, I need to do this. I must have done this on my
first application but forgot about it.

Thanks for the feedback.

George Chorny <gchorny@ravatech.com> wrote in message news:<LbMDc.24797$OT6.11584482@news4.srv.hcvlny.cv.net>...[vbcol=seagreen]
> Hi,
>
> I'm sure you've already seen this.. but if not, take a look here
> http://java.sun.com/products/jsp/ta...ref11.fm12.html
>
> Also, try getting rid of the "codebase" tag... that'll ensure that JSP is
> looking for the jar in the same dir as .jsp file is located
>
> - George
>
> Jimmy Pearson wrote:
>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com