• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applet not loading

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,

Can some one please help me .
my applet doesn't load as its having a dependency in the jar file which even though i put in archive path its not taking...

Can any one suggest me whats the problem ?

my class file is in YagattaQApp.jar
and the dependent jar files is facebook-java-api-1.8-final.jar which itself is having a dependency on json-1.0.jar

I am able to run in net beans but when i do it outside my applet doesn't load. If i remove the dependancy (comment the function ) applet runs well.

<HTML>
<HEAD>
<TITLE>Page</TITLE>
</HEAD>
<BODY>
<APPLET CODE="YagattaQApplet"
archive="json-1.0.jar,facebook-java-api-1.8-final.jar,YagattaQApp.jar"
WIDTH=150 HEIGHT=250>
</applet>
</P>
</BODY>
</HTML>

best regards,
titus
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

All 3 jar files need to be in the same directory as the HTML file containing the applet tag; is that the case? Are there any error messages in the Java Console?
 
Titus Abraham
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a ton for replying.

yes all the 3 jar files and the html are in the same folder and i am getting 2 types of errors from JAVA console.

the first time i load the page
Exception in thread "thread applet-YagattaQApplet-1" java.lang.ExceptionInInitializerError
at YagattaQApplet.init(YagattaQApplet.java:26)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
at java.lang.Class.checkMemberAccess(Unknown Source)
at java.lang.Class.getDeclaredField(Unknown Source)
at com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator.getDeclaredField(Unknown Source)
at com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator.getDeclaredField(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.RegistryInfoImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.addRegistry(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getTypeInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at com.facebook.api.FacebookRestClient.<clinit>(FacebookRestClient.java:124)
... 3 more


and if i refresh the page
----------------------------------------------------
Exception in thread "thread applet-YagattaQApplet-2" java.lang.NoClassDefFoundError: Could not initialize class com.facebook.api.FacebookRestClient
at YagattaQApplet.init(YagattaQApplet.java:26)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


any ideas.. Do help me out as i am absolutely stuck in my work.

Best regards,


 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)


Sounds like JAXB does something that applets are not generally allowed to do. The two ways around that are a) to sign the applet, or b) to alter the local security policy. See HowCanAnAppletReadFilesOnTheLocalFileSystem for more detail.
 
Titus Abraham
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,

Thank you once again for the reply.

I am going to host the html page on a public server (external : joyent) so I am not sure changing my local security policy will help?
so is signing the only way for the same ? can you suggest me a link or guide me for how to sign an applet if that's my only go ?

best regards

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correct, every user of the applet would have to change their individual local security policy.

The FAQ page links to various pages that explain applet signing in detail.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic