Lucas_Santos
Lucas_Santos

Reputation: 4740

Java Applet in .Net Web Application Issue

How can I put a Java Applet in my .Net Web Application ?

I'm trying the following code

                        <applet code="com.griaule.fingerprintsdk.appletsample.FormMain" 
                        archive="C:\Users\lucas\workspace\applet-chave\bin\SignedFingerprintSDKJava.jar, C:\Users\lucas\workspace\applet-chave\bin\SignedFingerprintSDKJavaAppletSample.jar, C:\Users\lucas\workspace\applet-chave\bin\sqljdbc4.jar" height="550" width="550">
                    </applet>

but i got the following error

   java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.util.ProgressMonitorAdapter.setProgressFilter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.setupProgress(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.util.ProgressMonitorAdapter.setProgressFilter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.setupProgress(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.util.ProgressMonitorAdapter.setProgressFilter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.setupProgress(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

If I insert into my .net project the .jar, occurs the error IllegalArgumentException, if I insert file:\ before the path of the jar files, occurs the error SecurityException like I said in comments.

Upvotes: 1

Views: 589

Answers (1)

AlexR
AlexR

Reputation: 115328

Java applet is configured using HTML tags, so reference to .Net is irrelevant here.

I guess that your problem is in manner you are configuring the classpath defined in attribute archive. The jar references specified there must be relative to your codebase. They cannot be absolute file paths on your machine.

You should write something like

first.jar,second.jar

and put the jars in place accessible over HTTP

Upvotes: 3

Related Questions