You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Eric Siebeneich <ze...@gmail.com> on 2010/10/15 23:18:50 UTC

Problem with Signed Applet

So, I developed an application in Pivot that I would like to deploy as an
Applet. The application works great from Eclipse, and requires access to the
file system (file upload), so the resulting jar must be signed. I created my
jar and signed it, and attempted opening a simple html file with it
included:

<applet code="org.apache.pivot.wtk.BrowserApplicationContext$HostApplet"
       
archive="lib/pivot-core-1.5.jar,lib/pivot-wtk-1.5.jar,lib/pivot-wtk-terra-1.5.jar,MyJar.jar"
        width="700" height="500">
        
        
</applet>

My directory looks like this:

folder
  +--lib
  |    +-- pivot-core-1.5.jar
  |    +-- pivot-wtk-1.5.jar
  |    +-- pivot-wtk-terra-1.5.jar
  +--MyJar.jar
  +--test.html

When I open the file in either Firefox or IE, the base Pivot window loads,
and then an Alert pops up in Pivot telling me "sandboxed loader attempted to
load trusted resource path.nam" (got cut off by the alert box, but I'm sure
its my main class)

Research led me to discover that this was caused by the unsigned pivot code
attempting to load my signed jar file. The fix was to modify my manifest
with the line "Trusted-Library: true". This fixed the issue with the loader
complaining about the mixed code, but introduced a new alert box with simply
the text "org/apache/pivot/wtkx/Bindable" (My main class implements
Bindable).

I've tried a bunch of different configurations, but can't seem to find one
that works. Anyone have any ideas or has anyone encountered this problem? 
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Problem-with-Signed-Applet-tp1711697p1711697.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Problem with Signed Applet

Posted by Greg Brown <gk...@mac.com>.
Did you sign all JARs or just your app JAR? I believe the rule of thumb is that you need to sign all JARs that will require security privileges. Since that can sometimes be tough to determine, it is generally easiest to simply sign all JARs used by your app (including the Pivot JARs).

On Oct 15, 2010, at 5:18 PM, Eric Siebeneich wrote:

> 
> So, I developed an application in Pivot that I would like to deploy as an
> Applet. The application works great from Eclipse, and requires access to the
> file system (file upload), so the resulting jar must be signed. I created my
> jar and signed it, and attempted opening a simple html file with it
> included:
> 
> <applet code="org.apache.pivot.wtk.BrowserApplicationContext$HostApplet"
> 
> archive="lib/pivot-core-1.5.jar,lib/pivot-wtk-1.5.jar,lib/pivot-wtk-terra-1.5.jar,MyJar.jar"
>        width="700" height="500">
> 
> 
> </applet>
> 
> My directory looks like this:
> 
> folder
>  +--lib
>  |    +-- pivot-core-1.5.jar
>  |    +-- pivot-wtk-1.5.jar
>  |    +-- pivot-wtk-terra-1.5.jar
>  +--MyJar.jar
>  +--test.html
> 
> When I open the file in either Firefox or IE, the base Pivot window loads,
> and then an Alert pops up in Pivot telling me "sandboxed loader attempted to
> load trusted resource path.nam" (got cut off by the alert box, but I'm sure
> its my main class)
> 
> Research led me to discover that this was caused by the unsigned pivot code
> attempting to load my signed jar file. The fix was to modify my manifest
> with the line "Trusted-Library: true". This fixed the issue with the loader
> complaining about the mixed code, but introduced a new alert box with simply
> the text "org/apache/pivot/wtkx/Bindable" (My main class implements
> Bindable).
> 
> I've tried a bunch of different configurations, but can't seem to find one
> that works. Anyone have any ideas or has anyone encountered this problem? 
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Problem-with-Signed-Applet-tp1711697p1711697.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: Problem with Signed Applet

Posted by Eric Siebeneich <ze...@gmail.com>.
Sorry, those two blank lines in the applet tag read:

param name="codebase_lookup" value="false"

and

param name="application_class_name" value="path.name.MyClass"

in html. The angle brackets are disappearing and eating the lines.
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Problem-with-Signed-Applet-tp1711697p1711718.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.