JMF with Native Libraries as Signed Applet

Hello
After spending a few days hunting through forums, digging into JMF source code and hacking in the dark I'm about to give up, but thought I'd start yet another thread on this. It's a long, sad story...
Problem: Deploying a JMF based program that relies on native libraries (in this case the FOBS4JMF bindings) as an applet: how to get jmf.properties and the native libraries loaded properly.
Partial Solution: the native libraries packaged in a signed jar file, added to the applet's archive property, extracted using getResourceAsStream(), and loaded using System.load(). This is how FOBS4JMF loads it's native library anyway (via the com.moesol.NativeLibraryFinder):
Class classInApplet; // name of a class loaded by the applet
File outputFile; // location for extracted library
InputStream is = classInApplet.getResourceAsStream(resource);
copyStream(is, outputFile);
System.load(outputFile.getAbsolutePath());Why this doesn't really work:
(a) JMF (com.media.util.Registry) only searches for jmf.properties (which contains the instructions to use the FOBS4JMF plugin) in real folders (i.e. not jars) on the classpath of the local machine. I could extract the jmf.properties to a folder on the local machine, but have no way of making sure that folder would be on the classpath. Calls to "System.getProperty("java.class.path") give varying results - including an empty string on FF/OSX. Even if i could get the classpath somehow, chances are that it wouldn't contain any folders writable under Vista's UAC, which would leave me out of luck.
JMF also looks for a file called ".jmfdir" in various platform specific locations, and appends the contents of this file to the classpath, so if i could write to that file i'd be golden. This seems like it would work on non windows platforms, because JMF looks for that in "user.home"). However, from what i can tell, on windows, JMF uses a native call to a function called nGetUserHome() to determine where to find .jmfdir - which leads to the second problem...
(b) the JMF native libraries are loaded through calls to System.loadLibrary(), not System.load(), which means that they have to be on the "java.library.path" in order to be found - and again, I have no way of extracting the libraries to a directory on that path (at least not one writable under Vista UAC). This wouldn't be a problem, as I could pre-load the libraries myself with System.load(), except that JMF throws an exception if it can't find one, and stops trying to do whatever it thinks it needs the library for. Again, not a problem if I use only the FOBS4JMF native code (though i would like to use the DirectAudio renderer on windows) - except that the nGetUserHome() function described above is in a native library (jmutil.dll). So, when com.media.util.Registry.getJMFDir() tries to find ".jmfdir" it first tries to load "jmutil.dll" using System.loadLibrary(). This throws an exception inf "jmutil.dll" is not on the "java.library.path", and com.media.util.Registry.getJMFDir() returns null. Here's the relevant code from com.media.util.Registry.getJMFDir() - with my annotations
All of these problems are fixable by relatively minor tweaks to the JMF source - but I don't think that's allowed under the SCSL. So if anyone has any, i mean ANY other suggestions, please BRING 'EM ON.
thanks
-chris
EDIT: just for kicks, i checked to see where JMF expects to find .jmfdir on windows - ie the result of nGetUserHome(). At least on XP this seems to be c:\WINDOWS. if it's the same on Vista, then fixing the loadLibrary problem won't help bc I still won't be able to write to this file.
Edited by: wodenx on May 7, 2010 9:46 AM

Hi-
Thanks for responding so quickly.
As far as the natives go, you might try using the new JNLP embedded applet ability in the plugin2 architecture.I was going to look into that, but decided it wasn't necessary since I can get the FOBS native code to link properly. It's really the registry that's the problem, since without solving that I can't get JMF to USE the FOBS code.
Can you get it all to work if the JMF installer is invoked? If so, perhaps if you add an installer-desc that calls the normal JMF setup.exe (though that final warning to reboot is both unnecessary and odious).I don't think it would work even with the JMF installer, bc I need to point JMF at the FOBS specific jmf.properties. I might be get it to work by invoking my own installer though, to place my jmf.properties somewhere in the native class path, so that's worth looking at. Thank you. Problem there is that on Vista users would have to elevate to run the applet, which is not ideal.necessary and odious).
Why do you particularly want to embed media in a web page?The customer may want it. I might be able to convince them to go with JNLP/WebStart, but I think I might have the same problem there. Please correct me if I'm wrong...
I've also read that there are problems with JMF and JNLP owing to the fact that JMF doesn't recognize the security manager invoked by JNLP, and so gives your program no permissions. Haven't tried it myself yet.
Thanks again!
Edited by: wodenx on May 7, 2010 12:07 PM

Similar Messages

  • Nodemanager start failed (problems with native libraries)

    Hi,
    I've problem in starting nodemanager, this exception has been raised when I run startNodeManager.sh script:
    + CLASSPATH=/e/bea/patch_weblogic300/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/e/bea/jdk150_06/lib/tools.jar:/e/bea/sipserver30/server/lib/weblogic_sp.jar:/e/bea/sipserver30/server/lib/wlss/sipservlet.jar:/e/bea/sipserver30/server/lib/wlss/wlss.jar:/e/bea/sipserver30/server/lib/wlss/wlss-descriptor-binding.jar:/e/bea/sipserver30/server/lib/wlss/profile-service-descriptor-binding.jar:/e/bea/sipserver30/server/lib/wlss/wlss-mbeaninfo.jar:/e/bea/sipserver30/server/lib/wlss/wlss_i18n.jar:/e/bea/sipserver30/server/lib/wlss/wlssechosvr.jar:/e/bea/sipserver30/server/lib/wlss/wlssdiameter.jar:/e/bea/sipserver30/server/lib/wlss/sctp.jar:/e/bea/sipserver30/server/lib/weblogic.jar:/e/bea/sipserver30/server/lib/webservices.jar::/e/bea/patch_weblogic300/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/e/bea/jdk150_06/lib/tools.jar:/e/bea/sipserver30/server/lib/weblogic_sp.jar:/e/bea/sipserver30/server/lib/wlss/sipservlet.jar:/e/bea/sipserver30/server/lib/wlss/wlss.jar:/e/bea/sipserver30/server/lib/wlss/wlss-descriptor-binding.jar:/e/bea/sipserver30/server/lib/wlss/profile-service-descriptor-binding.jar:/e/bea/sipserver30/server/lib/wlss/wlss-mbeaninfo.jar:/e/bea/sipserver30/server/lib/wlss/wlss_i18n.jar:/e/bea/sipserver30/server/lib/wlss/wlssechosvr.jar:/e/bea/sipserver30/server/lib/wlss/wlssdiameter.jar:/e/bea/sipserver30/server/lib/wlss/sctp.jar:/e/bea/sipserver30/server/lib/weblogic.jar:/e/bea/sipserver30/server/lib/webservices.jar::/e/bea/sipserver30/common/eval/pointbase/lib/pbclient51.jar:/e/bea/sipserver30/server/lib/xqrl.jar::/e/bea
    + export CLASSPATH
    + export PATH
    + cd /e/bea/sipserver30/common/nodemanager
    + set -x
    + '[' '' '!=' '' ']'
    + '[' '' '!=' '' ']'
    + /e/bea/jdk150_06/bin/java -client -Xms32m -Xmx200m -XX:MaxPermSize=128m -Xverify:none -da -Dplatform.home=/e/bea/sipserver30 -Dwls.home=/e/bea/sipserver30/server -Dwli.home=/e/bea/sipserver30/integration -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/e/bea/patch_weblogic300/profiles/default/sysext_manifest_classpath -Xverify:none -Djava.security.policy=/e/bea/sipserver30/server/lib/weblogic.policy -Dweblogic.nodemanager.javaHome=/e/bea/jdk150_06 weblogic.NodeManager -v
    <1-mar-2007 12.24.43> <INFO> <Loading domains file: /e/bea/sipserver30/common/nodemanager/nodemanager.domains>
    <1-mar-2007 12.24.44> <GRAVE> <Fatal error in node manager server>
    weblogic.nodemanager.common.ConfigException: Native version is enabled but node manager native library could not be loaded
    at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:212)
    at weblogic.nodemanager.server.NMServerConfig.<init>(NMServerConfig.java:172)
    at weblogic.nodemanager.server.NMServer.init(NMServer.java:174)
    at weblogic.nodemanager.server.NMServer.<init>(NMServer.java:139)
    at weblogic.nodemanager.server.NMServer.main(NMServer.java:286)
    at weblogic.NodeManager.main(NodeManager.java:31)
    Caused by: java.lang.UnsatisfiedLinkError: no nodemanager in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:992)
    at weblogic.nodemanager.util.UnixProcessControl.<init>(UnixProcessControl.java:16)
    at weblogic.nodemanager.util.Platform.getProcessControl(Platform.java:108)
    at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:210)
    ... 5 more
    It seems that problem is in nodemanager native library :
    /e/bea/sipserver30/server/native/linux/i686/libnodemanager.so
    I'm working on a host with a Amd Cpu
    cat /proc/cpuinfo
    model name : AMD Opteron(tm) Processor 280
    and a Linux OS:
    # uname -a
    Linux 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 x86_64 x86_64 x86_64 GNU/Linux
    thank in advance

    Hi
    Just modify the NativeVersionEnabled property to false in nodemanager.properties file, that will solve the pb. If you dont have a property in nodemanager.properties file add one.
    Thanks,
    Venkata Koteswara Rao

  • Including JMF libraries in an applet

    I am trying to include JMF libraries in my applet, so anybody who opens a URL in his navigator can see me through my webcam.
    To do this, I included customizer.jar, jmf.jar, mediaplayer.jar, multiplayer.jar and sound.jar in my jar distribution to make a test.
    The clients run properly, however the just see the movie if they have JMF installed. If they have not JMF installed, no exception is throwed, but still they do not see anything.
    Am I missing something? Does JMF uses native libraries?
    Any help is welcome. Thanks!!!

    I did that already
    i.e. what is written in
    Q: Can I capture audio or video from within an Applet with JMF 2.1.1?
    By default (for security reasons), JMF 2.1.1 does not allow capture from an applet. The user can turn this on by using JMFRegistry.
    Run "java JMFRegistry", select the UserSettings tab and check "Allow Capture From Applets". If the browser's security permits loading native libraries, then you will now be able to capture audio/video from an applet.
    but the program lines
    try
    player = Manager.createRealizedPlayer(ml);
    FormatControl formatControl = (FormatControl)player.getControl("javax.media.control.FormatControl");
    Component co = formatControl.getControlComponent();
    Thread.sleep(2000);
    player.start();
    give always the same error
    java.lang.RuntimeException: No permission to capture from applets
    java.lang.RuntimeException: No permission to capture from applets
    why?
    I am working inside the netbeans 6.9.1 editor

  • Bundle JMF with application or ask user to install it?

    I have added some video capturing functionality to my application (not an applet).
    Now I am not sure if I should bundle JMF with the application or if I should ask the user to download and install JMF him/herself. Personally I think it is nicer to have extensions like JMF installed so that they are available for other applications as well. But I wonder about the acceptance of users having to download and install something additionally to an application they are interested in.
    Any experiences on that?
    Thanks in advance!
    Torsten

    Ideally, you should support both options. The system should install out of the box
    on standard configurations that you support, with as little extra work as possible.
    However, there should be some way to work around this if JMF is already installed.
    We use IzPack, and so far things have gone ok, but we haven't done anything really
    complicated.
    One tricky bit is that JMF has native libraries. I wanted to have an application that
    needed native libraries to be nothing but an executable jar file, but I couldn't figure
    out how to do it untill I found an article describing how to do this: basically you have
    to copy the dll or .so file from the jar file to a tmp file, and then load it from the tmp file.
    There is a web page somewhere that explains this, but I couldn't find it right away.
    Good luck,
    -- cary

  • Problem on runtime enviorment for signed applet

    I am using the Java Media Framework for video capturing .Problem which i am facing is i have to configure the client machine so i wanted to download few of the class files which will execute on the client side and then stream the video back to the server .For this i have dezigned a java applet.This applet is signed by myself without any external agency so when ever the application is executed where it was signed this application gives no problem but when a different machine access the applet the user is asked for the verification of the applet but the error is thrown stating that the class not found exception .So please guide me that while making a signed applet which all packages need to be signed and what is the procedure .Do i have to sign the jmf packages also .

    I have signed applets but not with jmf. Your best bet is to put the applet in a jar and sign the jar. Most java runtimes with a self signed applet will prompt the user and ask the user if they want to grant permission. You probably have to use the java html converter to code your html to force the use of suns plugin. I am not sure if you have to sign the jmf jars or they may already be signed.

  • Using external libraries over signed Java applet: InvocationTargetException when running locally with 7u51

    We have a signed Java applet that uses external libraries, specifically the OpenOffice application libraries.
    We have a problem running Java applet with 7u51 of "InvocationTargetException" when use these libraries OpenOffice, that is not signed; regardless of the browser used (Mozilla Firefox, Explorer, Chrome).
    Please, as you could solve this problem?   This problem can not arose with 7u40 and earlier..
    Best regards.

    In  java - JRE 1.7.0_51-b13 and signed applet - Stack Overflow found solution. I've missed to add in external jars manifest this: 
    Trusted-Library: true

  • Signed Applet problems in Vista + JMF

    Hi All,
    I'm new to Java Applet programming. I wrote an application which works as a VoIP Client in a webpage (Using JMF). Its working very fine in allmost all Windows XP machines.
    But not in Windows Vista machines. In Vista i'm getting the following error :
    "No permission to capture from applet" - Since its a Signed applet. The application is digitally signed from a CA. Even though its not working in Vista (IE and Mozilla Firefox also).
    I have went through the following link which says IE in Vista will run on protected mode, so Signed Applet will not have all the permission eventhough its signed for "AllPermission".
    ----- http://java.sun.com/javase/6/webnotes/install/system-configurations.html
    And also I'm not able to create a customized jar file for JMF using JMF Customizer. (JMF Customizer is an application which creates a jar file with specified classes). While creating a jar file I'm getting particular class is not available. (In Windows XP, this class is compilled at run time).
    Please let me know the following things,
    a) Is there any security settings i have to make to run Signed Applet in Windows Vista ?
    b) What is Java Policy file? I don't have any policy file - will it affect the application ?
    c) Do I need to sign each applet (say i have 5 applets in single jar file) ?
    d) In Vista how Mozilla Firefox are running (like IE7's restricted environment or XP compatiable mode) ?
    Thanks in Advance,
    Karthikeyan R

    I have exatly the same problem but not with the class itself. I have the problem with an jar that my class calls.
    I use jdk1.4.2. I think it's basicaly the same problem as "lfpgMW".
    I'll also whould like an idea...
    thanks

  • Please HELP !!! Signed Applet & Java Media Framework(JMF)

    Hi,
    I have written a self signed applet that is used for Recording voice running in browser:
    The tag that I've given is as follows:
    <OBJECT
    classid = "clsid:CAFEEFAC-0014-0001-0000-ABCDEFFEDCBA"
    id="recordApplet"
    codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_1-windows-i586.cab#Version=1,4,1,0"
    WIDTH = 268 HEIGHT = 27>
    <PARAM NAME = CODE VALUE = "RecWindow">
    <PARAM NAME = ARCHIVE VALUE = "jmf.jar,sound.jar,SignedRecWindow.jar">
    <PARAM NAME = "soundtrack" VALUE="testFile.mp3">
    <PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.1">
    <PARAM NAME = "scriptable" VALUE = "true">
    <PARAM NAME = "MAYSCRIPT" VALUE = "true">
    </OBJECT>
    I've also signed jmf.jar as well as sound.jar that come in JMF 2.1 and am including it the archive. These jars are downloaded on client machine.
    My code works perfectly BUT only when JMF 2.1 is installed on the clients machine else I get a RunTime Exception stating "no permission to capture from applet".
    JMF FAQ states that If a user chooses to allow playing back locally stored media files or saving media files locally, he/she can do so by making use of a policy file. http://java.sun.com/products/java-media/jmf/2.1.1/faq-jmf.html#jmf2-applet-run
    My requirement is that once the user has agreed to the signed applet to run then there should be no need to install JMF rather use the jmf.jar that is downloaded on client machine.
    Also how can I grant the permission (permission javax.sound.sampled.AudioPermission "record";) to my applet in client computers ?
    The client should not be asked to add any files (policy) by itself, all must be transparent for him.
    Thanks in advance.
    Vipin.

    I too have been trying to get Java JMF sound recording to work via webstart. No luck so far.
    I even tried playing (security.AllPermissions) with .java.policy file in the user's home directory and even modifying java.policy in the JRE/lib/security directory. No luck there too!
    I also added security.AllPermissions to the javaws.policy in the JRE/jawas/javaws.policy file. Still no luck!
    Any idea, anyone?

  • Problem with a signed applet and a user machine.

    Hello. I´m having some problems with a signed applet with some dependences.
    In one particular computer the applet doesn´t load.
    The java version installed in that computer is 1.6.0_25.
    The invocation tag:
    <applet name=applet id="applet" code=Applet/RequestApplet.class width=155 height=21 archive="RequestApplet.jar " MAYSCRIPT>
       <param id="parametro1" name="usuario" value="<Computed Value>">
    </applet>The RequestApplet.jar and dependences:
       bcmail-jdk13-145.jar(signed by bouncy castle), jce-ext-jdk13-145.jar(signed by bouncy castle), AbsoluteLayout.jar, plugin.jar, RequestApplet.jar(signed by me)*this files are all in the same folder.
    The requestApplet.jar manifest:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    X-COMMENT: Main-Class will be added automatically by build
    Class-Path: bcmail-jdk13-145.jar jce-ext-jdk13-145.jar plugin.jar Abso
    luteLayout.jar
    Created-By: 10.0-b23 (Sun Microsystems Inc.)
    Main-Class: Applet.RequestApplet
    Name: Applet/ResponseApplet$1.class
    SHA1-Digest: fO5IPiwEH3OhvlprhBecmMIAVJI=
    Name: Applet/NewJApplet.class
    SHA1-Digest: 6XSpm7lQEQRi39TegoUYv2aFJrk=
    Name: Applet/ResponseApplet.class
    SHA1-Digest: v1EbKUFB+QdvO05xx8UzAMNIyRs=
    Name: Applet/ResponseApplet$4.class
    SHA1-Digest: XH4I67psXZTelpz0AMAYc/Ej8QY=
    Name: Applet/RequestApplet$1.class
    SHA1-Digest: KAP5sAC4Thv/6GClkFAdGUVzgYA=
    Name: Applet/ResponseApplet$5.class
    SHA1-Digest: CVPnKrW2SgNEkRzYnVnQe3KGrIU=
    Name: Applet/ResponseApplet$3.class
    SHA1-Digest: SjfW1k1K7BA9m3AxmHi+jvRE+9o=
    Name: Applet/ResponseApplet$2.class
    SHA1-Digest: 3Pu18CZMLuEh7/n3y7XxFSkuNQY=
    Name: Applet/RequestApplet.class
    SHA1-Digest: Tky85es5+o371adetH9XVEI2Z+o=The error:
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
         at java.awt.EventQueue.access$000(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         ... 20 more

    Thanks. I´ll try with your tips. But if i put all the dependences in archive I get this error.
    The tag:
    <applet name=applet id="applet" CODEBASE="." code="Applet/RequestApplet.class" width=155 height=21 archive="bcmail-jdk13-145.jar, jce-ext-jdk13-145.jar, AbsoluteLayout.jar, plugin.jar, RequestApplet.jar " MAYSCRIPT>
       <param id="parametro1" name="usuario" value="<Computed Value>">
    </applet>The error:
    Java Plug-in 1.6.0_25
    Usar versión JRE 1.6.0_25-b06 Java HotSpot(TM) Client VM
    Directorio local del usuario = C:\Documents and Settings\Administrator
    c:   borrar ventana de consola
    f:   finalizar objetos en la cola de finalización
    g:   liberación de recursos
    h:   presentar este mensaje de ayuda
    l:   volcar lista del cargador de clases
    m:   imprimir sintaxis de memoria
    o:   activar registro
    q:   ocultar consola
    r:   recargar configuración de norma
    s:   volcar propiedades del sistema y de despliegue
    t:   volcar lista de subprocesos
    v:   volcar pila de subprocesos
    x:   borrar antememoria del cargador de clases
    0-5: establecer nivel de rastreo en <n>
    basic: Receptor de progreso agregado: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@f39b3a
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/bcmail-jdk13-145.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/jce-ext-jdk13-145.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/AbsoluteLayout.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/plugin.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/RequestApplet.jar

  • Security Problems with Signed Applet

    Hello All,
    I need help with signed applets.
    I have an applet pkged in a jar that uses other jars. I have signed the jar containing applet and all the other jars being used. However, when I try to run the applet in IE 6.0.xx, I get the following error
    java.lang.ExceptionInInitializerError
         at aaa.aaa.somemethod(xxx.java:192)
         at aaa.aaa.aaa.access$000(xxx.java:27)
         at aaa.aaa.aaa.$1.run(xxx.java:467)
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
         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.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         ... 3 moreMy application is using Java 1.4.2.xx.
    Any help or pointers would be greatly appreciated.
    Thanks.

    Thanks harmmeijer and mjparme for your responses.
    I made some changes to my application and it does not now require the system property information. But now I am getting another exception related to class loader.
    I made the changes to the console as suggested by harmmeijer, and here is the stack trace. Also, I am not using any JavaScript explicitly.
    Registered modality listener
    Invoking JS method: document
    Invoking JS method: URL
    Referencing classloader: sun.plugin.ClassLoaderInfo@e0a386, refcount=1
    Loading applet ...
    Initializing applet ...
    Starting applet ...
    java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
         at xxx.xxx.a...<init>(a.java:39)
         at  xxx.xxx.b...<init>(b.java:42)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
         at xxx.xxx.a...ToolBus.<init>(a.java:39)
         at xxx.xxx.b....<init>(b.java:42)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Modality pushed
    Modality poppedmjparme as to your second point, the action is taking place in the same jar only. No other jar is involved at the stage where I am getting exception.
    Thankyou again and will appreciate your help.
    AC

  • Using JMF with applet

    Hello,
    I've got an applet that consumes a lot of CPU. I'm studying to migrate this applet to a pda, but it's not enough cpu for it. I'm reading JMF docs and I decide to generate a movie with the output of an applet. �If it's possible? My idea is to create the movie on the server. I can modify my applet to avoid the use of the applet inheritance and then render the output to an standard movie format. After I will send the movie to the browser
    You can see the applet here. Click on View route 3D under the flash movie.
    http://www.tmb.net/vullanar/en_US/resultatcerca.jsp?tipusrepre=0&origenx=31514.420&origeny=82758.000&descripcioorigen=L1+-ARCDE+TRIOMF&destix=34704.550&destiy=87378.460&descripciodesti=L2+-ARTIGUES-SANTADRI%C0&tipustransport=0&numtransbords=2&tempscaminant=20&velocitatcaminant=1&tipushora=1&dia=27&mes=05&hora=12&minut=22&idioma=en_US&operador=TMB&poblacioorigen=1&poblaciodesti=1
    Thanks in advance,
    David B.

    passionforjava2 wrote:
    ...I have issues with applet unable to transmit voice using JMF. i know it is a security issue. As the error on the console says
    java.lang.RuntimeException: No permission to capture from applets
    Error : Couldn't create DataSourceWhen JMF is installed, it generally offers a checkbox to allow or deny 'capture in applet'. By default it is not checked, and if the user goes with that recommendation, I am not sure that anything will overrule that.
    In a folder iPhone/myphone/What is the URL where we can visit this applet?
    .. i have applet embedded html file along with .jar files with required classed and applet signed. Are you prompted to trust the digitally signed code? You can see the dialog I mean by visiting the applet linked from [http://pscode.org/test/docload/].
    ..Along with that .jar i do have jmf.jar and java.policy.applet file and jmf.properties file . Forget the policy files, they are a waste of time, and completely impractical for end users.

  • Signed Applet and native code

    Hi all,
    I have an application which I deploy with webstart and includes native code. This all works perfectly with webstart. I now want to deploy it as an applet. This works accept for the native code. I have done heaps of searching and cannot determine the most appropriate way to make the native code visible to the applet.
    Ultimately I am at the point where i recieve a UnsatisfiedLinkError when calling loadLibrary(...) for the native code. Currently i have the native code (dll's for windows, so's for Solaris etc) in independent jars which are also signed (as needed for webstart).
    Could anyone give me some advise or a reference to more info on this topic.
    I am using Java 1.5 and am happy to use 1.6 if neccessary.
    Thanks,
    Dave

    Andrew - of course you were correct about the signed cert - I misspoke when the CA signed applet didn't show a warning. (You were also right that I must have checked 'always accept' the certificate on the server I had the CA signed cert on).
    I think you guys are on to something about the privileged actions. It would explain where one popup has the icon and the other doesn't. We have Javascript making calls into the applet and we do use JNI (although I don't think there are any calls back). We do wrap these calls in privileged actions but maybe we missed something. What I've seen before is a security exception is thrown if we don't wrap them - but maybe there are areas where we don't and it doesn't throw an exception or it does and we eat it somehow (and for whatever reason doesn't cause anything noticeable).
    Now that I know it could likely be the applet code and not necessarily a build issue with signing the jars, I have another place to look...
    I'll check it out and let you know what I find.

  • Problem with accessing Signed Applet from javascript method

    Hi,
    I am facing the following problem while accessing Signed Applet from javascript method.
    java.security.AccessControlException: access denied (java.io.FilePermission c:/temp.txt read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at FileTest.testPerm(FileTest.java:19)
         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 sun.plugin.javascript.invoke.JSInvoke.invoke(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 sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    I am using jdk1.5 for my development...
    Can anyone help to resolve this security issue. Urgent...
    Thanks in advance.

    Hey thanks. I wasn't able to get it to work with that sample but I did find this very similar code that does allow javascript to call JFileChooser in an applets public method.
    java.security.AccessController.doPrivileged(
    new java.security.PrivilegedAction()
    public Object run(){                           
    //do your special code here
    return null; //return whatever you want
    It seems a bit tempermental in that if you don't select a file quickly, it will hang the browser....no perfect solution but I'm going in the right direction.
    Thanks,
    Scott

  • Problems with signed Applet for File Download under JRE 1.4 (works with 1.3

    Dear all,
    i encountered a very strange behaviour with JRE 1.4x. A signed applet used for file download worked on all platforms (Windows NT, 2000 and XP wth/wthout SP...) until I installed JRE 1.4.x (1.4.1 or 1.4.2)
    I get an EOFException when downloading binary files (for ASCII it works fine) when trying to readByte() from a DataInputStream. But not immideately, but after x bytes in the while-loop. Security is fine (I know there have been changes to that in jre 1.4, the applet itself can be started an runs with ASCII files for transfer)
    Does anyone know, what has changed in jre1.4.
    As I said, it works fine under jre 1.3.x
    The relevant code is below: byte bt = dis.readByte(); causes the error
    try{
    // Get URL from Server
    URL uFile = new URL(sFilename);
    sThisURLFile = uFile.getFile();
    Integer inte = new Integer(i);
    //open input stream for the file on server
    DataInputStream dis = new DataInputStream(new BufferedInputStream
    (uFile.openConnection().getInputStream()));
    //open output stream for the file on local drive
    String sFilenameOnly = sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1);
    int iDotPos = sFilenameOnly.lastIndexOf(".");
    String sExt;
    if (iDotPos > 0) {
    sExt= sFilenameOnly.substring(iDotPos);
    } else {
    sExt = "";
    File fileOut = new File(sDownloadDir + sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1) );
    DataOutputStream dos = new DataOutputStream(new
    BufferedOutputStream(new FileOutputStream(fileOut)));
    //read one byte from input stream, and write that byte to output stream
    long nByte = 0;
    int iCnt = 0;
    iFilesizeDone ++;
    while (nByte < iFilesize){
    String sErrPs = new String();
    try{
    sErrPs = "00";
    byte bt = dis.readByte();
    sErrPs = "01";
    dos.writeByte(bt);
    } catch (EOFException ee)
    System.err.println("internal EOFException: " + ee.getMessage());
    System.out.println("Error Filesize is " nByte " of " iFilesize "---" + sErrPs);
    break;
    nByte++;
    iFilesizeDone ++;
    iCnt ++;
    if(iCnt >= 10240) {
    ShowProgress(nByte, iFilesize, iFilesizeDone, iFilesizeTotal); // repaint does not work during init-procedure
    iCnt = 0;
    line = "Progress: Total: " + ((iFilesizeDone*100)/iFilesizeTotal) + " perc, " + iFilesizeTotal/1024 +" kbytes" ;
    labLine.setText(line);
    //dos.flush(); // improves Client performance (Agent-Call!)
    dis.close();
    dos.close();
    }// End try
    catch (EOFException ee)
    System.err.println("EOFException: " + ee.getMessage()e);
    catch (SecurityException se)
    System.err.println("SecurityException: " + se.getMessage());
    catch (IOException ioe)
    System.err.println("IOException: " + ioe.getMessage());

    perhaps they've changed something with the file blocking.
    btw, you should try to use something like this
    DataInputStream dis = new DataInputStream(is);
    byte[] buffer=new byte[8192];
    int numBytesRead;
    while ( dis.available()>0 ) {
         numBytesRead = dis.read(buffer);
    }               

  • Safari will not run a signed applet on mac os x 10.5.7 with new Java update

    Hi Everyone,
    I've got a problem that hopefully you guys can help me solve. I have an applet that runs on windows, mac and linux that is signed by a verisign certificate my work has. The certificate is valid and everything works just fine on windows and linux, but after I upgraded our macs with the newest java update for mac (which gave macs Java 1.6.13), the applets won't work. When the applet is loaded in Safari or Firefox, it asks if I want to trust the certificate. When I tell it to trust it, Safari comes back with a message saying that it will not trust the code and will treat it as unsigned code.
    For a long time the applet was built and signed on windows, but now it can be built and signed on windows and mac. Building and signing on either platform gives the same results and the mac signed applet works just fine on windows.
    Has anyone else run across this problem? Any help or advice will be appreciated.
    Thanks,
    Robbie

    BenGlancy wrote:
    How did you tell it to fully trust it? I thought the dialog comes up asking the user whether to trust it.
    I only ask because it's not practical to expect all users to dig around for settings to trust a particular certificate.They don't have to dig around. When a signed Applet is loaded, if the certificate chain contains a certificate not in the trust store then a dialogue box asks the user if he wants to run it anyway. This dialogue box also has check box to indicate the the user should always trust this certificate and checking this means the user will not be asked again.

Maybe you are looking for