Applet network communication

We currently have an applet for a online submission system for an inhouse form. The applet talks to the server hosting the applet and accesses files from the client computer, so it has a self signed cert. Apperently in a tech company accepting the cirt is too hard, so we need to make the applet run without being signed. That is not a big deal as the file access can go, but I am having a problem with the applet talking to the server. The server just has a java application running, talking on port 1235. When the applet tries to talk back to the server, we get a permision run time error of:
Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.net.SocketPermission graphics1 resolve)
Graphics 1 is the host computer. The url to the html that loads the applet is: Http:\\graphics1\index.html
the content of the html is:
<html>
<head>
<title>Graphics Department E-Request Form </title>
</head>
<br>
<P ALIGN=center>
<applet code="graphicsapp/DCreate"
archive=GraphicsApp.jar,jdnc-0_7-all.jar
width="700"
height="620"
</applet>
<br>
Please contact MIS to upgrade java on your system if you only see a red X
</P>
</html> the applet's network code is:
String Ipaddy="graphics1";
   Socket socket = null;
        ObjectOutputStream out = null;
        ObjectInputStream in = null;
      //  BufferedReader in = null;
          //BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
            String serveraddress=Ipaddy;      
        try {
            socket = new Socket(serveraddress, 1235);       //it fails here
           out = new ObjectOutputStream(socket.getOutputStream());
           in=new ObjectInputStream(socket.getInputStream());
            //in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                   out.writeObject(use);It fails if ipaddy is http:\\graphics1
of the actual ip address of the server.
Thanks in advance
Cliffs:
Applet will not connect to originating server without a cert

Got it, I need to not list the address directly, but instead pull the host from the codebase.
example:
host = getCodeBase().getHost();
        try {
            address = InetAddress.getByName(host);
        } catch (UnknownHostException e) {
            System.err.println("Couldn't get Internet address: Unknown host");
            // What should we do?
        }I got this from
http://java.sun.com/docs/books/tutorial/deployment/applet/examples/QuoteClientApplet.java

Similar Messages

  • Inter applet network communication

    Hi
    Is this senario possible?
    Webserver W provides the applet A to two browser clients at two different IP addresses. The applets now instanciated are informed about the direct IP address of oneanother. Then the webserver is stopped.
    Can the applets now communicate directly? I would really like to know if there is a workaround for this as it could serve my purposes for a distributed prototype.
    Cheers,
    Rasped

    No, its not directly.
    It would work if you signed the applets. Digitally signed applets are allowed security priveledges like opening network connections to servers other than where they originated.
    What are you trying to do? I see posts regarding regressions, image processing, and sneaky, back door communicating applets.
    Have fun

  • Network communication Xacute applets client - Mii server

    Hi all,
    I have a rather technical question.
    Does anybody know what goes on from a network communication point of view when an applet on a irpt-page gets executed and fetches data from the Mii server?
    Do these applets use RMI or some other method?
    It's because we might have network issues, and I would like to know how the applets work on network level.
    Our architecture is as follows:
    On the client an irpt page is displayed in a browser (MSIE).  The irpt page contains applets generated by Xacute queries.  We also rely a lot on JS.
    The client application communicates with the Mii server over the WAN.
    So if someone can tell me which ports are used by the applets, would be great!
    W.

    Ok, on the server side indeed the applets connect to 5nn00.  I love the debug option!
    Now, on our WAN we have defined a QoS, for traffic prioritizing.  So certain port numbers (or ip-adresses) get priority over the network.  We added port 52000 (used by Mii) to this QoS, but unfortunately the traffic does not get prioritized.
    The problem is that on the client side (Mii HTTP application), we cannot control which ports are opened (that's the OS).
    On client side it could be port 4000 to 65999 or something.   When we do port-prioritizing, this can never work.
    So how do we configure our QoS?  Prioritize everything going to and coming from the Mii server?
    Anyone experience with that?  I know it's not directly related to SAP and Mii, but when working with Mii one stumbles onto all kind of technologies
    cheers!

  • Asynchronous applet-servlet communication

    Hi all,
    I am trying to implement asynchronous applet-servlet communication and need your help. Anything would help(I tried with synchronous applet-servlet communication but doesn't solve my problem).
    Thanks,

    http://java.sun.com/docs/books/tutorial/networking/index.html
    You can open a socket connection. Bother the client and the server
    can have separate threads for reading and writing and that you gives you
    asynchronous communication. Later, if you think the server is generating
    too many threads and not scaling, you can use features of .java.nio to
    make it more scalable:
    java.nio.channels

  • Welcome to Solutions and Architectures Borderless Networks Community

    Welcome to the Solutions and Architectures Borderless Networks Community.  We encourage everyone to share their knowledge and start conversations related to Borderless Solutions and architectures. All topics are welcome, including Switches, Routers, Security, Wireless, Cloud and System Management, WAN Optimization and solutions to solve business problems.
    Remember,  just like in the workplace, be courteous to your fellow forum  participants. Please refrain from using disparaging or obscene language  or posting advertisements.
    Cheers,
    Dan Bruhn       

    Hi,
    I have a question...
    I going to install two Nexus 7009 with three N7K-F248XP-25  modules on each one, I am planning to create 3 VDC, but at the initial configuration the system does not show the ethernets ports of these modules, even with the show inventory and show module I can see tah the modules are recognized and its status is OK. There is something that I have to do before start to configure these modules...? enable some feature or license in order to see the ports with show running CLI...?

  • When starting I get an error: "This operation cannot be completed because of an internal failure. A secure network communication has not been cleaned up correctly. "

    Each time I start up Firefox 4.0b6 I am getting the following error message: "This operation cannot be completed because of an internal failure. A secure network communication has not been cleaned up correctly. ". I run Firefox 3.6 as my standard Firefox browser in paralell.

    See https://bugzilla.mozilla.org/show_bug.cgi?id=588511
    (please do not comment in bug reports)

  • FF Beta 4.0b6: The operation can not be completed because of an internal failure. A secure network communication has not been cleaned up correctly. How to FIX ?

    The operation can not be completed because of an internal failure. A secure network communication has not been cleaned up correctly.
    beta 5 and 6 have been useless, unable to connect anywhere once loaded. Fortunately I still have v3x on the machine.

    No answer found.... sorry!

  • The operation can not be completed because of an internal failure. A secure network communication has not been cleaned up correctly ... Iget this message when closing firefox. It obviously has been a problem in the past but I'm using FF 6

    '''"The operation can not be completed because of an internal failure. A secure network communication has not been cleaned up correctly ... '''"Iget this message when closing firefox. It obviously has been a problem in the past for others but it has only happened to me since updating to firefox6'''

    Try to clear the "Active Logins" via Clear Recent History
    *https://support.mozilla.com/kb/Clear+Recent+History
    You can also try to delete the file secmode.db in the Firefox Profile Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder

  • The optn cannot be completed because of an internal failure. A secure network communication has not been cleared up correctly.

    Firefox 4.0 b 5 - was doing an update but gave this error message: The operation cannot be completed because of an internal failure. A secure network communication has not been cleared up correctly. - only option = OK

    This is a known bug and it is being worked on.
    The relevant bug report is [https://bugzilla.mozilla.org/show_bug.cgi?id=588511 Bug 588511], but please do not comment on the bug report.

  • Can't do google seaches or get tabs to open without ringo and get the alert..The operation can not be completed because of an internal failure. A secure network communication has not been cleaned up correctly.

    I can't get tabs to open or google search to operate without constant ringo and I get the alert...The operation can not be completed because of an internal failure. A secure network communication has not been cleaned up correctly. I have 8.0 firefox version

    This is a known bug and it is being worked on.
    The relevant bug report is [https://bugzilla.mozilla.org/show_bug.cgi?id=588511 Bug 588511], but please do not comment on the bug report.

  • Applet/servlet communication for byte transmission

    Hello all !
    I wrote an applet to transfer binary file from web servlet (running under Tomcat 5.5) to a client (it's a signed applet) but I have a problem of interpretation of byte during transmission.
    the code of the servlet is :
            response.setContentType("application/octet-stream");
            ServletOutputStream sos = response.getOutputStream();
            FileInputStream fis = new FileInputStream(new File(
                    "C:\\WINDOWS\\system32\\setup.bmp"));
            byte[] b = new byte[1024];
            int nbRead = 1;
            while (nbRead > 0) {
                nbRead = fis.read(b);
                System.out.println("octets lus = " + nbRead);
                sos.write(b, 0, nbRead-1);
            fis.close();
            sos.close();et le code de l'applet qui appelle cette servlet est :
            URL selicPortal = null;
            try {
                selicPortal = new URL(
                        "http://localhost:8080/AppletTest/servlet/FileManipulation");
            } catch (MalformedURLException e) {
                e.printStackTrace();
            URLConnection selicConnection = null;
            try {
                selicConnection = selicPortal.openConnection();
            } catch (IOException e) {
                e.printStackTrace();
            selicConnection.setDoInput(true);
            selicConnection.setDoOutput(true);
            selicConnection.setUseCaches(false);
            selicConnection.setRequestProperty("Content-Type",
                    "application/octet-stream");
            try {
                InputStream in = selicConnection.getInputStream();
                FileOutputStream fos = new FileOutputStream(new File(tempDir
                        + "\\toto.bmp"));
                byte[] b = new byte[1024];
                int nbRead = in.read(b);
                while (nbRead > 0) {
                    fos.write(b);
                in.close();
                fos.close();
             } catch (IOException ioe) {
                ioe.printStackTrace();
            }the file dowloaded is broken. it seems that bytes 01 00 or 00 01 are not correctly process.
    Some ideas to help me please ?

    hi,
    have you solved this issue.. please post me the code since i m also doing the applet/servlet communication and can use your code as reference.
    how to read the content placed in the urlConnection stream in the servlet
    Below is my code in applet
    public void upload(byte[] imageByte)
              URL uploadURL=null;
              try
                   uploadURL=new URL("<url>");
                   URLConnection urlConnection=uploadURL.openConnection();
                   urlConnection.setDoInput(true);
                   urlConnection.setDoOutput(true);
                   urlConnection.setUseCaches(false);
                   urlConnection.setRequestProperty("Content-type","application/octet-stream");
                   urlConnection.setRequestProperty("Content-length",""+imageByte.length);
                   OutputStream outStream=urlConnection.getOutputStream();
                   outStream.write(imageByte);
                   outStream.close();
              catch(MalformedURLException ex)
              catch(IOException ex)
    How can i read the byte sent on the outstream (in above code) in the servlet.
    Thanks,
    Mclaren

  • Is there a good advanced review on applet-servlet communication

    I am working on a web application and unfortunately experiencing a lot of trouble trying to use an applet as front end which interacts with a couple of servlets running on Tomcat. I need to get data from one servlet and send data to another.
    There is a lot of messages posted in this and other forums about how to do this, but none of them got a response pointing to a useful advanced reference on this subject. I have reviewed some of the references given, but couldn't find a thorough detailed advanced reference on applet-servlet communication. For this I mean an exhaustive explanation of the mechanism of communication and when and when is neccesary to use each of the multiple configuration possibilities regarding content-type, message-length, request-method, connection settings, and so on.
    Would anybody be so kind to show me the right direction? As I read the (literally) hundreds of messages posted on this topic, I see this info as widely useful. Most of the topic tracks ends on void or with painful no-way sentences, and maybe many people is avoiding Java technology on web application because of this problem (development delays can abort a project).

    This sample chapter in Java developers' guide to Servlets and Jsp focuses on Applet-Servlet communication, is a pretty good one, and is free :
    http://www.javaranch.com/bunkhouse/samps/2809ch12.pdf
    As to an exhaustive & complete guide that covers absolutely everything, I may be wrong but I doubt you'll find anything like that...unless there is a book somewhere dedicated to the subject.

  • Applet-servlet communication, object serialization, problem

    hi,
    I encountered a problem with tomcat 5.5. Grazing the whole web i didn't find any solution (some guys are having the same problem but they also got no useful hint up to now). The problem is as follows:
    I try to build an applet-servlet communication using serialized objects. In my test scenario i write a serialized standard java object (e.g. a String object) onto the ObjectOutputStream of the applet/test-application (it doesn't matters wheter to use the first or the latter one for test cases) and the doPost method of the servlet reads the object from the ObjectInputStream. That works fine. But if i use customized objects (which should also work fine) the same code produces an classnotfound exception. When i try to read and cast the object:
    TestMessage e = (TestMessage)objin.readObject();
    java.lang.ClassNotFoundException: TestMessage
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ...That seems strange to me, because if i instantiate an object of the same customized class (TestMessage) in the servlet code, the webappclassloader doesn't have any problems loading and handling the class and the code works fine!
    The class is located in the web-inf/classes directory of the application. I've already tried to put the class (with and without the package structure) into the common/classes and server/classes directory, but the exception stays the same (I've also tried to build a jar and put it in the appropriate lib directories).
    I've also tried to catch a Throwable object in order to get information on the cause. But i get a "null" value (the docu says, that this will may be caused by an unknown error).
    I've also inspected the log files intensively. But they gave me no hint. Until now I've spend a lot of time on searching and messing around but i always get this classnotfound exception.
    I hope this is the right place to post this problem and i hope that there is anyone out there who can give me some hint on solving this problem.
    Kindly regards,
    Daniel

    hi, thanks for the reply,
    all my classes are in the web-inf/classes of the web-app and have an appropriate package structure. thus the TestMessage class is inside a package.
    i tried some names for the testclass but it didn't matter. the exception stays the same. I also tried to put the jar in the common/lib but the problem stays.
    Well the problem with loaded classes: As i mentioned in the post above i can instantiate an object of TestMessage in the code without any problems (so the classloader of my webapp should know the class!!)
    only when reading from the objectinputstream the classloader doesn't seem to know the class?? maybe theres a parent classloader resposible for that and doesn't know the class?
    strange behaviour...
    p.s. sending the same object from the servlet to the client works well
    regards
    daniel
    Message was edited by:
    theazazel

  • Get this on launch: "...Secure network communication has not been cleaned up correctly". What is going on?

    Launch Firefox beta and get this dialog box: "The operation can not be completed because of an internal failure. A secure network communication has not been cleaned up correctly." Firefox then goes on to seemingly launch ok. Why am I getting this security warning? And what does it mean?

    See https://bugzilla.mozilla.org/show_bug.cgi?id=588511
    (please do not comment in bug reports)

  • Applet/Servlet communication - StreamCorruptedException

    Hi, I'm having a problem when I try to connect to a servlet. I am using applet/servlet communication. The problem only occurs when I have lauched a crystal report via http in a new window.
    After the report is launched if I try to hit my servlet I get the following error:
    java.io.CorruptedStreamException: invalid stream header
    Not all crystal reports I launch cause this behavior but I can see nothing in the url I use to launch the report that is out of place or different than other reports.
    APPLET-SERVLET CONNECTION
    try {
    StringBuffer path = new StringBuffer();
    path.append(ip);
    path.append("servlet/DatabaseServlet?");
    path.append("option=getRecords&query=").append(URLEncoder.encode(query,"UTF-8"));
    URL url = new URL(path.toString());
    URLConnection servletConnection = url.openConnection();
    servletConnection.setUseCaches(false);
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    servletConnection.setRequestProperty("Content-Type", "application/x-java-serialized-object");
    ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
    rc = (RecordCollection) inputFromServlet.readObject();
    inputFromServlet.close();
    } catch (Exception e) {
    e.printStackTrace();
    SERVLET CODE
    Forwards to doPost
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    System.out.println("session id: " + request.getSession().getId());
    this.doPost(request, response);
    LAUNCHING REPORT FROM APPLET
    try {
    String launchURL = host + directory + report + "?promptOnRefresh=0"+ "&" +
    authentication + "&" + key + "&" + startPeriods + "&" + reportYears + "&" + reportTitle + "&" endPeriods "&" + locations + "&" + reportPeriod + "&" + fiscalWeek + "&" + fiscalYear + "&" +time;
    context.showDocument(new URL(launchURL), "_blank");
    } catch (Exception ex) {
    ex.printStackTrace();
    SAMPLE URL THAT CAUSES PROBLEM
    http://localhost:113/Reports/OpenToBuy_3.class?promptOnRefresh=0&user0=rpuser&password0=er34sw1&[email protected]=rpuser&[email protected]=er34sw1&user0@sub2=rpuser&[email protected]=er34sw1&promptex-key="L","L1","ALL"&promptex-start="1"&promptex-years="2004","2004"&promptex-title="Report Title"&promptex-end="1"&promptex-locs="01","03","04","05"&promptex-period="Feb 2004 [04-01]"&promptex-cw="1"&promptex-cy="2004"&promptex-time=-2-52728"
    Everything works fine until I launch this report then I can no longer get data from my servlet. I thought the URL lenght for the report might be the problem but I lauch a report with a URL longer than the problem one and there I don't get the errors after. When I try to connect to the servlet the println statement in the doGet method of my servlet doesn't get printed so it's not even making it inside that method in the servlet.
    Anyone have any idea what could be causing this? Anyone have any ideas what would be causing this? I'm really stumped.

    I've seen this problem before. Because your accessing a complete URL (ie http://<host>:<port>/xxx), you are actually creating a new session. Whenever the applet opens a connection to a servlet it is running on it's own session not the same as the JSP. This is rather obvious since the Page and Applet are separate entities.
    Try sending authentication with the url. I think the syntax is:
    username:password@http://localhost/xxx
    However I'm not sure how well this might work for Tomcat. As for Java it may try and throw a MalformedURLException I would have to test it first - it's been a long time since I used this technique!
    Wish I could be more help,
    Anthony

Maybe you are looking for

  • Financial Statement / Balance sheet in Periodic Display

    Sirs,   We want to create a balance sheet with all period amounts displayed in different colums (tcode F.01 , RFBILA00). Can we do this with report writer or do we need to fully create a customized abap report for this.    output should be           

  • Problem with sending message with excel attachment

    hi,        i m using sap b1 2005b  i send message with excel attachment to sap user but message is reached to destination but attchment cannot send .ot shows an internal error pls help me. reagrds, vishal

  • How to decompose a string with ';' into Internal table

    Hello all, I need your help for find a Function module or Abap code. I have a file with the separator is the ';' Example of the contains of my file : 521010;16;46048,00;;*Soucet*Odmena za 524012;41;103807,00;;Zdrav.p.organizace 524012;42;;18332,00;Zd

  • Is there any function to split string value into diff junks

    Hi guys i have a string value as below 14507|||Subterranean Masquerade||||||Subterranean Masquerade you can say ||| is a field delimiter. i want to split each field identified by ||| delimiter and store in a collection table. is there any easy way to

  • PROBLEM WITH iMOVIE PROJECT CONVERSION TO QT

    I occasionally have strange things happen when converting iMovie (DV) projects to 'full quality' QT.dv files. Example: footage transferred from a visually pulsating image (originated on a 1920s 30 line mechanical TV scanner invented by J L Baird) has