Dll-in-jar access by java2/1.2 applet

Given the new security mechanisms of Java2/1.2, is it possible for an applet loaded from the network to access a dll in a jar?
TIA,
Reggie

Java Web Start can access and load native librarys (dll's) but only if the application is signed and requesting <all-permissions> - see the developers guide: http://java.sun.com/products/javawebstart/1.2/docs/developersguide.html#jnlp
and the section on the Nativelib element.

Similar Messages

  • Error while accessing a public method of applet from javascript.

    Hi,
    I am getting "Object doesn't support this property or method" error
    when accessing a public method of applet from javascript in IE 6 using
    document.applets[0].myMethod();
    The same is working in IE 7.
    Thanks in advance.
    Regards,
    Phanikanth

    I don't know why it happens, but this works for me in both versions:
    <applet ..... name="MyApplet">
    </applet>and in javascript use
    document.MyApplet.myMethod()

  • WHY can't I access my database from an applet???????????

    The security code won't let my applet access its own database (from its own server)..
    I'm using getDocumentBase()
    to try and tell it that it is my own damn file..
    I keep getting :
    java.securityAccessControlException: access denied <java.util.PropertyPermission jdbc.drivers write>
    ...etc.
    This applet crap is really starting to piss me off. I can see why they came out with JSP.
    All I need to do is access my database, update it, etc. It kind of defeats the purpose of being able to do jdbc from applets if you can't even access the database on your own damn server.
    If you all don't have a clue, I'm freakin switching to PHP--I'm tired of this crap-I was thinking Java was a damn good language until I hit applets.

    The simple answer to your question is: Because of security concerns.
    The somewhat longer answer is that directly accessing a database from an applet is generally not a good idea. A lot of security-critical code like DB username/password must be hidden in the applet which potentially can be downloaded (and disassembled) by anyone that hits your webpage. Maybe you do an intranet solution with trusted users but that is not what applets were originally designed for.
    The clean way is to make your applet talk to a servlet that talks to your database.
    If that is not the way you want to do it, make sure that all client policy files (yes, on the browser machine) contain the permissions that your applet needs.

  • Hi,  Trying to log in with my user id and password at iocbc but was not able to access. Problem message shown : Applet not initialised or may not be supported. Please refresh the page or check the browser setting  Anyone can advise? or i need to download?

    Hi,
    i have the same problem?
    Trying to log in with my user id and password at iocbc but was not able to access.
    Problem message shown : Applet not initialised or may not be supported. Please refresh the page or check the browser setting
    Anyone can advise?

    You need to install Java for your Mac OS version, and/or make sure it's enabled in the Java Preferences application and your browser's preferences.

  • How to access the sql database in applet?

    How to access the sql database in applet?
    Please help me.

    import java.applet.*;
    import java.awl.*;
    import java.sql.*;
    //other packages
    public class jdb extends Applet
    Connection con;
    Statement stmt;
    String name="drvijay";
    String phoneno="9842088860";
    public void init(){}
    pubilc void stop(){}
    public void destroy(){}
    public void start()
    call();
    public void call()
    try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              conn=DriverManager.getConnection("Jdbc:Odbc:emp","sa","");
              stmt=conn.createStatement();
              stmt.executeUpdate("insert into empdetails(name,phoneno) values ('"+name + "',''"+ phoneno +"' )" );
              }catch(SQLException e)
                   System.out.println("error"+e);
                   System.exit(0);
    //<applet code="jdb" height="200" width="200"> </applet>
    u this jdbc statement in any of the method..
    */

  • Can I access the methods of an applet in a JTabbedPane?

    Hi,
    I have a jtabbedpane that can open multiple windows and in each window the component is a different instatiation of this one applet. I was just wondering if there is any way that I could access the methods of that applet w/in that tabbed pane position. So far I've tried making a copy of the component(the applet), and then access the method of the copy, and then setting the copy to be the component of that tabbed pane, but that just seemed a little resource heavy.
    Thanks, any help is greatly appreciated

    with HTML of course!
    if you want it in the center... do <center> appletcode </center>
    if you want it in the bottom right corner use tables to move it there.

  • JVM does load DLL within JAR executable

    Hi,
    I'm not sure the following problem is related to this forum but...
    I have problem to load native code (DLL) by running executabe JAR file(created by JBuilder 9).
    The program runs fine within JBuilder & Eclipse compilers.
    When run the EXE an error says "JVM cannot load the DLL" in java library path.
    I have tried without succes:
    1. Loading dll in main function: [System.load() & System.loadlibrary()].
    2. Running JVM with parameter: -Djava.library.path=<DLL path>
    * running the class with "java" application works fine as well.
    Any ideas?
    Thanks,
    AST

    I extract the DLL file to working directory if necessary, also the DLL is stored in System32 & working directories (the directories are part of Java library path).
    Normally,the DLL is loaded by external package that embedded to program, could it be that executable JAR blocks access to native code?
    Thanks,
    AST

  • Third party dlls and jars with in jars.

    Hi,
    I have a application which uses several 3rd party jars and dlls.I want to create a executable jar for the application .I added the external jars using fat jar eclipse plugin. Iam able to run the jar on my system successfully.But on other systems the application doesnot launch as the dlls are not avaiable which is fairly understandable. It gives the following exception 'JarClassLoader: Warning: Unable to load native library: java.lang.NullPointerException'.Now i need to include these dlls into the jar so that i can distribute the application as a single jar and launch double clicking it.I know expecting dlls ignores the cross platform nature of java but i need it.please give me some idea on how this can be done.
    Thanks in advance

    Hi,
    I have a application which uses several 3rd party jars and dlls.I want to create a executable jar for the application .I added the external jars using fat jar eclipse plugin. Iam able to run the jar on my system successfully.But on other systems the application doesnot launch as the dlls are not avaiable which is fairly understandable. It gives the following exception 'JarClassLoader: Warning: Unable to load native library: java.lang.NullPointerException'.Now i need to include these dlls into the jar so that i can distribute the application as a single jar and launch double clicking it.I know expecting dlls ignores the cross platform nature of java but i need it.please give me some idea on how this can be done.
    Thanks in advance

  • How to pass a struct to a DLL function and accessing it in another VI

    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM

    aajjf wrote:
    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM
    You say nothing about how your cluster looks but I'm afraid you did the standard error here and placed arrays in it. That is not what the C structure is representing for several reasons.
    First fixed size arrays in C are inlined inside a structure, so are not a pointer but for the case of your val1 element three doubles.
    Second although not relevant here because of above point: LabVIEW arrays are not the same as C arrays. LabVIEW uses a pointer to a pointer and has the size of the array in elements prepended to the array data. C simply uses a pointer and all the rest is the programmers sorrow. The Call Library Node does convert the top level element of variables you pass according to the type configuration of that parameter but does no conversion of internal elements at all. So passing clusters with anything like arrays or strings is always wrong unless the DLL is aware of the specific datatypes LabVIEW uses.
    Last but not least you can end up with alignment issues. Elements in structures are aligned by every C compiler to a certain value. This value can be defined by the programmer in the project settings or for Visual C through #pragma pack() statements in the C code. The alignment rule says that an variable is aligned to the smaller of the two values that are either a multiple of the variable element size or the alignment setting. Most 32bit code nowadays uses 8 bit default alignment but LabVIEW always uses 1 byte. In your case there is nothing to observe since the large variables are at the beginning. Otherwise you might have had to insert filler elements in the LabVIEW cluster.
    One last thing bool is a C++ type only. Its size is 1 byte and incidentially this is the same LabVIEW uses for Booleans.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Including a DLL in JAR file (Comm API)

    Writing a little app that interfaces with serial port device using the communications API and I'd like to bundle it into an executable JAR. JBuilder will create the JAR for me fine, but the issue is with the win32com.dll file thats part of the comms API. I need to include this, I don't think its possible to include as part of the executable, but otherwise the DLL needs to be in the windows\system folder. Could I include the dll as part of the JAR archive and then extract it upon runtime? If so how would I go about this?
    Any help much appreciated.

    There is another option. Native libraries need to reside within the java.library.path location. As it turns out, if you, at runtime, grab this property and ADD your own location to it, then set it back in to the System.setProperty() call, it will NOT work. The only way to do it is the -Djava.library.path value that tjmaven suggested.
    However, if you read up on how a native library is found, it uses the ClassLoader.loadLibrary() which calls the protected findLibrary() method. You can therefore extend ClassLoader to find a path yourself.
    One way is to extend URLClassLoader since it has the protection/security stuff AND the ability to look in .jar files for you. Your custom loader is created by a "launcher" class in your .jar file. First, your luancher uses getClass().getProtectionDomain().getCodeSource().getLocation() to get the absolute location of the .jar file its executing within. From there, you open the jar and look for your native library, extract it using the JAR api to a location of your choosing. Now, you instantiate the custom classloader and using this custom loader instance you load the rest of your classes. The main .jar file contains two classes, the launcher and the custom classloader, and contains the native library if you wish to do it this way. The custom classloader, you specify a URL[] of "classpath" entries. You bundle up the rest of your source in a second .jar file that you pass to the URL[] when creating the custom classloader. It will find all your classes in the 2nd jar no sweat. You can even "reload" these classes on the fly by recreating the custom classloader instance if you so wish to add a sort of "reload" feature.
    Now, in your custom classloader, you override the findLibrary() and return the SAME STRING PATH that you used to unjar your native files to. This way, when the JVM asks your custom loader to load the library at some path, you return the right path to find the native files in.
    I haven't verified that this works just yet, but I will soon. Primarily, my plugin engine over at www.platonos.org will support the ability to place native libraries in plugins, allowing you to effectively wrap a native library use as a plugin. Not yet working, but we'll soon have it in place.

  • ORA805.dll unable to access using TOAD

    Has anyone encountered this issue?
    Access violation in module ora805.dll using the TOAD software
    What was the solution to correct?
    Thanks

    First recommendation is to upgrade your Oracle client as advised. If that's not possible - Toad is still tested and certified for Oracle releases all the way back to 7.3. But there are complications of course - as certain Oracle client versions cannot connect to some older databases. But your case here looks to be Toad specific. I think you should double check that Toad is pointing to the correct Oracle home for that client. The Toad connection screen offers the ability to look into that.

  • JAR access using C#

    Dear all,
    I have a JAR file that contain a .dat (data.dat) file which i want to access.
    how can i access a JAR file using c# ? Is there any way to do it?
    "you should change things better than being a victim of these changes", AyedSQ.

    a jar file is just a zip file with a different extension, so if you can find a .NET zip library, you're away

  • Ieframe.dll crashing whenever accessing Address Book

    I have been able to reproduce this error whenever we have Internet Explorer 8 installed on a Windows XP SP3 machine, running GroupWise 7.0.4.
    The easiest way to reproduce:
    New Mail -> Enter user in "To:" Field -> Click on "Subject Line" -> Go Back to "To:" field, and Right-Click on User, and select "Details".
    Window will display for a moment, but never display the information, and then subsequently Crash against ieframe.dll (8.00.XXXX).
    We are banging our heads against this one, because we tried everything we can think of. Reaimging, Reinstalling both IE8 and GroupWise, rolling back Windows Updates... Nothing seems to be working.

    Originally Posted by xirphoid
    I have been able to reproduce this error whenever we have Internet Explorer 8 installed on a Windows XP SP3 machine, running GroupWise 7.0.4.
    The easiest way to reproduce:
    New Mail -> Enter user in "To:" Field -> Click on "Subject Line" -> Go Back to "To:" field, and Right-Click on User, and select "Details".
    Window will display for a moment, but never display the information, and then subsequently Crash against ieframe.dll (8.00.XXXX).
    We are banging our heads against this one, because we tried everything we can think of. Reaimging, Reinstalling both IE8 and GroupWise, rolling back Windows Updates... Nothing seems to be working.
    I believe you need GW8 client for IE8 support but I'm not sure.... Try setting Firefox or some other browser as default on the workstation and see if it works better.
    Thomas

  • Can not copy dll to system 32 in windows 7 while applet loading

    I am using the jniwarapper to access registry information in windows from my applet. The applet i signed. In windows xp, able to copy the jniwrap.dll from server path to the system 32 on the client computer. But from windows 7 , not able to copy though having the administrator previleges.
    Is it purely windows 7 specific or do i have any other option to copy the dll files to the system 32 folder on windows 7?

    HI,
    I used the below jnlp file
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp href="java2d.jnlp">
    <information>
    <title>Java2D Demo</title>
    <vendor>My Company, Inc.</vendor>
    <offline-allowed />
    </information>
    <resources>
    <j2se version="1.4+" href="http://java.sun.com/products/autodl/j2se" />
    <jar href="myapplet.jar" main="true" />
    <nativelib href="mydlls.jar"/>
    </resources>
    <applet-desc name="MyFileAccess" main-class="com.applet.MyFileAccess" width="710" height="540">
    </applet-desc>
    </jnlp>
    mydlls.jar contain the jniwrap.dll file. i have copied the jniwrap.lic to META-INF folder of myaaplet.jar file.
    The dll is recognized by JVM and also license verification is success.
    But got the below error still, i have the b.class in the applet jar itself.
    Exception in thread "thread applet-ge.indsys.applet.MyFileAccess-1" java.lang.NoClassDefFoundError: com/jniwrapper/b (wrong name: com/jniwrapper/B)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.access$400(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
         at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at com.jniwrapper.Pointer$Void.<init>(SourceFile:491)
         at com.jniwrapper.Pointer$Void.<init>(SourceFile:482)
         at com.jniwrapper.win32.Handle.<init>(SourceFile:17)
         at com.jniwrapper.win32.registry.RegistryKey.<init>(SourceFile:100)
         at com.jniwrapper.win32.registry.RegistryKey.<clinit>(SourceFile:20)
         at com.applet.MyFileAccess.addIE8Key(MyFileAccess.java:1096)
         at com.applet.MyFileAccess.init(MyFileAccess.java:3794)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    copied the class files to mydlls.jar also, same exception. Please suggest.
    Edited by: user13722950 on Feb 22, 2011 12:35 AM

  • Dynamically Loading .jar into the AppletClassLoader of Signed Applet

    First of all, I thank you for reading this post. I will do everything I can to be concise, as I know you have things to do. If you're really busy, I summarize my question at the bottom of this post.
    My goal:
    1.) User opens applet page. As quickly as possible, he sees the "accept certificate" dialog.
    2.) Applet gets OS vendor, and downloads native libraries (.dll for windows, etc.) and saves them in user.home/ my new dir: .taifDDR
    3.) Calls are made to System.load(the downloaded .dlls) to get the natives available.
    4.) Applet downloads the .jar files that we stripped so that the applet was smaller, one by one
    5.) For each .jar downloaded, it goes through the entries, decodes the .class files, and shoves them onto the AppletClassLoader.
    6.) Finally, the looping drawmation of the applet is linked to a subclass, that now has everything it needs to do what it wants.
    I have gotten all the way to step 5!!! It was amazing!
    But now I'm stuck on step 5. I can download the .jar files, read them, even decode the classes!
    As evidence, I had it print out random Methods using reflection on the created classes:
    public net.java.games.input.Component$Identifier net.java.games.input.AbstractComponent.getIdentifier()
    public final void net.java.games.input.AbstractController.setEventQueueSize(int)
    public java.lang.String net.java.games.input.Component$Identifier.toString()
    public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
    ... many many more So, its frustrating! I have the Class objects! But, whenever the applet begins to try to, say instantiate a new ControllerEnvironment (jinput library), it says ClassNotFoundException, because even though I made those Classes, they aren't linked to the system classLoader!
    Here is how I am loading the classes from the jar and attempting to shove them on the appletclassloader:
    ClassLoader load = null;
    try {
         load = new AllPermissionsClassLoader(new URL[]{new File(url).toURL()});
    } catch (MalformedURLException e2) {
         e2.printStackTrace();
    final JarFile ajar = new JarFile(url);
    ... we iterate over the elements (trust me, this part works)
    String name = entry.getName();
    if (name.endsWith(".class")) {
         name = name.substring(0, name.length() - 6);
         name = name.replace('/', '.');
              Class g = load.loadClass(name);
    public class AllPermissionsClassLoader extends URLClassLoader {
        public AllPermissionsClassLoader (URL[] urls) {
            super(urls);
        public AllPermissionsClassLoader (URL[] urls, ClassLoader parent) {
            super(urls, parent);
            System.out.println(parent);
        public AllPermissionsClassLoader (URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) {
            super(urls, parent, factory);
        protected PermissionCollection getPermissions (CodeSource codesource) {
            Permissions permissions = new Permissions();
            permissions.add(new AllPermission());
            return permissions;
    }so, my assumption here is that if I create a new AllPermissionsClassLoader and then call loadClass, the loaded class (because it does return a valid Class object) is usable globally across my applet. If this is not true, how should I else be doing this? Thank you for Any advice you could offer!

    I know it's two years ago but the OP's approach seems pointless to me.
    4.) Applet downloads the .jar files that we stripped so that the applet was smaller, one by oneWhy? Just name the JAR files in the CLASSPATH attribute of the <applet> tag. Then what you describe in (5) and (6) happens automatically on demand.
    protected PermissionCollection getPermissions (CodeSource codesource) {Who does he think is going to call that?

Maybe you are looking for

  • OCZ Intel extreme on H55-GD65

    Hi, I have bought an MSI H55-GD65 motherboard, and with that the following sticks of RAM : OCZ Intel Extreme Edition XMP 4 Go (kit 2x 2 Go) DDR3-SDRAM PC3-10600 - OCZ3X1333LV4GK I would like to have your opinion on this choice. For instance, I would

  • Not allow credit check

    Hi, I have a scenario wherein we want to configure credit check at sales order level to not happen on sales order creation level, although there may be blocked sales order/delivery for same customer. Eg: Credit limit for X is set as 100/- Total value

  • I have a blank screen and it won't reset

    I HAVE A BLANK SCREEN AND IT WONT RESET

  • Run script in Keynote?

    Can I run a script in Keynote? Please Help! Thanks!

  • Valuation Record Error

    While doing GR for Material  iam getting this error Valuation record 300105 XXXX DOMESTIC does not exist Message no. M7077 Actually i created 2 valuation types in configuring split valuation Domestic and Foreign in Material master for this material i