Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Please help with "cannot find symbol" error

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Please help with "cannot find symbol" error

    Hi, i wrote this code, but when i running program, there's error : "cannot find symbol method getInputStream()"

    Please help me..

    package Server;
    import java.net.*;
    import java.io.ObjectInputStream;
    import java.net.Socket;
    /**
    *
    * @author Owner
    */
    public class ObjectServer {
    private static int PORT = 5000;
    private static ObjectInputStream in=null;

    public static void main(String[] args) throws Exception {

    ServerSocket serverSocket = null;
    try {
    Servsocket socketsv = new Servsocket(PORT);
    Socket socket = socketsv.accept();
    serverSocket = new ServerSocket(PORT);

    in = new ObjectInputStream(serverSocket.getInputStream());
    Message messageObject = (Message) in.readObject();
    String messageText = messageObject.getText();
    }
    catch(Exception e) {
    e.printStackTrace();
    System.out.println("Error occured while creating the server socket");
    return;
    }

    Socket socket = null;
    try {
    socket = serverSocket.accept();
    } catch (Exception e) {
    System.out.println("Error occured while creating the server socket");
    return;
    }

    } }
    Last edited by Kartika Wahyu I; May 12th, 2014 at 05:18 AM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default re: Please help with "cannot find symbol" error

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    Please post your code correctly per the above link, AND give your threads better titles.

  3. The Following User Says Thank You to GregBrannon For This Useful Post:

    Kartika Wahyu I (May 12th, 2014)

Similar Threads

  1. Error:Cannot find Symbol
    By Leonardo1143 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 13th, 2013, 06:40 PM
  2. [SOLVED] cannot find symbol error
    By Topflyt in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 5th, 2011, 08:57 AM
  3. error :cannot find symbol
    By iswan in forum AWT / Java Swing
    Replies: 1
    Last Post: October 1st, 2011, 08:26 AM
  4. Cannot find symbol error
    By AnuR in forum What's Wrong With My Code?
    Replies: 9
    Last Post: February 23rd, 2011, 02:50 PM
  5. cannot find symbol Error
    By bananasplitkids in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 9th, 2010, 02:36 AM