Socket communication between client and server

Hi all,
I am doing an assignment for communication between java client and java server using sockets. This communication is in the form of XML documents. I am facing a problem in this communication.
Actually at Server side I'm creating an XML document(Document type object) using DocumentBuilderFactory in javax.xml.parsers package and transforming this Document into a stream using StreamResult.
My code is :
Transformer xmlTransformer = TransformerFactory.newInstance().newTransformer();
StreamResult xmlString = new StreamResult(currentClientHandler.getSocketOutputStream());
DOMSource xmlDocSource = new DOMSource(xmlDocument); // xmlDocument is Document type reference
xmlTransformer.transform(xmlDocSource, xmlString);
so, this xmlString(i.e. StreamResult) is passed directly into the output stream. Here I need to close() output stream after transform() call to help SAX parser to know about end of stream.
Now at Client side, I am parsing this stream using SAX parser. It parses this correctly. But when sending some another data back to Server when client opens output stream, it given Socket closed exception. I know that closing input or output stream closes socket. But in my problem, I have to send data in streams and not by using files or byte[] etc.
So what is nearest solution to problem ??
Plz help me. Any kind of help will be greatly appreciated.

hi
thanks for ur reply.
I didnt get any error msg while getting the back the datas.
Actually i divided my application into two parts.
My application will act as both server and client.
server ll get the browser request and send to the client and the client will send that data to the c++ server.
Im able to do that.and unable to get the data from server.
Didnt get any error.
can u tell me how to make an application to act as both client and server.
I think im wrong in that part.
thanks a lot

Similar Messages

  • Communication between client and server

    I am using sockets for communication between the client and the server. is there any other way that i can use for communication between the client and server???

    Plenty of ways: JMS, SOAP, RMI, a RESTful API, writing-files-to-a-shared-directory-on-the-disk, Sneakernet, ...
    Some of them use sockets (or better TCP/IP) as the underlying protocol.
    But to give you a good answer, you would have to tell us why you want a different way. I hope you're not searching for a different way just for the sake of being different.

  • 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();
    }

  • XML over HTTP between client and server

    We are trying to pass XML between a client and servlet over HTTP.
              We used the code from the StockClient/StockServlet examples as a
              starting point but cannot get it to work. Basically we
              have a simple command line java client that is trying to access
              a VERY simple servlet. When the client tries to write data into
              the output stream associated with the connection I get:
              "Connection rejected: 'Login timed out after: '15000' ms....."
              I have read several postings that instruct me to raise the
              timeout limit, but as you can see, I surely don't need 15 seconds
              to write this data out! Is there something special I need to do?
              Does this have anything to do with known issue #10065
              (http://www.weblogic.com/docs51/release_notes/rn_knownprob51.html)
              I have followed all of the instructions in the example code
              (http://www.weblogic.com/docs51/classdocs/xml.html)...
              Any assistance is appreciated...
              here is the client code:
              import java.io.*;
              import java.net.*;
              public class TestClient
              public static void main(String aa[])
              URL url = null;
              HttpURLConnection urlc = null;
              PrintWriter pw = null;
              file://Commented lines indicate other things I have tried
              try
              url = new URL("http://localhost:7001/ParserServlet");
              file://urlc = url.openConnection();
              urlc = (HttpURLConnection)url.openConnection();
              file://urlc.setRequestProperty("Content-Type", "text/xml");
              urlc.setDoOutput(true);
              urlc.setDoInput(true);
              file://urlc.connect();
              pw = new PrintWriter(new OutputStreamWriter
              (urlc.getOutputStream()), true);
              pw.println("<?xml version='1.0'?><test>testing123</test>");
              pw.flush();
              file://urlc.disconnect();
              } catch(IOException ex) {
              System.out.println(ex.getMessage());
              Here is the servlet code:
              import javax.servlet.*;
              import javax.servlet.http.*;
              import java.io.*;
              import java.net.*;
              public class TestServlet extends HttpServlet
              public synchronized void init(ServletConfig config) throws
              ServletException
              super.init(config);
              System.out.println("Inside init()");
              public final void doPost(HttpServletRequest request, HttpServletResponse
              response)
              throws ServletException, IOException
              System.out.println("Inside doPost()");
              protected void doGet(HttpServletRequest req,
              HttpServletResponse resp)
              throws ServletException,
              java.io.IOException
              System.out.println("Inside doGet()");
              

              Jon,
              One thing is missed in your client code. When you use HTTP POST to send request,
              you have two ways to tell the Web server when to stop reading from your input and
              to start process your input: the first one is using "Content-Lenght" header property
              to specify how many bytes you want to send to your servlet, the seocnd is use "Transfer-Code:
              Chunked" and is much more complicated. I didn't see you pass "Content-Length" in
              your client code, in which case, the Web server (Weblogic) cannot know the end of
              your request data and could keep waiting for last byte to come out or waiting for
              the socket time out (that is what you get).
              Since you use servlet, not JSP, I would recommend to code in this way (it works fine
              for me, no guranttee for your situation):
              Client code: Use a big temprary string, or StringBuffer, or StringWriter to store
              all the request data (your xml file content) before you send out the request. After
              you finish to form your XML string, calculate the number of bytes (should equal to
              the length of the string) and add the request header as
              urlc.setRequestProperty("Content-Length", bytes_length);
              I will not suggest you using PrintWriter. Think use BufferedOutputStream constructed
              from URLConnection and write the bytes (use String.getBytes()) to the servlet and
              then flush.
              Servlet code: in the doPost() of your servlet, try to find the request data length
              by calling request.getContentLength(), then open the InputStream (think to use BufferedInputStream
              for performance). Read the contents from the InputStream byte by byte and counter
              the number of bytes. Once you get the number of bytes as specified via request Content-Length,
              break your reading loop and start whatever you want.
              Hope it helps.
              "Jon Clark" <[email protected]> wrote:
              >We are trying to pass XML between a client and servlet over HTTP.
              >We used the code from the StockClient/StockServlet examples as a
              >starting point but cannot get it to work. Basically we
              >have a simple command line java client that is trying to access
              >a VERY simple servlet. When the client tries to write data into
              >the output stream associated with the connection I get:
              >"Connection rejected: 'Login timed out after: '15000' ms....."
              >I have read several postings that instruct me to raise the
              >timeout limit, but as you can see, I surely don't need 15 seconds
              >to write this data out! Is there something special I need to do?
              >Does this have anything to do with known issue #10065
              >(http://www.weblogic.com/docs51/release_notes/rn_knownprob51.html)
              >I have followed all of the instructions in the example code
              >(http://www.weblogic.com/docs51/classdocs/xml.html)...
              >
              >Any assistance is appreciated...
              >
              >here is the client code:
              >import java.io.*;
              >import java.net.*;
              >
              >public class TestClient
              >{
              > public static void main(String aa[])
              > {
              > URL url = null;
              > HttpURLConnection urlc = null;
              > PrintWriter pw = null;
              >
              > file://Commented lines indicate other things I have tried
              > try
              > {
              > url = new URL("http://localhost:7001/ParserServlet");
              > file://urlc = url.openConnection();
              > urlc = (HttpURLConnection)url.openConnection();
              > file://urlc.setRequestProperty("Content-Type", "text/xml");
              > urlc.setDoOutput(true);
              > urlc.setDoInput(true);
              > file://urlc.connect();
              > pw = new PrintWriter(new OutputStreamWriter
              > (urlc.getOutputStream()), true);
              > pw.println("<?xml version='1.0'?><test>testing123</test>");
              > pw.flush();
              > file://urlc.disconnect();
              > } catch(IOException ex) {
              > System.out.println(ex.getMessage());
              > }
              > }
              >}
              >
              >
              >
              >Here is the servlet code:
              >
              >import javax.servlet.*;
              >import javax.servlet.http.*;
              >import java.io.*;
              >import java.net.*;
              >
              >public class TestServlet extends HttpServlet
              >{
              > public synchronized void init(ServletConfig config) throws
              >ServletException
              >
              >
              > super.init(config);
              > System.out.println("Inside init()");
              > }
              >
              > public final void doPost(HttpServletRequest request, HttpServletResponse
              >response)
              > throws ServletException, IOException
              > {
              > System.out.println("Inside doPost()");
              > }
              >
              > protected void doGet(HttpServletRequest req,
              > HttpServletResponse resp)
              > throws ServletException,
              > java.io.IOException
              > {
              > System.out.println("Inside doGet()");
              > }
              >}
              >
              >
              >
              >
              

  • Oracle returns redicrect when there is NAT between client and server

    I have Oracle 8i on Linux sitting behind a firewall/NAT. I have two Apache webservers that run both Tomcat and WebLogic webapps, also behind the NAT. One of them is on the same machine as the Oracle server. Those all connect just fine. I recently had to load a JBoss/Tomcat webapp (no Apache) outside the NAT which needs to talk to the Oracle server. It's using a JDBC driver, I believe calling on this class: oracle.jdbc.driver.OracleDriver. The configured URL is "jdbc:oracle:thin:@localhost:1521:qlink". Using ethereal (A GUI frontend to the packet sniffer tcpdump, which understands the TNS protocol) showed me that this is the connection request being made: "(DESCRIPTION=(CONNECT_DATA=(SID=qlink)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle)))
    (ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))))". I notice it uses SID, where it seems everything else I've analyzed with Ethereal is using SERVICE_NAME. I was first trying to pipe the data through an SSH tunnel. This technique works with all of Oracle's tools that I have tried it with, and with TOAD. I can connect to this Oracle server with the DBA Studio and sqlplus, over an ssh tunnel. But as soon as this JBoss/Tomcat webapp tries, Oracle returns a REDIRECT message. There are two things that strike me as odd: The REDIRECT message returns the hostname of the Oracle server and a nonstandard port; and the JBoss/Tomcat webapp doesn't seem to do anything about it. I has assumed the TNSLSNR forwarded data between 1521 and the appropirate port for requested databse. The port is the same every time, so I made sure that the hostname/port returned was reachable from the client side. But like I said, the client seemed to just ignore it and hang. Getting desparate, I then tried to open up the Oracle ports on the NAT, and use ipchains to restrict what IPs could connect to it, that yielded the same results. I've seen this webapp work with Oracle running on the same machine, both configured identically. (Running Oracle behind the NAT and using SSH tunnels gives the same configuration for JBoss/Tomcat as if I was running Oracle on the same machine)

    I'm pretty uninitiated with Oracle. I don't know how to verify/disprove your guess about the shared server dispatcher, or even what it means. Should I try to pursue the observation that the JDBC client specifies a SID to connect to and everything else specifies a SERVICE_NAME, or is that of little consequence? I'm not sure how to interpret the output from 'lsnrctl serv'. Here's the chunk pertaining to the database in question:
    qlink has 3 service handler(s)
    DISPATCHER established:120 refused:0 current:120 max:254 state:ready
    D000 <machine: sark.unboundtech.com, pid: 15801>
    (ADDRESS=(PROTOCOL=tcp)(HOST=sark.unboundtech.com)(PORT=41714))
    qlink has 3 service handler(s)
    DEDICATED SERVER established:46 refused:0
    LOCAL SERVER
    DISPATCHER established:0 refused:0 current:0 max:254 state:ready
    D001 <machine: sark.unboundtech.com, pid: 15803>
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sark.unboundtech.com)(PORT=41716))(PRESENTATION=oracle.aurora.server.SGiopServer)(SESSION=RAW))
    Presentation: oracle.aurora.server.SGiopServer
    The (ADDRESS=...) is what is returned in the redirect. I created the database with dbassist using the default setup type. I'll have a look at listener.log (the name/location of a log file is actually a question I had but forgot to ask, so thanks), I don't know how to check trace output. The webserver is able to resolve the hostname being returned, and knows how to route to it.
    Localhost is the correct entry. If you've never used SSH tunnels here's a quick rundown. You can tell most SSH clients to listen on an arbitraty port on your machine, and forward data to a remote IP/port from the other side. So from the webserver, I would say to forward localhost:1521 to localhost:1521 on the oracle server. So for sqlplus, for example, I setup tnsnames.ora to route connections to a particular SERVICE_NAME to localhost:1521, which is forwarded through my SSH connection, to localhost:1521 on the Oracle server. This lets gains me two things, all connections look like localhost, making my firewall rules simpler, and I get encryption through SSH (I know Oracle can do encrypted connections, but some clients might not support it, and I don't know how to set it up yet.) I am able to connect to the database over an SSH tunnel using sqlplus, from the webserver (since I ended up installing Oracle on it), so I know the connection is possible.
    After reading that, you might wonder if the hostname:port returned in the redirect were accessible from the web server. They weren't at first, but opening port 1521 and 41714 for sark.unboundtech.com at the NAT, and firewalling requests from IPs other than the webserver, then giving the JDBC config sark.unboundtech.com instead of localhost with an SSH tunnell yielded identical behavior. After recieving the REDIRECT, the JDBC code doesn't seem to do anything except hang, nothing is sent to the location given in the REDIRECT response.

  • Interprocess socket communication between Java and C

    Hello,
    I have opened a socket to C-process listening at predefined port.
    The C rpogram requires data to be send sandwiched between
    "@BEGMSG\n" "@ENDMSG\n"
    WHen the C program encounters \n it understands it is end of line and returns "\0"
    kkSocket = new Socket("abcd",12013);                    
    out = new PrintWriter(kkSocket.getOutputStream(), true);
    is = new DataInputStream(kkSocket.getInputStream());
    out.println("@BEGMSG@\n");
    ibyteread = is.read();
    System.out.println("Server 1 ::"+ibyteread);
    out.println("INIT\tIMISFS11\timisdiag\tdamnyas1\tllgyZux8Mt2Qs\n");
    ibyteread = is.read();
    System.out.println("Server 1 ::"+ibyteread);
    out.println("@ENDMSG@\n");
    ibyteread = is.read();
    System.out.println("Server 1 ::"+ibyteread);
    My problem is the C-program gives error while reading the "@ENDMSG@";
    Can any one tell the problem

    Hello,
    I have taken care of that,
    Also i am writing as bytes
    as shown below
    fromUser= "@BEGMSG@\n";
    String data = "\0INIT\tIMISFS11\timisdiag\tdamnyas1\tllgyZux8Mt2Qs\n";
    String endmsg = "@ENDMSG@\n";
    os.writeBytes(fromUser);
    in.read();
    os.flush();
    os.writeBytes(data);
    in.read();
    os.flush();
    os.writeBytes(endmsg);
    ibyteread=in.read();
    os.flush();
    Now teh C-program reads the first two lines, but gets third line as empty or -1
    Also i have to read the stream after every write, other wise my data is not written to C-program.
    Some how my third statement which @ENDMSG@ is getting converted to empty string of length <=-1,
    If i don;t read after os.writeBytes(data);
    That line is ignored and C-program directly jumps on "@ENDMSG@\n";
    and reads it.
    Can any one tell this funny behaviour
    Thanks

  • Socket communication between Java and Python aplications.

    I'm try to connect a pyhton client to a Java server through Socket. The problem is that the python client never receive anything. I'm using a ObjectOutputStream to send the msgs. Does anyone have any idea how make this works?!

    RicardoS wrote:
    So how do you do it?! What do you use?!Bytes! Normally I generate the bytes from XML.
    Edited by: sabre150 on Mar 24, 2008 5:10 PM

  • Signal tranmission between client and server through tcp/ip

    Hi everyone,I want to transmit analog signal from server to the client,I enclosed one file which is used to transfer an array of string,how can I modify the enclosed example for analog signal tranmission(numeric) and save the signal into a file "load to an ASCII file"".kindly help me to modify this code.
    Thanks
    regards,
    Khan_khan
    Attachments:
    ConcatenatedStringToArray.vi ‏11 KB
    Simple Data Client.vi ‏20 KB
    Simple Data Server.vi ‏19 KB

    Dear thanks for your reply and suggestion.I solve somehow the problem as enclosed in the zip file but now there is one problem that i am not getting with. When I run the project, the first array with the name of "array" gives the wrong result in some position.First all slots of array are filled with the right data but then the first index and few other index gives the wrong result.Kindly correct my error.
    The second problem is ,when i increase the frequency of the signal considering also the sampling rate, it gives me unexpected data at multiple locations.Kindly correct my design so that it should work perfectly.I shall be very thankful.
    Attachments:
    ConcatenatedStringToArray.vi ‏13 KB
    Simple Data Client.vi ‏23 KB
    Simple Data Server.vi ‏27 KB

  • How to handle when Client and server write to the socket at the same time

    Hi all,
    I'm writing a socket communication when client and server may write information the the socket at the same time. I look every where but the samples from the internet only shows example of server replies to client after receiving requests from clients.
    Let's say that:
    Client 1 ->Socket 1 -> Server 1
    Now if there are two threads in the server, one blocked waiting for the input from client on socket 1, the second one write something on the socket to client 1, is it possible?
    And if it's possible, if at the time Server 1 writes information to Client 1, Client 1 writes some information to Server 1 too, will there be any conflict problem or the socket could handle that two ways communication simultaneously?
    It's critical questions for me. Thanks for your help.

    I really use Server Client paradigm. However, beside the request, response mechanism, there is also an additional mechanism called update which server periodically send information update to client without the need for a request from client.
    So you suggest client should initiate 2 sockets, one for request and response, one for receiving update from the server? Will this work?

  • Communication between java and c++, help!

    i am c++ programmer and newly to java.
    now i am developping a client/server app. i use java transfers data (socket) between client and server, and use c++ to create user interfaces because c++ is easier for interfaces.
    my question is:
    in a single PC, java needs to tell c++ what info was read from socket and c++ needs to tell java what info will be written to socket.
    i want to use 2 files (read and write) as media between java and c++. that is: java writes data to a file and c++ reads from the file, and vice versa.
    i know it's not efficient. could you tell me better way to do?
    thanks in advance.

    thanks for reply.
    my problem is: socket is fare in java, not fare in c++
    (win/nt). could u use server in a non nt-server
    machine with c++?I'm not sure what you mean "fair". NT-Server is just a version of NT that Microsoft adds their server products to. Most of which you don't want to use because they are a security nightmare. I think what your asking is can you do the equivalent of Java's ServerSocket in C++. Sure, the socket libraries in Windows (at least last time I checked) were based off the BSD socket libraries. So you would basically do something like:
    // Open socket
    ss=socket(AF_INET, SOCK_STREAM, 0);
    if(ss==-1)
      cerr<<"Error opening socket."<<endl;
      return 0;
    // Fill in address
    struct sockaddr_in server;
    server.sin_family=AF_INET;
    server.sin_port=htons((unsigned short)port);
    server.sin_addr.s_addr=INADDR_ANY;
    // Bind to port
    if(bind(ss, (struct sockaddr *)&server, sizeof(server))==-1)
      cerr<<"Could not bind to port "<<port<<"."<<endl;
      return 0;
    // Ready to accept connections
    if(listen(ss, 5)==-1)
      cerr<<"Could not listen."<<endl;
      return 0;
    // Loop to accept connections
    while(/* some condition */)
      // Accept a connection
      int s=accept(ss, 0, 0);
    }This should work on any version of windows as long as you have winsock. The example code might need to be changed a little though since I copied it from a Linux program I had.

  • Socket Communication between java client and c++ server

    HI,
    In my project,I want to do the following:
    1.Sending datas from client to server.
    2.Getting the response from server to client.
    I written the client in java.but the server is in c++.
    Is it possible to communicate with the server using java codings itself?
    Im able to send the data from my java client to the server.
    but unable to get back the datas from server to client.
    Can anyone tell me how to do this?
    thanks a lot

    hi
    thanks for ur reply.
    I didnt get any error msg while getting the back the datas.
    Actually i divided my application into two parts.
    My application will act as both server and client.
    server ll get the browser request and send to the client and the client will send that data to the c++ server.
    Im able to do that.and unable to get the data from server.
    Didnt get any error.
    can u tell me how to make an application to act as both client and server.
    I think im wrong in that part.
    thanks a lot

  • Communication between two jvm (client and server)

    Hi ,
       I want to access the UME service of the SAP J2EE Container using a stanalone client application.
    So the client would be running on remote JVM.
    Here we use the JNDI service to communicate between the client and server.
    p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
                        p.put(Context.PROVIDER_URL, providerURL.trim());
                        p.put(Context.SECURITY_PRINCIPAL, securityPrinciple.trim());
                        p.put(Context.SECURITY_CREDENTIALS, securityCredentials.trim());
                        Context ctx = (Context) new InitialContext(p);
                        Object objRef = ctx.lookup(ejbName.trim());
    I want to know that is the communication between the client and server secured in this scenario
    Best Regards
    Manoj

    Okay, the client and server VMs are different implementations of the Hotspot engine. Hotspot basically takes the Java bytecode from your .class files and turns it into native machine instructions at runtime. (The optimizations are actually much more complex than that, but that's the basic concept.)
    The client VM is so named because it's designed to be used for GUI-type applications interacting with the user. It is designed to have a quicker startup and smaller memory footprint.
    The server VM uses more memory and is typically slower at starting up than the client VM, but can often perform ridiculously fast. This of course depends completely on the particular code being run, and you should probably profile and see which VM works better for your application.
    Some interesting optimizations are performed by the 1.4.1 server VM, such as: removal of array-bounds checks (when it determines that the index can't become out of bounds), inlining of methods, and more.
    Here is a link to more info if you're interested:
    http://java.sun.com/products/hotspot/docs/whitepaper/Java_HotSpot_WP_Final_4_30_01.html

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

  • How to run a datagram socket client and server program

    hi,
    I am new to socket programming. I am following the tutorial of sun for socket programming...The link is
    http://java.sun.com/docs/books/tutorial/networking/datagrams/clientServer.html
    I have understood the concept, but the problem is i cannot run the program. I am using netbeans and i have created a package and stored the files QuoteServer,QuoteServerThread, QuoteClient in this package. How can i make the server program run first and then client program in netbeans
    kindly help me
    Thankyou

    I think you are trying to run both server and client
    on one machine!!!
    It is impossible, your server is blocking the port to
    send packets, so you must run client on another
    computer!!!It's not impossible to run a client and server on the same machine just for testing or as a demo. Just have the server listen on one port and the client use a different port.
    No need to use 2 seperate computers. I've done it one computer before without a problem.
    Nick

  • JSSE  Client and server communication problem .err:untrusted server cert

    Hai all,
    I am trying to communicate JSSE client and server.
    I have created root.cert(CA),root.key,server.cert,server.key , client.cert and client.key. All these certificates are created using openssl.
    I have placed root.cert in default keystore cacerts.
    I have created a keystores(server & client) name mykeystore.
    I have placed root.cert and client.cert in the client keystore.
    I have placed root.cert and server.cert in the server keystore.
    But during the run time i am getting javax.net.ssl.SSLException: untrusted server cert chain.
    please suggest the modifications needs to be done to fix the error.
    please tell me In the client keystore and in the server keystore....what certificates we need to put?
    whether my approach as said above is correct or not?
    In java code how to specify this particular certificate we are referring?
    I have coded in this way ....
    SSLContext ctx;
    KeyManagerFactory kmf;
    KeyStore ks;
    char[] prasad = "prasad".toCharArray();
    ctx = SSLContext.getInstance("SSLv3");
    kmf = KeyManagerFactory.getInstance("SunX509");
    ks = KeyStore.getInstance("jks");
    ks.load(new FileInputStream("mykeystore"), prasad);
    kmf.init(ks, prasad);
    ctx.init(kmf.getKeyManagers(), null, null);
    factory = ctx.getSocketFactory();
    But my doubt is we are specifying only keystore name with that how it will check root.cert(ca) and client.cert and server.cert?
    Is there any modifications need in my code?
    Please tell me some way ...
    Thanks ,
    Prasad.

    Hi prasad,
    There will be a problem with the certificates being received from thr remote server or client. Check that your trust store contains the certificate of the remote machine or the CA that signed it and that the certificate has not expired.
    Also be sure that both machines are using the latest version of the JSSE.
    Hope this will help you.
    Regards,
    Anil.
    Technical Support Engineer.

Maybe you are looking for

  • Error While executing the Standard Program RSEINB00

    Hi, I am trying to execute the Standard Program RSEINB00. The input parameters for this program are 1. File path along with name 2. Port. File path I am giving the application server directory along with the filename. For port. i have created a port

  • How to add signature "sent via blackberry​" on facebook posts from BlackBerry q5?

    I have a problem with the signature. Whenever I post, or update my status from my BlackBerry q5, it doesn't show "sent from BlackBerry ". Please help.

  • Export to PDF feature

    Hi All, How to add a link like "Export to PDF" in the context menu for KM documents and on click of that , the document will be exported as a PDF? Regards, Smita

  • ITunes/iPod displays album tracks out of order

    I have this weird problem where one of my albums has three tracks that display out of order. http://i55.tinypic.com/mtwf0x.png I can't think of anything in the tags that would cause this. They're all identical in terms of album/artist/# of tracks...

  • Header image overlapping menu div tag...

    Hi, I have decided to play some more with Dreamwaver, and started to build a website in it. So far everything went smooth, but I have to place the menu buttons over the header image (which is the background for my buttons in the same time) and notice