Using sockets with Applet

Hey,
I have a website which has an applet on one of the pages. I put in code that uses a socket to connect to MY computer. ( i want to use my computer as a server which stores data/accounts/etc) A SecurityException was thrown when I tested the applet. Is what I'm trying to do possible? or does something like this have to connect to a server which is on my website?
Thanks

I believe you can run something like this by signing the applet.
And then the user has the option of allowing or disallowing a signed applet to do that kind of thing. I don't know which is the default.

Similar Messages

  • Using javaagents with applets

    Is it possible to use javaagents with applets?
    If it is, how?

    FYI... my environment is:
    Oracle9iAS (9.0.3.0.0)
    JDeveloper (9.0.3.4)

  • Working with sockets with applets

    Hello, I am working in my account on a web server, and I am trying to develop a chat using applets. My program works great on the command line, but the applets cannot create a socket because of a SocketPermission problem. I have read about this problem a lot, and I found that applets will only create a socket with the server the applet originates from. I have still not had any success in allowing my applet to create a socket to connect to a server.
    I would appreciate any advice concerning this problem!
    Thanks so much!
    Christina

    If you are calling the HTML page containing the Applet as http://localhost then the Applet has to open a socket back to local host.
    Make sure you call the applet using the full ip address of the where the web server is running. This should match the socket ip address you are trying to open inside the Applet.

  • Using JMF with applet

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

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

  • Using bc4j with applets

    Hi,
    I was wondering if you have any tips on using bc4j in applets. The 2 biggest problems I'm having is the jar size of the applet after all libs are included
    (4MB+) and the fact that I can't use XDK, JNDI, BC4J and some other libs from applets unless I sign them or change the policy file at each client using the applets.
    I really think all the calls to System.getProperties(), etc. should be placed inside try catch blocks to catch the security exceptions raised by xdk, RMIInitialContextFactory, etc. and handled using
    defaults for properties... it'd be even better if these properties could be set in another way as well.
    Thanks in advance,
    Leonardo Bueno

    FYI... my environment is:
    Oracle9iAS (9.0.3.0.0)
    JDeveloper (9.0.3.4)

  • Using sockets with java from PL/SQL in Oracle 8.1.7 DBA

    Hey all,
    I've been struggling for a couple of weeks now with a problem. I wrote a framework around a toolkit which makes socket connections to another server. I am attempting to use the framework from within a PL/SQL script, which is calling the framework class files which have been loaded into Oracle 8.1.7 database. The problem seems to be if I grant all permissions, or socket permissions for all hosts/ports, or even the ones I know about are being used, I get a hang when trying to connect. The funny thing is, using the toolkit, if I invoke their classes directly within code written from Oracle's code editor, it will work.
    I suspect there is
    a) Some hidden permission issue
    b) A bug in the sockets implementation Oracle is using for their JVM.
    Can anyone offer insight to this problem?
    Thanks,
    Dave Blake
    [email protected]

    Hello,
    I'm trying to investigate the same thing.
    I want to make a soap-client with PL/SQL with 8i 8.1.6.0.0
    Did you succeed some additional information ??
    I tried to run the following example:
    http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
    but it only works with 9i.
    With 8i the errors encountered were : XMLTYPE undefined
    Perhaps if we find the definition of XMLTYPE and we process it to 8i we'll be able to run the example ??
    thank's

  • Am I able to use Sockets in applets

    I developed a server-client application in java using datagrams, and decided to try to convert the client application into an applet.
    The problem was that the applet wouldn't run in a browser but it worked if I used javas appletviewer!
    Tryed both JDK1.1.8 and JDK1.3.1!
    Browser = IE5
    Am I able to do any networking with browser at all?

    My applet only connects to the server (and port) it was served from! But it still doesn't work... It works fine in an appletviewer but in a Browser I won't even get my GUI up :(
    Hmmm... OK! I'll try to make a TCP connection from Applet to my server application, I've done it once before but as an application, the server then had to be multithreaded so it could work with multiple users simuntaniusly... the reason I switched over to datagram packages is that I could make the server single threaded!

  • Using Sockets with BufferedInputStream

    Hi,
    Many thanks in advance for any help or advice. I have been struggling with this for a while now.
    I have data comming in from a Socket. I create a BufferedInputStream like this:
    inputStream = new BufferedInputStream( socket.getInputStream() ); The class that this code is in extends Thread, and in the run method i have:
    while( true )
                   try
                        inputSource = new InputSource( inputStream );
                        responseXML.parseClientData( inputSource, client.getID() );
                   catch( Exception e )
                        System.out.println( "run.Error: " + e );
              }The class responseXML takes the stream and tries to parse the XML as follows:
    public void parseClientData( InputSource dataFromFlash, int clientID )
              System.out.println( "parseClientData" + clientID );
              try
                   xmlReader.parse( dataFromFlash );
              catch( Exception e )
                   System.out.println( "parseClientData.Error: " + e );
    My problem:
    The above method (parseClientData) is getting called over and over again - it is stuck in an infinite loop.
    And this error is caught in the above methodt:
    parseClientData.Error: java.io.IOException: Stream closed
    Any ideas? I have been struggling with this for far too long.
    I thnik it might be to do with blocking and non-blocking input streams.
    When i used a noraml BufferedReader - i didn't have this problem.
    Thanks.
    Regards, Custom
    Message was edited by:
    custom
    Message was edited by:
    custom

    Come on buddy wake up!
    You have a while loop that NEVER exits and exception blocks that don't do anything productive and this error message "ClientData.Error: java.io.IOException: Stream closed" tells you exactly what the problem is.
    Do you think maybe you should exit the while loop if an exception is thrown? Do you? Perhaps? Maybe?

  • How to use dll with applet?

    I want to use a dll with a applet.
    I try several solutions : signed applet, dll in jar, ... But without any result.

    U can use it if u sign the applet. It is a bit trick way though.
    Create an inputstream, read and copy the dll to some where path is defined (System dir for ex) from jar. Then load that library.. But u need a dummy class for that before starting applet. Rest is ur brain.. Best of luck. I tried and succeded.

  • Win socket with applet socket by byte type data network

    Server is windock
    Client is applet
    How do i receive and send byte type data..
    What i do using sock type?
    UDP? just i use Inputstream, Outputstream?
    and i some warring..
    Packet Buffering...
    how do i?
    plz help me...

    Hi
    Search the Forum for "socket", start reading other people questions and answers, i am sure that after spending few hours you will find some answers.
    Noah

  • Using t3s with applets

    Hi -
    We have a few applets accessing EJB's on WebLogic 5.1 (SP 6) which utilize
    "t3" as the protocol and don't have any problem getting Contexts and issuing
    requests. However, once we switch to t3s, we get an error indicating that
    the server can't be found at t3s://myserver:443. This is not a firewall
    problem (we've tested it with no firewall in place), nor does it appear to
    be a certificate problem (WL server is running in 128-bit mode with a valid
    cert, etc.) Does anyone have any experience running applets and WL,
    particularly over t3s? I've included a stack trace below. Thanks in
    advance -
    Andy
    [email protected]
    =========================
    javax.naming.CommunicationException. Root exception is
    java.net.ConnectException: No server found at T3S://myserver:443
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:161)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:200)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    [applet call stack goes here]
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    FYI, I believe we have a legitimate fix, but we're still waiting for an
    official stance from WL. The "fix" we've implemented includes the previously
    mentioned workaround, plus the layering of SP8 weblogic.security package on
    top of SP6.
    Andy
    "Andrew King" <[email protected]> wrote in message
    news:[email protected]...
    Hi -
    It appears there's a bug with WL's RSA classes in SP6 (RSAKey, RSApkcs1),
    128-bit vesion. We've hacked a couple of fixes which appear to work, butI'm
    wondering if anyone else can confirm this. Thanks -
    Andy
    "Andrew King" <[email protected]> wrote in message
    news:[email protected]...
    Hi -
    We have a few applets accessing EJB's on WebLogic 5.1 (SP 6) which
    utilize
    "t3" as the protocol and don't have any problem getting Contexts andissuing
    requests. However, once we switch to t3s, we get an error indicating
    that
    the server can't be found at t3s://myserver:443. This is not a firewall
    problem (we've tested it with no firewall in place), nor does it appearto
    be a certificate problem (WL server is running in 128-bit mode with avalid
    cert, etc.) Does anyone have any experience running applets and WL,
    particularly over t3s? I've included a stack trace below. Thanks in
    advance -
    Andy
    [email protected]
    =========================
    javax.naming.CommunicationException. Root exception is
    java.net.ConnectException: No server found at T3S://myserver:443
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:161)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:200)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    [applet call stack goes here]
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

  • How to use sockets in applets?

    hi,
    i wrote the following applet:
    http://spidey.bei.t-online.de/rest/java/jtv/jTV.html
    its a little applet which asks tvtoday.de for the movies which are running on the channels/time and day you specified and puts them into the table
    as a normal java application everything works fine
    but as an applet i always get an exception that im not allow to open sockets to tvtoday.de
    how comes? and is there a way to fix that?
    thx

    Applets are only allowed to create sockets back to the host that they originally came from. This is a security measure - otherwise, a trojan horse applet could be downloaded through a firewall, then open connections and do malicious things to hosts that were supposed to be protected by the firewall.
    I am not sure if there is a way the solve this. Perhaps you could sign your applet and let java pop up a "Let this applet open sockets elsewhere?" window (similar to what java web start can do), but I personally don't know of such a system.

  • Using MVC with Applet inside Servlet

    Hello fellow Java developers,
    I want to implement the Model View Controller concept inside a Bean Applet combination running in a servlet environment.
    When my model (the Bean) changes, I want my Applet (the View) to get notified so it can get the update from the Bean. The Applet is incorporated inside the jsp page (e.g. the servlet). The Bean is known inside the jsp. How do I make that same Bean known inside the Applet?
    When I create a new Bean during init, or in the constructor of the Applet, I get a complete other reference than the Bean inside the jsp. So, when I ask information from the Bean, I often get NullPointerExceptions, because I am referencing the wrong Bean.
    Does anyone have a solution for my problem?
    Regards,
    Michel

    hi,
    a servlet is server side object, an applet is client side object.
    For the communication, you should try HttpUrlConnection from applet to servlet.
    another way is tu use ejb, or rmi communcation

  • Problem using SAAJ with Applets

    This method to do a SOAP connection call does not work within a Applet -- but it works fine otherwise.
    Any help would be appreciated.
    Thanks.
    public void execute() {
         try {
             SOAPConnectionFactory
              soapConnectionFactory     = SOAPConnectionFactory.newInstance();
             connection               = soapConnectionFactory.createConnection();
             response     = connection.call(request, endpoint);
             connection.close();
         } catch (Exception ex) {
             ex.printStackTrace();
        } Trace follows:
    Jun 8, 2006 8:22:12 PM com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection post
    SEVERE: SAAJ0009: Message send failed
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:127)
         at imt.util.SOAPTrans.execute(SOAPTrans.java:52)
         at test.util.applet_soap.init(applet_soap.java:54)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         ... 4 more
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:325)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:150)
         ... 6 more
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission setFactory)
         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.checkSetFactory(Unknown Source)
         at java.net.HttpURLConnection.setFollowRedirects(Unknown Source)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:239)
         ... 7 more
    CAUSE:
    java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         at imt.util.SOAPTrans.execute(SOAPTrans.java:52)
         at test.util.applet_soap.init(applet_soap.java:54)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:325)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:150)
         ... 6 more
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission setFactory)
         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.checkSetFactory(Unknown Source)
         at java.net.HttpURLConnection.setFollowRedirects(Unknown Source)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:239)
         ... 7 more
    CAUSE:
    java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         at imt.util.SOAPTrans.execute(SOAPTrans.java:52)
         at test.util.applet_soap.init(applet_soap.java:54)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:325)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:150)
         ... 6 more
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission setFactory)
         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.checkSetFactory(Unknown Source)
         at java.net.HttpURLConnection.setFollowRedirects(Unknown Source)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:239)
         ... 7 more
    java.lang.NullPointerException
         at imt.util.SOAPTrans.getXMLResponse(SOAPTrans.java:37)
         at test.util.applet_soap.init(applet_soap.java:56)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Solved my own problem.
    I was erroneously not signing one of my jar files.
    cheers.

  • Communication between Windows 7 and Windows 8(and above) using Sockets(TCP and UDP)

    I need to use TCP and UDP using Sockets to communicate between two(or more) applications installed in Windows 7 and Windows 8.
    Is it possible.? I tried within a LAN, but in vain. If needed I would post the appropriate code.
    Note: I only tried running exe(s) in these machines and not with installation.

    Hello Prabodh.Minz,
    >>Is it possible.?
    It is not clear what develop language you are using, here are examples which uses the C# based on .NET. It created the communition between two machines by using sockets with TCP protocol, a server and a client:
    Synchronous example:
    Client and
    Server.
    Asynchronous example:
    Client and
    Server.
    Multi-client per one server - socket programming in .net(C#)
    >>Note: I only tried running exe(s) in these machines and not with installation.
    There are all .exe.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • How to Bind a Combo Box so that it retrieves and display content corresponding to the Id in a link table and populates itself with the data in the main table?

    I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables: 1. Party (PartyId, Name) 2. Case (CaseId, CaseNo) 3. Petitioner (CaseId, PartyId) ............. Link Table I am completely new to .Net and to

  • Unrecognized DVD/CD drive after I-tunes upgrade to ver 7.6.2.9

    I have a problem since I upgraded I-tunes to latest version 7.6.2.9. My PC no longer recognizes my DVD/CD Rom. I have deleted my Upper and Lower filters in the registry, then reboot my CD-Rom is back. I open I-tunes and the program does not see my CD

  • 1 channel not working

    Hi, I have an X-Fi xtreme gamer fatalty which is great but for one problem;? The rear right channel on my Logitech Z5500's will not work in games, it's definitely not the speakers because running a pink noise test through all the speakers works fine,

  • SAP query - SQ01 distinct rocord

    Hi, I created a join with VBAK and VBAP tables. We are trying to get distinct sales order document number based on sales order line item details. Currently query output is listing sales document number repeated for input. How we can get a list output

  • Adobe Reader Not Working at all.

    The Adobe Reader does not work at all since yesterday, after updating it to the latest version 11. I uninstalled it and installed version 9 and that too does not work. All my work is held up due to it. What should I do to get the Adobe Reader working