

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
7 messages in net.java.dev.jna.usersRe: [jna-users] Usage of JNA inside a...| From | Sent On | Attachments |
|---|---|---|
| Isidoro Trevino | Jan 6, 2009 8:59 am | |
| Timothy Wall | Jan 6, 2009 9:13 am | |
| Paul Loy | Jan 6, 2009 9:20 am | |
| Emmanuel Pirsch | Jan 6, 2009 10:12 am | |
| Isidoro Trevino | Jan 6, 2009 10:30 am | |
| Timothy Wall | Jan 6, 2009 11:23 am | |
| Emmanuel Pirsch | Jan 6, 2009 11:35 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] Usage of JNA inside an applet | Actions... |
|---|---|---|
| From: | Timothy Wall (twal...@dev.java.net) | |
| Date: | Jan 6, 2009 11:23:10 am | |
| List: | net.java.dev.jna.users | |
The JNA file downloads include platform-specific jar files, which may or may not be of use to a JNLP applet. They are normally for use with JNLP so that the native library is installed locally for JNLP and avoids the need to unpack the shared library from the JNA jar file.
I'm not sure if the jnlp applet handles native libraries in the same way that vanilla JNLP does.
On Jan 6, 2009, at 1:13 PM, Emmanuel Pirsch wrote:
This can be easily achieved by using JNLP to start your applet. It just requires Java 1.5 and up. JNLP Applets provides a much better applet environment than using the object tag or the old applet tag. Just google for JNLP applet and you should find how to do it. Here is what my jnlp file looks like : <?xml version="1.0" encoding="UTF-8"?> <jnlp spec="1.0+" href="example.jnlp"> <information> <title>Applet title</title> <vendor>Your Company</vendor> </information> <security> <all-permissions /><!-- you may also ask only for the permissions you need here --> </security> <resources> <jar href="signed-applet.jar" main="true" /> <!-- Application Resources --> </resources> <applet-desc name="AppletName" main- class="com.yourcompany.applet.YourApplet" width="630" height="240"> </applet-desc> </jnlp>
and my applet tag in my page : <applet width="630" height="240" code="com.yourcompany.applet.YourApplet" class="span-16"> <param name="jnlp_href" value="/applets/example.jnlp" /> <param name="separate_jvm" value="true" /> </applet>
Note that the separate_jvm paremeter should normally be set to false (default value). as it will cause a new JVM to be spawned each time your applet is loaded. I had to do this because I had some trouble with the native library I was using.
Note also that I'm using a native library that is already present on the system. I have yet to get everything from the jar.
The code attribute in the applet tag need not to be your applet name, it will be used only if the Java plugin installed on the user computer does not support JNLP applets. You can use it to load an applet that will ask the user to download the latest JRE from ww.java.com
You'll also need to sign every jars that your applet uses. I've managed to do that easily by combining all my applets dependencies using the Maven Shade plugin. Here is my plugins section in pom.xml : <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <artifactSet> <excludes> <exclude>junit:junit</exclude> <exclude>com.sun.java:plugin</ exclude> </excludes> </artifactSet> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> <goals> <goal>sign</goal> </goals> </execution> </executions> <configuration> <alias>replace with your keyring alias</alias> <storepass>keyring password</storepass> <verify>true</verify> </configuration> </plugin> </plugins>
On Tue, Jan 6, 2009 at 12:20 PM, Paul Loy <pa...@keteracel.com> wrote: some insights:
http://www.javaworld.com/jw-10-1998/jw-10-apptowin32.html?page=3
maybe try putting jnidispatch.dll in the codebase directory and explicitely load it in the applet before jna tries to.
On Tue, Jan 6, 2009 at 5:00 PM, Isidoro Trevino <chol...@gmail.com> wrote: Hi,
I'm developing an applet that will need the use of a DLL so I tought using JNA might be a great idea, but I'm stuck with it because I'm getting a SecurityException when trying to load jnidispatch.dll and I'm stil unable to find a workaround.
Do you have any guidelines or suggestions of using JNA inside an applet without much trouble? I'm using self signed jars but I can't get rid of the SecurityException
Thanks in advance
-- Ing. Isidoro Treviño de la Garza 044 55 1800 8365
--
--------------------------------------------- Paul Loy pa...@keteracel.com http://www.keteracel.com/paul







