Making a single jar file from differnet packages

admin

Administrator
Staff member
Hello,I am developing an applet which uses the classes in four different packages.Allthe four packages and the appletsubclassare in the same directory.when I open the HTML page withcode="appletsubclass.class" everything works fine.*********Problem with the jar**************After deployment on the webserver to reduce the number of connections betweenthe browser and the webserver (everytime a class is instantiated )I wantedto make a single jar file with all the classes.**********current directory******************************HTML fileAppletsubclass which is the entry class for the browsercompany-division-product---data-(*.class)---graphics(*.class)---server(*.class)********************************************************To make a jar file encompassing all the class files I created a Jar packageas belowto add classes from data directoryjar cfv allclasses.jar company/division/product/data/*.classthen to add classes from graphics directory to the same jar filejar ufv allclasses.jar company/division/product/graphics/*.classthen to add classes from server directory to the same jar filejar ufv allclasses.jar company/division/product/graphics/*.classonce all the classes are added to allclasses.jar fileI test it by extracting it and found every thing ok.Then in the HTML fileI said in the applet tag<applet code="appletsubclass" archive="allclasses.jar" width=600height=600>My curent directory is f:\jartestingwebgraphics\withtwowhen i open this file the browser gives me the following exception in thejava consolecom.ms.security.SecurityExceptionEx[CBKHGR0002.init]: java.io.IOException:bad path: F:\jartestingwebgraphics\withtwo\company\division\product\superappletsubclass.classat com/ms/security/permissions/FileIOPermission.check (FileIOPermission.java)at com/ms/security/PolicyEngine.deepCheck (PolicyEngine.java)at com/ms/security/PolicyEngine.checkPermission (PolicyEngine.java)at com/ms/security/StandardSecurityManager.chk (StandardSecurityManager.java)at com/ms/security/StandardSecurityManager.checkRead (StandardSecurityManager.java)at java/io/File.isDirectory (File.java)at sun/net/www/protocol/file/FileURLConnection.connect (FileURLConnection.java)at sun/net/www/protocol/file/FileURLConnection.getInputStream (FileURLConnection.java)at com/ms/vm/loader/ResourceLoader.getURLData (ResourceLoader.java)at com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData (ResourceLoader.java)at com/ms/vm/loader/ResourceLoader.getClassData (ResourceLoader.java)at com/ms/vm/loader/URLClassLoader.findClass (URLClassLoader.java)at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)at java/lang/ClassLoader.loadClassInternal (ClassLoader.java)at CBKHGR0002.init (CBKHGR0002.java)at com/ms/applet/AppletPanel.securedCall0 (AppletPanel.java)at com/ms/applet/AppletPanel.securedCall (AppletPanel.java)at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)at com/ms/applet/AppletPanel.run (AppletPanel.java)at java/lang/Thread.run (Thread.java)java.lang.ClassNotFoundException: company.division.product.data.superappletsubclass.classat com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)at java/lang/ClassLoader.loadClassInternal (ClassLoader.java)at CBKHGR0002.init (CBKHGR0002.java)at com/ms/applet/AppletPanel.securedCall0 (AppletPanel.java)at com/ms/applet/AppletPanel.securedCall (AppletPanel.java)at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)at com/ms/applet/AppletPanel.run (AppletPanel.java)at java/lang/Thread.run (Thread.java)What do I need to do to rectify this error and create a jar filecontaining all the class files from different packages?Why I am I getting a security exception using the jar filewhen everything works fine when the browser downloads each classitself?
 
Back
Top