Facing error in creating ObjectInput/output stream socket

hi I am Jatandar and i am implemeint client server program which will be using object Input/Output stream to pass data through sockets . The problem is the i m getting error when the cleint connects to the server here is the server and client code , YOur help will be appreciated
Inventory class with serializable has been implemented
public class Client
public static void main( String [] args )//throws IOException
Inventory invt[];
try
Socket serv = new Socket( "localhost", 8000 );
// connect to server at port 8000
          ObjectInputStream ois ;     
ois= new ObjectInputStream(serv.getInputStream());
invt=(Inventory[]) ois.readObject() ;
System.out.println(invt[0]);
catch(IOException e )
System.out.println(" no server Found \n");
catch(Exception e)
System.out.println(e);
public class A3Server
     public static void main(String arg[] ) throws IOException
          //create a Server Socet
          ServerSocket ss= new ServerSocket(8000) ;
          ObjectOutputStream oos;
          //create a clent Socker that will listen for connection
          //listen for the connection from client
          BufferedReader br=null;
          FileReader fr=null;
          LinkedList ll=new LinkedList();
          StringTokenizer stkr;
          int i=0;
          Inventory inv=new Inventory();
          Inventory invt[];
          String t[]=new String[5];
          boolean choice=true;
          String temp="",temp2;
// i am reading a text which contain data
//that data is stored in invt []
//that array is transfered to clien t when it is connected
     Socket toClient= ss.accept();
oos = new ObjectOutputStream(toClient.getOutputStream());
oos.writeObject(invt );
     oos.close();     
          }// end of main fucniton
     }//end of Server class
DETAIL OF ERROR
error in natived socket write method

hi I am Jatandar and i am implemeint client server program which will be using object Input/Output stream to pass data through sockets . The problem is the i m getting error when the cleint connects to the server here is the server and client code , YOur help will be appreciated
Inventory class with serializable has been implemented
public class Client
public static void main( String [] args )//throws IOException
Inventory invt[];
try
Socket serv = new Socket( "localhost", 8000 );
// connect to server at port 8000
          ObjectInputStream ois ;     
ois= new ObjectInputStream(serv.getInputStream());
invt=(Inventory[]) ois.readObject() ;
System.out.println(invt[0]);
catch(IOException e )
System.out.println(" no server Found \n");
catch(Exception e)
System.out.println(e);
public class A3Server
     public static void main(String arg[] ) throws IOException
          //create a Server Socet
          ServerSocket ss= new ServerSocket(8000) ;
          ObjectOutputStream oos;
          //create a clent Socker that will listen for connection
          //listen for the connection from client
          BufferedReader br=null;
          FileReader fr=null;
          LinkedList ll=new LinkedList();
          StringTokenizer stkr;
          int i=0;
          Inventory inv=new Inventory();
          Inventory invt[];
          String t[]=new String[5];
          boolean choice=true;
          String temp="",temp2;
// i am reading a text which contain data
//that data is stored in invt []
//that array is transfered to clien t when it is connected
     Socket toClient= ss.accept();
oos = new ObjectOutputStream(toClient.getOutputStream());
oos.writeObject(invt );
     oos.close();     
          }// end of main fucniton
     }//end of Server class
DETAIL OF ERROR
error in natived socket write method

Similar Messages

  • Facing error while creating PerformancePoint Dashboard in SharePoint 2013?

    Hi All,
    I am not able to create Performance Point Dashboard site in SharePoint 2013, while creating facing this error:
    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however,
    be viewed by browsers running on the local server machine.
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application.
    This <customErrors> tag should then have its "mode" attribute set to "Off".
    <!-- Web.Config Configuration File -->
    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>
    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
    <!-- Web.Config Configuration File -->
    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>
    How to fix this issue?
    Thanks in advance

    Hi Sam,
    Please modify your web.config file to show error details in SharePoint as below:
    Set customErrors mode to Off
    Set SafeMode CallStack to true
    Set compilation debug to true
    For more information:
    http://www.keremozen.com/2012/04/08/how-to-show-error-details-in-sharepoint/
    http://www.ashokraja.me/post/Display-Stack-Trace-in-Sharepoint-2010.aspx
    After modification, check the detail error message.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • URGENT!! ObjectInput/Output stream

    guys help me please,
    i am writting a client/server application, and i want to send an object from the client to the server and send it back to the client. but see, when i run the program its gives
    java.io.StreamCorruptedException:invalid stream header
    my code is something like this:
    BufferedReader br;
    BufferedWriter bw;
    ObjectOutputStream oos;
    ObjectInputStream ois;
    OutputStream ou;
    InputStream iu;
    Color color = JColorChooser.showDialog(
    ClientGUIT.this, "Choose a color", color );
    if ( color == null )
    color = Color.LIGHT_GRAY;
    try{
    soc = new Socket( InetAddress.getByName( chatServer ), 1241);
    br = new BufferedReader(new InputStreamReader(soc.getInputStream()));
    bw = new BufferedWriter(new OutputStreamWriter(soc.getOutputStream()));
    ou = soc.getOutputStream();
    iu = soc.getInputStream();
    oos = new ObjectOutputStream(ou);
    ois = new ObjectInputStream(iu);
    oos.writeObject(color);
    oos.flush();
    oos.close();
    }catch(IOException e){addToTranscript("Error: " + e.toString());}
    please can any one tell me how i can write this object into the socket without getting any exceptions.
    Thanks in advance

    ois = new ObjectInputStream(iu);The stream parameter in the constructor of the class ObjectInputStream should be the one that was written with ObjectOutputStream.

  • ObjectInput-Output Stream problem ?

    I have a server-client program and I am sending my data on OutputStream()
                input = new InputStream(mydataSocket.getInputStream()) ;
                output = new OutputStream(mydataSocket.getOutputStream()) ;
                objInput = new ObjectInputStream(input) ;
                objOutput = new ObjectOutputStream(output) ;but I am taking an error.
    Implement all abstract method() ;
    is this read() method necessary ?

    Server
        protected void runServer() throws IOException
            ServerSocket serSock = null ;
            Socket sock ;
            ObjectOutputStream output ;
            ObjectInputStream input ;
            String line ;
            ArrayList<String> al = new ArrayList<String>() ;
            try {
                serSock = new ServerSocket(5000,100) ;
                while (true)
                    sock = serSock.accept() ;
                    input = new ObjectInputStream(sock.getInputStream()) ;
                    output = new ObjectOutputStream(sock.getOutputStream()) ;
                        line = input.readUTF() ;
                        al.add(line) ;
                    try {
                            for ( int j = 0 ; j < al.size() ; j++ )
                                oyuncu_listesi += al.get(j) + "," ;
                                output.writeUTF(al.get(j)) ;
                    } catch (IOException e) {
                        System.err.println(e) ;
                        e.printStackTrace();
                        System.exit(1);
                    sock.close() ;
           } catch(IOException e) {
                System.out.println(e) ;
            finally {
                serSock.close() ;
        }Client
        protected void baglan() throws IOException
                Socket client ;
                ObjectInputStream input ;
                ObjectOutputStream output ;
                String line , deger ;
                try {
                    client = new Socket(InetAddress.getLocalHost() ,5000) ;
                    input = new ObjectInputStream(client.getInputStream()) ;
                    output = new ObjectOutputStream(client.getOutputStream()) ;
                        deger = girdi.getText() ;
                        output.writeUTF(deger) ;
                        output.flush() ;
                    while ( true ) {
                            line = input.readUTF() ;
                            liste.addElement(line + "\n") ;
                } catch (IOException e) {
                    System.out.println(e) ;
        }

  • Facing error while creating CR in customer master MDG.

    Can anyone plz help me out.I am not able to create a customer in customer master MDG after activation of 0MDG_ANLY_CR_PROCESS BI component in BSANLY_BI_ACTIVATION Tcode.Becoz my activation was completed by error.So plz see the attaachment and help me out.
    Thanks In advance.

    Drear Rath,
    it is the problem with either role or you have not assing the target UI ,Please check on that side.

  • Facing error in creating a provisioning gold image

    Hi All,
    I want to create one middleware gold image for a middleware home in OEM 12c Cloud Control using Provisiong and patching feature. I have set up one software library. Now while creating a middleware gold image in the subsequent steps I am getting the following error my gold image is not getting created.
    The command "/home/orasoaapp/Oracle/Middleware/utils/clone/clone.sh" was not run successfully. The possible causes are:
    1. All the WebLogic product directories (like WebLogic Server, Coherence) were not installed inside this Middleware home.
    2. In case of Windows, some Java or WebLogic processes were running from this Middleware home.
    mine is linux operating system.
    Can anyone tell me what could be the issue??
    Thanks in Advance!!

    Can you provide some more details on how are you creating your Gold image? Are you creating it from a WLS domain menu?
    Can you also explain the topology of your WLS domain as in how many servers/clusters/number of hosts participating etc?
    Also, what version of OEM are you on? is it 12.1.0.2.0?

  • Facing error while creating report in OEM 12c Cloud Control

    Hi All,
    I want to create a report in OEM 12c Cloud Control in Information Publisher. I have select element as "Table from SQL" and want to select data from "gc$metric_values_latest" view. But when I am writing a sql statement like..
    select * from gc$metric_values_latest
    Then on execution I am getting the following error "Error rendering element. Exception: ORA-00942: table or view does not exist "
    What can be the issue for this. Please suggest..
    Thanks in Advacnce!!!

    Is this mean that we can not fetch data from gc$metric_values_latest view or we need to do some configuration in order to fetch information from this view. Because I am able to fetch from views like mgmt$metric_current or mgmt$metric_history
    So what can be the probable cause of not getting access to gc$metric_values view

  • Error when creating desktop within streamed portal

    Hi.
    When creating a desktop from a file-based desktop (.portal) the following error was raised:
    "An exception occurred: com.bea.netuix.application.transform.disassembler.XmlDisassemblerException:
    The pinc file :: /folderA/folderB/pageC.page :: has no book or page element defined.
    caused by : com.bea.netuix.application.transform.disassembler.XmlDisassemblerException: The pinc file :: /folderA/folderB/pageC.page :: has no book or page element defined."
    Does this error message make any sense?
    What should be done?
    Att.
    Eduardo

    Thanks for the advice, George.
    But in fact, the problem was that bookC.book (which includes pageC.page) was manually edited through "Open With -> XML Editor" context menu
    and accidentally the *<netuix:pageContent>* tag was used instead of *&lt;netuix:bookContent&gt;* tag.
    It was probably a copy-and-paste error.

  • Unrecognized Windows Sockets error: 10106: create

    Am getting the following error when I use tcp-mon to sniff the HTTP traffic. Same when I use SOAP-UI.
    I'm using windows 7 and using "jdk1.6.0_13". Any help on this pls .
    java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
    at java.net.Socket.createImpl(Socket.java:388)
    at java.net.Socket.<init>(Socket.java:362)
    at java.net.Socket.<init>(Socket.java:180)
    at org.apache.ws.commons.tcpmon.SocketWaiter.halt(SocketWaiter.java:98)
    at org.apache.ws.commons.tcpmon.Listener.stop(Listener.java:543)
    at org.apache.ws.commons.tcpmon.SocketWaiter.run(SocketWaiter.java:87)

    Winsock error 10106. 8 seconds in Google. Looks like something wrong with your operating system installation.

  • Error while creating a Development plan template

    Hi Gurus,
    I am facing errors  while creating Development Plan Template.
    This is how it goes :
    When i click on Define Forms for Talent Assessment --> a wizard pops up & i select Development Plan :
    In first step, I am giving Title,Integration with SAP Learning Solution (check) & a rating scale.
    Now after clicking next, I am adding 2 development areas :
    1) Training
    2) Mentoring,
    now as soon as I'm clicking on End Configuration, It displays 2 errors & 1 warning message :
    error1 : Element Appraisal Template 'XXXXX' contains errors.Cannot change status.
    error2 : Value type 000000XXX of value class Q does not exists
    Warning 1 : You have maintained a description that is not displayed.
    In PHAP_CATALOG, when I'm trying to manually release the Criterion Group (VB) or Appraisal template (VA), it does not allow me to do it.
    Kindly let me know how to proceed further.
    Regards
    bharti

    Hi,
    Even though it gives the error,the new RTF template is uploaded and it is reflected when I query the template again.
    But when I run the Concurent program and see the output,the output still shows me the old template.
    Regards
    Jujaar

  • Error while creating BOM

    Hi
    iam facing error while creating, changing and display BOM.
    Error: Status MHCO of the user interface SAPLCSDI missing.
    rgads

    Dear,
    MHCO - BOM item screen GUI status..Are you using any Alternative item?
    Have you applied any new patch in the system?
    Contact ABAPer, can give more details
    In SAP service place serach for this interface program,,,you will get many notes on this.

  • Error while creating OLAP connection in IDT

    Hi friends,
    I am facing error while creating OLAP connection in IDT (BO 4.1 sp2)
    I am using sql server 2012.In the screen shots you can observe server name and user name of the Sql server
    I am creating OLAP connection to connect CUBE
    Check the screen shots for the error
    Plz help me
    Here you can see the server name and user name
    While creating OLAP connection I gave these credentials
    This is the error I am getting

    Hi..
    To create connection and access the BW data, developer must have the password. and while create connection using Authentication Mode: Single Sign On, need to loin the username has pattern <SID~client/SAP userid>,
    User Name: SID~client/SAP userid
    Password for the SID,
    Authentication as SAP.
    Plese find the below link for more info: http://scn.sap.com/community/semantic-layer/blog/2014/06/19/pre-requisite-authorizations-in-sap-bw-side-before-develop-the-universe

  • Error while create sales order

    Hi,
    Please help.
    I am facing error while create sales order.
    No item category available (Table T184 OR VERP  )
    Message no. V1320
    Diagnosis
    No item category could be determined for the combination OR VERP .
    System Response
    The system does not allow further processing of this item.
    Procedure
    Check the entries in table T184 by means of which item category determination is controlled.
    If you do not have the authorization to do this yourself, contact your system administrator.

    Hi,
    Check in spro whether Item categorygroup VERP is assigned to sales document type.if not assign.
    Path
    SPRO-SD-sales-sales douments-sales document item-assign item categories.

  • Error in creating workspace

    HI,
    I have installed 10g and applied the patch p4163362_10104_WINNT. I am using AWM 10.1.0.4.
    I had imported the Global schema and tring to creating the workspace "GLOBAL" as per the give document. I am facing error while creating Workspace.
    Kindly help..!
    Thanks
    siva

    Please specify which error you are seeing and when.
    Aneel Shenker
    Senior Product Manager
    Oracle Business Intelligence

  • Store Output Stream into String

    Hello
    I want to store my out put stream in to string so that i can use it latter.
    out.println("Nilesh patel");
    out.println("[email protected]");
    out.println("Ahmedabad");
    it is "Nilesh patel [email protected] Ahmedabad" but i want to store into string like
    String tmp = out.toString();
    it is return the hash code of out object how can i store this value in String variable?

    To me, the most elegant way to do this would be with a Servlet Filter.
    You use a ResponseWrapper to create a "BufferedResponse" object, and pass that down to the next JSP/Servlet. Basically you have to override methods such as getWriter(), getOutputStream()...
    The JSP/servlet works as normal, but any calls to out.println() can be under your control.
    This simple class might help:
    public class RedirectingServletResponse extends HttpServletResponseWrapper {
        RedirectServletStream out;
         * @param arg0
        public RedirectingServletResponse(HttpServletResponse response, OutputStream out) {
            super(response);
            this.out = new RedirectServletStream(out);
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#flushBuffer()
        public void flushBuffer() throws IOException {
            out.flush();
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#getOutputStream()
        public ServletOutputStream getOutputStream() throws IOException {
            return out;
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#getWriter()
        public PrintWriter getWriter() throws IOException {
            return new PrintWriter(out);
        private static class RedirectServletStream extends ServletOutputStream {
            OutputStream out;
            RedirectServletStream(OutputStream out) {
                this.out = out;
            public void write(int param) throws java.io.IOException {
                out.write(param);
    }You then use it something like this:
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
      // create an output stream - to file, to memory...
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      // create the "dummy" response object
      RedirectingServletResponse dummyResponse = new RedirectingServletResponse(response, out);
      // pass it on to the next level:
      chain.doFilter(request, dummyResponse);
      // at this point the OutputStream has had the response written into it.
      byte[] result = out.getByteArray();
      // now you can do with it what you will.
    }There is probably a better way - providing response that will write any output to two output streams - the original and an alternative one (file) would be a good option.
    Hope this helps,
    evnafets

Maybe you are looking for

  • How do I change the phone number linked to one of my contacts?

    We want to FaceTime my mother in law but under her contact her work number is listed as the FaceTime phone number. I need to change that to either her mobile or her email address. How do I do that?

  • Can't connect to Mac Pro from Macbook Pro on finder

    Hi there was wondering if someone can help me out with this? I used to be able to connect through the side panel on the finder with my macbook to my mac pro and vice versa.  I had not used this function in a few months and tried the other day and it

  • Custom Template Questions...

    I guess i should explain what we are creating first... this is our first "full length" dvd project. It is entirely in native 16:9 3CCD SD. the main title page will have 4 "titles": main feature, instruction, extras, disclaimer/credits. the instructio

  • My graphics freak out! - watch a video and tell me what's wrong

    So I really don't want to cart my very heavy Mac Pro into the Apple store if I can avoid it. I especially can't afford to be w/o it if it has to be shipped away for repair. Here's the deal. After using Premiere Pro for varying lengths of time, my gra

  • Hp photosmart C7280 says "stopped" in print queue and won't print!

    I just bought an hp photosmart C7280 today. It was a pretty simple setup with the actual printer and network and all. i download the updated driver from the hp website and all seemed kosher there too. now i click "print" and on the print queue page i