Thread problem in JavaNIO client server application

**Dear experts,**
I have problem with server which is nonblocking nio server, after registering one client the server is not registering other clients can some body told me, what is going on why sever is not showing any activity*
this is Tour proxy class which is at client site and dealing with server and updating GUI on client site:*
public void run() {
          connect(host);
          running = true;
          while (running) {
               readIncomingMessages();
               // nap for a bit
               try {
                    Thread.sleep(50);
               catch (InterruptedException ie) {
     } this is GUI which is dealing with Tourproxy
class WrapNetTour3D
void createSceneGraph(String userName, String tourFnm,
                                             double xPosn, double zPosn)
  // initialize the scene
    sceneBG = new BranchGroup();
    bounds = new BoundingSphere(new Point3d(0,0,0), BOUNDSIZE);
    // to allow clients to be added/removed from the world at run time
    sceneBG.setCapability(Group.ALLOW_CHILDREN_READ);
    sceneBG.setCapability(Group.ALLOW_CHILDREN_WRITE);
    sceneBG.setCapability(Group.ALLOW_CHILDREN_EXTEND);
    lightScene();         // add the lights
    addBackground();      // add the sky
    sceneBG.addChild( new CheckerFloor().getBG() );  // add the floor
    makeScenery(tourFnm);      // add scenery and obstacles
    TP = new TourProxy("localhost",this,obs);
    makeContact();     // contact server (after Obstacles object created)
    addTourist(userName, xPosn, zPosn);     
                            // add the user-controlled 3D sprite
    sceneBG.compile();   // fix the scene
  } // end of createSceneGraph()
private void makeContact()
  /* Contact the server, and set up a TourProxy to monitor the
     server. */
    try {
           TP.start();
    catch(Exception e)
    { System.out.println("No contact with server");
      System.exit(0);
  }  // end of makeContact()
....} this is class which is initializing the above class WrapNetTour3D:
  public NetTour3D(String args[])
    super("3D NetTour");
    processArgs(args);
    setTitle( getTitle() + " for " + userName);
    Container c = getContentPane();
    c.setLayout( new BorderLayout() );
    w3d = new WrapNetTour3D(userName, tourFnm, xPosn, zPosn);
    c.add(w3d, BorderLayout.CENTER);
     addWindowListener( new WindowAdapter() {
       public void windowClosing(WindowEvent e)
       { w3d.closeLink(); }
    pack();
    setResizable(false);    // fixed size display
    setVisible(true);
  } // end of NetTour3D() and this is server:
public NIOTourServer( String string, int port) throws IOException {
          this.addr = string;
          this.port = port;
          writeBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE);
          dataMap = new HashMap<SocketChannel, List<byte[]>>();
          clients = new LinkedList();
          userName = "?";
          startServer();
     private void startServer() throws IOException {
          // create selector and channel
          this.selector = Selector.open();
          ServerSocketChannel serverChannel = ServerSocketChannel.open();
          serverChannel.configureBlocking(false);
          // bind to port
          InetSocketAddress listenAddr = new InetSocketAddress(this.addr,
                    this.port);
          serverChannel.socket().bind(listenAddr);
          serverChannel.register(this.selector, SelectionKey.OP_ACCEPT);
          log("Echo server ready. Ctrl-C to stop.");
          // processing
          while (true) {
               // wait for events
               this.selector.select();
               // wakeup to work on selected keys
               Iterator keys = this.selector.selectedKeys().iterator();
               while (keys.hasNext()) {
                    SelectionKey key = (SelectionKey) keys.next();
                    // this is necessary to prevent the same key from coming up
                    // again the next time around.
                    keys.remove();
                    if (!key.isValid()) {
                         continue;
                    if (key.isAcceptable()) {
                         this.accept(key);
                    } else if (key.isReadable()) {
                         this.read(key);
                    } else if (key.isWritable()) {
                         //this.write(key);
     private void accept(SelectionKey key) throws IOException {
          ServerSocketChannel serverChannel = (ServerSocketChannel) key.channel();
          SocketChannel channel = serverChannel.accept();
          clients.add(channel);
          log.info("got connection from: " + channel.socket().getInetAddress());
          channel.configureBlocking(false);
          // write welcome message
          channel.write(ByteBuffer.wrap("Welcome, this is the Tour server\r\n"
                    .getBytes("US-ASCII")));
          Socket socket = channel.socket();
          SocketAddress remoteAddr = socket.getRemoteSocketAddress();
          log.info("Connected to: " + remoteAddr);
          // register channel with selector for further IO
          dataMap.put(channel, new ArrayList<byte[]>());
          channel.register(this.selector, SelectionKey.OP_READ);
     private void sendMessage(SocketChannel channel, String mesg) {
          prepWriteBuffer(mesg);
          channelWrite(channel, writeBuffer);
     private void read(SelectionKey key) throws IOException {
          try {
               SocketChannel channel = (SocketChannel) key.channel();
               ByteBuffer buffer = ByteBuffer.allocate(4192);
               int numRead = -1;
               // read from the channel into our buffer
               numRead = channel.read(buffer);
               // check for end-of-stream
               if (numRead == -1) {
                    log.info("disconnect: " + channel.socket().getInetAddress()
                              + ", end-of-stream");
                    channel.close();
                    clients.remove(channel);
                    sendBroadcastMessage("logout: "
                              + channel.socket().getInetAddress(), channel);
               } else {
                    byte[] data = new byte[numRead];
                    System.arraycopy(buffer.array(), 0, data, 0, numRead);
                    String dataReturn = new String(data, "US-ASCII");
                    log("Got: " + dataReturn);
                    processClient(dataReturn,channel);
          } catch (IOException ioe) {
               log.warn("error during select(): ", ioe);
          } catch (Exception e) {
               log.error("exception in run()", e);
     private void processClient(String line,SocketChannel from)
     /* Stop when the input stream closes (is null) or "bye" is sent
           Otherwise pass the input to doRequest(). */
          //String line;
          boolean done = false;
          while (!done) {
               // if((line = in.readLine()) == null)
               if(line == null)
                    done = true;
               else {
                    // System.out.println(userName + " received msg: " + line);
                    if (line.trim().equals("bye"))
                         done = true;
                    else
                         doRequest(line.trim(), from);
     }  // end of processClient()
...} i thought there is some problem with threads
can somebody tell me how can i deal with it, as i m new newbie and how could i avoid problems in such design and complex application so that i am able to complete this application
please help,
thanks a lot
jibbylala
Edited by: 805185 on Nov 23, 2010 10:43 AM
Edited by: 805185 on Nov 23, 2010 11:36 AM

ejp:Here you are assuming that the socket is readable. Check it. You also need to check for isConnectable(), and if true, try finishConnect(), and if that succeeds deregister OP_CONNECT and register OP_READ.
where i do this or it should be  done in connect method() or in readIncomingMessages() .
the current problem is connecting 2nd client.
i thought the other steps came later
i changed the connect method like this :
private void connect(String hostname) {
          try {
               InetAddress addr = InetAddress.getByName(hostname);
               int mnInterestOps = 0;
               try
                    channel = SocketChannel.open();
                    channel.configureBlocking(false);
                    InetSocketAddress mxRemoteAddress = new InetSocketAddress(addr, PORT);
                    boolean t_connect = channel.connect(mxRemoteAddress);
                    if (t_connect)
                         System.out.println("connected");
                         mnInterestOps = SelectionKey.OP_WRITE | SelectionKey.OP_READ ;
                    else
                         mnInterestOps = SelectionKey.OP_CONNECT;
                    //create the selector
                    readSelector= SelectorProviderImpl.provider().openSelector();
                    //register the channel with the selector indicating an interest
                    SelectionKey x_key = channel.register(readSelector, mnInterestOps);
                    //select loop
                    while(true)
                         //block until connect response is received
                         int selectReturn = readSelector.select(0);
                         if (selectReturn == 0)
                              System.out.println("select returned 0");
                         Set myKeys = readSelector.selectedKeys();
                         if (!myKeys.isEmpty())
                              Iterator x_readyKeysIterator = myKeys.iterator();
                              // Iterate over the set of keys for which events are available
                              while (x_readyKeysIterator.hasNext())
                                   SelectionKey x_selectionKey = (SelectionKey) x_readyKeysIterator.next();
                                   // Remove selected key
                                   x_readyKeysIterator.remove();
                                   if (x_selectionKey.isValid())
                                        if (x_selectionKey.isConnectable()) {
                                             channel.finishConnect();
                                             System.out.println("connection 2 accepted");
                                        else if (x_selectionKey.isWritable()) {
                                             System.out.println("writable channel, select return =" + selectReturn);
                                             x_selectionKey.cancel();
                                        else if (x_selectionKey.isReadable()) {
                                             System.out.println("readable channel" + selectReturn);
                                   else
                                        //cancel the channel registration with this selector
                                        x_selectionKey.cancel();
                                        System.out.println("key not valid");
                    } //end while(true)
               } //end try block
               catch (Exception ex)
                    System.out.println("exception " + ex);
          catch (UnknownHostException uhe) {
               uhe.printStackTrace();
          catch (Exception e) {e.printStackTrace();
     } but now i m getting NPE HERE in tourproxy class.
this is method which is calling channelWrite() and this method sendMessage()  i m calling from different other gui classes and i don't think so that i need  to pass the channel from there:
void sendMessage(String mesg) {
          prepWriteBuffer(mesg);
          channelWrite(channel, writeBuffer);
private void channelWrite(SocketChannel channel, ByteBuffer writeBuffer) {
nbytes += channel.write(writeBuffer); *//channel is null here*
} *can you just  tell me why it is null as i m populating it in connect method or what should i do?
PS: i already created chat application with javaNIO....
The output of this application  is nothing but a sprite which has to move simultaneously on two clients but it is not because server can't register more than one client.

Similar Messages

  • Problem using the File Dialog Box in a Client/Server application

    I am developping a client-server application using Labview 5.1 . The application on the server acquires data from some instruments and saves it on file, while the application on the clients displayes such acquired data. For doing this I call some routines on the server via the "Open Application vi" (remote connection). All goes well except when I open on the server the "File Dialog Box vi" : in this case the application on the clients is blocked (is blocked the execution of the called vi on the server). Only when
    the File Dialog Box on the server is closed, the execution of the called vi on the server starts again.
    I need to use the File Dialog Box on the server, but I don' t want to stop at the same time
    the clients !!
    I need help for resolving such problem.
    Many thanks in advance !!!

    Hi!
    waldemar.hersacher wrote:
    "It seems that the VIs called by the clients are running in the user interface thread.
    A call to the file dialog box will call a modal system dialog. So LV can't go on executing VIs in the user interface thread."
    Are you sure? I think, that File Dialog, called by LabVIEW File Dialog from Advanced File Functions Palette doesn't blocking any cycles in subVI, which running in UI Thread. Look in my old example (that was prepared for other topic, but may be good for this topic too).
    2 linus:
    I think, you must a little bit reorganize you application for to do this. You must put your File Dialog into separated cycle. This cycle, of course, will be blocked when File Dialog appear on the screen. But other cy
    cle, which responsible for visualization will run continuosly at the same time...
    Attachments:
    no_block_with_file_open_dialog.zip ‏42 KB

  • HELP - problem in running SSLSocket client/server application

    Hi,
    I want to create a SSLSocket based client/server application for this i have used EchoServer.Java and EchoClient.Java files. Both files are successfully compiled and when i ran EchoServer it throws an exception "Server certificate not found".
    I want to make a complete auto-controlled client/server application which will automatically gets certificate and all configuration itself from program because i will use both client and server application in as a servlet part.
    I did as per following instructions:
    -Create a keystore to hold the private and public keys for the server. e.g.
    keytool -genkey -keystore mykeystore -alias "myalias" -keypass "mysecret"
    -Export the X509 certificate from this store
    keytool -export -alias "myalias" -keystore mykeystore -file mycertfile.cer
    -Import this into a trustStore for the client
    keytool -import -alias "myalias" -keystore mytruststore -file mycertfile.cer
    -Run the server using the keystore
    java -Djavax.net.ssl.keyStore=mykeystore -Djavax.net.ssl.keyStorePassword="mysecret" EchoServer
    -Run the client using the truststore
    java -Djavax.net.ssl.trustStore=mytruststore -Djavax.net.ssl.trustStorePassword="mysecret" EchoClient localhost
    EchoServer.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.Socket;
    import javax.net.ssl.SSLServerSocket;
    import javax.net.ssl.SSLServerSocketFactory;
    public class EchoServer {
    public static int MYECHOPORT = 8189;
    public static void main(String argv[]) {
    try {
    SSLServerSocketFactory factory =
    (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
    SSLServerSocket sslSocket =
    (SSLServerSocket) factory.createServerSocket(MYECHOPORT);
    while (true) {
    Socket incoming = sslSocket.accept();
    new SocketHandler(incoming).start();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(30);
    class SocketHandler extends Thread {
    Socket incoming;
    SocketHandler(Socket incoming) {
    this.incoming = incoming;
    public void run() {
    try {
    BufferedReader reader =
    new BufferedReader(new InputStreamReader(incoming.getInputStream()));
    PrintStream out =
    new PrintStream(incoming.getOutputStream());
    boolean done = false;
    while (!done) {
    String str = reader.readLine();
    if (str == null)
    done = true;
    else {
    System.out.println("Read from client: " + str);
    out.println("Echo: " + str);
    if (str.trim().equals("BYE"))
    done = true;
    incoming.close();
    } catch (IOException e) {
    e.printStackTrace();
    EchoClient.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import javax.net.ssl.SSLSocket;
    import javax.net.ssl.SSLSocketFactory;
    public class EchoClient {
    public EchoClient(){}
    public static final int MYECHOPORT = 8189;
    public static void main(String[] args) {
    /*if (args.length != 1) {
    System.err.println("Usage: Client address");
    System.exit(1);
    String sAddress="localhost";
    InetAddress address = null;
    try {
    //address = InetAddress.getByName(args[0]);
    address = InetAddress.getByName(sAddress);
    } catch (UnknownHostException e) {
    e.printStackTrace();
    System.exit(2);
    Socket sock = null;
    try {
    sock = new Socket(address, MYECHOPORT);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    SSLSocketFactory factory =
    (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket sslSocket = null;
    try {
    sslSocket =
    (SSLSocket) factory.createSocket(sock, args[0], MYECHOPORT, true);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    BufferedReader reader = null;
    PrintStream out = null;
    try {
    reader = new BufferedReader(new InputStreamReader(sslSocket.getInputStream()));
    out = new PrintStream(sslSocket.getOutputStream());
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    String line = null;
    try {
    // Just send a goodbye message, for testing
    out.println("BYE");
    line = reader.readLine();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    System.out.println(line);
    System.exit(0);
    } // Client
    Can anybody will please help me to solve my problem i am using JDK1.4.2_07
    Thanks in advance.

    Hi,
    I want to create a SSLSocket based client/server application for this i have used EchoServer.Java and EchoClient.Java files. Both files are successfully compiled and when i ran EchoServer it throws an exception "Server certificate not found".
    I want to make a complete auto-controlled client/server application which will automatically gets certificate and all configuration itself from program because i will use both client and server application in as a servlet part.
    I did as per following instructions:
    -Create a keystore to hold the private and public keys for the server. e.g.
    keytool -genkey -keystore mykeystore -alias "myalias" -keypass "mysecret"
    -Export the X509 certificate from this store
    keytool -export -alias "myalias" -keystore mykeystore -file mycertfile.cer
    -Import this into a trustStore for the client
    keytool -import -alias "myalias" -keystore mytruststore -file mycertfile.cer
    -Run the server using the keystore
    java -Djavax.net.ssl.keyStore=mykeystore -Djavax.net.ssl.keyStorePassword="mysecret" EchoServer
    -Run the client using the truststore
    java -Djavax.net.ssl.trustStore=mytruststore -Djavax.net.ssl.trustStorePassword="mysecret" EchoClient localhost
    EchoServer.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.Socket;
    import javax.net.ssl.SSLServerSocket;
    import javax.net.ssl.SSLServerSocketFactory;
    public class EchoServer {
    public static int MYECHOPORT = 8189;
    public static void main(String argv[]) {
    try {
    SSLServerSocketFactory factory =
    (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
    SSLServerSocket sslSocket =
    (SSLServerSocket) factory.createServerSocket(MYECHOPORT);
    while (true) {
    Socket incoming = sslSocket.accept();
    new SocketHandler(incoming).start();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(30);
    class SocketHandler extends Thread {
    Socket incoming;
    SocketHandler(Socket incoming) {
    this.incoming = incoming;
    public void run() {
    try {
    BufferedReader reader =
    new BufferedReader(new InputStreamReader(incoming.getInputStream()));
    PrintStream out =
    new PrintStream(incoming.getOutputStream());
    boolean done = false;
    while (!done) {
    String str = reader.readLine();
    if (str == null)
    done = true;
    else {
    System.out.println("Read from client: " + str);
    out.println("Echo: " + str);
    if (str.trim().equals("BYE"))
    done = true;
    incoming.close();
    } catch (IOException e) {
    e.printStackTrace();
    EchoClient.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import javax.net.ssl.SSLSocket;
    import javax.net.ssl.SSLSocketFactory;
    public class EchoClient {
    public EchoClient(){}
    public static final int MYECHOPORT = 8189;
    public static void main(String[] args) {
    /*if (args.length != 1) {
    System.err.println("Usage: Client address");
    System.exit(1);
    String sAddress="localhost";
    InetAddress address = null;
    try {
    //address = InetAddress.getByName(args[0]);
    address = InetAddress.getByName(sAddress);
    } catch (UnknownHostException e) {
    e.printStackTrace();
    System.exit(2);
    Socket sock = null;
    try {
    sock = new Socket(address, MYECHOPORT);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    SSLSocketFactory factory =
    (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket sslSocket = null;
    try {
    sslSocket =
    (SSLSocket) factory.createSocket(sock, args[0], MYECHOPORT, true);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    BufferedReader reader = null;
    PrintStream out = null;
    try {
    reader = new BufferedReader(new InputStreamReader(sslSocket.getInputStream()));
    out = new PrintStream(sslSocket.getOutputStream());
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    String line = null;
    try {
    // Just send a goodbye message, for testing
    out.println("BYE");
    line = reader.readLine();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    System.out.println(line);
    System.exit(0);
    } // Client
    Can anybody will please help me to solve my problem i am using JDK1.4.2_07
    Thanks in advance.

  • How to validate a server in client-server application

    I am considering a client server application for a masters project. One of the core requirements for this application would be to ensure that the server could not be replaced. This would be easy to do using public/private keys. The client creates a message and encrypts using servers public key, then sends to the server. The server decrypts, processes, creates response, and encrypts using its private key. This works, however the public and private keys need to be in the source code. It looks like keystores may fix that problem, however the password to the key store would then be required. For this application to be usefull, I need to find a way to embed a password or encryption key in a .classfile in a way that it can not be retrieved by decompiling or parsing for strings. Anyone have ideas on how this could be done, or a different method I could use to guarantee that the response coming from a server process is from my server program and not a fake program?

    More detail. The program is a network license server (not web based). We need a simple license server for internal use, so that we can track usage and limit concurrent users for custom software. We also need some security so that people can not take the software home and use it. We have looked at commercial applications, however they are very expensive and we can not justify the cost since this is for internal software. There are 3 main pieces to a license server, the client libraries, the server, and the key generator. For the license server to be usefull, it should be impossible (or very very difficult) for someone to generate their own keys and add them to the license server. It should also be very difficult for them to create a fake license server that will grant licenses to clients without needing keys. If public/private key encryption is used, then the client would need to know the servers public key and their private key. These keys would need to be compiled into the program, stored in a key store, or looked up at run time from some other resource. The server would need to know its private key, and the clients public key. Since this is internal software, we can limit access to the server software, so it would be ok to compile the keys into the code (not ideal but secure enough for out use). However if I use this program as my Masters project, I would need to figure out a better way to secure it. The generic problem is how to give someone two programs that talk to each other, and be able to ensure that they do not fake one of the programs?

  • Client Server Application with images or icons

    I made a Client Server application with JFrames, but I put a jLabel with an icon, and I can't run the Client.
    It says java.lang.NullPointerException
    Do you know why I can't see the icon in the JLabel? It isn't an applet, it's an application with JFrames.

    You have to explain the problem better if you want some help. Also show the code which is giving you the nullpointerexception(Do not forget codetags!).

  • Are there any Client/Server Application (using sockets) design patterns?

    Hi,
    The title of the post nearly says it all. I am searching for different design patterns related with the development of a client/server application. I understand that there must be any different ways on how a client/server application can be developed.
    Regards,
    Sim085
    Disclaimer:
    When I enter in the Socket forum on this site I recieve this message "Thank you for any participation in this forum. Due to a lack of relevant activity, we have decided to archive this forum on June 16, 2006. For future posts on this topic, we suggest you use the Networking forum" and I am not allowed to create a new post! However I can see posts done yesterday! All i did is add the forum in 'my forums'. Does this happen to you people as well?

    Hi Sim085...How are you?
    So look this:
    http://forum.java.sun.com/thread.jspa?threadID=5148926&tstart=75
    I don�t know if is what you want...but I hope in this^^
    Ok man...If you have one example for help you is better.
    [ ]

  • Writng-Reading stream through client-server application

    I am developing a client-server application which is the client sends a sentence to the server and the server will convert the sentence from small letters to all capital letters. The problem is when the sentence send by the client contains special character such as Registered Trade Mark or Copyright , the server receive the sentence but the special character has changed to undefined symbol. After the server do the conversion process, the server couldn't send back the sentence because of the undefined symbol. It will make the system hangs.
    I use socket connection to do the process. The system use DataOutputStream object to pass the sentence . The source code is as below:
    Socket clientSocket = new Socket("localhost", 111);
    DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
    BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
    sentence = "Stomach-Comfort is the all-natural alternative to over-the-counter products, such as Tums�, Rolaids� and Pepcid AC�.";
    outToServer.writeUTF(sentence + '\n');
    modifiedSentence = inFromServer.readLine();
    System.out.println("FROM SERVER: " + modifiedSentence);
    Any body can help me?

    Well, I think that this would work but I haven't tried it, but you could evaluate the numerical value of each
    character and see if it falls within the range of ASCII fields that you want to convert.
    If not don't convert it.
    So for example,
    for each char in your stream:
    1) get a char's numerical value
    2) If between 97-122 decimal
    convert to the capital (forgot the exact method name)
    3) else
    keep value as it is.

  • Problem to rewrite client/server MS Word report in Reports 10g

    Hi all,
    We are going to migrate 4.5 forms application to 10g and we have the following problem.
    In the old client/server application we are calling some DB function which returns the character string and we are writing this string into the text file (TEXT_IO). Afterwards the text file is formatted using MS WORD (called from the form with DDE.APP_BEGIN) and .DOT template file.
    In forms 10g in order to implement the same functionality we found two possible solutions:
    •     Generate the file on the OAS , transfer it to client machine with WEBUTIL and manually run MS WORD in the batch file and generate the report
    •     Generate the Oracle Report.
    We are more inclined to the second solution but in order to develop the report it should be based on some table or view or REF CURSOR. The called DB function contains six cursors and it will be very difficult to rewrite it with one cursor in order to use REF Cursor. In this case we have to use the temporary table but it doesn’t look as a best solution.
    What could be an alternative solution?
    Any help will be appreciated.
    Thanks
    Alex

    Bill and Kileen,
    Thanks both. That is just what was needed. I tested and it works fine now.
    The same is also mentioned in the User Guide / Release Notes that accompanied the toolkit.
    I happened to collect some other webpages and .pdf that talk of other issues. In case someone happens to need this (.zip file would be less than 1 MB), please feel free to write at [email protected]
    Best regards,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

  • Client server application using CORBA

    Hi
    I have a basic client server application running using CORBA/idl where the client starts up and the server says hello back to the client. I have figured out the basics but would like some help with these small problems.
    When I start the client, the server says hello. Thats OK. Now I want the client to start a simple java app (called c:\test.java - it works) that I created before. How?
    The next bit is when I close down the app "test" that I start, I want the server to realise that its closing and simply say goodbye on the client. How?
    If anybody can help me, I'd appreciate it.
    Thanks for your time,
    Shaun

    hi,
    to my knowledge, you will have to define a method in idl file and in your client, which server invocates(saying good bye etc) before shutting down..
    ls.

  • Client/server application (Help me)

    I have a client server application.In the client part i send data to the server and the server receive data. After receiveing data server also send some data but the client can't capture data. Anyone please tell me what is the problem?
    I am giving the sample code here......
    I am thinking actually the problem is in the client side.......
    Server
    out = new DataOutputStream(client.getOutputStream());
    input = this.client.getInputStream();
    byte[] data=new byte[input.available()];
    input.read(data);
    byte[] sdata=new byte[3];
    sdata[0]=1;
    sdata[1]=2;
    sdata[2]=3;
    out.write(sdata);
    Client
    How can i implement my client to send and receive at a time??

    Thanks all of u.
    I have solved the problem.
    Now i have another problem.In the Client side I have used DataOutput
    Stream(for sending) and InputStream(for receiving).
    With the InputStream i am capturing data by this way.....
    int dataSize=is.available();
    int kkk=0;
    boolean hasSize=true;
    while (kkk<=0) {
    dataSize = is.available();
             if (dataSize != 0 && hasSize) {
                          byte[] dat = new byte[dataSize];
                          is.read(dat);
                           String s = new String(dat);
                           System.out.println("Capture:" + s);
                           System.out.println("data ssss: "+dataSize);
                           hasSize=false;
                           kkk=9;
                       }//End of if
      }//End of while
                     Here is the problem. If I am sending from the server data size less 4000 byte then the client can easily capture the data. But when i am sending the data which is very very large such as 70,000 bytes then it creates a problem.
    My target is simple. I want to capture the whole data that is send by the server . then want to keep the data in a byte array which size will depend upon the receiving data.
    How can i do that??

  • Advanced Client Server Application

    Hi friends .I'm working on a client server project.In this project I must use two OBJECTOUTPUTSTREAM and OBJECTINPUTSTREAM.But in the program one of them lock the program.
    This code a part of from my code.
    input1 and input2 a ObjectInputStream.
    There are two serversocket in the server side.
    Client side got two socket and connected server's two sockets.
    Sockets had an objectoutputstream and an objectinputstream.
    This project about a game .But players can talk to each other.
    input1 send the game move to another player.
    input2 send the chat message to anoyher player.
    But program always wait the input1 after wait input2.As soon as one of the player moves or seend message another side must take it same time
    I can't do this.
    do{
    move=*this*.input1.read();
    // this wake for move and lock the program here.program doesn't go down.IT'IS A PROBLEM
    message=(String)*this*.inputi2.readObject();
    }*while*(!str.equalsIgnoreCase("Kapat"));
    I thought very much about it.I think I must use a thing lile listener whitch run as soon as objectoutput write to input.
    I'm waiting for your help.If you show a sample code about this subject I pleased very much.
    Good luck everone.Herkese iyi �anslar.this explanation isn'about code and it's my own language.
    T&Uuml;RK&Ccedil;E
    �nsan�n ana dili gibisi yok.Bu a&ccedil;�klamay� Ba�taki ingilizcede sonra yapt���m i&ccedil;in bu dili bu g&uuml;ne kadar geli�tirip gelen t&uuml;m t&uuml;rk milletinden &ouml;z&uuml;r diliyorum.Amac�m istedi�ime ula�mak ve bu siteyi ziyeret edenlerin % 99 ingilizce kulland��� i&ccedil;in b&ouml;yle yapmak zorunda kald�m.Kusuruma l&uuml;tfen bakmay�n.
    K�sace &ouml;zetlemek gerekirse uygulamamda Farkl� socketler &uuml;zerinden birbirine ba�l� 2 OBJECTINPUTSTREAM ve OBJECTOUTPUTSTREAM var
    bunlar�n ikisindende kar��l�kl� ver aktar�yorum .biri oyun hamlesi ta��mak di�eride mesaj ta��mak i&ccedil;in.Ama bunlardan biri program� blokluyor di�eride orogram inemiyor.Bu sorunu &ccedil;&ouml;zmeliyim.
    do{
    move=*this*.input1.read();
    // Hamleyi beklemeye ba�lad���zaman bir mesaj gelince buraya inmiyor illaki hamleyi bekliyor.
    //Hamle geldikten sonrada bu sefer mesaj� bekliyor hamleyi alm�yorr.Bu sorunu halletmem laz�m.
    message=(String)*this*.inputi2.readObject();
    }*while*(!str.equalsIgnoreCase("Kapat"));
    Listener gibi bir �ey kullan�rsam sorun &ccedil;z&uuml;l&uuml;r san�r�m.Yard�mc� olursan�z minnettar olurum.

    I'll go further than that. I'd say that these days, any time you have any kind of client/server application, the first question you should ask is, is there any pressing reason why we can't just use a web server for the server do all communication over HTTP using a textual serialization mechanism like XML and preferably using REST?
    The documentation and infrastructure for this stuff is so extensive these days, and the potential for repurposing is so great, that going any other way without a good reason is a waste of effort. Even if HTTP/REST/XML isn't an exact fit, it can still be worth it (at least for prototyping) just for the convenience.

  • Servlet in client/server application?

    hi,
    I am planing to make a client server application( SWING & an OODB), would it be clever to use servlet ( not httpservlet) as midle tier framework?
    If yes , what are the benefits?
    Thanks.

    thanks for responding
    actually my client don't wanna run a separate server application on the hosting machine as it costs too much, so thats why i think there is no other way to achieve the task rather than using servlets.
    please do help me or atleast give me a suggestion. actually i'm developing an internet messenger application. i have developed it using client/server application model in which both (the swing client and the server) uses java sockets to communicate with each other. but now i want to develop the server side of the messenger as servlets. but as far as i know the servlets follow the request/response model. if i follow that model i have to use some sort of client pull after certain amount of time say after five or ten seconds, and this approach does not fulfill my requirements as it would slow the performance if there are hundreds of clients calling the servlet every 5 seconds. thus i want to create persisted connections between the client and the servlet which last for the life time of the user's session. also it is important for the data integrity of the application, so please help me in this matter as i have no other source of guidence in this meany world. i hope you will certainely help me in this matter. please mention that if there are any drawbacks of my approach i mean the persisted connections.
    thanks you a lot
    Best reagrds
    Imran Sarwar.

  • Should i use secure sockets for my whole client/server application?

    Hi,
    I have a client server application, and I want to ensure that the login process is secure (i.e. use secure sockets). but I dont know how to switch back to a normal socket once that is done.
    So I am left thinking that i should just use SSL for my whole application, which can last pretty long. But I would rather not. Is there any other way of doing this?
    or should I just encrypt the login info using MD5 or something like that, then send it over an unsecure socket?
    thanks!

    Hey,
    Are you sure you haven't confused JGSS for JSSE?
    Imagine you have a client-server system and you sometimes want data sent over the wire to be encrypted... JGSS offers you this flexibility; if you a encrypted transmission, run ift through JGSS before transmitting it; if you don't want an encrypted transmission, bypass JGSS and just send the transmission.
    The benefit is the security (encryption) isn't hard-wired into you communications protocol i.e. TLS. JGSS has nothing to do with connections it is just protocol for securing messages, not sending them.
    You would need to establish the secure context but this could be done at startup and persist for the duration of you applicaiton invocation. You perhaps might need to implement a mechanism to identify encrypted messages on the receiving peer (so it knows to attempt decryption).
    Admittedly, kerberos seems like one of those 'inside-joke' things. I've come to realise if you don't have some sort of kerberos realm/server against which to authenticate - you need to swap it out as the underlying mechanism. How this is done I'm not sure yet, but I intend to find out today....further down the rabbit hole I go!
    If I discover anything helpful, I will let you know.
    Warm regards,
    D

  • Client/server application under development

    Hi there,
    I've been working on a client/server application that includes chat and whiteboard features. In terms of how the client app communicates with the server app, my initial thought was to just go with xml, until I reached a snag. Everything about chat and almost everything that is accomplished on the whiteboard can be expressed in terms of text or character data; which what makes xml a good candidate for moving the data back and forth from client to server. However, there's one part of the whiteboard feature that can't be converted to just text. The whiteboard has an ImageTool. With it you can select an image (gif,jpg) from your harddrive and load it into the whiteboard. An image is binary data and simply cannot be put into an xml file for transport. At least, that's my understanding. Am I wrong about this?
    So, this poses the questions: "How do other similar applications like MSN Messenger move images around? If they're not using xml as there medium, what are they using? Just plain sockets without any structured medium like xml?"
    Please advise,
    Alan

    You could always Base64 encode the image file content and then put the Base64 in XML.
    I am in the middle of a client-server project and I use XStream ( http://xstream.codehaus.org/ ) to convert Objects to XML automatically. I don't have to do any explicit encoding - XStream does it all for me.

  • Can i use forms 9i or 10g for client/server applications

    Right now, we are using oracle 9i DB and developer suite 10g. I have to build a client/server application. In one of the OTN articles, it says that from forms 9i onwards, it's not supporting client/server applications. Do i have to use 6i for this.
    Thank You.
    Sree.

    That's right. Only web deployment is support from 9i onwards. Bad decision since Oracle seems to ignore their customer's view

Maybe you are looking for

  • EBS 11i AutoInvoice Performance Very Slow

    Hi all, EBS 11i Oracle 9.2.0.6 32bit AutoInvoice Transfer Program has been bugging down the Company's business, a bad start for 2013. Please help for this serious problem :( Attached is the "STATSPACK" report for the slow performance time. STATSPACK

  • Report from PL/SQL

    Hi guys, I'm using BI Publisher - a tool for generating reports using SQL queries - to create some reports. Since I'm not an expert in SQL I'm here to ask for some help. I have a table which maps products to packages. For example, suppose that "Packa

  • Can you loop video forever as a menu background, but audio only once?

    I'm wanting to make a menu that has a video background and plays music as soon as the DVD starts up, but I want the music to stop after it plays through twice and the video to continue to loop. I know I could do this by setting a loop point, but I do

  • IPhoto upgrade will not install after downloading Yosemite

    iPhoto will not upgrade after installing Yosemite.

  • WBS as default Acct Assgnmt  for Cost Center

    Hi experts ! I need to save WBS as default Acct Assgnmt  for Cost Center (transaction KA01). I do not have  it on the screen. Would anyone help me, where I can change this sceen in spro ? Rgds, Stenwa