|
-
Making a single jar file from differnet packages
Hello,
I am developing an applet which uses the classes in four different packages.All
the four packages and the appletsubclass
are in the same directory.when I open the HTML page with
code="appletsubclass.class" everything works fine.
*********Problem with the jar**************
After deployment on the webserver to reduce the number of connections between
the browser and the webserver (everytime a class is instantiated )I wanted
to make a single jar file with all the classes.
**********current directory******************************
HTML file
Appletsubclass which is the entry class for the browser
company-division-product---data-(*.class)
---graphics(*.class)
---server(*.class)
********************************************************
To make a jar file encompassing all the class files I created a Jar package
as below
to add classes from data directory
jar cfv allclasses.jar company/division/product/data/*.class
then to add classes from graphics directory to the same jar file
jar ufv allclasses.jar company/division/product/graphics/*.class
then to add classes from server directory to the same jar file
jar ufv allclasses.jar company/division/product/graphics/*.class
once all the classes are added to allclasses.jar file
I test it by extracting it and found every thing ok.
Then in the HTML file
I said in the applet tag
<applet code="appletsubclass" archive="allclasses.jar" width=600
height=600>
My curent directory is f:\jartestingwebgraphics\withtwo
when i open this file the browser gives me the following exception in the
java console
com.ms.security.SecurityExceptionEx[CBKHGR0002.init]: java.io.IOException:
bad path: F:\jartestingwebgraphics\withtwo\company\division\product\superappletsubclass.class
at 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.class
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)
What do I need to do to rectify this error and create a jar file
containing all the class files from different packages?
Why I am I getting a security exception using the jar file
when everything works fine when the browser downloads each class
itself?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks