Signed Applet aah ... im getting crazy...

Hello
I have looked on all tutorials i can find about making an applet an signed applet, but none have WORKED for me.
I want the applet to be able to communicate with a server using sockets , if im right applet arent allowed to communicate with sockets if the applet isnt signed.
If im right you have to make the applet to a jar file to get it signed , am i right?
Can you please write an tutorial about how to make the applet signed (to make it able to communicate with an server using sockets).
Please make it like stepped like this:
1. Blablablabla
2. Blablablabla
Thank you so much if you post.
/javaguy
PS. if you wonder why i ask this questiong the answer is that im trying to make an online game.

You can use signing tool from Mozilla ,
http://www.mozilla.org/projects/security/pki/nss/tools.
Use this tutorial,
http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/rsa_signing.html
See this topic Signing Applets Using Netscape Signing Tool
It has worked for me. Let us know if you face any problem with this.
--Sachin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Questions on Signed Applets -- Can't Get it to Work

    For some reason my applet doesn't do any of the JDBC stuff that it's supposed to do on the web, yet when I run it through my IDE (Eclipse) the JDBC stuff gets executed. I uploaded all of my .class files and the mysql-connector com and org packages. Anybody have an idea what's wrong? I know this may be vague, so please ask questions if you need more information.
    I got this error message when I changed things up a bit:
    Connecting to the url MySQL database on port [port]
    SQLException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.security.AccessControlException
    MESSAGE: access denied (java.net.SocketPermission [url] resolve)
    Message was edited by:
    ktm5124

    When I view my applet on my website I get the error message: The application's digital signature is invalid. All I did was follow the steps at the URL I mentioned. What could I have done wrong? =(
    Perhaps it's the policy file. Should I make the policy file myself? I uploaded the one that Eclipse made for me. It looks like this:
    /* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/
    /* DO NOT EDIT */
    grant {
    permission java.security.AllPermission;
    Oh, and this is what my Java Console says when I view the applet on the website:
    Connecting to the [database name] MySQL database on port 3306
    SQLException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.security.AccessControlException
    MESSAGE: access denied (java.net.SocketPermission [MySQL database URL] resolve)
    STACKTRACE:
    java.security.AccessControlException: access denied (java.net.SocketPermission [MySQL database URL] resolve)
         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.checkConnect(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName(Unknown Source)
         at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:137)
         at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
         at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555)
         at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
         at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at util.LoadDriver.load(LoadDriver.java:19)
         at main.RedButtonGame.init(RedButtonGame.java:77)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    ** END NESTED EXCEPTION **
    Last packet sent to the server was 751 ms ago.
    SQLState: 08S01
    VendorError: 0
    Exception in thread "Timer-0" java.lang.NullPointerException
         at main.ScoresUpdater.update(ScoresUpdater.java:76)
         at main.ScoresUpdater.access$0(ScoresUpdater.java:70)
         at main.ScoresUpdater$1.run(ScoresUpdater.java:55)
         at java.util.TimerThread.mainLoop(Unknown Source)
         at java.util.TimerThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
         at main.User.updateYourself(User.java:47)
         at main.RedButtonGame.actionPerformed(RedButtonGame.java:244)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
         at main.ScoresUpdater.update(ScoresUpdater.java:76)
         at main.ScoresUpdater.refresh(ScoresUpdater.java:44)
         at main.RedButtonGame.actionPerformed(RedButtonGame.java:247)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
         at main.ScoresUpdater.update(ScoresUpdater.java:76)
         at main.ScoresUpdater.refresh(ScoresUpdater.java:44)
         at main.RedButtonGame.actionPerformed(RedButtonGame.java:247)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)

  • Change language on the security warning popup when using signed applets

    Hi
    Today when we use a signed applet the user get a security warning popup box where the langauge is English.
    Is it possible to change the language to other that English and if possible how can this be done ?
    Thanks in Advance,
    Henrik Rasmussen
    Denmark

    The Microsoft one is especially annoying because they should know better than to submit from secure to insecure.
    Let's say you are currently logged in to a Microsoft account and you click Sign in on MSDN. The site redirects to login.live.com, which recognizes that you are logged in, and generates a page with a hidden form and submits it back to MSDN using a script. This is where the problem is, because the hidden form action URL is not secure, yet it is on a secure page. (See Screen shots)
    The workaround (hack, whatever) is to modify the form to a secure address before it is submitted. How can you do that? Since it is impractical to do by hand, you can use an add-on.
    In an earlier thread, user thx1200 posted a link to a userscript that fixes this issue on login.live.com. The userscripts''.''org site has seemingly died, but there is a copy on a mirror of that site.
    * Earlier thread (long): [https://support.mozilla.org/questions/964250 How do disable this Warning? Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection]
    * You need Greasemonkey to run user scripts: https://addons.mozilla.org/firefox/addon/greasemonkey/
    * User script install page: [http://userscripts-mirror.org/scripts/show/173384.html Fix security warning for Microsoft Live login]

  • Class not found in signed applet

    Hello
    I am using a signed applet and am getting a class not found exception
    this works fine when i run it in the IDE but get the exception when i try to load the applet from the web browser in the application.
    java.lang.ClassNotFoundException: MyApplet
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:162)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:566)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:619)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:548)
    at sun.applet.AppletPanel.run(AppletPanel.java:299)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:265)
    at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:43)
    at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:152)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:149)
    ... 9 more
    I have my applet code in the applet folder
    here is my jsp call
    <applet code="MyApplet" codebase="../applet" archive="SMyApplet.jar" width=400 height=400>
    </applet>
    here is my applet code
    package applet;
    import java.applet.*;
    import java.awt.*;
    public class MyApplet extends Applet
    public void paint(Graphics g)
    g.drawString("Generate Me",50, 50);
    }

    If i do
    <APPLET CODE="xxx.class" CODEBASE="." ARCHIVE = "skshrad.jar , javax.jar" WIDTH=500 HEIGHT=500>
    is it correct?
    because it still appeared class not found error..
    This is a signed applet
    thanks..
    i try to put 2 directories in a jar also did not work..

  • Jms signed applet with SP3

    Hi,
              I am using a thin client version of weblogic client & jms jars for my signed applet.I am getting an exception when I try to initialize the applet without closing the browser window. This was an issue in SP2 and was reportedly fixed in SP3 but for some reason I dont see it working.
              I am using 1.4.2_05 as the jre for my java plugin and 8.1 SP3 for my weblogic. I see the messages these messages being printed in the logs
              +++ <Warining> Don't have permissions to access ThreadGroup. We strongly recommend to use signed applet.
              +++ <Warining> Proceed further without creating ThreadGroup.
              +++ <Warining> Don't have permissions to access ThreadGroup. We strongly recommend to use signed applet.
              +++ <Warining> Proceed further without creating ThreadGroup
              This is the exception that gets thrown when you try to start the applet again without closing the browser window.
              javax.naming.NamingException: Unhandled exception in lookup [Root exception is org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 208 completed: Maybe]
                   at weblogic.corba.j2ee.naming.Utils.wrapNamingException(Utils.java:81)
                   at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:237)
                   at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:171)
                   at javax.naming.InitialContext.lookup(Unknown Source)
                   at com.vz.inms.client.applet.MyApplet.init(MyApplet.java:84)
                   at sun.applet.AppletPanel.run(Unknown Source)
                   at java.lang.Thread.run(Unknown Source)
              Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe
                   at com.sun.corba.se.internal.iiop.IIOPConnection.purge_calls(Unknown Source)
                   at com.sun.corba.se.internal.iiop.ReaderThread.run(Unknown Source)
              But in my case, the applet is signed and I can see it in the trace as well as I get a prompt whether I want to accept the signed applet when the applet is about to be invoked. I have signed the applet using my own certificate instead of one from verisign or other CA's. I dont think it should matter.
              Does anyone know if this was really fixed in SP3?
              This is what documentation for resolved issues for 8.1 SP3 says :
              CR120811
              When using the WebLogic thin client with an applet, concurrentModificationExceptions and JMSExceptions were thrown. Investigation showed that there were two problems:
              There was a problem with the Sun ORB implementation. An applet's virtual machine released AppletContext upon a browser refresh and stopped all threads in the applet context's thread group. When an ORB was initialized as part of an applet context, the reader threads were created in the applet context's thread group. When the browser was refreshed, the ORB reader threads were also stopped.
              The WebLogic thin client created two threads in the applet context group: a HeartbeatMonitor thread and a RequestTimer thread. When the browser was refreshed, these threads were stopped with others in the applet context group.
              The problems were solved with the following changes:
              The Sun ORB implementation changed in JDK 1.4.2_04 so that it creates the reader threads on a child thread group of the system thread group but not to the applet's context thread group. This change ensures the reader thread stays alive as long as the orb is alive or applet's JVM is alive.
              The WebLogic thin client TunnelResponse and HeartbeatMonitor threads are now created on a child thread group of the system thread group but not to the applet's context thread group. This change ensures these threads stay alive as long as applet's JVM is alive. The fix is provided only for signed applets.
              I would really appreciate if someone could give any insight to this problem.
              Thanks,
              Jatinder

    I am also getting this error.
              BEA...is it possible to use an applet with JMS without signing it?

  • Signing applets, going crazy

    hi,
    I think I've posted enough thread on signed applets and
    still haven't got the solution and i'm the strong believer
    that any sought of problem will be solved in the forums,
    and I still believe in that. Ok! I don't wan't to bore u,
    here is my problem:
    1) I've signed the applet using keytool and specify the
    signed.jar file in the archive parameter in <applet> tag,
    but each and every client have to get the .java.policy
    file to be placed on their windows home directory!!!
    Is that the rt way to do it, or is there any way to link
    the .java.policy while signing the applet.
    2)I've also tried in signing the cab files, ok fine but don't
    know how to set the permissions in the .ini file in SDK for
    java, no proper documentation and also when i got to
    use the plugin converter to use my applet since the
    browser does'nt recognise the rmi classes, so when i use
    the plugin, and also the cabbase parameter, i'm not able
    to get it, but i'm able to get one of my applet get going
    which is a normal applet tries to write a file on to the
    desktop, but it doesn't have the plugin.
    3)Is there anyway to make applet work without using the
    plugin concept. I came to know the if i specify archive
    for rmi.zip, it should work, but I cou'lnt do it, is there any
    other versions of rim.zip
    Sorry 4 a long story,
    ThanX for baring me.
    kiran,
    [email protected]

    1:From my understanding, if you sign the applets you should not have to set policy files onto the client side.
    Applets should have complete unrestricted access to the system when these are signed.
    2: Are you trying in anyways to perform callbacks through firewalls ? If you do check RMI vs Internet on this forum.
    RMI works without plugin for jdk1.1 and over
    3: I don't know , sorry.

  • Signed applet gets email address

    Hi,
    I am working with a signed applet to get the email address setup up in the browser for both Nescape and IE. Is it possible to do that?
    Thanks
    Tak

    You can only get the user's e-mail address if he/she is willing to give it to you -- the fact that you're using a signed or unsigned applet is irrelevant.
    V.V.

  • Signed applet accessing remote host getting AccessControlException

    I'm fairly new to java development, so hopefully this is an easy answer, but in my searching I haven't yet been able to figure out why this isn't working for me.
    I have a self-signed applet, running on a server in my intranet. I understood that using a signed applet would allow connecting to any host within the applet. In the applet, I'm using the following code to try to connect to a remote host, which is also in my intranet:
    import org.apache.commons.net.ftp.*;
    FTPClient ftp = new FTPClient();ftp.connect("[myhost]");
    //Where [myhost] is the name of the host I'm trying to connect to.This works fine when running from Eclipse Applet Viewer, but when I run from the website, I get the prompt to accept the signature and run. I click run. When the code above runs, I get the following exception:
    ava.security.AccessControlException: access denied (java.net.SocketPermission cmdsp.bsu.edu resolve)
    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.checkConnect(Unknown Source)
    at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at java.net.InetSocketAddress.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at org.apache.commons.net.DefaultSocketFactory.createSocket(DefaultSocketFactory.java:53)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:162)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:250)
    at Deploy.DeployCard(Deploy.java:150)
    Any help would be GREATLY appreciated.
    Thanks!
    Daryl

    Bonjour,
    J'ai le problème que celui énoncé dans ce topic. Je réalise une applet ftp qui doit se connecter à un serveur ftp. J'utilise org.apache.commons.ftp.net et mon appli fonctionne sous eclipse mais pas intégré sur une page web.
    J'ai signé le jar commons-net-1.1.4.jar et le jar qui contient mon code et ça ne fonctionne pas.
    dois-je mettre toutes les classes de commons-net-1.1.4.jar dans mon fichier jar, je ne sais pas comment faire pour inclure commons-net-1.1.4.jar dans mon jar car lorsque je compile, je met le path dans eclipse mais je n'ai normalement pas besoin de mettre le commons-net-1.1.4.jar dans mon jar car les classes sont automatiquement importées.
    Merci de votre aide

  • Signed.applets.codebase_principal_support is set true but I always get error

    signed.applets.codebase_principal_support is set true but I always get error like Error: A script from «https://127.0.0.1:8080 <https://127.0.0.1:8080/> » was denied UniversalXPConnect privileges.
    On linux it works well.
    May be I need to change something else ?

    Possibly the consequence of this bug fix.
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=546848 bug 546848] - Remove support for enablePrivilege
    <i>([https://bugzilla.mozilla.org/page.cgi?id=etiquette.html please do not comment in bug reports])</i>

  • Self signed Applet - still getting Security Exception...

    Hi everyone...
    I m new to Java Mail... Nd I m developing a Applet to send mail from my Gmail account, nd I used keytool, jarsigner to Self sign the applet. Nd I wrote a Html page and when calling my applet method using javascript, I m having Security Exception... And I m using Java 1.5 (i.e., J2SE 5)
    Here is the sample of my code...
    --------- MyMail.java -----------
    import javax.mail.*;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    And all neccessory packages are imported....
    public class MyMail extends JApplet
         String server = "smtp.gmail.com";
         String username;
         String password;
         String fromAddres="";
         String toAddres="";
         Other Variable declaration goes here........
    Session ses;
    Transport tr;
    MimeMessage msg;
         public void init() //For testing purpose
              doLogin("username","password"); //My account details
         public void doLogin(String user,String pass)
              username = user;
              password = pass;
              boolean success;
              fromAddres = user+"@gmail.com";
              toAddres = "[email protected]";
              subject = "TEst SubJect";
              body = "This is Test Mail";
              success = doAuthentication();
              if(success)
                   setHeaders(server,username,password,fromAddres,toAddres,cc,bcc,htmlFormat,subject,body);
                   sendMail(ses);
                   doLogout();
         public void doLogout()
              //Deals with the logout from my account
         public boolean doAuthentication()
              //Deals with the authentication of my account
              // Setting properties, creating a session, getting transport object...
              //and returns true if authentication is success, false if not.
         public void setHeaders(String server, String username, String password, String fromAddress, String toAddress, String cc, String bcc, boolean htmlFormat, String subject, String body)
              //Sets the headers fields for the message (recieved through arguments)
         public void sendMail(Session ses)
              //Deals with sending mail
    class MyPasswordAuthenticator extends Authenticator
         //Deals with the authentication of my account
    ---------- MyMail.html -----------
    <html>
    <head>
    <script language=javascript>
    function sendmail()
    document.MyMail.doLogin("username","password"); //my account details
    </script>
    </head>
    <body>
    <input type=button name=but value=Send mail onclick=sendmail()>
    <applet name=MyMail code=MyMail.class
    archive=mail.jar,activation.jar,mailplus.jar width=0 height=0>
    </applet>
    </body>
    </html>
    And the applet is Self signed using the tools supplied from Java SDK...
    it got signed...
    And as the applet got loaded when i opend the MyMail.html, as i called the doLogin(..,..) in init() it is sending mail successfully...
    The problem is.... As I given the action for my button to send mail (by calling java method from java script i.e., calling doLogin() when the button clicked) I m getting Security Exception
    So...anyone plz tell me the solution....
    Thnx in advance....
    - Kanta

    http://www.google.nl/search?hl=nl&q=site%3Asun.com+javascript+signed+applet&btnG=Google+zoeken&meta=
    DoPrivileged would solve your problem but I've seen some cases where the
    threaded (link mentioned below second post) mothod is the only way it'll work.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and reply 18 for the java class file using doprivileged
    Still problems?
    A Full trace might help us out:
    http://forum.java.sun.com/thread.jspa?threadID=656028

  • For a signed applet am getting java.security.PrivilegedActionException:

    I have a signed applet,now for testing it's a self signed applet.
    It used for adding files using JFilechooser.
    It works fine in my machine with JRE version 1.5.0_12 .
    In other machines having jre version with 1.5 onwards it's working fine.
    But one problem am facing now is ,whenever we call a method in applet
    thorugh javascript it is giving security error . This problem comes only when the applet is running in some other machine having a diff jre (in that system the applet loads well,problem comes only when we access any applet method from a javascript).
    Is it due to the diff of java enabled in javascript (at client browser) and in applet (when complied and created the singed jar )
    bellow shows part of the error.
    java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
    Caused by: java.lang.reflect.InvocationTargetException
    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.JSInvoke.invoke(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor5.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.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)
    ... 4 more
    Caused by: java.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\dnixon\My Documents\photos\astro1.jpg 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.checkRead(Unknown Source)
    at java.io.File.exists(Unknown Source)
    Please any one help.
    thanks in advance
    It's very urgent

    [http://forums.sun.com/thread.jspa?forumID=421&threadID=5308353]

  • IIS, Javascript, Signed Applet and ASP Blank Page Problem

    Hi,
    I'm having a problem using a Signed Applet in a site that runs in a IIS (Windows Server 2003).
    My aspx web page uses the applet to read my smart card and get information from it.
    This applet uses an auxiliar dll (stored in a second Signed Jar file) in order to read the information from my smart card.
    The way the solution is design:
    1) Aspx page is asked from server
    2) Internet Explorer recieve the page and asks the server for it content (images, applet, javascripts, etc)
    3) After this the JVM runs (console opens)
    4) After the Aspx page render fully a javascript register onload fires and call an applet method
    5) Applet receive the call and run the logic of the method:
         - reads the smart card;
         - calls Javascript function in order to fill aspx fields with information from smart card
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    5) The server makes some logic with the information receive and responds to client registering in aspx page a call to another Javascrit function
    6) The client received the asnwer from server and runs the Javascript function registered on step 5)
         This Javascript calls another method from applet and runs the following logic:
         - reads more information from smart card;
         - call javascript function in order to fill more fields of aspx page with the information readed
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    7) The server makes some logic and call another pages with no Applets
    8) Client asks for a second page with the same applet and we start with another logic express on steps 1);2);3),4);5) and then 7).
    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
         - with fiddler I can seer the request for the aspx page (that uses the applet)
         - but server responds with a blank html page
    The JVM doesn't fire.
    The IIS log don't show errors.
    The eventviewer doesn't show errors.
    The problem is solved with an IIS reset or a Application Pool reset.
    After a while the problem returns.
    This problem occours for other user in another machine, the server just stops responding correcly to request regarding pages with applets, the other pages still continue to work.
    If we disable Java Control Panel->Advanced->Java Plug-in->Enable the next-generation Java Plug-in the problem seend to stop, but we can't force all clients to disable this option right?
    Or there is a way to force the Applet to run with this option disabled?
    As anyone experience similar problem?
    Regards,
    OF

    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
    - with fiddler I can seer the request for the aspx page (that uses the applet)
    - but server responds with a blank html pageWell, if http requests look identical in case of success and failure (pay attention to cookies, etc) then it has to be something on the server side.
    It could be that server gets into this wrong state because of previous requests made by applet but it is hard to tell.
    I am not clear how old/new plugin can make a difference unless your applets run in the legacy mode (i.e. you are actually trying to reuse SAME instance of the applet when
    it is loaded next time).
    I'd start with
    1) carefully comparing good/bad sessions
    2) checking whether server will serve correct response to another client when it serves "bad" page for current client
    3) add debug statements to aspx - it is scripted page, may be some condition is not met and then it returns blank?
    4) record all http requests in one session until you get to "error" state and then use any http server testing tool to "replay" this set of requests.
    You should be able to get server into the same state without use of applet. Then you can try to tweak set of requests to see what makes a difference.

  • Signed Applet not loading on Mac OS X if using HTTPS protocol

    Hi All,
    I need to open a trusted applet on Mac OS 10.2. The applet works fine if using HTTP protocol. But if the protocol used is HTTPS the the applet does not loads and "javax.net.ssl.SSLException - untrusted server cert chain" exception comes on the console.
    The error comes for both - Verisign and javakey - signed applet.
    On seaching for possible solution on the net, i came across following link: http://www.macosxhints.com/article.php?story=20020525101202503&query=Workaround+for+secure+Java+applet+problems
    It says that this is Mac's known bug and gives the workaround as:
    1. Access the problematic site with Internet Explorer on Windows. Click on the padlock item and export the certificate to a file.
    2. Copy the certificate to your Mac.
    3. Use the command
    sudo keytool -import -trustcacerts -keystore /Library/Java/Home/lib/security/cacerts -file mycert.cer
    to import the certificate file to your keystore (substitute mycert.cer with the name of the file containing the certificate). The keystore is password protected - the default password is "changeit".
    4. Restart your browser
    But the client cannot be asked to do all this to run the applet.
    Is this problem being solved by Mac in their java implementation or is there any other possible solution?
    Thanx in advance.
    Regards,
    Charu

    I am experiencing the same problem - I notice it does not happen on OS9.2 using IE but appears a problem on all browsers on OSX
    Apple gave me the following reply.....
    Re: Bug ID# 3268633: cannot load applet class under https connection
    Hello Andrew,
    Thank you for bringing this problem to our attention. We have received feedback
    from engineering on your
    reported issue.
    Please know that to get Java to recognize the certificate you will need to do
    one of two things, depending
    on which VM you are using. Since you want it to work with Internet Explorer, we
    will assume Java 1.3.1.
    In Java 1.3.1 you'll need to add the certificate to
    /Library/Java/Home/lib/security/cacerts using
    /usr/bin/keytool to import the certificate into the certificate database.
    In Java 1.4.1 you should be able to just add the certificate to the keychain
    using certtool. For more
    details on how to do this, please refer to the information found at
    <http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/keytool.html>. After
    doing so, if you should require
    further help from Apple in resolving this issue, we recommend that you request
    assistance from Developer
    Technical Support. This must be done by filing a Technical Support Incident.
    So I am supposed to tell every Mac user to do the above am I?!!!

  • File read access denied for signed applet

    Hi:
    I have a signed applet with a certificate generated with the keytool. Yet, I keep getting this error:
    java.lang.Exception: java.security.AccessControlException:
        access denied (java.io.FilePermission C:\WINDOWS\system32\aetpkss1.dll read)The error is produced when the method loadKeyStore(pin) below is called.
        private KeyStore ks;
        private Provider provider;
        private static final String providerName    = "PKCS11";
        private static final String providerLibrary = "aetpkss1.dll";
        public void loadKeyStore(String pin) throws IOException,
         CertificateException, KeyStoreException, NoSuchAlgorithmException {
         if (provider == null)
             registerProvider(providerLibrary);
         try {
             ks = KeyStore.getInstance(providerName,provider);
         } catch (Exception e) {
             throw new KeyStoreException("Failed get keystore instance\n"
                             + e.getMessage());
         try {
             ks.load(null, pin.toCharArray());
         } catch (Exception e) {
             throw new KeyStoreException("Failed load keystore\n"
                             + e.getMessage());
        public void registerProvider(String library)
         throws FileNotFoundException, KeyStoreException {
         String fileName;
         if (new File(library).isAbsolute())
             fileName = library;
         else
             fileName = getAbsolutePath(library);
         if (!(new File(fileName).exists()))
             throw new FileNotFoundException("No such file: " + fileName);
         String config = "name = " + providerName + "\n"
             + "library = " + fileName;
         ByteArrayInputStream confStream =
             new ByteArrayInputStream(config.getBytes());
         try {
             provider = new sun.security.pkcs11.SunPKCS11(confStream);
             Security.addProvider(provider);
         } catch (Exception e) {
             throw new KeyStoreException("Can initialize " +
                             "Sun PKCS#11 provider. Reason: " +
                             e.getCause().getMessage());
        private String getAbsolutePath(String lib) throws FileNotFoundException {
         String[] searchPath;
         /* NOTE: This should be modified to suit different versions of   *
          *       Windows and not just Windows XP                         */
         if (System.getProperty("os.name").matches("^(?i)Windows.*")) {
             searchPath = new String[] { "C:\\WINDOWS\\system32" ,
                             "C:\\java" };
         } else {
             searchPath = new String[] { "/usr/local/lib/" };
         for (int i = 0; i < searchPath.length; i++) {
             if ((new File(searchPath[i] + File.separator + lib).exists()))
              return (searchPath[i] + File.separator + lib);
         throw new FileNotFoundException("Library not in search path " + lib);
        }The above code is called by a java script, the class' constructor is empty.
    The error appears not to be caught by my code. I have tried to insert try/catch statements everywhere to figure out where this error is produced.
    The code is write off of the applet for signing with a smart card by Svetlin Nakov - and his applet works!
    I have also made a CLI application that uses the above code and it works perfectly.
    So: Something is wrong either with my certificate, the signing method, signature verification or something completely different. Any hints?
    The certificate I generated with
    keytool -genkey -keystore mystore -alias me
    keytool -seflcert -keystore mystore -alias meI have tired both with and without the selfcert step.
    Thanks! Erik

    The problem has been identified: Placing registerProvider() in the constructor the error no longer occurs, instead an error is produced when the key store is loaded.
    It appears that the javascript code is not trusted and so, even though the applet is signed, access privileges are restricted to those of the java script.
    A solution to this problem is not clear, but possibly, serving the pages from a trusted server, the java script will be trusted, some documentation seem to indicate.

  • 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);
    }               

Maybe you are looking for

  • Full path and filename in wwv_flow_files after upload from UNC path in IE

    I have a page with a file browse item. After page submit I move the file from wwv_flow_files to another table. Normally the column wwv_flow_files.filename only contains the filename. However, when using IE9 and selecting a file from an UNC path the c

  • Multiprovider on Open Sales Order Cube & Delivery Analysis Cube

    Hi All, I have requirement to create a new report, for this report fields are getting from two cubes (Open Sales Order & Delivery Analysis). Open Sales Order cube is under Sales in S&D, Delivery Analysis Cube is under Distribution in S&D. Both cubes

  • How to select all text in document?

    I need to select all text in a long document to export to rtf. I only seem to be able to select a story. Any ideas in how I can do it? Thanks Ian

  • How to import xls file to BPA11gR1

    I got business flow from customer,one xml and one xls file. I imported xml file as following: New a database. Run BPA(11gR1) and open above database. Right-click on the group and select Evaluate/Start macro. The Macro Wizard opens. Select the "Import

  • Dreamweaver CC and incontext editing. No tools anymore?

    Hey, I've just updated to Dreamweaver CC to find out that the tools for integrating incontext editing tags into a page have been removed. I always found these tools extremly helpful for me as designer as well as I found incontext editing a major sell