Typical problem in java program ?

Typical problem in java program ?
I have three java files , i am pasting them here. Please show me the errors. Compilation error in Cat.java
File 1 : Dog.java
public class Dog extends Animal {
public String noise() { return "back"; }
File 2 : Cat.java
public class Cat extends Animal {
public String noise() {
return "meow";
File 3:AnimalTest.java
public class AnimalTest {
public static void main(String[] args)
Animal animal = new Dog();
//Cat cat = (Cat)animal;
Cat cat = new Cat();
System.out.println(cat.noise()...
Output :
D:\>javac AnimalTest.java
.\Cat.java:4: illegal start of expression
^
.\Cat.java:5: ';' expected
^
.\Cat.java:5: '}' expected
^
3 errors
Please help me. Not a homework.
Message was edited by:
Taton

D:\>javac AnimalTest.java
.\Cat.java:4: illegal start of expression
^You really need to start to understand what you are doing. Look at the error, it even points to what the error is. Look at where this bracket appears in your code and think to yourself "Should that be there or should it be something else" Once you fix that, the other errors will probably disappear.
Stoopid lag.
Message was edited by:
flounder

Similar Messages

  • Problems Running Java Programs

    I usually use Forte for Java to run and compile my java programs, but now I am trying to compile and run using the command line. When I compile something it runs fine. However when I attempt to run something it gives me a NoClassDefFound Error. For example when I have this program in package greetings.
    D:\JDK_Forte\forte4j\Development>javac greetings\Hello.java
    D:\JDK_Forte\forte4j\Development>java greetings.Hello
    Exception in thread "main" java.lang.NoClassDefFoundError: greetings/Hello
    So it compiles fine but does not run. Is something possibly not set up correctly? I don't know what could be wrong. Thanks for any help you can give.

    try
    D:\JDK_Forte\forte4j\Development>java -classpath .
    greetings.HelloI tried that and I got this error don't know if this helps at all....
    D:\JDK_Forte\forte4j\Development>java -classpath . greetings.Hello
    Exception in thread "main" java.lang.NoClassDefFoundError: greetings/Hello (wron
    g name: Hello)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)

  • Problem running Java programs

    Hello,
    Have recently re-formatted my hard drive and re-installed Windows XP. I have installed the 1.4.2_03 SDK and any Java program I run just shows a grey window, with the toolbar as usual on top. I have un-installed it and re-installed it, and even tried installing the 1.5.0 beta, but it still keeps happening. Even the Jav Control Panel just shows the grey window.
    Does anyone know how to fix this? Or have any suggestions I may try?
    Thanks.

    This is a fresh install of XP. But if I can't figure it out soon, I'll probably re-format and re-install again.

  • MS Access Date problem (from Java program)

    I have written an app. in Java that reads & writes data from a MS Access database.
    I am trying to write an insert class which will add a row of data to one of my database tables - which contains Date fields.
    My problem is that I can update the text fields, but not Date fields - every time I try my program throws an exception:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement
    My simplified code reads as:
    try {
    Statement insertStatement = databaseConnection.createStatement();
    String query = "INSERT INTO myTable(jobId, employeeId, date) VALUES('11', '1', " + "'13/11/2006'" + ");";
    insertStatement.execute(query);
    } //close, etc. etc.
    If I remove the date info from the query, the program executes successfully. I appreciate my problem might be related to the formatting of the date in Access, and if not a 'proper' Java question I give my apologies.
    I have attempted several formats of the date with no success or variation in the exception.
    I am, however, completely stuck and would appreciate any and all help given.
    Regards and thanks
    David

    I have amended my code to use a preparedStatement, but on execution I have the same problem.
    My code is as follows:
    PreparedStatement pstmt = null;
    try {
    String query = "INSERT INTO myTable (jobId, employeeId, date) VALUES(?, ?, ?);";
    pstmt = databaseConnection.prepareStatement(query);
    pstmt.setString(1, "11");
    pstmt.setString(2, "1");
    java.sql.Date sqlDate = getCurrentJavaSqlDate();
    pstmt.setDate(3, sqlDate);
    // execute query, and return number of rows created
    int rowCount = pstmt.executeUpdate();
    System.out.println("rowCount=" + rowCount);
    pstmt.close();
    catch, etc. etc.
    Any ideas or help most welcome
    Regards
    David

  • Who can help me :)--a problem with java program(reset problem in java )

    I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
    correspond to the black square.The code like this,first one is shapes:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class shapes extends JFrame {
         private JPanel buttonPanel; // panel for buttons
         private DrawPanel myPanel;  // panel for shapes
         private JButton resetButton;
        private JComboBox colorComboBox;
         private JRadioButton circleButton, squareButton;
         private ButtonGroup radioGroup;
         private JCheckBox filledButton;
        private JSlider sizeSlider;
         private boolean isShow;
         private int shape;
         private boolean isFill=true;
        private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
                                   "green", "lightgray", "magenta", "orange",
                                   "pink", "red", "white", "yellow"};   // color names list in ComboBox
        private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public shapes() {
             super("Draw Shapes");
             // creat custom drawing panel
            myPanel = new DrawPanel(); // instantiate a DrawPanel object
            myPanel.setBackground(Color.white);
             // set up resetButton
            // register an event handler for resetButton's ActionEvent
            resetButton = new JButton ("reset");
             resetButton.addActionListener(
              // anonymous inner class to handle resetButton events
                 new ActionListener() {
                       // draw a black filled square shape after clicking resetButton
                     public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
                          // to decide if show the shape
                         myPanel.setShowStatus(true);
                             isShow = myPanel.getShowStatus();
                             shape = DrawPanel.SQUARE;
                         // call DrawPanel method setShape to indicate shape to draw
                             myPanel.setShape(shape);
                         // call DrawPanel method setFill to indicate to draw a filled shape
                             myPanel.setFill(true);
                         // call DrawPanel method draw
                             myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
             );// end call to addActionListener
            // set up colorComboBox
            // register event handlers for colorComboBox's ItemEvent
            colorComboBox = new JComboBox(colorNames);
            colorComboBox.setMaximumRowCount(5);
            colorComboBox.addItemListener(
                 // anonymous inner class to handle colorComboBox events
                 new ItemListener() {
                     // select shape's color
                     public void itemStateChanged(ItemEvent event) {
                         if(event.getStateChange() == ItemEvent.SELECTED)
                             // call DrawPanel method setForeground
                             // and pass an element value of colors array
                             myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
                        myPanel.draw();
                }// end anonymous inner class
            ); // end call to addItemListener
            // set up a pair of RadioButtons
            // register an event handler for RadioButtons' ItemEvent
             squareButton = new JRadioButton ("Square", true);
             circleButton = new JRadioButton ("Circle", false);
             radioGroup = new ButtonGroup();
             radioGroup.add(squareButton);
             radioGroup.add(circleButton);
            squareButton.addItemListener(
                // anonymous inner class to handle squareButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                           if (isShow==true) {
                                 shape = DrawPanel.SQUARE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                   }// end anonymous inner class
             );// end call to addItemListener
             circleButton.addItemListener(
                   // anonymous inner class to handle circleButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                             if (isShow==true) {
                                 shape = DrawPanel.CIRCLE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                             else
                                 System.out.println("Please click Reset button first");
                   }// end anonymous inner class
             );// end call to addItemListener
             // set up filledButton
            // register an event handler for filledButton's ItemEvent
            filledButton = new JCheckBox("Filled", true);
             filledButton.addItemListener(
              // anonymous inner class to handle filledButton events
            new ItemListener() {
                  public void itemStateChanged (ItemEvent event) {
                    if (isShow==true) {
                            if (event.getStateChange() == ItemEvent.SELECTED) {
                                  isFill=true;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                            else {
                                isFill=false;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                    else
                        System.out.println("Please click Reset button first");
              }// end anonymous inner class
             );// end call to addItemListener
            // set up sizeSlider
            // register an event handler for sizeSlider's ChangeEvent
            sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
            sizeSlider.setMajorTickSpacing(10);
            sizeSlider.setPaintTicks(true);
            sizeSlider.addChangeListener(
                 // anonymous inner class to handle sizeSlider events
                 new ChangeListener() {
                      public void stateChanged(ChangeEvent event) {
                          myPanel.setShapeSize(sizeSlider.getValue());
                             myPanel.draw();
                 }// end anonymous inner class
             );// end call to addChangeListener
            // set up panel containing buttons
             buttonPanel = new JPanel();
            buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
             buttonPanel.add(resetButton);
             buttonPanel.add(filledButton);
            buttonPanel.add(colorComboBox);
            JPanel radioButtonPanel = new JPanel();
            radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
            radioButtonPanel.add(squareButton);
            radioButtonPanel.add(circleButton);
            buttonPanel.add(radioButtonPanel);
            // attach button panel & draw panel to content panel
            Container container = getContentPane();
            container.setLayout(new BorderLayout(10,10));
            container.add(myPanel, BorderLayout.CENTER);
             container.add(buttonPanel, BorderLayout.EAST);
            container.add(sizeSlider, BorderLayout.SOUTH);
            setSize(500, 400);
             setVisible(true);
         public static void main(String args[]) {
             shapes application = new shapes();
             application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }second one is drawpanel:
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
        private int shapeSize = 100;
        private Color foreground;
         // draw a specified shape
        public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
            int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
                 if (fill == true){
                     g.setColor(foreground);
                      g.fillOval(x, y, shapeSize, shapeSize);
                else{
                       g.setColor(foreground);
                    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
                 if (fill == true){
                     g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
                else{
                        g.setColor(foreground);
                    g.drawRect(x, y, shapeSize, shapeSize);
        // set showStatus value
        public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
        public boolean getShowStatus () {
              return showStatus;
         // set fill value
        public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
        public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
        // set shapeSize value
        public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
        // set foreground value
        public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
        public void draw (){
              if(showStatus == true)
              repaint();
    }If any kind people who can help me.
    many thanks to you!

    4 widgets???
    maybe this is what you mean.
    add this inside your actionPerformed method for the reset action
    squareButton.setSelected(true);
    colorComboBox.setSelectedIndex(0);
    if not be more clear in your post.

  • A problem with java program(reset problem in java GUY)

    I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
    correspond to the black square.
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
        private int shapeSize = 100;
        private Color foreground;
         // draw a specified shape
        public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
            int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
                 if (fill == true){
                     g.setColor(foreground);
                      g.fillOval(x, y, shapeSize, shapeSize);
                else{
                       g.setColor(foreground);
                    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
                 if (fill == true){
                     g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
                else{
                        g.setColor(foreground);
                    g.drawRect(x, y, shapeSize, shapeSize);
        // set showStatus value
        public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
        public boolean getShowStatus () {
              return showStatus;
         // set fill value
        public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
        public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
        // set shapeSize value
        public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
        // set foreground value
        public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
        public void draw (){
              if(showStatus == true)
              repaint();
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class shapes extends JFrame {
         private JPanel buttonPanel; // panel for buttons
         private DrawPanel myPanel;  // panel for shapes
         private JButton resetButton;
        private JComboBox colorComboBox;
         private JRadioButton circleButton, squareButton;
         private ButtonGroup radioGroup;
         private JCheckBox filledButton;
        private JSlider sizeSlider;
         private boolean isShow;
         private int shape;
         private boolean isFill=true;
        private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
                                   "green", "lightgray", "magenta", "orange",
                                   "pink", "red", "white", "yellow"};   // color names list in ComboBox
        private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public shapes() {
             super("Draw Shapes");
             // creat custom drawing panel
            myPanel = new DrawPanel(); // instantiate a DrawPanel object
            myPanel.setBackground(Color.white);
             // set up resetButton
            // register an event handler for resetButton's ActionEvent
            resetButton = new JButton ("reset");
             resetButton.addActionListener(
              // anonymous inner class to handle resetButton events
                 new ActionListener() {
                       // draw a black filled square shape after clicking resetButton
                     public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
                          // to decide if show the shape
                         myPanel.setShowStatus(true);
                             isShow = myPanel.getShowStatus();
                             shape = DrawPanel.SQUARE;
                         // call DrawPanel method setShape to indicate shape to draw
                             myPanel.setShape(shape);
                         // call DrawPanel method setFill to indicate to draw a filled shape
                             myPanel.setFill(true);
                         // call DrawPanel method draw
                             myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
             );// end call to addActionListener
            // set up colorComboBox
            // register event handlers for colorComboBox's ItemEvent
            colorComboBox = new JComboBox(colorNames);
            colorComboBox.setMaximumRowCount(5);
            colorComboBox.addItemListener(
                 // anonymous inner class to handle colorComboBox events
                 new ItemListener() {
                     // select shape's color
                     public void itemStateChanged(ItemEvent event) {
                         if(event.getStateChange() == ItemEvent.SELECTED)
                             // call DrawPanel method setForeground
                             // and pass an element value of colors array
                             myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
                        myPanel.draw();
                }// end anonymous inner class
            ); // end call to addItemListener
            // set up a pair of RadioButtons
            // register an event handler for RadioButtons' ItemEvent
             squareButton = new JRadioButton ("Square", true);
             circleButton = new JRadioButton ("Circle", false);
             radioGroup = new ButtonGroup();
             radioGroup.add(squareButton);
             radioGroup.add(circleButton);
            squareButton.addItemListener(
                // anonymous inner class to handle squareButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                           if (isShow==true) {
                                 shape = DrawPanel.SQUARE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                   }// end anonymous inner class
             );// end call to addItemListener
             circleButton.addItemListener(
                   // anonymous inner class to handle circleButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                             if (isShow==true) {
                                 shape = DrawPanel.CIRCLE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                             else
                                 System.out.println("Please click Reset button first");
                   }// end anonymous inner class
             );// end call to addItemListener
             // set up filledButton
            // register an event handler for filledButton's ItemEvent
            filledButton = new JCheckBox("Filled", true);
             filledButton.addItemListener(
              // anonymous inner class to handle filledButton events
            new ItemListener() {
                  public void itemStateChanged (ItemEvent event) {
                    if (isShow==true) {
                            if (event.getStateChange() == ItemEvent.SELECTED) {
                                  isFill=true;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                            else {
                                isFill=false;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                    else
                        System.out.println("Please click Reset button first");
              }// end anonymous inner class
             );// end call to addItemListener
            // set up sizeSlider
            // register an event handler for sizeSlider's ChangeEvent
            sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
            sizeSlider.setMajorTickSpacing(10);
            sizeSlider.setPaintTicks(true);
            sizeSlider.addChangeListener(
                 // anonymous inner class to handle sizeSlider events
                 new ChangeListener() {
                      public void stateChanged(ChangeEvent event) {
                          myPanel.setShapeSize(sizeSlider.getValue());
                             myPanel.draw();
                 }// end anonymous inner class
             );// end call to addChangeListener
            // set up panel containing buttons
             buttonPanel = new JPanel();
            buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
             buttonPanel.add(resetButton);
             buttonPanel.add(filledButton);
            buttonPanel.add(colorComboBox);
            JPanel radioButtonPanel = new JPanel();
            radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
            radioButtonPanel.add(squareButton);
            radioButtonPanel.add(circleButton);
            buttonPanel.add(radioButtonPanel);
            // attach button panel & draw panel to content panel
            Container container = getContentPane();
            container.setLayout(new BorderLayout(10,10));
            container.add(myPanel, BorderLayout.CENTER);
             container.add(buttonPanel, BorderLayout.EAST);
            container.add(sizeSlider, BorderLayout.SOUTH);
            setSize(500, 400);
             setVisible(true);
         public static void main(String args[]) {
             shapes application = new shapes();
             application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }Many thanks

    Who is this Java guy anyway?

  • Problem in Java Programing

    Hi,
    I developed a program J2EE Web Module Project. In which when i enter a vendor number it has to get the details of the particular Vendor Name.
    But when i deployed it is throwing an exception "NullPointerException". But I could not recognize it. Please let me know where is the error.
    Here is my HTML and Servlet Code :
    <html>
    <head>
    <title> Vendor Details</title>
    <script language="JavaScript">
         function randomnumber()
              var r=Math.floor(Math.random()*1111);
              if ( r!=0)
              document.form1.rand.value=r;
         function getVendorDetails()
              document.location = "http://localhost:8880/vendor/Servlet";
    </script>
    </head>
    <body bgcolor="#eeeff8" onLoad = "javascript:randomnumber();">
    <center>
    <hr>
         <h1>Enter the Vendor Number</h1>
    <hr>
    </center>
    <form name=form1 action="Servlet" method=post>
    <center>
    <input type="text" name="vendno">
    <input type="Submit" value="Submit">
    <input type=hidden name="rand">
    </center>
    </form>
    </body>
    </html>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF">
    </BODY>
    </HTML>
    and Servlet code is as below :
    package vendor.pkg;
    import java.io.PrintWriter;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.sap.mw.jco.IRepository;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.IFunctionTemplate;
    public class VendorServlet extends HttpServlet {
         PrintWriter pw;
         public void doPost(HttpServletRequest req, HttpServletResponse res) {
              int num = Integer.parseInt(req.getParameter("rand"));
              String no, name, city, po;
              String SID = "R" + num;
              String vendno = req.getParameter("vendno");
              IRepository repository;
              // The repository we will be using
              try {
                   // Add a connection pool to the specified system
                   JCO.addClientPool(
                        SID,
                        100,
                        "200",
                        "pavan",
                        "pavan",
                        "EN",
                        "sapdev",
                        "00");
                   repository = JCO.createRepository("MYRepository", SID);
                   pw.println("Connection got");
                   IFunctionTemplate ftemplate =
                        repository.getFunctionTemplate("ZTEST_VENDOR");
                   JCO.Function function = new JCO.Function(ftemplate);
                   JCO.Client client = JCO.getClient(SID);
                   JCO.ParameterList input = function.getImportParameterList();
                   input.setValue(vendno, "LIFNR");
                   client.execute(function);
                   JCO.Structure ret =
                        function.getExportParameterList().getStructure("RETURN");
                   pw = res.getWriter();
                   pw.println(
                        "<html><head><title>VendorDetails</title></head><body bgcolor=#eeeff8><center><hr><h1>Customer Details</h1><hr>");
                   JCO.Table vend = function.getTableParameterList().getTable("ITAB");
                   for (int i = 0; i < vend.getNumRows(); i++) {
                        vend.setRow(i);
                        no = vend.getString("LIFNR");
                        name = vend.getString("NAME1");
                        city = vend.getString("ORT01");
                        po = vend.getString("PFACH");
                        pw.println(
                             "<table border=1><tr><td><B>Vendor Number</B></td><td>"
                                  + no
                                  + "</td></tr><tr><td>"
                                  + "<B>Customer Name</B></td><td>"
                                  + name
                                  + "</td></tr><tr><td>"
                                  + "<B>Customer Address</B></td><td></tr>"
                                  + "<tr><td> </td><td><B>City</B></td><td>"
                                  + city
                                  + "</td></tr>"
                                  + "<tr><td> </td><td><B>District</B></td><td>"
                                  + po
                                  + "</td></tr>+</table>");
                        pw.println(
                             "<form name=form1 action='Index.html' method=get><input type=submit value='Back'></form></center></body></html>");
              } catch (Exception E) {
                   pw.println(E);
    Please help me out.
    Thanks,
    Pavan.

    Did you try debugging a break point (a debugging point) in the servlet and check where exactly you are getting an exception?

  • Typical problem - Will Java Runtime options help me ?

    Hi,
    We are using JInitiator to launch our application.When launching, this application downloads the ".JAR" files which are in server .I'm able to get the handle of the application and access all the Methods and properties from Visual Basic 6.0. But the problem is that I'm able to call methods which accepts only Integer or String as arguments.
    I'm unable to call the methods which has argument type as Boolean [ Ex : Win.setVisible( Boolean b)  ]. I tried passing all types of VB variables ,But I get "Type Mismatch Error" . I found an application which is similar to mine that uses "-Xbootclasspath" , "-Xrunmicsupp" , "MIC_CLASSES" & "_classload_hook" options to control Java applications by overriding some classes.
    I created a new class with the same name but which has an extra function to accept string as a parameter [ Win.setVisible( String b) ] that enables me to call from VB. I want to Override my application's class with my class file which is in my local system. I want to override it because I'm supposed to change the class file in the server.
    Is it possible to do my task using " java -Xbootclasspath" or something similar to that ? If so, Please tell me the way to do this. Please point me to some sites where in i can find the details about the above options that which the application similar to mine is using. Please help me,I will be very thankful to you guys.Hope to see your replies soon.
    Thanks and Regards,
    Srinivas.

    D:\>javac AnimalTest.java
    .\Cat.java:4: illegal start of expression
    ^You really need to start to understand what you are doing. Look at the error, it even points to what the error is. Look at where this bracket appears in your code and think to yourself "Should that be there or should it be something else" Once you fix that, the other errors will probably disappear.
    Stoopid lag.
    Message was edited by:
    flounder

  • Problem compiling java programs

    when i run javc in command prompt it runs fine but when i try to compile any program through command prompt it gives following error:
    javac: file not found
    usage: java <options> <source file>
    use -help for list of attributes
    what shouls i do plz help

    yogiis wrote:
    when i run javc in command prompt it runs fine but when i try to compile any program through command prompt it gives following error:
    javac: file not found
    usage: java <options> <source file>
    use -help for list of attributes
    what shouls i do plz helpuse set path="path of java/jdk/bin folder with double quotes" then press enter
    otherwise if you are ussing windows system goto to my computer properties and use advanced tab then use environment variables, there use user/system variables and check is there any exisiting path named variable is there or not if there click on edit and use ; and paste the complete path there. press ok, apply. Then use the command.

  • Java programs not working.

    I'm having problems running java programs. Whenever I open them, the window will open, but nothing will appear inside. The only parts of the program that appear, and only sometimes, will be the word "cancel" or "OK" where there should be buttons, but the rest of the program, including text boxes, other buttons, anything else, etc. will not load. Does anybody have any ideas as to what might be the problem? Thank you.

    Hmmm. Both of those programs work fine on my machine. We're running the same version of the OS and the hardware shouldn't matter, but maybe someone with an Intel Mac like yours could try them and report on their results.
    As a shot in the dark, you could run the standard maintenance routines like Repair Permissions and Repair Disk to see if that fixes your problem. Other than that, I don't know what to suggest. Sorry.

  • Compile correct but not run java programs

    I have problem. Java program copile correctly but not run. I can't understand this one.
    **this is the error**
    Exception in thread "main" java.lang.NoClassDefFoundError: suminda
    Caused by: java.lang.ClassNotFoundException: suminda
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: suminda. Program will exit.

    The error is telling you that the jvm could not find a class named suminda. Are you aware that class names are case sensitive? Suminda is not the same as suminda for example.
    This error usually happens when you haven't specified the classpath correctly. A simple thing to try isjava -cp  .  sumindaHere's some links that may help.
    [http://www.kevinboone.com/classpath.html]
    [http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html]

  • Problem while calling a Webservice from a Stand alone java program

    Hello Everyone,
    I am using a java program to call a webservice as follows. For this I have generated the client proxy definition for Stand alone proxy using NWDS.
    Now when I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    public class ZMATRDESCProxyClient {
         public static void main(String[] args) throws Exception {
              Z_MATRDESC_WSDService ws = new Z_MATRDESC_WSDServiceImpl();
              Z_MATRDESC_WSD port = (Z_MATRDESC_WSD)ws.getLogicalPort("Z_MATRDESC_WSDSoapBinding",Z_MATRDESC_WSD.class);
              String res = port.zXiTestGetMatrDesc("ABCD134");
              System.out.print(res);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>Material Not Found</b> -
    > This is the output of webservice method and it is right.
    Can any one please let me know why I am getting the warning and error message and how can I fix this.
    Thanks
    Abinash

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • Problems running a java program

    Hello,
    I have absolutely no java experience whatsoever, and I need to fix a program that suddenly stopped running properly after several years without problems. Basically, I have a perl script that calls a java program. Everytime I run this perl script from the web browser, the java program returns an internal error:
    # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://www.blackdown.org/cgi-bin/jdk # # Error ID: 5649525455414C53504143450E4350500024 # # Problematic Thread: prio=5 tid=0x804e680 nid=0x6d16 runnable #
    However, when I run the perl script command line, it runs fine. I added the -verbose option to the java call, and I discovered that the program stops running after it opens the .jar files but before it loads them .... these files have full read permissions, so I don't think that's the problem. Any ideas?
    Thanks!

    ...fix a program that suddenly stopped running properly after several years without problems.Which means either the program changed or the environment changed. I would guess the environment. The most likely possibilities: new version of the operating system, new version of perl, new version of java. Also possible: new version installed of any of the previous without removing older versions, new software not associated with the first, new mapped drives and/or changed env vars.

  • Problem in Creating New position in Siebel CRM 7.8 using java program

    Hi
    We have Siebel CRM with Business Object and Business Component as Position.
    Position Business Component has a manadatory pick list Division.
    When we try to create a new Position by picking the Divison then we are getting the below error
    Logged in OK!
    picking the list
    in the pick() method before
    <Exception>
    <Major No.>256</Major No.><Minor No.>21944</Minor No.><Message>An error has occurred picking the current row.
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</Message><DetailedMessage>Unknown<DetailedMessage>
    <Exception>
    <com.siebel.om.sisnapi.i>
    <Major No.>256</Major No.><Minor No.>21944</Minor No.><Message>An error has occurred picking the current row.
    <Error><ErrorCode>21944</ErrorCode> <ErrMsg>An error has occurred picking the current row.
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</Message><DetailedMessage>Unknown<DetailedMessage>
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</ErrMsg></Error>
    <com.siebel.om.sisnapi.i>
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Siebel eScript runtime error occurred in procedure 'BusComp_SetFieldValue' of BusComp [Position]:
    <Error><ErrorCode>21944</ErrorCode> <ErrMsg>An error has occurred picking the current row.
    ConversionError 1616: Undefined and Null types cannot be converted to an object.
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</ErrMsg></Error>
    (SBL-SCR-00141)</ErrMsg></Error>
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Siebel eScript runtime error occurred in procedure 'BusComp_SetFieldValue' of BusComp [Position]:
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Stack trace:
    BusComp [Position].BusComp_SetFieldValue(), Line: 1110</ErrMsg></Error>
    ConversionError 1616: Undefined and Null types cannot be converted to an object.
    </com.siebel.om.sisnapi.i></Exception>
    (SBL-SCR-00141)</ErrMsg></Error>
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Stack trace:
    BusComp [Position].BusComp_SetFieldValue(), Line: 1110</ErrMsg></Error>
    </com.siebel.om.sisnapi.i></Exception>
    at com.siebel.data.SiebelBusComp.pick(SiebelBusComp.java:241)
    at siebelconn.main(siebelconn.java:44)
    Java program
    import com.siebel.data.*;
    import com.siebel.data.SiebelException;
    class siebelconn {
    public static void main (String args [])
    SiebelDataBean m_dataBean = null;
    SiebelBusObject m_busObject = null;
    SiebelBusComp m_busComp = null;
    SiebelBusComp picklistBC = null;
         try{
    m_dataBean = new SiebelDataBean(); //Create Siebel JDB instance
    m_dataBean.login("XXXX", "XXX", "XXX");
         System.out.println("Logged in OK!");
    m_busObject = m_dataBean.getBusObject("Position");
    m_busComp = m_busObject.getBusComp("Position");
    m_busComp.newRecord(false);
    picklistBC = m_busComp.getPicklistBusComp("Division");
    picklistBC.clearToQuery();
    picklistBC.setViewMode(3);
    picklistBC.setSearchSpec("Name", "idmtest");
    //picklistBC.executeQuery(true);
    picklistBC.executeQuery2(true,true);
    if(picklistBC.firstRecord())
    System.out.println("picking the list");
    picklistBC.pick();
    System.out.println("records are there");
    m_busComp.setFieldValue("Name","Access GE HQ 11");
    m_busComp.writeRecord();
    }//if
         if(m_busObject!=null)
    m_busObject.release();
    if(m_busComp!=null)
    m_busComp.release();
    if(picklistBC!=null)
    picklistBC.release();
    if(m_dataBean!=null)
    m_dataBean.logoff();
    catch(Exception e)
    System.out.println(e);e.printStackTrace();
    if(m_busObject!=null)
    m_busObject.release();
    if(m_busComp!=null)
    m_busComp.release();
    if(picklistBC!=null)
    picklistBC.release();
    try
    if(m_dataBean!=null)
    m_dataBean.logoff();
    }catch(Exception e1){System.out.println(e1);}
    Can any body please help us.
    Thanks

    From the error code, it looks like you have a scripting error in the BusComp_SetFieldValue event on the Position
    business component in your application.
    Have you tried to look at that code or to turn of scripting for the application as a total?
    Axel

  • Problems with JAVA SE 6 in 1 Program.

    Hello, I'm a new guy here, so sorry for mistakes
    Problem that JAVA seems does not work propertly. This is the text from error.log in program that I want to start: "1020=The JVM found at {0} is damaged.\r\nPlease reinstall or define EXE4JJAVAHOME\r\nto point to an installed 32-bit JDK or JRE.". Cause I am not a pro in using mac os I can't understand how to solve this problem. Thank you for your time and answers.
    Best Regards,
    Mantas

    HI,
    Try here. http://developer.apple.com/java/faq/
    Carolyn

Maybe you are looking for

  • Media encoder error

    I have to assemble a series of security cam video and no matter what format I try for export I get the error message Pproheadless has encountered an error [..\..\Src\WinFile.cpp-759] the original video is .avi 320x240 framerate 30 square pixels any i

  • GR reversed inspite of invoice

    We have an issue with GR being reversed,inspite of invoice postings. OMBZ settings was not the reason. Apperciate,if someone can Assist.

  • -13005 Error when connecting to 2003 Server

    I've got a 2003 Server setup with Active Directory and I've enabled SFM (Services for Macintosh), and created a few mac shares. I created a new account and left the "User must change password at next logon" option enabled, something I don't usually d

  • Installation errors when installing trial version of Photoshop CC

    Hi, I'm trying to install a trial version of Photoshop CC on a Macbook Pro running Mavericks. The app won't install; the error message is 'Some items for the following product(s) could not be installed successfully.' The error summary is as follows:

  • ACS 4.1 for Windows, command accounting.

    ACS doesn't log the command into the csv file. I have verified that device sends the acct message, the tacacs service (in full log mode) reports the message but there isn't an entry into the csv TACACS+ Admin. Thanks. Andrea