Decompile applet and proxify all URL and socket connection and recompile

Hi,
Please anybody have idea for the below.
I need to decomple the applet class file to .java file and need to change all URL and Socket connection to proxify all connections from applet. and recompile the sample applet to make ready to load in browser.
Thi is to load the applet form the web server through one proxy server. In the proxy server side While loading the applet from web server that applet code need to be changed to modify the URL and connections used in that applet to change the further connection from applet through proxyserver.
Compile and decompile is not a problem that i can use javac and javap respectively.
But I want to know how to change all URL and connection in applet. is there any easy way to handle this with out changing the applet code.
can Anybody help me.
Thanks and Regards,
Shiban.

Not sure how you do that:
Client <----[HTTPS]-----> Secure Gateway <------[HTTP]------->Web servers
or
Internet Explorer/Mozilla <----[HTTPS]-----> proxy <------[HTTP]-------> Google
Is the above correct?
If so than what are the proxy settings in IE/Moz, I can specify the proxy address in the
browsers but not the proxy type (SSL).
When you want to visit a page like google I gues you just type http://www.google.com in
the browsers address bar. The browser will figure out how to connect to the proxy.
Java has got the control panel in the general tabl there is a button "network settings...:"
I have it to "use browser settings" and this works for me.
All URL and URLConnections work but the sockets don't (maybe put in a bug report)
for example games.yahoo.com -> card games -> bridge -> create table
In the trace I can see:
network: Connecting http://yog70.games.scd.yahoo.com/yog/y/b/us-t1.ldict with proxy=HTTP @ myproxy/00.00.00.00:80
network: Connecting socket://yog70.games.scd.yahoo.com:11999 with proxy=DIRECT
The second one fails because port 11999 is not open (what idiot uses an unassigned
port for a profesional site is beyond me).
http://www.iana.org/assignments/port-numbers
#               11968-11999 Unassiged
Even if the port was open on the proxy you'll notice with proxy=DIRECT that
"use browser settings" does not work with socket (bug report??).
Anyway my advice is to open the java console (windows control panel or javacpl.exe in
the bin dir of java.home) and make sure it is set to "use browser settings"
Then enable a full trace:
To turn the full trace on (windows) you can start the java console, to be found here:
C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
In the advanced tab you can fill in something for runtime parameters fill in this:
-Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
if you cannot start the java console check here:
C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
I think for linux this is somewhere in youruserdir/java (hidden directory)
add or change the following line:
javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
for 1.5:
deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
The trace is here:
C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
I think for linux this is somewhere in youruserdir/java (hidden directory)
Print out the full trace of the exception:
try{...}catch(Exception e){e.printStackTrace();}
Then visit the games.yahoo and try to create a new table playing bridge.
Inspect the trace and see if it works/why it doesn't work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • All url's stuck connecting. uninstalled and reinstalled no help. deleted parental lock file, no help

    I have been using FF for over 2 years. Suddenly 2 days ago it will not load any web sites. Just get stuck in connecting. no error messages. Tried to upgrade. No help. Uninstalled (keeping user info). Re-installed. Still have same problem. Read through your help. Deleted parental lock file, no help

    Hello,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information. <br>
    '''Note''': ''This will cause you to lose any Extensions and some Preferences.''
    *Open websites will not be saved in Firefox versions lower than 25.
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.
    Patrick

  • Socket communication between applet and an AP on simulastor

    Hi!
    I implemented my system under Server/Client model.
    The server is running in a Set-Top-Box simulator, which
    creates a ServerSocket on port 9190.
    The client is an applet and using the following codes to connect to server:
    ==========================================
    Socket socket = new Socket("127.0.0.1", 9190)
    InputStream in = socket.getInputStream();
    OutputStream out = socket.getOutputStream();
    ==========================================
    When I start the applet, no exceptions are thrown,
    and objects socket, in and out are not null.
    But when I was trying to send a string to server,
    ==========================================
    out.write("a string".getBytes());
    ==========================================
    nothing happened. Server didn't get anything.
    What's wrong? How can I solve this?

    First of all "nothing happend" is something you tell the DELL helpdesk.
    This is a developer forum.
    My guess is you are using somthing of a in.readLine() on the server and since the
    client doesn't sent a linebreak it will hang there.
    Or the client gets an AccessControlException that you silently catch and therefore get
    no exception. Allthough the InputStream would be declared in the try block (according
    to posted code) and can not be checked for beeing null in the catch (out of scope).
    Here is some sample code of client and server, try to implement the run method in
    your client and run both appTest and applet on the local machine (http://127.0.0.1).
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class appTest implements Runnable {
         public appTest() {
              new listner().start();
              new Thread(this).start();
         // main program
         public static void main(String argv[]) throws Exception {
              new appTest();
         public void run() {
              // the client
              try {
                   Socket s = new Socket("127.0.0.1", 9190);
                   // if multiple messages are to be sent and received
                   // this is where you start a new thread
                   byte b[];
                   OutputStream out = s.getOutputStream();
                   InputStream in = s.getInputStream();
                   String message = "hello from client";
                   int messageLength = message.getBytes().length;
                   // writing the length of the message
                   out.write(new Integer(messageLength).byteValue());
                   b = message.getBytes();
                   // writing the message
                   out.write(b);
                   // reading the length of the message and setting the byte array to
                   // it
                   b = new byte[in.read()];
                   in.read(b);
                   // receiving the message
                   System.out
                             .println("received massage from server: " + new String(b));
                   out.close();
                   in.close();
              } catch (Exception e) {
                   e.printStackTrace();
         class listner extends Thread {
              public void run() {
                   try {
                        ServerSocket srv = new ServerSocket(9190);
                        while (true) {
                             try {
                                  System.out.println("before accepting a client");
                                  Socket s = srv.accept();
                                  System.out.println("after accepting a client");
                                  // if multiple messages are to be sent and received
                                  // this is where you start a new thread
                                  byte b[];
                                  OutputStream out = s.getOutputStream();
                                  InputStream in = s.getInputStream();
                                  // reading the length of the message and setting the
                                  // byte array to
                                  // it
                                  b = new byte[in.read()];
                                  in.read(b);
                                  // receiving the message
                                  System.out.println("received massage from client:"
                                            + new String(b));
                                  System.out.println("sending message from server:");
                                  String message = "hello from server";
                                  int messageLength = message.getBytes().length;
                                  // writing the length of the message
                                  out.write(new Integer(messageLength).byteValue());
                                  b = message.getBytes();
                                  // writing the message
                                  out.write(b);
                                  out.close();
                                  in.close();
                             } catch (Exception ex) {
                                  ex.printStackTrace();
                   } catch (Exception e) {
                        e.printStackTrace();
    }

  • Socket communication failure between Java applet and C++ application

    I have a java applet that connects to a C++ application via Java's ServerSocket and Socket objects. THe C++ application is using the Winsock 2 API. The applet and application are running on an NT workstation (SP 6) and using IE (5.5) For a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close. Upon performing a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket. The Java applet can still receive messages from the C++ app but C++ cannot receive responses from the Java side. Java throws no exceptions and an explicit check of the socket shows no errors. Again, what puzzles me is that it works for simple C++ applications. Are there any known conflicts between Java and C++ in this regard?
    I have inlcuded the basic java code segments below.
    / run Method.
      * This method is called by the Thread.start() method. This
      * method is required for the implementation of the Runnable interface
      * This method sets up the server side socket communication and
      * contiuously loops looking for requests from a external
      * socket.
      * @author Chris Duke
      public void run(){
         // create socket connections
         boolean success = false;
         try {
             cServerSocket = new ServerSocket(cPortID);
             System.out.println("Waiting for client to connect...");
             cClientSocket = cServerSocket.accept();
             System.out.println("Client connected");
             // Create a stream to read from the client
             cInStream = new BufferedReader(new InputStreamReader(
               cClientSocket.getInputStream()));
             // Create a stream to write to the client       
             cOutStream = new PrintWriter(
               cClientSocket.getOutputStream(), true);
             success = true;
         }catch (IOException e) {
             System.out.println("CommSocket:Run - Socket Exception(1) " + e);
             success = false;
         // if the socket was successfully created, keep the thread running
         while (success){
             try{
                // check socket to see if it is still available for reading
                if (cInStream != null && cInStream.ready()){
                    // check for an incoming message
                    String message = ReceiveMessage();
                    // Send message to listeners
                    Event(message);
                if (cInStream == null){
                    success = false;
                    System.out.println("CommSocket:Run - shutdown");
             }catch (IOException e){
                System.out.println("CommSocket:Run - Socket not ready exception");
                break;
    // SendMessage method -
      *  Sends a text message to a connected listener through port specified by portID
      * @author Chris Duke
      * @param  String message - This will be the message sent out through the server
      * socket's port specified by portID.
       public void SendMessage(String message){
          cOutStream.println(message);
          if (cOutStream.checkError() == true)
            System.out.println("SendMessage : Flush = Error");
          else{
            System.out.println("SendMessage : Flush - No Error");
       }

    a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close.
    This quite strongly implicates the extra code in the C++ App. The firstly thing I would try would be telnet. Try connecting to both versions of the C++ Application and manually reproducing a proper exchange.
    a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket.
    A correct implementation of recv should return the number of bytes received, or -1 for an error. A zero return indicates no bytes received not a socket closed/error. This sounds like FUD to me.
    Are there any known conflicts between Java and C++ in this regard?
    I can see no obvious faults, though the code is incomplete, I don't think it's an sockets implementation issue, at either end, it sounds more likely to be a protocol/handshaking bug in the C++ App.

  • TCP Socket connection in CLOSE_WAIT status and not getting closed

    I am facing an issue with the TCP socket connections not getting closed and they are in CLOSE_WAIT status for ever.
    As a part of batch process in our application, emails are sent with 4 embedded images. These images are downloaded from 3rd party site with IP say "UUU.XXX.YYY.ZZZ"
    The images are embedded to email as follows
    1. An URL object is created with the site url.
    URL urlPhoto = new
    URL("http://UUU.XXX.YYY.ZZZ/email/photos.jpg");
    2.     The image cid is created with the URL object and the image name
    HtmlEmail htmlEmail = new HtmlEmail();
    String cid1 = htmlEmail.embed(urlPhoto,
    "photo.jpg");
    3.     The image cid is added to the email template by replacing the ${cid1} and the email is sent.
    <td valign="top">
                   <img src="cid:${cid1}" width="279" height="274">
              </td>
    When a mail is sent, 4 new TCP connections are opened and are put in CLOSE_WAIT status for ever. For every mail sent 4 new connections are opened. In UNIX there is an upper limit on the number of open file handles (defaults to 1024) at any point of time. The open TCP connection has the underlying socket in CLOSE_WAIT status and is not getting closed at all. When the upper limit (1024) is reached the batch process is throwing the following exception and terminates.
    Caused by: com.inet.tds.ap: java.net.SocketExceptionjava.net.SocketException: Too many open files
    at com.inet.tds.am.a(Unknown Source)
    at com.inet.tds.TdsDriver.a(Unknown Source)
    at com.inet.tds.TdsDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at com.hcomemea.batchprocess.dataaccess.database.BaseJdbcDao.openConnection(BaseJdbcDao.java:106)
    ... 12 more
    When I run the command lsof in UNIX which list the open file handles in the system
    $ /usr/sbin/lsof -p 22933 -i | grep CLOSE_WAIT
    java 22933 build_master 297u IPv6 129841943 TCP integration.com:47929->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 298u IPv6 129841947 TCP integration.com:47933->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 299u IPv6 129841950 TCP integration.com:47936->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 300u IPv6 129841970 TCP integration.com:47952->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    ���list of 935 connections similarly�
    I tried 2 solutions
    1. Got the HttpURLConnection from the URL object and invoked disconnect method on the same. But it doesn�t work.
    2. Ran the batch process java program with the parameter �Dhttp.keepAlive=false to close the underlying connection but didn�t help.
    I need the underlying sockets to be closed and not put in CLOSE_WAIT status after sending the mail.
    Is it the problem with the embed method of HtmlEmail object not closing the underlying socket connection.
    If anyone has faced this issue before, kindly let me know the possible solutions for the same ASAP.
    Thank you,
    Ramesh G

    This sounds more like a problem due to connection pooling at middle tier/application server.
    If that has been ruled out, then you might to enable DCD or set expiry time on the server.

  • Deploy Applet and MySQL - how to read and write

    Question on deploying Applet and MySQL
    I am building an applet that is to be a part of a simple game. The applet is supposed to read data from a MySQL server and use it to place towns on the map. In addition, the applet must be able to write to the base.
    I have build a prototype and ran it in netbeans on my computer. It then successfully read data from a local MySQL base. HOWEVER; when I embed the applet in html code it no longer reads from the base. My method for connecting to the base is
    try{
    Statement stmt;
    ResultSet rs;
    Class.forName("com.mysql.jdbc.Driver");
    String url=adress;
    Connection con=DriverManager.getConnection(url, user, user);
    stmt=con.createStatement();
    rs=stmt.executeQuery("SELECT * " +
    "from "+table+" ORDER BY id");
    while(rs.next()){
    get data...
    Town T=new Town(data...); //construct town object
    TL.put(T); //put town objects in an object TownList to use later
    con.close();
    catch(Exception e){
    So;
    1) Why wont the applet read anymore?
    2) Is there a better way to do this? I have heard that its better to connect applets to servlets in some situations. What demands does this place on the server? Is there software that you need to install on the server to use servlets?

    I think I do need an applet. The map I have written permits a lot of features that I dont know how to achieve in another way.
    1) Zooming in and out on mousewheel
    2) Clicking on on two towns gives the distance and by selecting a trooptype one can get information about the traveltime between cities.
    3) Right now, I have a feature to find players or groups of players that are of special interest. It allows a player to submit a list of interesting players. The applet reads this list and provides a button with the players name. If one clicks the name of a player, all his cities flash between their originall color and white (using thread).
    I need java to do this and I need to run it in a webbrowser because there are som parts of the game that is made up of php. So I assume I have to build it as an applet?

  • JRE 1.4.x Plugin - Signed Applets and Weird Behaviour (Policy)

    Hello.
    I have recently experienced some strange behaviour related to signed applets and policy files in JRE 1.4.2-b28 ( a friend got the same behaviour in a flavour of 1.4.1-xx as well ). Both tests were on Windows 2000 Professional platforms.
    Initially my unsigned applet, which attempts socket connections to a server different from the download location, fails with security exceptions ( as expected ). Then I did the following to sign the applet jar and configure my environment
    Steps: 1) Import "trusted CA" certificate into ${java.home}/lib/security/cacerts. (JRE home outside the JDK)
    2) Signed the jar using jarsigner and a certificate generated from the "trusted CA" (Entrust CA and certificate).
    3) Imported the signing certificate into the Java plugin using import in the plugin control panel.
    4) Created a new keystore (keytool,jks) and imported the signing certificate into the keystore with alias "developer". The keystore is stored in the user home as .keystore.
    5) Created a .java.policy for the user and attaching the keystore in 4) to it. ( also stored in user home ).
    6) Used the policy tool to grant socketpermissions to the specific codebase ( testing with file:/C:/test/* initially ) signed by "developer"
    After this, when I ran the test page under IE 5.5SP2 and Netscape 7.1 it worked without any security exception. Ditto for using the appletviewer and the policy file I created for the user.
    The weird part occurred when I removed the policy entry from the user policy file. After doing this, Netscape and IE still allow the applet to execute - somehow remembering that it was granted permissions at some point. The appletviewer does not allow it to execute, generating security exceptions.
    It appears the old policy is being cached somewhere, but I cannot find where. If I replace the applet jar with an unsigned version it does fail in IE and Netscape. I tried cleaning the plugin cache and removing the "deployment.certs" files related to the users but still get the same behaviour.
    Does anyone know where the old policy information is being stored ? Does anyone know how to revoke the permissions so that I am restored to my original base environment ( no permissions for "designer" signed applets ) ? Would attempting to utilize the AccessController.doPriveleged( xxxx ) operations in JDK 1.4 avoid all of this confusion with policy files, keystores and certificate storage ? After all the messing about I would like a zero-footprint alternative ( or minimzed footprint anyway ).
    Any ideas would be most welcome.
    Regards,
    James.

    Hello Again.
    I am either enlightened or confused at this point. I found that as long as all of my related Jars are signed ( even by self-signed certificates ) I am granted SocketPermissions for calls outside of the originating server. Unsigned code is refused, but even when the Jars were signed using a self-signed certificate the Socket calls were allowed.
    Am I experiencing the appropriate behaviour in this case ( which would mean not having to utilize policy files to distribute an applet that uses calls to arbitrary servers - e.g. JavaMail ) or am I suffering from something damaged in my environment ?
    It has been a long time since I played with signed applets and I am having difficulty determining what operations require policy file entries/AccessController.doPrivileged() calls and which are granted when a user elects to trust a signed applet without policy.
    Any assistance in clearing up my confusion would be appreciated.
    Regards,
    James.

  • Applets and EJB's

    Can an Applet work like a client for an EJB? How can I do this?
    Thanks for all.

    Yes you can use an applet here and applets can be very useful in a J2EE application. The rule of thumb should be to NOT use them unless your users demand a sophisticated UI component that can not easily be done in html/jsp/servlet. The advantages of an applet are the availability of swing and awt design ui objects. The major disadvantage is the requirement for users to download the swing and applet jars before they can run your app. If your doing an Amazon.com kind of thing that would be unacceptable but if your doing an intranet or industry specific site, it might be ok.
    When you decide to use an applet you can just put in in a jsp. Create a servlet to handle talking to the applet and user http sockets to do so.
    t3chi3

  • Accidentally denied a Java Applet and now it wont load whenever i click allow

    Hi Everyone,
    I had a moment when i clicked Deny on an applet and now whatever i do i cant get it to run.
    The applet came up with the message
    "An applet from "URL" is requesting access to your computer.
    The digital signature could not be verified.
    Allow / Deny "
    It has always come up with this and i have always allowed it and it has run no problem.  It is a VPN Dial in style applet to allow a remote connection to work based systems.  I have always run it on Safari after Firefox stopped letting it run and it has been fine.  But now it just attempts to connect for forever and never getting anywhere.
    I am running Mac OSX 10.6.8 with all updates completed.
    I have tried Safari, Firefox and Chrome and none will let it launch.
    I have reset Safari, cleared the Java Preferences Cache, looked for any exceptions but have been unable to find anything unusual.
    Any help would be greatly appreciated.
    Many thanks

    Hi akahn,
    Retaking the exam is between you and your professor, however for the page not letting you click on "stay on page" after two finger swiping.
    This is a javascript feature that the developer put into the page you were taking the test on. If you disable javascript however, the page may not continue to work. And this hack [http://forums.mozillazine.org/viewtopic.php?f=38&t=2083577] may break the functionality of the page as well. But for future situations disabling specific handlers may be a work around.
    I wonder if there is a temporary way to disable the two finger swipe for when you take the test, yep.
    The config entry is mentioned here: [https://support.mozilla.org/en-US/questions/926002#answer-328219]
    Sorry about the test, hope it ends up well.

  • Applets and HTML 5 Offline Cache

    Hi,
    We're doing some tests with offline application caching in HTML 5 (using Firefox 3.5 for testing).
    We can get our basic app to work offline, but the Applets refuse to load from the offline cache.
    You can see the demo here: http://3d-lab.aarkid.com/playground/html5/
    Just enter a message and it will appear in the two applets and in the HTML below (there are two because we initially thought it was a problem due to the middleware we were using, so there's a basic Applet there too). You will need to wait for the Applets to load before the controls appear.
    Now, when offline (completely offline, no Internet connection at all) the Applets are trying to load the class from their online location rather than using the cached version. (console output below)
    Is there any way to tell the Java Plug-in that it's offline or where to load the classes from?
    Thanks.
    Console:
    Java Plug-in 1.6.0_17
    Using JRE version 1.6.0_17-b04 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Brian
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    load: class HTML5TestApplet.class not found.
    java.lang.ClassNotFoundException: HTML5TestApplet.class
        at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.UnknownHostException: 3d-lab.aarkid.com
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.<init>(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at java.net.HttpURLConnection.getResponseCode(Unknown Source)
        at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
        at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
        at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        ... 7 more
    Exception: java.lang.ClassNotFoundException: HTML5TestApplet.class

    AndrewThompson64 wrote:
    Out of curiosity. What is it you can do with JS that cannot be done with an applet and an active server (e.g. something that can run PHP, JSP, ASP..)?We require the app to run completely offline (or rather, the client does) (i.e.) no Internet connection. We have tried giving them an install with a portable apache and PHP, which has worked in the past but not for this client. So we were attempting to use HTML 5 for storing data offline, but the lack of support for offline caching in the Java Plug-in is the only thing holding us back, I guess we'll just have to wait for Sun to catch up :)

  • Signed applet and database connetion...

    Hello,
    Well, I am deploying an applet application which needs to connect with a postgres database.
    I put my application in my hosting then I changed my local java.policy file adding a line as
    permission java.net.SocketPermission "127.0.0.1:5432", "connect,resolve";And my applet works... but I don't want that the user needs to change his policies file.
    I read in somewhere in the forum if the applet is signed the user doesn't need to change anything... then I sign the applet. But it doesn't work. It looks to me that signing the applet is not enough to allows the connection.
    But I don't sure.
    Some body had had the same problem or am I doing some thing wrong?? Other Ideas
    By the way, sorry for my bad english, I hope you can understand what I am saying.
    Bye, and thanks by advance

    4NDR01D3 wrote:
    Thanks for the answer.
    That's a good test, I put some code before the DB connection to create a file:
                  File file = new File("tavo.txt");
                 boolean success = file.createNewFile();
                 if (success) {
                      javax.swing.JOptionPane.showMessageDialog(null, "YES");
                     // File did not exist and was created
                 } else {
                      javax.swing.JOptionPane.showMessageDialog(null, "NO");
                     // File already exists
                 }And surprisingly it creates the file. but doesn't connect to the database.
    I Sign the applet by command line, like this:
    keytool -genkey -alias signFiles -keystore compstore -keypass pass -dname "cn=salazar" -storepass pass
    jarsigner -keystore compstore -storepass pass -keypass pass -signedjar Sproceso.jar proceso.jar signFiles
    baftos wrote:Or at least one of the classes that are on the stack when you cpnnect to the database does not come from > the signed jar.Out of the Jar are the JDBC files(postgres.jar), it could be the problem??Your JAR is signed OK and this is good.
    DB connections are not prohibited as such.
    What is prohibited are Socket connections, which DB connections use internally.
    Therefore, if any of the classes on the stack, when the Socket connection occurs
    is not from your jar, it will fail. Therefore, the 3rd party files must be all in your jar.
    Technically, this is easy: explode their jar and create your jar in such a way as to contain
    all the files from their jar as well. Do it just as an experiment. If it works, read well
    their licensing terms, which may forbid this. If they forbid it or if in doubt, contact them.

  • MII and Plant Connectivity 2.2 Bi-directional Socket Connection

    Hi,
    I have to send a command to a serial device from within MII via a socket connection to be able to have a respons from the device.  I know in Plant Connectivity a socket connector can be setup. But is it also possible to send a message from MII to the serial device over Plant Connectivity, because it seems that the socket can only be setup to trigger notifications based on received messages from sources (and not from destinations). I read this functionality was planned to be build into Plant Connectivity 2.2, but I can't figure out how to set it up?
    kind regards,

    Hi Bram,
    We can set up connection between PCO & MII through "UDC" connector. UDC connector is available in MII through
    Data Services --> Data Servers --> New --> UDC and click on "OK" button.
    You need to provide all PCO system details like server name, Port number etc and save the connection. Check the status of connectivity through Data Services --> Connection Status.
    Go through the URL : http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm
    Navigate to Data Services --> SAP MII Workbench --> Query Template --> Tag Query
    Upon successful connection, open SAP MII workbench (Data Services --> SAP MII Workbench) and create a new "Tag Query" template to pull details from PCO.
    So far, we pulled information from PCO, manipulated those values in MII and send these values to ERP to create notification. Let us know business scenario on which you need to send back information to PCO from MII.
    Thanks
    Rajesh.S

  • 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.

  • I need help with Applets and Multithreading

    [hello all.  first time poster. big fan of java.]
    now to the important matter: Applets and Threads
    =======================================
    1) I have an applet with that implements the runnable interface, and has one thread (and a simple animation). If I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
    "java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"
    but, if I run the applet through a web browser, by putting it in an html document, it runs correctly, without error
    What on earth is wrong, and how do I fix it?!?
    2) I want to put 2 threads in my applet?
    If I implement the Runnable interface, I can only have one Run() method in my applet, right?
    So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour? Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?
    3) I tried to make 2 threads in my applet by creating my own thread classes, and instantiating them in my applet (instead of implementing the runnable interface).
    I still get the same insane error as I mentioned in my first point (which I expected), except now, the applet won't work even when viewed through a web browser!!
    Please please help me. I am frustrated beyond belief (at what is probably a very simple problem)
    I have searched and searched all over and found no answers on this

    If I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
    "java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"Don't know anything about JGrasp, but it runs with pretty tight security - thats what this insane error is all about. Use the appletviewer or a browser.
    If I implement the Runnable interface, I can only have one Run() method in my applet, right?Correct
    So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour?
    Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?You can create two Runnable implementations (classes) in your applet.
    example (missing code)
    class MyApplet extends Applet {
      void doSomething() {
      void doSomethingElse() {
      void startThreads() {
        Thread t = new Thread(new Runnable() { public void run() { doSomething();}});
        t.start();
        t = new Thread(new Runnable2());
        t.start();
      class Runnable2 implements Runnable {
         public void run() {
           doSomethingElse();
    }If the above seems confusing, read up on anonymous and inner classes.
    3) I tried to make 2 threads in my applet by creating my own thread classesTry not subclassing thread - this causes a security check

  • Security issues with applets and windows Vista when printing to file

    Hi, everyone
    I am currently developing an application that prints out the result of some calculations.
    from a Javascript file, the output finally ends up in a java applet that should print the file in a special printer.
    For debugging purposes I have created a File printer that creates a file from the output comming to the printer; this way I can debug what commands the printer is receiving.
    This worked well on Windows Xp; Vista always asks for permissions for the applet, and altough I guarantee these permissions, printer is not allowed to create the output file and reports an error writing
    after a little research, I have found that java applets have all permissions when certificated as trusted applications; all but file creating permissions
    anyone has any idea of how could I fix this problem?
    Thanks in advance

    HI,
    Have you actually signed your applet? If the signers certificate is the trusted key store for Java it should treat your applet as trusted. You can use a self signed certificate for testing as long as the cert is in the trusted key store.
    Some links that might help:
    [http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html]
    [http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/rsa_signing.html]
    Cheers,
    Shane

Maybe you are looking for

  • Connected but pages do not load

    Hi I am new here and I was wondering if somebody could help me with my problem. The BT people were unable to help me so I am trying here. Basically, my internet connection is good (apparently excelent) but it often happens that no pages are loading w

  • I would like to know a phone # in which i can speak to a live person.

    I would like to know a phone # in which i can speak to a live person. Is there such a thing now days!!! Rick McLaughlin

  • LDAP + Web Logic Server

    Hi, I'm new to weblogic server as well as LDAP. Can anyone tell us, is it possible to configure LDAPContextFactory to Foreign JNDI in web logic server console. If so how we can access the newly created Foreign Context? I have created the Foreign JNDI

  • I can't download Canon 5D Mark III RAW files with Bridge CS6

    I also tried to install the release version of the latest Camera Raw update (7.1), it fails with error message in the log: Photoshop Camera Raw 7.1 Installation failed. Error Code: U44M2P7

  • How do i find hidden files on a memory stick

    i have been given a memry stick which i was told that it as some files on there that i asked for but when i plugged it in it was not showing any files. the guy who gave it to me said they are hidden files and to unhide them first but that was on a pc