JS to applet connection

Hi all,
I'm trying to activate a method from the html using javascript.
The problem start from the fact that the applet isn't activated when running the html.
I used the object tag like this:
<form name="Form1">
<OBJECT ID="AudioPlay" WIDTH=50 HEIGHT=50
CLASSID="CLSID:CAFEEFAC-0014-0001-0000-ABCDEFFEDCBA">
<PARAM NAME="type" value="application/x-java-applet;jpi-version=1.4.1">
<PARAM NAME="code" value="AudioPlay.class">
<PARAM NAME="level" value="5">
<PARAM NAME="scriptable" value="true">
</OBJECT>
I can use some help here,
Thanks,
Shai.

What browser are you using? The object used for applet-to-javascript communication, JSObject, seems to generate an exception with netscape no matter what. I have had this problem for weeks, and can't seem to figure it out, or find any solution on the internet. Internet Explorer handles it fine.

Similar Messages

  • Applet connecting to MS SQL Database (Remote DataSourse)

    Hello,
    I started by building my interface to a Database within an Application. I am not to the point where I am ready to make it an applet but want to get some tips when the time comes very soon.
    First of all what security issues do I have to deal with to let the applet connect to the database?
    Second I currently created a local Datasource via ODBC call JavaDB and linked it to my MS SQL Database.
    QUESTION
    How do I link to the with a remote Datasource so that the local machine does not have to worry about the datasource.
    Lastly can I use the "sun.jdbc.odbc.JdbcOdbcDriver" in an applet. I sure hope so...
    Then the part of my code that connected to the database was this:
    private void initDB(){
    String url = "jdbc:ODBC:JavaDB";
    Connection con;
    String query = "select * from COFFEES";
    Statement stmt;
    try {
    //Class.forName("myDriver.ClassName");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url, DBADM, DBPWD);
    stmt = con.createStatement();                                   
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    System.out.println("");
    int numberOfColumns = rsmd.getColumnCount();
    for (int i = 1; i <= numberOfColumns; i++) {
         if (i > 1) System.out.print(", ");
         String columnName = rsmd.getColumnName(i);
         System.out.print(columnName);
    System.out.println("");
    while (rs.next()) {
         for (int i = 1; i <= numberOfColumns; i++) {
         if (i > 1) System.out.print(", ");
         String columnValue = rs.getString(i);
         System.out.print(columnValue);
         System.out.println("");     
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Thanks,
    Kenny

    Kenny,
    As no one has replied, I've managed to implement a database that uses applets.
    Firstly, one needs to obtain a JSP server (apache tomcat is free and can be configured into a IIS 4 server).
    Secondly, write all the DB connection stuff within a jsp page (ex.) "builders.jsp"
    <%@ page import="java.sql.*" %>
    <%!
    protected String driver="sun.jdbc.odbc.JdbcOdbcDriver";
    protected String url="jdbc:odbc:PhotoDBase";
    protected String userid=null;
    protected String passwd=null;
    %>
    <html><head><title>Builder Example</title></head><body>
    <%!
    public static String GET_BUILDER_QUERY =
    "SELECT * FROM BuilderInfo WHERE BuilderID =?";
    %>
    <%
    String bID = "24"; //normally this would use
    //request.Parameter("bID");
    //in order to pull up a specific
    //record. In this test case it is
    //hard coded to pull only builder #24
    %>
    <%
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, userid, passwd);
    PreparedStatement stmt = conn.prepareStatement(GET_BUILDER_QUERY);
    stmt.setString(1, bID);
    ResultSet rs = stmt.executeQuery();
    rs.next();
         String buildID = rs.getString("BuilderID");
         String bName = rs.getString("BuilderName");
         String bAddress = rs.getString("Address");
         String bCity = rs.getString("City");
         String bState = rs.getString("State");
         String bZip = rs.getString("Zip");
         String bCName = rs.getString("ContactName");
         String bCLast = rs.getString("ContactLast");
         String bPhone = rs.getString("Phone");
         String bFax = rs.getString("Fax");
         String bMobile = rs.getString("Pager/Cell");
    rs.close();
    stmt.close();
    if (bName == null)
         bName = "No Builder";
    if (bAddress == null)
         bAddress = "N/A";
    if (bCity == null)
         bCity = "N/A";
    if (bState == null)
         bState = "N/A";
    if (bZip == null)
         bZip = "N/A";
    if (bCName == null)
    bCName = "N/A";
    if (bCLast == null)
         bCLast = "N/A";
    if (bPhone == null)
         bPhone = "N/A";
    if (bFax == null)
    bFax = "N/A";
    if (bMobile == null)
    bMobile = "N/A";
    %>
    <p>Builder: <%= bName%> BuilderID #: <%= buildID%>
    <br>Contact: <%= bCName%> <%= bCLast%>
    <br>Address: <%= bAddress%>
    <br><%= bCity%>, <%= bState%> <%= bZip%>
    <br>Phone: <%= bPhone%>
    <br>Fax: <%= bFax%>
    <br>Mobile: <%= bMobile%>
    <p><applet code="Build.class" width="600" height="300">
    <param name=buildID value=<%= buildID%>>
    <param name=bName value="<%= bName%>">
    <param name=bAddress value="<%= bAddress%>">
    <param name=bCity value="<%= bCity%>">
    <param name=bState value="<%= bState%>">
    <param name=bZip value="<%= bZip%>">
    <param name=bCName value="<%= bCName%>">
    <param name=bCLast value="<%= bCLast%>">
    <param name=bPhone value="<%= bPhone%>">
    <param name=bFax value="<%= bFax%>">
    <param name=bMobile value="<%= bMobile%>">
    </applet>
    </body>
    </html>
    The jsp gets the data from the DB based on the parameter bID which would be passed to it via a search or input page with various error checking included.
    The applet then recieves its data via parameters. (Build.class has been shortened here to show you the meat and potatoes of the whole deal)
    //<applet code="Build.class" width="600" height="300"></applet>
    import java.awt.*;
    import java.awt.Event;
    import java.applet.Applet;
    import java.io.*;
    public class Build extends java.applet.Applet {
    protected Panel search ;
    protected TextField Nametxt ;
    protected TextField Loctxt ;
    protected TextField Citytxt ;
    protected TextField Statetxt ;
    protected TextField Ziptxt ;
    protected TextField CNametxt ;
    protected TextField CLasttxt ;
    protected TextField Phonetxt ;
    protected TextField Faxtxt ;
    protected TextField Celltxt ;
    public Build(){
    super();
    search = new Panel();
    Nametxt = new TextField();
    Loctxt = new TextField();
    Citytxt = new TextField();
    Statetxt = new TextField();
    Ziptxt = new TextField();
    CNametxt = new TextField();
    CLasttxt = new TextField();
    Phonetxt = new TextField();
    Faxtxt = new TextField();
    Celltxt = new TextField();}
    public void init(){
         BorderLayout bl = new BorderLayout();
         setLayout(bl);
         add(search, "Center");
         setBackground(Color.white);
         String buildID = getParameter("buildID");
         String bName = getParameter("bName");
         String bAddress = getParameter("bAddress");
         String bCity = getParameter("bCity");
         String bState = getParameter("bState");
         String bZip = getParameter("bZip");
         String bCName = getParameter("bCName");
         String bCLast = getParameter("bCLast");
         String bPhone = getParameter("bPhone");
         String bFax = getParameter("bFax");
         String bMobile = getParameter("bMobile");
    Nametxt.setText(bName);
    Loctxt.setText(bAddress);
    Citytxt.setText(bCity);
    Statetxt.setText(bState);
    Ziptxt.setText(bZip);
    CNametxt.setText(bCName);
    CLasttxt.setText(bCLast);
    Phonetxt.setText(bPhone);
    Faxtxt.setText(bFax);
    Celltxt.setText(bMobile);
    Hope this will aid you in yours and anyone elses endevours.
    James <[email protected]>

  • Inputstream.java.io.IOException  ,  applet connection

    I'm working on a problem with the failure of a java
    applet connection to a java servlet.
    The connection is via the internet, and over port 80.
    the java console loggin reports the following
    There was an attempt to redirect a url request,
    but the attempt was not allowed by the client. IOException caught in run
    could some one let me know what the URL re-direction is here,
    much apreciated,
    slainte

    I have often found this problem with inexperts java programmers.
    I could tell you better luck next time, but today I feel generous, so I will answer.
    There is a redirect domain problem. When you try to connect the site you receive an ICMP error message, which is the responsable of the error message you can see. That occurs because the URL connects to another URL different (surely because its original URL has changed to another) and you only have to discover the new URL, and try to connect to it.

  • Applet connected to oracle

    hi everybody,
    i've faced with a small problem while dealing with my homework.
    i have a simple applet connected to oracle. if i open it with applet viewer it works correctly but when i put the applet in a html file
    i'm getting following error:
    java.security.AccessControlException: access denied (java.util.PropertyPermission oracle.jserver.version 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)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(Oracle Driver.java)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at deneme.Connect(deneme.java:163)
    at deneme.<init>(deneme.java:41)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known 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)
    java.security.AccessControlException: access denied (java.util.PropertyPermission oracle.jserver.version 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)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(Oracle Driver.java)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at deneme.Connect(deneme.java:163)
    at deneme.<init>(deneme.java:41)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known 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)
    what's the problem? thanks in advance

    The simple answer is the applet security sandbox enforced by the browser. You should look on the Sun Java website for details on how to work with applets security.
    http://java.sun.com/
    Search on keywords applet security
    In a nutshell an applet can't open a socket to a server from other than that which it was served. There are (many) other security restrictions that you probably want to read about.
    The applet viewer doesn't enforce the sandbox security which it why it works well for you there.

  • Can a applet connect to another applet?

    can a applet connect to another applet by using socket only? i mean without using serlvet...
    what's that--> "exception: com.ms.security: SecurityExceptionEx" ??
    kill me please.. >_<

    i mean in different machine.. like i have an applet in machine A trying to get a connection with an applet in machine B...

  • Mysql-jdbc applet connection issue

    I am developing a user interface for a mysql database. I am able to successfully access the db and execute queries through a java APPLICATION.
    I need to do the same (access the db (mysql)) through a java APPLET. When I compile the applet it complies fine. When I try to run the applet I'm getting the following error message:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I tied running the applet using appletviewer and through a web browser, same result. I can run the application from the same command prompt it works fine.
    Please help.
    Relevant info:
    OS: Linux, Fedora4
    Classpath: export set CLASSPATH=/home/xyz/Java/mysql-connector-java-5.0.5/:$CLASSPATH;
    JDK: PATH=/usr/java/jdk1.6.0/bin
    Program:
    import java.sql.*;
    public class b extends java.applet.Applet
         int y = 0;
    public void paint(java.awt.Graphics g)
              y = y + 10;
    Connection conn = null;
    String driver = "com.mysql.jdbc.Driver";     
    String url = "jdbc:mysql://localhost:3306/testdb?user=usr1234&password=xyzxyz";
    try {
         Class.forName(driver).newInstance();
         conn = DriverManager.getConnection(url);
         System.out.println("Connected to the database.");
         System.out.println(" ");
         //*********BLOCK TO RETRIEVE RECORDS FROM TABLE*********          
                   try{
                        Statement st = conn.createStatement();
                        ResultSet res = st.executeQuery("SELECT * FROM table1");
                        System.out.println("Name: " + "\t" + "Age: ");
                        while (res.next()) {
                             String s = res.getString("name");
                             int i = res.getInt("age");
                             System.out.println(s + "\t" + i);
                   catch (SQLException s){
              y = y + 20;
    g.drawString("******* s: "+s,50,y);
         //*********END OF BLOCK TO RETRIEVE RECORDS FROM TABLE*********          
         conn.close();
         System.out.println("Disconnected from database");
         }      catch (Exception e) {
              y = y + 20;
    g.drawString("******* e: "+e,50,y);
                   e.printStackTrace();
    Thanks for the help in advance.
    --Mat                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    First, accessing a database from an applet is a horrendous idea.
    Having said that, did you add the mysql jar to the applet tag in the html page (in the archive property)?

  • Java Applets connecting to Oracle DB thru OAS (JNDI)

    i am developing an application, like i said before, i am using three applets, one controls a webcam, (records an image to disk and oracle), another controls a Electronic signature pad (records an image to disk and oracle), and finally a finger print reader (the same with this), at the beginning i didnt have any problem at all connecting this applet to the database, but top management wants to do things in another way, not allowing me to connect the applet directly to the database for security reason, My app resides on Oracle Application Server, and i use DataSource and Connection Pooling,
    I want that this applets use the available datasource on OAS to connect to the Database, due that the DataBase IP Address wont be public but OAS IP address will, I know that i must use JNDI to accomplish this, but i didnt have any results at all
    Message was edited by:
    efebo_abel2002

    i retrieved all the datasources from my app and i got this, i show my code and the returned errors, I can't connect my applet to the DB thru OAS datasources, any suggestions?
    package rdf.struts.ajax;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NameClassPair;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    public class ConductoresClient2 {
    public static void main(String [] args) {
    try {
    final Context ctx = getInitialContext();
    System.out.println(ctx!=null?"ctx no es null":"ctx es null");
    NamingEnumeration nenum=ctx.list("jdbc");
    while (nenum.hasMore()) {               
    NameClassPair entry = (NameClassPair)nenum.next();
    System.out.println("entry:="+entry.getName());
    try {
    DataSource ds=(DataSource)ctx.lookup("jdbc/"+entry.getName());
    Connection conn=ds.getConnection();
    Statement stm=conn.createStatement();
    ResultSet rs=stm.executeQuery("SELECT * FROM palic_ow.conductores");
    while(rs.next())
    System.out.println("rs.getString(1):="+rs.getString(1));
    System.out.println("rs.getString(2):="+rs.getString(2));
    System.out.println("rs.getString(3):="+rs.getString(3));
    catch (Exception e) {
    System.out.println("Exception conectando a la base :"+e);
    //java:comp/env/
    }catch (Exception e) {
    System.out.println("Exception obteniendo Context "+e);
    private static Context getInitialContext() throws NamingException {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"oracle.j2ee.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL,"oc4jadmin");
    env.put(Context.SECURITY_CREDENTIALS,"admin");
    env.put(Context.PROVIDER_URL,"ormi://localhost:23791/sertracen");
    return new InitialContext( env );
    ctx no es null
    entry:=OracleDS
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    entry:=v8PooledDS
    Exception conectando a la base :javax.naming.NamingException: Disconnected: java.lang.NoClassDefFoundError: javax/resource/Referenceable
    entry:=caom
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    entry:=v8DS
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    entry:=v8CoreDS
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    Process exited with exit code 0.
    null

  • Untrusted Applet Connection Restrictions

    Hi,
    There is a security rule that untrusted applets and WebStart applications may connect only to hosts from they was downloaded. But I could not find any strict definition of this rule. What does it mean "downloaded"? Different parts of an applet may be downloaded from various hosts: jnlp from one host, library jars from another and own jars from third. What of these hosts figure as a relay host for applets? Possible variants:
    1. Host from .jnlp file was downloaded (or html page containing applet)
    2. Host specified in codebase parameter
    3. Host from a .jar file that contains main class (or Applet class) was downloaded
    Another question is if there is any possibility to connect my applet/webstart app. to various hosts with the same domain? Applet must retrieve information from various hosts but it can be loaded only from one of them. Applet is public and modifying policy file is not a solution. And also I don't want to sign it (it must stay untrusted). Any trick? The only idea I have is write a JavaScript proxy on the page containing applet and use it to make requests...
    Antón

    By default an applet can communicate with the server from which it originated (that server that was visited by the web browser that served the page containing the applet.) At work we have an internal Linux box running Apache/Tomcat as an intranet server but also MySQL database. Because the applets containing web page and the database are on the same server the default security is fine.
    However, if you want your applet to connect to a different server you need to get the usrs permission. If this action was allowed by default then you might get the applet from a trusted site but the applet could then contact an untrusted site. This would be bad.
    A way round this is to sign the applet. The user is then prompted to accept that they trust the applet when it loads. If they do then the applet, as I understand it, is free to run as a trusted application would. This would allow it to contact other servers. (I've not tested this. I have only signed applets when I want the to be able to access the clipboard, another protected action.) You would need to do this if you database server and web/intranet server are not the same machine. (There may be other ways around this, but I'm not aware of them.)
    The thread below might also be helpful.
    http://forum.java.sun.com/thread.jsp?forum=421&thread=530200
    regards
    sjl

  • MS SQL SERVER-APPLET CONNECTION WITHOUT ODBC

    ONE QUESTION ALL
    Can it be achieved? I want to setup a database on a running sql server. On the same machine both and then i want to connect an applet with the database!! Please tell me if it can be done and any source code would be helpful!!!
    e-mail:[email protected]
    i will look again here but if you have anything send it here on this e-mail!!!
    I need some answer please!

    To connect to sql server directly from an applet is a waiste of time.
    Do multiple clients use your applet?
    yes:
    You have to write server side script on the same server that the applet came from that
    does the database work according to submitted values from the applet (applet uses url
    urlconnection POST or GET).
    If you want the applet to connect directly you have to sign the applet or set up a policy and
    tell all the clients to install the needed jdbc classes.
    no:
    Write an application using swing.

  • HELP! Applet connecting too Database

    I am trying to connect an Applet too a Database file, that will be hosted in the same directory as the html, and jar files. The database connection and manipulation methods are in a seperate class, from the Applet.
    I get an error on the line:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    It is beign caught in a try/catch, and I print out what is below, includes exception dump.
    Failed to load JDBC/ODBC driver.
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
    Any help on why this is happening, and how I can fix it, would be appreciated.

    signing the applet, would remove almost all restrictions on the applet. But would it remove this restriction, since that particular error, is because the applet is trying to access a class that it is not allowed too.
    the client server model, would work also, but you have to leave the server side piece always running, even though it wont always be needed.
    a applet servlet setup, I believe could work, but serving servlets is not a capability the server currently has, and the admin, does not particularly want too add it.
    I asked for a specific database.
    I am in a large company, so maybe I can find what is suggested.
    Anymore ideas?
    I always appreciate input.

  • Applets Connecting to DataBases

    I want to connect an applet to a database residing in my hard disk
    but I come up with the message "AccessDeniedException" what is the best way to overcome this? does it concern my browser IE or the jave I am writing.

    to alamnbr:
    I suggest that you look at the notepad applet included in Java WebStart, which was installed along with Java - look for its icon on your desktop.
    Also, please do not post to an existing thread if your post does not relate to the thread content - start a new thread, instead. Thanks

  • ResourceBundles in jars, applet, connection refused

    Hi,
    we run our code as application and as applet.
    We have a lot of ResourceBundle files (ListResourceBundles) which are archived per language (RBjars).
    The application and applet is in another package than the RBjars.
    An URLClassloader for loading the ResourceBundles is used which contains only the necessary language resource bundle jar file ( ResourceBundle.getBundle(resBundleName, locale, rbClassloader) ).
    When running as applet we get an exception (java.net.ConnectException: Connection refused: connect), although correct RBJar is loaded from server.
    When running as application we get same exception (java.net.ConnectException: Connection refused: connect),
    index and manifest used when archiving main package, but RBJars not in classpath of manifest, nor there are in the archive attribute of html of applet.
    If we define all RBjars in classpath of manifest (or in archive attribute), the applet allways load all RBjars, that cost too much time. This is the main problem.
    If anyone has an idea how to handle a lot of resource bundle jar files in an applet, please let me know.
    Thanks,
    Inge

    While one cannot say for sure, it looks like your problem is only tangentially connected with Java, jars, or applets. "Connection refused" means that there wasn't an HTTP server running at the address you gave to supply whatever file you asked for.
    It's probably a configuration or administration problem. Try typing the URL the program is using into your web-browser and see if you get the file.

  • How can an client-applet connect to server-DB?

    as the subject.
    I want the applet@client-side connect to DataBase@server-side,
    I am using Tomcat as engine & JDBC-mysql as tools
    where should the jdbc class placed in? WEB-INF/classes ? WEB-INF/lib ?? or others?
    now i am facing the problem that the applet seems cannot access WEB-INF and cannot locate the jdbc driver.
    could anybody give me some hints?
    thank you very much

    Hello
    I don't know the answer, sorry. This is the jdb (java debugger) tool forum.
    You might want to post your question over on the JDBC forum.
    Try this link:
    http://forum.java.sun.com/forum.jsp?forum=48

  • Probllem with applets connecting to servlets

    This piece of code has an applet making a connection to a server.
    This works using the older version of an appletviewer but not on the jdk1.2 appletviewer and also on netscape nor opera browsers.
    It gives me a security... error.
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.applet.*;
    import java.lang.*;
    class Listener extends Thread
    MapApplet appl;
    URL mapServerURL;
    Listener(String url, MapApplet app)
    appl = app;
    try
    System.out.println(url);
    mapServerURL = new URL(url);
    catch(Exception e)
    System.out.println(e + "in Constructor");
    public void run()
    URLConnection u = null;
    try
    u = mapServerURL.openConnection();
    catch(Exception e)
    System.out.println(e + " while getting connection");
    if (u != null)
    try
    DataInputStream in;
    in = new DataInputStream(u.getInputStream());
    try
    int i = 0;
    while (true)
    i = (i+1)%2;
    String s = in.readLine();
    System.out.println("Text = " + s);
    if(i==1)
    appl.lbltext.setText(s);
    catch(Exception e)
    System.out.println(e +" no input available");
    catch (Exception e)
    System.out.println(e + " while getting input stream");
    else
    System.out.println("Unable to get connection");
    public class MapApplet extends Applet
    public Label lbltext;
    private int pid;
    public void init()
    pid = Integer.parseInt(getParameter("PID"));
    public void start()
    setLayout(null);
    setFont(new Font("Serif",Font.BOLD,10));
    lbltext = new Label();
    add(lbltext);
    lbltext.setSize(150,100);
    lbltext.setLocation(10,10);
    lbltext.setBackground(Color.green);
    lbltext.setAlignment(Label.CENTER);
    Listener l = new Listener("http://144.16.67.49:6500/getNextMsg/"+pid, this);
    l.start();
    public void paint(Graphics g)
    String str;
    //Draw a Rectangle around the applet's display area.
    g.drawRect(0, 0, size().width - 1, size().height - 1);
    // str = connection.getNextMsg();
    // addItem(str);
    //Draw the current string inside the rectangle.
    // g.drawString(buffer.toString(), 5, 15);
    }

    I think you have your answer too.. because you have posted this in 'Signing Applets' forum. Sign the applet using Irene 10 steps.

  • Applet connecting to Mysql on serverside?problem

    hi all
    i am having some problem in Applet
    The problem is i am drawing on an applet.
    which is taking input from database(Mysql)
    it is running fine on konsol in appletviewer,
    but when i run in Browser(NetScape 4.*) it is giving error
    Applet not started , code is as follows
    /*<applet code="AppletSql" width=100 height=100></applet>*/
    import java.sql.*;
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import org.gjt.mm.mysql.Driver;
    public class AppletSql extends Applet{
    Exception e1;
    Button b ;
    public void init(){
    try{
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    }catch(Exception e){}
    b= new Button("Hi");
    add(b);
    i am using Tomcat as my server, now i am keeping my this applet in my /usr/local/jakarta..../weapps/examples/jsp .is it the problem of my server, do i have to configure my server for mysql-connector..
    or is it like this as appets are running on client side,so u cannot
    connect to Drivers on Server,or i have to write socket prog.. for
    connecting to Applet can i do the same thing swings or beans,or can i draw graphics with beans
    Thanking you
    sunil

    In your html page, you need to have the applet tag e.g
    <applet code="classname" codebase="serverurl" height="" width="">
    </applet>

  • Applet connections

    I've made a fighting game applet and I've made it in a way I believe it should be able to play with another player. Now I'm looking to network the game but I'm not sure how to do this exactly with an applet. I know how to connect between applications with a direct connection between client and server but with applets I can only connect the 1 client to the webserver that I'm on. I know it's possible to connect to other people for games because there are many online java games that do so, runescape, yahoo games, and battlefield. A while ago I asked this question I received a response that said I needed to sign my applet and get a lot of permissions and such but this just cannot be the case. I've been thinking the way to do this however is to send information from one client to the server then to the other client but is this possible ? and how would I do this ? do I open a connection to the server using a socket... ? The problem is I would like to host the game on a free webserver like geocities and I'm starting to think that wouldn't be possible. So do i have to have my own webserver and have the clients connect to the webserver and then have the clients interact through the server? or is there another more effiecient way?
    this may just seem like me rambling but please help if you understand what im saying, thanks ahead of time.

    If I remember correctly (I could be wrong, haven't used applets in a while), the only Socket connection you can make without signing is the webserver. You would have to write a server yourself that is assigned to some port of the webserver to manage all of the connections of the clients and to create some interactivity. The main problem with this is most webservers (even services you pay for) don't allow you to run a custom-made program on the server because it could cause potential damange to the machine which would cause a huge problem for other customers you're sharing that machine with.
    Now, what you can do is purchase a machine specifically for webserving and basically host yourself in a way. You can even do this with your current machine if you wanted, however your compuer would need to always be on and you would have to be on a stable connection (DSL/Cable, nothing dialup). However during this entire process your IP would be exposed unless you used something like dyndns.org or somehow get a domain registered to your IP (however your IP would have to be static, dyndns is the only domain service I know that has a workaround for non-static IPs via a background application that constatnly updates the dyndns database).
    In summary, to create a server/client application over the web without signing the applet, you have to create the server and run it on the same machine that hosts the webpage that contains the applet. Again, I could be wrong on some of this, it might not even be possible to establish a connection to the webserver without signing, I will definitely look into this.

Maybe you are looking for

  • What are the consequences of having more than one iphone connected to the same itunes on 1 computer?

    I'm wondering if there are any weird problems or glitches to be expected when 2 iphones are connected to the same itunes on a single computer.  My wife and I both have iphone 5's with separate apple IDs.  We only have one computer with one user accou

  • Move playlist from one iPod to another?

    Is it possible to transfer a playlist from one iPod to another? I have an iPod on which I've developed some playlists for classes (I teach music) and I just got a new iPod, and I would like to transfer that playlist on the old iPod to the new iPod. L

  • Print line number on print layout

    Hi all, Is there a way to print the line number on the print layout? Thanks, Jane

  • FCP 6 will not launch in 10.5.8.

    Hi. I just replaced the primary boot drive in my PPC G5 (running 10.4.11) by cloning it to a larger drive. Tested the drive and it ran perfectly (actually faster than the old one). Upgraded my OS to Leopard and after testing it w/ the first installme

  • WM Material Master Data - extend materials inquiry

    I have a question regarding WM Material Master Data - extend materials what is the best practice for extending materials to Warehouse Management views 1 and 2. We have 1 new warehouse with fixed bins 001 Pallet, 002 Racking, 003 Floor, 004 Bins, 005