Help in Applet

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Help in Applet

Mamdouh Kaadan-2
Dear All

 

I want to run applet in OFBIZ, I have done the following:

 

1-       I have create an applet class called EmbeddedViewerApplet

This class exists in the following path:
ofbiz\framework\webapp\src\org\ofbiz\webapp\applet

2-       In the web.xml, I have added applet the allowedPaths

<init-param>

            <param-name>allowedPaths</param-name>

 
<param-value>/control:/select:/index.html:/index.jsp:/default.html:/defa
ult.jsp:/applet:/images:/includes/maincss.css</param-value>

      </init-param>

3-       In my module which Is CRM I have added the archive file:
jasperreports-0.6.0-applet.jar in the following path:
ofbiz\applications\crm\webapp\crmmgr\applet

4-       In the ftl file the code is:

<!--"CONVERTED_APPLET"-->

<!-- HTML CONVERTER -->

<SCRIPT LANGUAGE="JavaScript">

<!--

    var _info = navigator.userAgent;

    var _ns = false;

    var _ns6 = false;

    var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 &&
_info.indexOf("Windows 3.1") < 0);

//-->

</SCRIPT>

    <COMMENT>

        <SCRIPT LANGUAGE="JavaScript1.1"><!--

        var _ns = (navigator.appName.indexOf("Netscape") >= 0 &&
((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0
&&java.lang.System.getProperty("os.version").indexOf("3.5") < 0) ||
(_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) ||
(_info.indexOf("AIX") > 0) ||(_info.indexOf("OS/2") > 0)));

        var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));

//--></SCRIPT>

    </COMMENT>

 

<SCRIPT LANGUAGE="JavaScript"><!--

    if (_ie == true) document.writeln('<OBJECT
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "600"
HEIGHT = "400"
codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.c
ab#Version=1,1,2,0"><NOEMBED><XMP>');

    else if (_ns == true && _ns6 == false) document.writeln('<EMBED
type="application/x-java-applet;version=1.1.2" CODE
="org.ofbiz.webapp.applet.EmbeddedViewerApplet" CODEBASE =
"/crmmgr/applet" ARCHIVE =
"/crmmgr/applet/jasperreports-0.6.0-applet.jar" WIDTH = "600"HEIGHT =
"400" scriptable=false
pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.ht
ml"><NOEMBED><XMP>');

//-->

</SCRIPT>

<APPLET  CODE = "org.ofbiz.webapp.applet.EmbeddedViewerApplet" CODEBASE
= "/crmmgr/applet" ARCHIVE =
"/crmmgr/applet/jasperreports-0.6.0-applet.jar"WIDTH = "600" HEIGHT =
"400"></XMP>

<PARAM NAME = CODE VALUE =
"org.ofbiz.webapp.applet.EmbeddedViewerApplet" >

<PARAM NAME = CODEBASE VALUE = "/crmmgr/applet" >

<PARAM NAME = ARCHIVE VALUE =
"/crmmgr/applet/jasperreports-0.6.0-applet.jar" >

<PARAM NAME="type" VALUE="application/x-java-applet;version=1.2.2">

<PARAM NAME="scriptable" VALUE="false">

</APPLET>

</NOEMBED>

</EMBED>

</OBJECT>

<!--

<APPLET CODE = "org.ofbiz.webapp.applet.EmbeddedViewerApplet" CODEBASE =
"/crmmgr/applet" ARCHIVE =
"/crmmgr/applet/jasperreports-0.6.0-applet.jar"WIDTH = "600" HEIGHT =
"400">

</APPLET>

-->

<!--"END_CONVERTED_APPLET"-->

5-       In the java console I'm getting the following error:

sun.plugin.cache.DownloadException

      at sun.plugin.cache.CachedFileLoader.load(Unknown Source)

      at sun.plugin.cache.FileCache.get(Unknown Source)

      at
sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connectWithC
ache(Unknown Source)

      at
sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connect(Unkn
own Source)

      at
sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.getInputStre
am(Unknown Source)

      at java.net.HttpURLConnection.getResponseCode(Unknown Source)

      at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknow
n Source)

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

sun.plugin.cache.DownloadException

      at sun.plugin.cache.CachedFileLoader.load(Unknown Source)

      at sun.plugin.cache.FileCache.get(Unknown Source)

      at
sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connectWithC
ache(Unknown Source)

      at
sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connect(Unkn
own Source)

      at
sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.getInputStre
am(Unknown Source)

      at java.net.HttpURLConnection.getResponseCode(Unknown Source)

      at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknow
n Source)

      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 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 org.ofbiz.webapp.applet.EmbeddedViewerApplet not found.

java.lang.ClassNotFoundException:
org.ofbiz.webapp.applet.EmbeddedViewerApplet

      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

 

Can any one help me please?

 

 

Thanks in advance

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

Mamdouh Kaadan

Software Engineer

IT - Application