Cannot run jfileupload on webserver, only locally

Upload core product.
Post Reply
xtas
Posts: 2
Joined: Thu Mar 03, 2011 5:39 pm

Cannot run jfileupload on webserver, only locally

Post by xtas »

Hello,

i'm interested in using & buying jfileupload, but i'm unable to run it through the webserver.

It's a windows XP machine, with latest xampp 1.7.4 (Apache 2.2.17), latest JRE 1.6.0_24-b07.

When i run the file locally, i.e. doubleclick applet_http.html, applet loads ok and in the browser's address bar i can see local path file://c:/...path.../applet_http.html.

But when i open my local webserver at 127.0.0.1, navigate to applet_http.html and click on it,
in the applet window there is an error message: Error. click on details (no matter if I use
firefox or IE). In a few seconds the window disappears and java crashes.
The error from java console is:

Code: Select all

load: class jfileupload.upload.client.MApplet.class not found.
java.lang.ClassNotFoundException: jfileupload.upload.client.MApplet.class
	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 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)
Exception: java.lang.ClassNotFoundException: jfileupload.upload.client.MApplet.class

Now the strange part: I thought the problem is some apache settings, but to be sure
I wrote HelloWorld.class applet, created hworld.jar archive from it, and put it to \lib dir.
I updated applet_http.js to use my hworld.jar (CODE="HelloWorld.class" and
ARCHIVE VALUE="lib\hworld.jar) and guess what? Yes, it works.

I made two simple html versions of the script loader applet_http.html (with no different browser support etc) and here they are: File1

Code: Select all

<html><body>

<APPLET CODE="jfileupload.upload.client.MApplet.class" JAVA_CODEBASE="./" ARCHIVE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar" WIDTH="250" HEIGHT="250" NAME="fileupload">

<PARAM NAME=ARCHIVE VALUE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar">
<PARAM NAME=CODE VALUE="jfileupload.upload.client.MApplet.class">
<PARAM NAME=CODEBASE VALUE="./">

<PARAM NAME=NAME VALUE="fileupload">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
<PARAM NAME="scriptable" VALUE="true">
<PARAM NAME="url" VALUE="http://localhost:8080/upload/process.jsp">
<PARAM NAME="paramfile" VALUE="uploadfile">
<PARAM NAME="param1" VALUE="todo">
<PARAM NAME="value1" VALUE="upload">
<PARAM NAME="mode" VALUE="http">
<!-- <PARAM NAME="resources" VALUE="i18n"> -->
<PARAM NAME="authentication" VALUE="auto">

</APPLET>

</body></html>
It's a simple code from the original applet_http.html and applet_http.js.
Runs ok locally (file://c:/...applet_http.html) with both FF and IE.
But makes error and crashes java vhen running through web browser (127.0.0.1/applet_http.html).


File2:

Code: Select all

<html><body>
<APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>

<PARAM NAME=ARCHIVE VALUE="lib\hworld.jar">
<PARAM NAME=CODEBASE VALUE="./">

<PARAM NAME=NAME VALUE="fileupload">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
<PARAM NAME="scriptable" VALUE="true">
<PARAM NAME="url" VALUE="http://localhost:8080/upload/process.jsp">
<PARAM NAME="paramfile" VALUE="uploadfile">
<PARAM NAME="param1" VALUE="todo">
<PARAM NAME="value1" VALUE="upload">
<PARAM NAME="mode" VALUE="http">
<!-- <PARAM NAME="resources" VALUE="i18n"> -->
<PARAM NAME="authentication" VALUE="auto">

</APPLET>

</body></html>
this one is ok from both local & webserver.


Do you have any suggestions what can cause the problem? I tried to change the applet paramerers (like CODE - some are thice in File1), i tried to change the path but still with no luck.

i tried to move the code to apache's root directory (also the /lib dir) and I get slightly different
error, it seems some applets were downloaded ok but still doesn't work, here's the new log
from java console:

Code: Select all

----------------------------------------------------
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>
----------------------------------------------------

Trace level set to 5: all ... completed.
network: CleanupThread used 2 us
network: CleanupThread used 2 us
network: CleanupThread used 2 us
network: CleanupThread used 1 us
network: Cache entry not found [url: http://127.0.0.1/lib/chttpclient.jar, version: null]
network: Connecting http://127.0.0.1/lib/chttpclient.jar with proxy=DIRECT
network: CleanupThread used 2 us
network: Downloading resource: http://127.0.0.1/lib/chttpclient.jar
	Content-Length: 360 578
	Content-Encoding: null
network: Cache entry not found [url: http://127.0.0.1/, version: null]
network: Cache entry not found [url: http://127.0.0.1/jfileupload/upload/client/MApplet.class, version: null]
network: Connecting http://127.0.0.1/jfileupload/upload/client/MApplet.class with proxy=DIRECT
network: Cache entry not found [url: http://127.0.0.1/jfileupload/upload/client/MApplet/class.class, version: null]
network: Connecting http://127.0.0.1/jfileupload/upload/client/MApplet/class.class with proxy=DIRECT
basic: load: class jfileupload.upload.client.MApplet.class not found.
load: class jfileupload.upload.client.MApplet.class not found.
java.lang.ClassNotFoundException: jfileupload.upload.client.MApplet.class
	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 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)
Exception: java.lang.ClassNotFoundException: jfileupload.upload.client.MApplet.class
security: Accessing keys and certificate in Mozilla user profile: null
Trace level set to 5: all ... completed.

but I'm still not able to make it work through the webserver in any way.
thanks, xtas

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Cannot run jfileupload on webserver, only locally

Post by support »

Are you able to download JAR files directly from browser?
You could try to contact support(at)jfileupload(dot)com if you have a testing URL.

xtas
Posts: 2
Joined: Thu Mar 03, 2011 5:39 pm

Re: Cannot run jfileupload on webserver, only locally

Post by xtas »

yes, if I enter into my brower for example http://127.0.0.1/lib/jfileupload.jar or any of the files from /lib, I get standard browser download dialog.

I'll set the firewall ane make a testing url to my computer.

tejas.j654
Posts: 3
Joined: Wed May 08, 2013 7:23 am

Re: Cannot run jfileupload on webserver, only locally

Post by tejas.j654 »

I'm facing the same problem. Currently 'm using the free version. Is it because some paths are hard coded in applet? If that is the case, why it is not reported anywhere in forums?

I'm using XAMPP 1.8.1 in windows 7. I can access the jar files from the same path so it is not a permission issue. I have copied the console log for reference.

Code: Select all

Detected from bootclasspath: C:\\PROGRA~1\\Java\\jre7\\lib\\deploy.jar
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@1ad637e
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/jfileupload.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/ftpimpl.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/cnet.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/clogging.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/jsch.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/sftpimpl.jar
network: Cache entry not found [url: http://localhost/jfileupload/lib/jfileupload.jar, version: null]
network: Connecting http://localhost/jfileupload/lib/jfileupload.jar with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
and it just hangs there.

tejas.j654
Posts: 3
Joined: Wed May 08, 2013 7:23 am

Re: Cannot run jfileupload on webserver, only locally

Post by tejas.j654 »

Hi. Even I'm facing the same problem. I'm using XAMPP 1.8.1 on Windows 7 and the applet just hangs. Is this due to a hard coded path in applet?

Here's my console log for reference.

Code: Select all

Detected from bootclasspath: C:\\PROGRA~1\\Java\\jre7\\lib\\deploy.jar
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@1ad637e
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/jfileupload.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/ftpimpl.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/cnet.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/clogging.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/jsch.jar
basic: Plugin2ClassLoader.addURL parent called for http://localhost/jfileupload/lib/sftpimpl.jar
network: Cache entry not found [url: http://localhost/jfileupload/lib/jfileupload.jar, version: null]
network: Connecting http://localhost/jfileupload/lib/jfileupload.jar with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
I tried accessing the jar file path using the same link and it works fine. So it is not a permission issue. I will attach the config file if necessary.

Post Reply