(e-mail address removed) wrote something like:
[...]
I have an applet program in NetBeans. I imported two JAR files, and
the project worked fine when I ran it from NetBeans. The problem
arose when I tried to launch it using the following HTML file: [...]
<APPLET
ARCHIVE = " log4j.jar, ActForexApi.jar "
CODE = Start.class
WIDTH = 600
HEIGHT = 400
</APPLET> [...]
In the above ARCHIVE parameter, I need to use two jar files, but it's
detecting only one. What should I do?
How did you determine that the applet container is loading only one JAR
file? Is the errant file name spelled correctly. Is your host file
system case sensitive? Are trailing spaces significant? Are more than
two JAR files required? Have you tried other containers?
Hello Sir,
I tried to run the above applet program using a batch file with the
following code:
@echo off
set CLASSPATH="ActForexApi.jar";"log4j.jar";"."
java -cp %CLASSPATH% Start
and its working fine.
but when i'm trying to open it in web browser(IE7 or Mozilla3) with
the above given code, it throws following exceptions:
1)
----------------------------------------------------
java.lang.ExceptionInInitializerError
at SimpleTestApplet.<init>(SimpleTestApplet.java:69)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(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.security.AccessControlException: access denied
(java.lang.RuntimePermission shutdownHooks)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.Runtime.addShutdownHook(Unknown Source)
at actforex.api.TraderApi.<clinit>(TraderApi.java:53)
... 12 more
2)
--------------------------------------------------------------------------------------------
java.lang.NoClassDefFoundError: Could not initialize class
actforex.api.TraderApi
at SimpleTestApplet.<init>(SimpleTestApplet.java:69)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(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)
------------------------------
it throws the Exception no.1 sometimes, but generally it throws 2nd
exception,
once it throws the 2nd exception, it doesn't throws 1st exception, and
keeps on throwing 2nd exception.
2nd exception contains "actforex.api.TraderApi" which is a class in a
jar file included in archive.
i'm still trying.
what could be the reason that it runs from Batch File, but not from
Html File.