Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Runtime extension instalation

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

Im currently working video conferencing project.
Everything is fine with video sending/receiving.

Client need jre instaled and jmf( Java Meda Framework ) extension.

There are few ways to instal jmf, one of them is describet there :
http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/extensions_example.html

It works fine, but client have to :
#2 confirm that they trust me( signed applet)

#1 in yes/no dialog press yes to instal extension:
-Implementation-URL ...

What I want to do is to awoid yes/no dialog for plugin instalation.
If client "trust" me, it gives me permission to search client machine for jmf.jar and instal(copy byte by byte) jmf.jar to client machine.

Problem is accessing instaled classess because ClassLoader havent load them.
I tried somthing like this :

JarFile jf;
Enumeration e;


URL[] urlList = {new File("path to jmf.jar").toURL()};
ClassLoader loader = new URLClassLoader(urlList);
JarFile jf = new JarFile("path to jmf.jar");

for (Enumeration e = jf.entries() ; e.hasMoreElements() {
String jarEntry = e.nextElement().toString();

if (jarEntry.endsWith(".class")) {

jarEntry = jarEntry.replace('/','.');
jarEntry = jarEntry.substring(0,jarEntry.length()-6);
System.out.println(jarEntry);
Class inst = loader.loadClass(jarEntry);
}
}

This works fine, but when I try :
Object o = inst.newInstance();

I get :

DirectSoundAuto
DirectSound Capture Supported = true
Exception on commit = java.lang.SecurityException: commit: Permission denied
DirectSoundAuto: Committed ok
Export
java.lang.InstantiationException: Export

As far as I know java.policy.applet, created by Eclipse gives maximum permissions.

Well anyway is there way to instal extensions like jmf.jar runtime in applet? ( http://www.javaworld.com/javaworld/jw-10-1996/jw-10-indepth.html says its not possible in applets )

----

There is one more way to get done with it :
Include jmf.jar in archive="" but its 2mb and even if I cut it I guess it will be at least 1mb huge.

I can make an applet which checks if user have jmf instaled withot making trused applet, and then in videoconferencing applet include archive="jmf.jar", if its not.

Second problem is : How to access archive="jmf.jar", to be copied to client lib/ext directory, so next time user will not have to instal anything !??

If I could handle 1 of those 2 problem everything would be OK!

(sorry abut poor english)
Thank u!
 
I brought this back from the farm where they grow the tiny ads:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic