Please help it's objects again

here is a section of the code below:
//--- attributes --------------------------------------
// set up some topical films
Film uweFilm1 = new Film ("Bambi 2", "U", 120, "Bambi's Return");
Film uweFilm2 = new Film ("Italian Job 2", "PG", 150, "US remake");
Film uweFilm3 = new Film ("Calendar Girls", "PG", 120, "WI goes topless");
// set up some screens in the cinema
Screen uweScreen1 = new Screen (1, 50);
Screen uweScreen2 = new Screen (2, 100);
Screen uweScreen3 = new Screen (3, 150);
// set up some date information
private static Date now = new Date( );
private static final long NOW = now.getTime( );
private static final long THREEHOURS = 3 * 60 * 60 * 1000; // in milliseconds
private static final long THREEHOURSLATER = NOW + THREEHOURS;
private static final long SIXHOURSLATER = THREEHOURSLATER + THREEHOURS;
Showing uweShowing1 = new Showing (NOW, uweScreen1, uweFilm1);
The uweShowing1 object will not get created, the following error message appears :
UweFlixCinema.java:25: cannot resolve symbol
symbol : constructor Showing (long,Screen,Film)
location: class Showing
Showing uweShowing1 = new Showing (NOW, uweScreen1, uweFilm1);
^
1 error
can anyone help?

You keep putting dukes on threads, but never assigning them to anyone...
http://forum.java.sun.com/thread.jsp?thread=473502&forum=54
http://forum.java.sun.com/thread.jsp?thread=474087&forum=54
http://forum.java.sun.com/thread.jsp?thread=474562&forum=54
http://forum.java.sun.com/thread.jsp?forum=54&thread=473493

Similar Messages

  • Ebay states "This Connection Is Untrusted" and has done for a long time - please help me use ebay again!

    For a long time now, every time I've tried to log in to ebay (I can get into ebay, but I cannot log into my account, etc) or Paypal (I cannot even access this site), I get an error message stating that "the connection is untrusted" "You have asked Firefox to connect securely to signin.ebay.com, but we can't confirm that your connection is secure".- I've tried the standard solution i.e. resetting the time and date on my computer, but still this does not work.
    Please help as this is severely restricting the use on my computer - and it's frustrating as hell!
    Many thanks

    Try to rename the cert8.db file in the Firefox profile folder to cert8.db.old or delete the cert8.db file to remove intermediate certificates that Firefox has stored.
    If that helped to solve the problem then you can remove the renamed cert8.db.old file.<br />
    Otherwise you can rename (or copy) the cert8.db.old file to cert8.db to restore the previous intermediate certificates.<br />
    Firefox will automatically store intermediate certificates when you visit websites that send such a certificate.
    If that didn't help then remove or rename secmod.db (secmod.db.old) as well.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Please help with geometric objects in ARRAY...........

    I am facing a programming issue here;
    I am supposed to create an array of circle objects of random dimensions.
    Next, I am supposed to check each circle and make sure it does not intersect with any other circle in the array. If it does, I am expected to remove the circles that intersect with it from the array. I have found this technique more feasible, but in the question, it is suggested to check for intersection before the circle is added to the array. To quote "Check that the new circle does not intersect a previous one. You will need to iterate through the array list and verify that the current circle does not intersect with a circle in the array list. Add the circle to the array list if it does not intersect with another one." For some reason, I think my approach is more feasible. But feel free to differ.
    Then, I am supposed to draw the circles.
    The program compiles but when it is run, only one circle is drawn.
    Any advice would be appreciated, and as before thank you in advance.
    import java.util.Random;
    import java.awt.geom.Ellipse2D;
    import javax.swing.JComponent;
    import java.util.ArrayList;
    import java.awt.Graphics2D;
    import java.awt.Graphics;
    public class CirclesComponent extends JComponent
    public CirclesComponent(int numberCircles)
          NCIRCLES = numberCircles;
          circles = new ArrayList<Ellipse2D.Double>();
          final int XRANGE = 292;
          final int YRANGE = 392;
          final int RRANGE = 20;
             generator = new Random();
             double x = generator.nextInt(XRANGE) + 1;
             double y = generator.nextInt(YRANGE) + 1;
             double r = generator.nextInt(RRANGE) + 1;
             double w = 2 * r;
             double h = 2 * r;
             for (int i = 1; i <= NCIRCLES; i++)
             Ellipse2D anEllipse = new Ellipse2D.Double(x, y, w, h);
             circles.add(anEllipse);
          Test if two circles intersect.
          (distance between centers is less than sum of radii)
    public void circlesIntersect()
              Ellipse2D zeroEllipse = (Ellipse2D)circles.get(0);
               for (int v = 1; v <= circles.size(); v++)
                   Ellipse2D anotherEllipse = (Ellipse2D)circles.get(v);
                         double radius1 = zeroEllipse.getWidth() / 2;
                         double radius2 = anotherEllipse.getWidth() / 2;
                         double dx = zeroEllipse.getX() + radius1 - anotherEllipse.getX() - radius2;
                         double dy = zeroEllipse.getY() + radius1 - anotherEllipse.getY() - radius2;
                         double distance = Math.sqrt(dx * dx + dy * dy);
                         if (distance < radius1 + radius2)
                         circles.remove(v);
       public void paintComponent(Graphics g)
          Graphics2D g2 = (Graphics2D) g;
          for (int z = 0; z < circles.size(); z++) // iterate through every circle in the list
          g2.draw((Ellipse2D)circles.get(z)); // draw the circle
       public void getRejection()
           System.out.println("The percentage of rejected circles is " + ((circles.size() / NCIRCLES ) * 100));
           System.out.println("The size of the array is " + (circles.size()));
       private int NCIRCLES; 
       private ArrayList circles;
       private Random generator;
    import java.util.Scanner;
    import java.awt.Graphics2D;
    import java.awt.Graphics;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    public class CirclesTester
    public static void main(String[] args)
          Scanner thescanner = new Scanner(System.in);
          System.out.print("How many circles do you want? ");
          int totalCircles = thescanner.nextInt();
          CirclesComponent theCircle = new CirclesComponent(totalCircles);
          theCircle.getRejection();
          JFrame frame = new JFrame();
          frame.setSize(300, 400);
          frame.setTitle("Non-Intersecting Circles");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.add(theCircle);
          frame.setVisible(true);
    }

    homebrewed wrote:
    I am supposed to create an array of circle objects of random dimensions.
    Next, I am supposed to check each circle and make sure it does not intersect with any other circle in the array. If it does, I am expected to remove the circles that intersect with it from the array. I have found this technique more feasible, but in the question, it is suggested to check for intersection before the circle is added to the array. To quote "Check that the new circle does not intersect a previous one. You will need to iterate through the array list and verify that the current circle does not intersect with a circle in the array list. Add the circle to the array list if it does not intersect with another one." For some reason, I think my approach is more feasible. But feel free to differ.Gladly. It is much simpler to iterate over a List and check if the new circle is valid than to iterate over a List and remove those circles that make the new circle invalid. Note that the code you have now will skip items in the list when a circle is removed.
    Then, I am supposed to draw the circles.
    The program compiles but when it is run, only one circle is drawn. And why is that? Is it only drawing one of the circles? Is it drawing all the circles but they're all the same circle? Does your list only contain one circle?
    You need to run your program in a debugger or add println() statements to output your program state at important points along the execution path.
    Once you figure out why you're only getting one circle, it becomes much simpler to figure out how it happened.

  • Experts please help me (structure incompatible again but in diff style)

    Hi experts,
    while upgrading i am getting this error
    plz help in solving it
    thanx in advance.
    ERROR COMING IN THIS LINE :
    PERFORM select_costs_by_table_for_rev TABLES r_kstar
                                                   t_cost
                                     USING 'COSS'.
    ERROR IS :
    "T_COST" cannot be converted to the line incompatible. The line type          
    must have the same structure layout as "T_COST" regardless of the          
    length of a Unicode . Unicode character. Unicode character.          
    FYI::
    t_cost     TYPE type_t_cost OCCURS 0 WITH HEADER LINE
    t_cost_rev TYPE type_t_cost_rev OCCURS 0 WITH HEADER LINE,
    TYPES: BEGIN OF type_t_cost,
            objnr    LIKE coss-objnr,
            gjahr    LIKE coss-gjahr,                  
            wog001   LIKE coep-wogbtr,
            wog002   LIKE coep-wogbtr,
                   END OF type_t_cost.
    TYPES: BEGIN OF type_t_cost_rev,
            objnr    LIKE coss-objnr,
            gjahr    LIKE coss-gjahr,
            kstar    LIKE coss-kstar,                          
            wog001   LIKE coep-wogbtr,
            wog002   LIKE coep-wogbtr,
                   END OF type_t_cost_rev.

    yes
    i guess the prblen is in this part
    FORM select_costs_by_kstar_for_rev TABLES   r_kstar STRUCTURE r_kstar
                                                t_cost  STRUCTURE t_cost_rev
    Load costs from internal postings
      PERFORM select_costs_by_table_for_rev TABLES r_kstar
                                                   t_cost
                                     USING 'COSS'.
      PERFORM select_costs_by_table_for_rev TABLES r_kstar
                                                   t_cost
                                     USING 'COSSP'.
    Load costs from external postings
      PERFORM select_costs_by_table_for_rev TABLES r_kstar
                                                   t_cost
                                     USING 'COSP'.
      PERFORM select_costs_by_table_for_rev TABLES r_kstar
                                                   t_cost
                                     USING 'COSPP'.
      SORT t_cost ASCENDING BY objnr gjahr.
    ENDFORM.                    " select_costs_by_kstar_for_rev

  • Someone please help creating comparable objects

    I have been given a second part to an assignement that wants me to create a program for comparing student obejects. The assignment description and code are below. I can' t see how the find to method interlocks with the findsmallest because find smallest is already finding the smallest value. I also don't see where the new diffinitions for UMUC_Comparable goes.
    In the second part of this project, you will also find the smallest element in the array, but now the array will be of UMUC_Comparable objects. It will use the compareTo method to compare objects to find the smallest one. This method will also have the name findSmallest, but will take an array of UMUC_Comparable objects. This findSmallest method will have a definition as follows:
    UMUC_Comparable findSmallest(UMUC_Comparable[] array);
    The findSmallest method will use the compareTo method in the UMUC_Comparable interface. You will be using it with the Student objects from module V, section III, so you do not have to rewrite the compareTo method; you can simply use the one defined in the Student object in module V.
    For the second part of this project, you should:
    Create a main that creates an array of Student objects, as in section III of module V. You can use the same array as defined module V. You do not have to read these objects in from a file.
    Call the findSmallest method to find the smallest Student object.
    Use the getName and getAverage methods in the Student object to print out the smallest object.
    Note that the return from the method is a UMUC_Comparable object, not a Student object, so you must cast the returned object to a Student object before printing it out. You can do so as follows:
    Student[] students ....; // Fill in the declaration // of the student array.
    Student s = (Student)findSmallest(UMUC_Comparable[] array);
    /* File: Student.java
    * Author: Darrell Clark
    * Date: December 3, 2006
    * Purpose: Shows how to find the smallest Int value in an array
    import java.util.*;
    import java.io.*;
    public class Student {
    private int average;
    private String name;
    /* public constructor. Note that because no default
    * constructor exists, Student objects will always
    * be constructed with a name and an average.
    public Student(String name, int average) {
    this.average = average;
    this.name = name;
    } // end method
    * return name
    public String getName() {
    return name;
    } // end method
    * return average
    public int getAverage() {
    return average;
    } // end method
    * compare to method for locating smallest value
         public static int findSmallest(int[] array) {
              int min = Integer.MAX_VALUE;
              for (int i = 1; i < (array.length); i++) {
                   if (array[i] < min)
                        min = array;
              return min;
    * compare student value
    public int compareTo(Student student) {
    return (this.average - student.average);
    } // end method
         public static void main(String[] args) {
    Student[] studentArray = { new Student("Tom", 87),
    new Student("Cindy", 100),
    new Student("Pat", 75),
    new Student("Anne", 92),
    new Student("Matt", 82)};
    for (int i = 0; i < studentArray.length; i++) {
    System.out.println(studentArray[i].name + " " +
    studentArray[i].average);
    } // end for
    } // end method
    } // end class

    Were you given the UMUC_Comparable interface, or do you have to write it?
    (1) In the latter case, that is where to start. It includes the method
    compareTo(UMUC_Comparable). This will almost certainly return an
    int - check out the API documentatuon for the Comparable interface.
    (2) What I think the assignment is asking you to do is rewrite the Student
    class so that it implements UMUC_Comparable.
    Then you write the findSmallest(UMUC_Comparable[]) method. There is
    already a static method like this in the (existing) Student class. It's anybody's
    guess where this method is supposed to go - perhaps you could ask
    whoever gave you the assignment. The problem is that it can't go in
    UMUC_Comparable because that's an interface. And it doesn't really belong
    in Student because it is a sort of utility function that deals with any
    UNUC_Comparable array.
    (3) Let's assume that findSmallest(UMUC_Comparable[]) goes in the
    Student class. So you replace the existing findSmallest() with the new one.
    The new one goes through the array using the UMUC_Comparable's
    compareTo() method to find the smallest UMUC_Comparable.
    (4) Finally in main() you create a test array, use the newly rewritten
    findSmallest() to find the smallest Student, and print their name and
    average.

  • PLEASE HELP! My objects have no stroke/fill unless in publish preview. I can't see what I am doing?

    I have CS6 Flash Professional, Windows 7 Professional, File I am trying to make is an ActionScript 2. I have to use ActionScript 2 for it because it is a school project.  I can click the oval tool, set the stroke size to 2.0 stroke to black, fill to pink and drag to create the oval on the stage. while i am dragging, and when i finish dragging it is still just a thin green outline of an oval. No fill, no thickness to the stroke, and the only color it will be is green. When i click publish preview and load a preview for flash the pop up box shows the oval with 2.00 stroke size, black stroke, and pink fill.
    It seems like no matter what I try to draw or make for the stage it just shows up as this green outline and wont display any of the stroke/fills that i select for them. Is this something in my settings that I need to change?
    If someone could help me out it would be really, really appreciated!!!

    You appear to have things displaying in outline mode.  There are a couple of places/ways this can happen. 
    The first, more obvious place is on the timeline.  If you look at the layer you are drawing in, at the end of the section where you name the layer you should see a small square.  That square controls the outline mode for that layer.  I cannot tell from the image you show if it is active or not, so try clicking on it to switch it between outline and not outline mode to see if that fixes things.  The color inside the square will be a solid color if it is not in outline mode.
    The second, less obvious place to look in via the top menu bar... select View -> Preview Mode -> and make sure Outlines is not selected.

  • Please help me use ipod again

    I forgot the password to my iPod touch 4g (i lost it then found it again a couple months later) I began resetting it with the home and power button reset, it displays a message that iPod is disabled and to connect to iTunes when I plug it in my computer it begins to charge but my computer does not even know it's been plugged in so I tried to plug it in to my sister's computer and it registers on her's that it has been plugged in but it is displayed as removable storage device g and when clicked it asks for me to insert a disk also will not connect to my sister's iTunes.

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings

  • I have lost my address bar!  Please help me find it again.

    I seem to have 'hidden' the address bar in Safari and cannot find it.  Anyone got any ideas?

    Open Safari. Select Customize Toolbar from the View menu. Select the Address Bar gadget and drag it to Safari's toolbar.

  • Canon IP7250 - Color won't print - Please help

    I have a Canon IP7250, two day ago, my printer showed me error C000. I resolved this error, but now my printer won't printing in colour. Black working properly. I tried many times to cleaning a toner in mainteace. When I go to "print head alignment" then shows error 2500. ? In nozzle check black colour is excellent but no other colors on paper. 
    Please, help me. 
    Thanks.

    Again, the username/password, would either be your logon username/password or your "root" username/password if you have enabled it.
    Another option would be to update your CUPS software. Multi-functional printers are usually "tricky" to get full-featured drivers for. It's possible that a newer version for this particular printer may exist with an update.
    Still another option (and possibly a better one) would be to download and install the latest Gutenprint printer drivers. These were formally known as Gimp-Print drivers. (ref: http://gimp-print.sourceforge.net/MacOSX.php3)

  • Adobe liveCycle Email: Please help!

    I am worried on how to send email on a button press to a variable recipient  i.e  the email id will be changing based on the dropdownlist selected in the form.I think we can do  it in the designer itself, but instead of ‘mailto:[email protected]’ in below code, how can I make it a variable  based on dropdown selection?
    <event activity="click">
    <submit format="pdf" textEncoding="UTF-16" xdpContent="pdf datasets xfdf" target="mailto:[email protected]"/>
    Please help me and thanks again for the support and encouragement.
    Thanks,
    Vinod.

    See the attached sample for your requirement.
    (The credits will goto Paul !)
    Nith

  • Please Help - DB13 All Jobs Are Failed

    Hello Gurus,
    My Qurey Was
    In T-Code DB-13, I created some Jobs example like checkdb, update stats, etc etc
    while running this jobs giving me this error can anybody tell me what is the rectification or what is a needful to solve this problem
    Job started
    Step 001 started (program RSDBAJOB, variant &0000000000099, user ID CSCADMIN)
    Execute logical command BRCONNECT On host bascop26
    Parameters: -u / -jid CHECK20070608095728 -c -f check
    BR0801I BRCONNECT 7.00 (11)
    BR0477I Oracle pfile /oracle/QBW/102_64/dbs/initQBW.ora created from spfile /oracle/QBW/102_64/dbs/spfileQBW.ora
    BR0280I BRCONNECT time stamp: 2007-06-08 09.57.33
    BR0301E SQL error -942 at location BrLicCheck-32
    ORA-00942: table or view does not exist
    BR0806I End of BRCONNECT processing: cdvlajpr.log2007-06-08 09.57.33
    BR0280I BRCONNECT time stamp: 2007-06-08 09.57.33
    BR0804I BRCONNECT terminated with errors
    External program terminated with exit code 3
    BRCONNECT returned error status E
    Job finished
    As Per SAP Note - Note 134592 - Importing the SAPDBA role ( sapdba_role.sql)
    I have uncar the file - sapdba_role_ora9.SAR (9i is my database)
    but in which way i am going to to execute this script in my database
    Please help ASAP

    Check the note again, it´s listed there:
    Download the SQL script for creating the SAPDBA role from the attachment to this note (for Oracle 8.1: sapdba_role_ora8, for Oracle 9.2: sapdba_role_ora9, for Oracle 10g: sapdba_role_ora10). Execute this script as follows (sapdba_role.sql in the current directory).
    Oracle 9.2:   sqlplus /nolog @sapdba_role DB
    What´s your problem?
    Markus

  • Need help filling this object please!!!

    I need to fill shape 1 with a solid color. Shape 2 is what the object looks like when selected. Shape 3 is what happens when I try to fill it with color. I need it to stay within the boundaries shown on shape 1. Please help, I'm relatively new to Illustrator and cannot seem to find out what it is that is happening. I'm working in Illustrator CC.

    jbizzle,
    However I needed to redraw the object, and instead of lines I had to use rounded rectangles to create it.
    Can you reuse the outer shape that looks like part of an ellipse?
    If you can, you can start by recreating the top one as follows (Smart Guides are your friends):
    1) Select and copy the upper/outer elliptic shape to the front (Ctrl+C+F), then lock the original full shape;
    2) With the Line Segment Tool ClickDrag between the end Anchor Points of 1) (Smart Guides say anchor when you are there), then drag over the H value in the Transform palette and Ctrl+C to copy it;
    3) Click with the Ellipse Tool on the Artboard and insert the value divided by 2 for W and H, then cut it at the top and bottom Anchor Point, then delete the right half;
    4) Move the half circle on top of the lower left half circle shape as closely as possible, then select both the half circle and the outer ellipse, click the outer ellipse again and in the Align palette click Vertical Align Bottom;
    4) Create a copy of the half circle and move it up by its height, then ShiftDrag it to fit the upper right half circle shape as closely as possible;
    Now you should have the curved parts in place, and you only need the straight parts;
    5) With the Direct Selection Tool Click each pair of Anchor Points to be connected by straight segments and Ctrl+J to join them;
    Now you should have one clean path to fill. After that, you can rotate and move a copy.

  • Class Cast problem when attempting to add Object in TreeSet, Please Help...

    hi friends,
    I have a TreeSet Object in which i add Object of type WeatherReport but when I trying to add my Second WeatherReport Object it throwing ClassCastException please Help Me in figure out the mistake that i did...
    /*code sample of my WeatherReport.class*/
    package com;
    class WeatherReport implements Serializable
    private String region;
    private String desc;
    private String temp;
    /*equvalent getter and setters come here*/
    /*in my jsp*/
    <%@ page import="com.WeatherReport"%>
    <%
    TreeSet<com.WeatherReport> ts=new TreeSet<com.WeatherReport>();
    while(condition)
    WeatherReport wp=new WeatherReport();
    /*setting data for all the Methods*/
    ts.add(wp);
    %>
    Error:
    java.lang.ClassCastException: com.WeatherReport
            at java.util.TreeMap.compare(TreeMap.java:1093)
            at java.util.TreeMap.put(TreeMap.java:465)
            at java.util.TreeSet.add(TreeSet.java:210)
            at org.apache.jsp.Weather_jsp._jspService(Weather_jsp.java:138)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)Edited by: rajaram on Oct 31, 2007 12:56 AM

    hi ChuckBing,
    Thank you very much, your suggestion helps me a lot...
    I change the WeatherReport Class as follows and its working now...
    public class WeatherReport implements Serializable,Comparable {
        private String location;
        private String temp;
        private String desc;
        public int compareTo(Object o) {
            if(o instanceof WeatherReport)
                WeatherReport wp=(WeatherReport)o;
                String l1=wp.getLocation();
                String l2=this.getLocation();
                return l2.compareTo(l1);
            return -1;
    }Once Again Thanks a lot ...
    Edited by: rajaram on Oct 31, 2007 9:11 PM

  • Sending object over socket - please help (urgent)

    I have written a server/client application where server sends object to client.
    But on the client I've received the first message "@Line 1: Get ready!!!" TWICE but NEVER the second message "@Line 2: Please input Start".
    Please help me! Its urgent! I appreciate my much in advance.
    The source for Server:
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import sendNode;
    public class TestSer {
         static sendNode sendNodeObj = new sendNode();
    static String inputLine;
         public static void main(String[] args) throws IOException {
    ServerSocket serverSocket = null;
    try {
    serverSocket = new ServerSocket(4444);
    } catch (IOException e) {
    System.err.println("Could not listen on port: 4444.");
    System.exit(1);
    Socket clientSocket = null;
    try {
    clientSocket = serverSocket.accept();
    } catch (IOException e) {
    System.err.println("Accept failed.");
    System.exit(1);
    OutputStream o = clientSocket.getOutputStream();
    ObjectOutput out=new ObjectOutputStream(o);
    BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        clientSocket.getInputStream()));
    sendNodeObj.sendMsg="@Line 1: Get ready!!!";
    sendNodeObj.typeNode=-1;
    out.writeObject(sendNodeObj);
    out.flush();
    sendNodeObj.sendMsg="@Line 2: Please input Start";
    sendNodeObj.typeNode=-2;
    out.writeObject(sendNodeObj);
    out.flush();
    inputLine = in.readLine();
    while (!inputLine.equalsIgnoreCase("Start")) {
         sendNodeObj.sendMsg="@Error, Please input Start";
    sendNodeObj.typeNode=-1;
    out.writeObject(sendNodeObj);
    out.flush();
    inputLine = in.readLine();
    out.close();
    in.close();
    clientSocket.close();
    serverSocket.close();
    The source code for Client :
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.applet.Applet;
    import sendNode;
    public class TestCli extends Applet {
    static sendNode recNodeObj=null;
    public static void main(String[] args) throws IOException {
    BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
    Socket kkSocket = null;
    PrintWriter out = null;
    try {
    kkSocket = new Socket("127.0.0.1", 4444);
    out = new PrintWriter(kkSocket.getOutputStream(), true);
    } catch (UnknownHostException e) {
    System.err.println("Don't know about host.");
    System.exit(1);
    } catch (IOException e) {
    System.err.println("Couldn't get I/O for the connection to: taranis.");
    System.exit(1);
    InputStream i= kkSocket.getInputStream();
    ObjectInput in= new ObjectInputStream(i);
    try {
         recNodeObj = (sendNode)in.readObject();
    System.out.println(recNodeObj.sendMsg);
         recNodeObj = (sendNode)in.readObject();
    System.out.println(recNodeObj.sendMsg);
    if (recNodeObj.sendMsg.equalsIgnoreCase("@Line 2: Please input Start")) {
    out.println("Start");
    } catch (Exception e) {
    System.out.println(e.getMessage());
    System.out.println("receive error.");
    System.exit(1);
    out.close();
    in.close();
    stdIn.close();
    kkSocket.close();
    The object to be sent:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class sendNode implements Serializable {
    String sendMsg;
    int typeNode; // -1 no ObjectNode;
    // 1 right node, 2 base node, 3 left node;
    Object objectNode;

    You forgot to reset the OOS. ObjetOutputStream keeps a buffer of objects, so if you write the same object again with changes on it, you must reset the buffer.
    out.writeObject(sendNodeObj);
    out.flush();
    out.reset();

  • I locked myself out of my ipod touch for 60 mins then actually typed the wrong password in again.  Now it is telling me to "connect to itunes".  I am unsure how to do this.  I am unable to use my ipod at all now. Please help.

    Hi,
    Due to my brother locking me out of my ipod touch I had to wait an hour to log in again.  Unfortunately when I did this, I, again put in the wrong password twice more, each time locking me out for a further 60 minutes.  On my 3rd attempt to log in the wrong password was entered again.  This time though instead of logging me out for another 60mins it now tells me to "connect to itunes" but I have no idea how to do this and I am now unable to use my ipod.  Please help.

    See Here  >  http://support.apple.com/kb/HT1212

Maybe you are looking for

  • Java.lang.SecurityException: Jurisdiction policy files are not signed by t

    Hi *I am installing ECC6 onAIX 6.1 with oarcle 10g.* *I am getting error in create secure store* *Policy and security files are ok,* aused by: java.lang.ExceptionInInitializerError         at java.lang.J9VMInternals.initialize(J9VMInternals.java:218)

  • Icloud manual backup

    Hello. I am on ios 8.1.3 and I can not figure out how to do a manual backup. I go to settings --> icloud--> Storage--> Manage Storage. I can not find the "Backup Now" button anywhere. Did they get rid of this?? It says my last backup was yesterday bu

  • Re: HP Photosmart 7520 unable to connect to Web Services

    I am having the same problem and have tried the suggestions.  Can you please help? Thank you!

  • Calls in blackberry hub

    Hello, everyone Have a problem with blackberry hub. In call tab all the numbers are without names although in contacts i have all of them saved. Tried reboot with 5 mins of waiting, tried restarting a hub - nothing helped. Any solution?

  • Is there a way to stop public sharing of themes?

    I noticed that new themes appear in a public space to be commented on etc - I'd prefer this turned off by default, but can't see how to do so.