Clipboard functionality not working with websphere server - Websphere

This is a discussion on Clipboard functionality not working with websphere server - Websphere ; Hi, I found a strange problem with websphere server. In our application, we have a functionality, wherein on click of a button, the contents of few textboxes are copied to clipboard and when we paste the contents in other application ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Clipboard functionality not working with websphere server

  1. Clipboard functionality not working with websphere server

    Hi,



    I found a strange problem with websphere server.



    In our application, we have a functionality, wherein on click of a button, the contents of few textboxes are copied to clipboard and when we paste the contents in other application say Notepad, the contents should get saved, but it not happening with Websphere..



    I found this to happen only with Websphere, but in Tomcat server it is working fine.



    We are using Clipboard class from import java.awt.datatransfer.



    In the SystemOut.log file, we are able to see the copied contents pasted.. But when we try to paste it in notepad, we are not able to do so..



    --------------------------CODE----------------------

    try {



    //The parameter to getContents is not currently used so null should

    //be sent. If the clipboard is currently not available (for example

    //it is used by another application) the method throws an

    //IllegalStateException.

    System.out.println("srcData is : "+srcData.toString());

    if (srcData != null) {

    StringSelection contents = new StringSelection(srcData.toString());

    clipboard.setContents(contents, contents);

    tran = clipboard.getContents(contents);

    }



    System.out.println("here");

    } catch (IllegalStateException ex) {

    System.out.println("The clipboard is unavailable.");

    }



    System.out.println("Here1");

    if (tran != null &&

    tran.isDataFlavorSupported(DataFlavor.stringFlavor )) {

    System.out.println("here2");

    try {



    String clipboardContent =

    (String)tran.getTransferData(DataFlavor.stringFlav or);



    System.out.println("clipboardContent : " + clipboardContent);



    } catch (UnsupportedFlavorException ex) {

    ex.printStackTrace();

    } catch (IOException ex) {

    ex.printStackTrace();

    }

    }



    ---------------------------END OF CODE-------------------



    I am able to see all the System out printed in the code in the log file..

  2. Re: Clipboard functionality not working with websphere server

    kavithaka@gmail.com wrote:
    > Hi,
    >
    >
    >
    > I found a strange problem with websphere server.
    >
    >
    >
    > In our application, we have a functionality, wherein on click of a button, the contents of few textboxes are copied to clipboard and when we paste the contents in other application say Notepad, the contents should get saved, but it not happening with Websphere..
    >
    >
    >
    > I found this to happen only with Websphere, but in Tomcat server it is working fine.
    >
    >
    >
    > We are using Clipboard class from import java.awt.datatransfer.
    >
    >
    >
    > In the SystemOut.log file, we are able to see the copied contents pasted.. But when we try to paste it in notepad, we are not able to do so..
    >
    >


    [snp]

    Since this code doesn't run in WebSphere, I have a hard time believing
    it's a WebSphere problem.
    Ken

  3. Re: Clipboard functionality not working with websphere server

    Hi Ken,



    I dont think there is anything wrong with the code, because the same code is working perfectly fine with Tomcat server and not with Websphere server.



    Bye

  4. Re: Clipboard functionality not working with websphere server

    Admittedly, there is no obvious relation between a clipboard issue and a
    J2EE server... :-)

    Anyway, what sort of application is it that you have the problem with:
    Applet, JWS, classical AWT/Swing client-server application, other ?

    If client, is the JVM different when talking with Tomcat or WebSphere ?
    Could be a simple JVM bug.


  5. Re: Clipboard functionality not working with websphere server

    Hi,



    Thanks for your reply...



    Our application is a client-server web application.



    As per my knowledge, we are using the same JVM for both the servers (Tomcat and Websphere). I am not sure about this.. How do we test that the JVMs for both the servers?



    Please give me an idea about this.



    Thanks and regards

    Kavitha

  6. Re: Clipboard functionality not working with websphere server

    kavithaka@gmail.com wrote:
    > Hi,
    >
    >
    >
    > Thanks for your reply...
    >
    >
    >
    > Our application is a client-server web application.
    >
    >
    >
    > As per my knowledge, we are using the same JVM for both the servers (Tomcat and Websphere). I am not sure about this.. How do we test that the JVMs for both the servers?
    >
    >
    >
    > Please give me an idea about this.
    >
    >
    >
    > Thanks and regards
    >
    > Kavitha
    >

    Kavitha,
    You're going to have to do some more debugging on your client code. You
    stated that you see every System.out.println in the code you pasted, but
    that is not possible. You have these statements in both try{} and
    catch{} clauses, so you cannot be seeing all of them.

    In addition, the code you posted does not run in WebSphere. It runs in
    your client. I suspect that you are running different client code and/or
    using different JVMs in the clients you are using to test to both
    application servers.

    Ken

+ Reply to Thread