Java.lang.NoSuchMethodError: main                  Exception in thread main

I am a student currently trying to teach myself java with the aid of sams teach yourself java book, but whilst doing one of the examples I have become stuck.
I get the message that I have posted as the subject title, the book is designed to use java 2 with netbeans 4.0 java 1.5 I think which I guess the code is written for,
but at uni they have netbeans 3.6 java 1.4 so we have been advised to use this so there is no problems when working on the same projects and uni and at home,
anyway can someone please help the code is posted below.
thanx in advance
import java.awt.*;
import javax.swing.*;
public class MessagePanel extends JPanel {
    GridBagLayout gridbag = new GridBagLayout();
    public MessagePanel() {
        super();
        GridBagConstraints constraints;
        setLayout(gridbag);
        JLabel toLabel = new JLabel("To: ");
        JTextField to = new JTextField();
        JLabel subjectLabel = new JLabel("Subject: ");
        JTextField subject = new JTextField();
        JLabel ccLabel = new JLabel("CC: ");
        JTextField cc = new JTextField();
        JLabel bccLabel = new JLabel("BCC: ");
        JTextField bcc = new JTextField();
        addComponent(toLabel, 0, 0 , 1, 1, 10, 100,
            GridBagConstraints.NONE, GridBagConstraints.EAST);
        addComponent(to, 1, 0, 9, 1, 90, 100,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
        addComponent(subjectLabel, 0, 1, 1, 1, 10, 100,
            GridBagConstraints.NONE, GridBagConstraints.EAST);
        addComponent(subject, 1, 1, 9, 1, 90, 100,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
     addComponent(ccLabel, 0, 2, 1, 1, 10, 100,
            GridBagConstraints.NONE, GridBagConstraints.EAST);
        addComponent(cc, 1, 2, 4, 1, 40, 100,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
        addComponent(bccLabel, 5, 2, 1, 1, 10, 100,
            GridBagConstraints.NONE, GridBagConstraints.EAST);
        addComponent(bcc, 6, 2, 4, 1, 40, 100,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
    private void addComponent(Component component, int gridx, int gridy,
        int gridwidth, int gridheight, int weightx, int weighty, int fill,
        int anchor) {
        GridBagConstraints constraints = new GridBagConstraints();
        constraints.gridx = gridx;
        constraints.gridy = gridy;
        constraints.gridwidth = gridwidth;
        constraints.gridheight = gridheight;
        constraints.weightx = weightx;
        constraints.weighty = weighty;
        constraints.fill = fill;
        constraints.anchor = anchor;
        gridbag.setConstraints(component, constraints);
        add(component);
}I have copied exactly what the book says and downloaded the files from the website and everything is the same but it just won't work?

My guess is that the main method is in another class. It would probably look something like this:
public static void main(String[] args)
     JFrame f = new JFrame();
     f.setSize(500, 500);
     f.setLocation(20, 20);
     f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     f.setContentPane(new MessagePanel());
     f.setVisible(true);
}

Similar Messages

  • Error 'java.lang.NoClassDefFoundError: rn exception in thread 'main'

    I have been trying to install Full ABAP Edition-trial version of SAP Netweaver 04s on Windows XP professional SP2. I am getting the error 'java.lang.NoClassDefFoundError: run exception in thread 'main' while trying to execute 'setup.exe' in the image folder.
    i have installed 'j2sdk-1_4_2_09' on the system. still i am getting the same error. can somebody help me.
    I reinstalled the operationg system still the problem persisits.
    Thanks!

    I solved this problem by reinstalling the operating system.
    after this, I tried to start SAP MMC, it gave another error user id and password not valid.
    To avoid this problem make sure that password for administrator of the Operation system (PC or Laptop) should match the password for SAP MMC.

  • Message Mapping : ( Not Activating )-Main Exception in thread "main"

    Hi all
          I have configured a message mapping , with proper occurence checked for
    both source & target MesTypes.
    But on activation it is throwing the error :
    <b>java.lang.NoClassDefFoundError: com/sun/tools/javac/Main Exception in thread "main"</b>
    Also my previous mappings are also not activating , which were running properly previously...
    i tried these option already :-
    --> i also restart the Java Stack...
    ---> Re: JAVA stack not starting
    > SAp note 928038
    still i am getting the same error..
    Regards
    Ashutosh Rawat

    Ashutosh,
    I am not sure weather it will resolve your problem but you can give a try to it.
    If you have the access for tcode "<b>SICF</b>" then
    1. Run tcode SICF, and press F8 button.
    2. default_host>sap>xi.
    3. Now check the below mentioned are activated (activated services will be in black) or not, if not then just right click and activate the service:
         i). adapter_plain
        ii). cache
       iii). cache_gui
        iv). cache_ssl
         v). docu_apperror
        vi). docu_syserror
       vii). engine
      viii). simulation
    Regards,
    Sarvesh
    Message was edited by:
            Sarvesh Singh
        <b>SFIC</b> is corrected to "<b>SICF</b>"

  • Exception in thread "main" java.lang.NoClassDefFoundError: HW

    I am very new to java. Tried to take the time to learn but got wrapped up in other things. Now I am back to learn and here is what I am getting. I don't know if it has anything to do with java required files being in a different directory or what. I have my java sdk files in C:\Program Files\Java\jre1.6.0_05\ and the source file is in C:\Java
    Here is more information.
    My Error at runtime:_
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    My actions in the shell:_
    C:\Java>javac HW.java
    C:\Java>java HW
    Exception in thread "main" java.lang.NoClassDefFoundError: HW
    Caused by: java.lang.ClassNotFoundException: HW
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    My Source:_
    * The HelloWorldApp class implements an application that
    * simply prints "Hello World!" to standard output.
    class HW {
        public static void main(String[] args) {
            System.out.println("Hello World!"); // Display the string.
    }

    My Error at runtime:_
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    Exception in thread "main" java.lang.NoClassDefFoundError: HW
    Caused by: java.lang.ClassNotFoundException: HWO_o
    That's two different errors.
    Try to execute with:
    java -cp . HW

  • Another .....Exception in thread "main" java.lang.NoClassDefFoundError: Hw

    Here is my Java:
    package classes.com.mattclark.hw;
    import java.lang.*;
    public class Hw {
      private static Object mainClass = null;
      private Short var1 = null;
      public Hw(){
        var1 = new Short("0");
        System.out.println("| Class Name           |           Minimum Value |           Maximum Value |");
        System.out.println("----------------------------------------------------------------------------");
        System.out.println("| " + rPad(var1.getClass().getName(), 20) +
                           " |" + lPad(String.valueOf(var1.MIN_VALUE), 24) +
                           " |" + lPad(String.valueOf(var1.MAX_VALUE), 24) +
                           " |" );
      private String rPad(String initialString, int width) {
        String returnString = null;
        if(initialString.length() >= width) {
          // truncate the string and return it
          returnString = initialString.substring(0, width-1);
        } else {
          returnString = initialString;
          for(int i=initialString.length(); i<width; i++) {
            // pad the return string to the right
            returnString = returnString.concat(" ");
        return returnString;
      private String lPad(String initialString, int width) {
      String returnString = null;
      if(initialString.length() >= width) {
        // truncate the string and return it
        returnString = initialString.substring(0, width-1);
      } else {
        returnString = new String("");
        for(int i=initialString.length(); i<width; i++) {
          // pad the return string to the right
          returnString = returnString.concat(" ");
        returnString = returnString.concat(initialString);
      return returnString;
    public static void main(String[] args) {
        mainClass=new Hw();
    } I have tried other solution from other "Exception in thread "main"" posts
    I have tried all kinds of CLASSPATH's
    My teacher said to use: Set CLASSPATH=D:\java3\hw\classes

    My Error at runtime:_
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    Exception in thread "main" java.lang.NoClassDefFoundError: HW
    Caused by: java.lang.ClassNotFoundException: HWO_o
    That's two different errors.
    Try to execute with:
    java -cp . HW

  • Exception in thread "main" ... ive gone blind.

    Executing: D:\Program\ConTEXT\ConExec.exe "C:\j2sdk1.4.2\bin\java.exe" -cp D:\java\ Kylskap
    java.lang.NoClassDefFoundError: Kylskap
    Exception in thread "main"
    Execution finished.Im helping a friend with a program that should connect to a database and check passwords and some other stuff. Things went fine and i solved most of the problems and even got it running. But then i suddenly got this error above.
    Ive put the two files in a package
    ive remembered to declare that package in both files.
    i have checked my classpath and path
    ive checked the code over and over.
    I cant figure out what is wrong.
    It all started when i made the package and figured out how the inheritance should be. Other calls to other classes have worked before but now when i had to change everything into one package because i had to split some of the classes into separate files, it just doesnt work anymore.
    this is a short version of the start of the file Kylskap, where the error seems to be.
    package fabrik;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.io.*;
    import java.text.*;
    public class Kylskap extends Frame{
           public static void main (String[] args) {
                  Kylskap k = new Kylskap();
           //constructor
           public Kylskap() {
           //stuff
    }Help is very much appreciated.. Ive stared myself blind on this one.

    You're going to kick yourself on this one :)
    Once you put a class in a package, you need to fully qualify it when running it from the command line:
    ...java -cp D:\java\ Kylskap
    should be
    cp D:\java\ fabrik.Kylskap

  • Exception in thread "main" java.lang.NoClassDefFoundError org/xml/sax/SAXEx

    I want to run an jar file so on command prompt i am giving the command
    " java -jar jSimpleX_3.0.jar "
    I am getting the following error:
    "exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/SAXException "
    Can any body explain the reason of this exception
    Thanks in advance.

    Hi
    I am getting an exception while running code of "
    Reading an XML file in Java"
    The error is " Exception in thread "main"
    java.lang.NoClassDefFoundError:
    org/xml/sax/SAXException "
    I am using j2sdk1.4.0 and j2sdk1.4.2_13 and both are
    containing rt.jar file. But still i am receiving the
    same Error Exception.
    Can anybody there help me out.
    Thanks in Advance. !!!!Please help me out. Its urgent !!!!!!!!!!!!!!!!!!!!!!!

  • Exception in thread "main" java.lang.NoClassDefFoundError: Helloworld

    Hi Java Experts,
    I am at a lost to how Java searches for all the classes when running a program. Below are the following steps I have taken to try a simple basic HelloWorld.java program on the command prompt on Windows XP (SP2) platform:
    ( i ) Installed both jdk1.5.0_09 and Netbeans IDE 5.0 and working properly.
    ( ii ) The source file is located in F:\Documents and Settings\abc\HeadFirstDesignPattern\src\ch11 and the compiled file is in F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes\ch11 which was compiled in Netbeans.
    ( iii ) No problem compiling & running this program in Netbeans.
    ( iv ) The RUN CLASSPATH in Netbeans is F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes.
    ( v ) No CLASSPATH variable has been set.
    ( vi ) The HelloWorld program looks like this:
    package ch11;
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World!");
    ( vi ) Got the message
    "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld"
    when running a combination of the following Java commands:
    ( a ) cd F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes
    ( b ) java HelloWorld, or
    java -cp . HelloWorld or java -cp "." HelloWorld, or
    java -cp F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes" HelloWorld, or
    java -cp F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes;. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld, or
    java -cp "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";"." HelloWorld, or
    java -cp "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";"." ch11\HelloWorld.
    It is the package location which is a subdirectory of F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes which caused Java not to find this program. I had no problem running it if the HelloWorld.java was moved one level up. ie from F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes\ch11 to F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes.
    I have written Java in the last year mostly on Netbeans without any problem running them.
    The reason for having to learn to run Java on the command line is so that I could add arguments to the program which I couldn't do in Netbeans just yet.
    I have gone through a lot of the articles from Java forums, Google searches but yet to have found a solution.
    Many thanks,
    Netbeans Fan

    I am getting the same problem when running the same program on a Fedora 4.0 (Redhat Linux 10) system, together with Netbeans 5.5 and JDK1.5.0_09. Again, I have no such problem when running the same program in Netbeans.
    Here are the steps that I have taken as follows:
    $ hostname
    spisu07.stvincents.com.au
    $ uname -a
    Linux spisu07.stvincents.com.au 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686
    $ pwd
    /home/dbi/HeadFirstDesignPattern/build/classes/ch11a
    $ cd ..
    $ pwd
    /home/dbi/HeadFirstDesignPattern/build/classes
    $ ls
    ch11a
    $ ls ch11a
    GumballMachine.class GumballMonitor.class NoQuarterState.class State.class
    GumballMachineRemote.class GumballMonitorTestDrive.class SoldOutState.class WinnerState.class
    GumballMachineTestDrive.class HasQuarterState.class SoldState.class
    $ java -cp . ch11a.GumballMachineTestDrive
    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: ch11a.GumballMachineTestDrive
    at java.lang.VMClassLoader.transformException(java.lang.Class, java.lang.Throwable) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
    at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)file:///usr/share/doc/HTML/index.html
    ...4 more
    $ echo $PATH
    /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/opt/netbeans-5.5/bin:/etc/alternatives/.:/opt/netbeans-5.5/bin:/opt/jdk1.5.0_09:/etc/alternatives/.
    $ echo $JAVA_HOME
    $ echo $CLASSPATH
    Any suggestions?
    Thanks,
    Henry

  • Exception in thread "main" java.lang.noclassDefFoundError: AudioExample

    Hi,
    i tried to run the intermedia "AduioExample" Demo in Oracle8.1.7 (Java). It is compiled, however when i run the AudioExample.class as:
    c:\AudioExample Dir> java AudioExample
    i receive "Exception in thread "main" java.lang.noclassDefFoundError:AudioExample". anyway
    before running the AudioExample Demo i did
    1- install java 1.4.2 and i tried "HelloWorld" example and it worked
    2- setup the CLASSPATH and the PATH environment variables in Win2000 as requested in the Readme.txt file in the demo....Could anyone please tell me what's wrong...thank you

    i have solved the running of AudioExample.java Demo, the problem was that i loaded the CLASSPATH Environment Variables with many directories...when i deleted all the directories from CLASSPATH except the directories mentioned in the Readme.txt, it worked...

  • "Exception in thread "main" java.lang. No Class Def Found Error: Env"

    iam getting this erro message when i want to run the
    java program "Hello World"
    "Exception in thread "main" java.lang. No Class Def Found Error: Env"
    I have set environment variable for classpath and path for the jdk1.3.
    It is getting compiled without any error. When i try to run it it spits this error message:
    Help me......

    The problem could be from several reasons.
    If you're trying to run HelloWorld.java, you're class should defined as
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World");
    This program must be in a file called HelloWorld.java
    to compile-- javac HelloWorld.java
    fo run--- java HelloWorld
    1. The class has to be public
    2. you must have a main method.
    3. The file must be named the name of your class(HelloWorld) with a .java extension.
    4. After you compile make sure there is a gile called HelloWorld.class in the directory you're working in
    Steve

  • "java.lang.NoSuchMethodError: com.sun.tools..apt.Main.process"

    Hi,
    I am a new to Web Services and was following some site for implementing it.
    The link is as below:
    http://www.roseindia.net/webservices/netbeans/Web-Service.shtml
    However while doing the "build and deploy" -- I am getting the following error while doing a ::
    init:
    deps-module-jar:
    deps-ear-jar:
    deps-jar:
    Warning: MANIFEST.MF modified in the future.
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\META-INF
    Warning: META-INF\context.xml modified in the future.
    Warning: WEB-INF\lib\jaxws-tools-2.1.7.jar modified in the future.
    Warning: WEB-INF\sun-jaxws.xml modified in the future.
    Warning: WEB-INF\web.xml modified in the future.
    Warning: index.jsp modified in the future.
    Warning: modified in the future.
    Warning: META-INF modified in the future.
    Copying 5 files to D:\WebServices-NB-Practice\webservice1\build\web
    library-inclusion-in-archive:
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    library-inclusion-in-manifest:
    Warning: modified in the future.
    wsgen-init-nonJSR109:
    wsgen-MyWebService-nonJSR109:
    *java.lang.NoSuchMethodError: com.sun.tools.apt.Main.process(Lcom/sun/mirror/apt/AnnotationProcessorFactory;[Ljava/lang/String;)I*
    BUILD FAILED (total time: 1 second)
    I am using netbeans version 5.5 for this.
    Although from the initial investigation I understand that this error is related to "jaxws-tools.jar".
    However I could not resolve this error.
    Can Somebody provide me with the steps to resolve this error.
    Regards,
    Avinash

    No, I put the 'main' method just to see if it solved the problem

  • Exception in thread "main" java.sql.SQLRecoverableException: Io exception:

    When applying the 6678700 (12.1.1) Upgrade patch i am getting the below error.
    Raised Sev 2 SR with Oracle and they requested to change the following following paramter and bounce the DB as well Listener and re-start the patch. Did the same but no luck. Please let us know if anyone faced similar issue and fix for this issue
    Edit the sqlnet.ora and set the parameter:
    SQLNET.INBOUND_CONNECT_TIME=0
    Edit the listener.ora and set the parameter
    connect_timeout_ = 0
    ============================================================================================================================================
    adjava oracle.apps.ad.worker.AdJavaWorker "(DESCRIPTION=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=ihr45r)(PORT=31101)))(CONN
    ECT_DATA=(SID=IHR45R)))" APPS ***** thin 4 /home/apps/ora_hr/IHR45R/apps/apps_st/appl/admin/adUtilMapNew.txt
    Copyright (c) 2002 Oracle Corporation
    Redwood Shores, California, USA
    AD Java
    Version 12.0.0
    NOTE: You may not use this utility for custom development
    unless you have written permission from Oracle Corporation.
    Reading product information from file...
    Reading language and territory information from file...
    Reading language information from applUS.txt ...
    Temporarily resetting CLASSPATH to:
    "/home/apps/ora_hr/IHR45R/apps/apps_st/appl/ad/12.0.0/java/adjava.zip:/home/apps/ora_hr/IHR45R/apps/tech_st/10.1.3/appsutil/jdk/lib/dt.jar:/home/apps/ora_h
    r/IHR45R/apps/tech_st/10.1.3/appsutil/jdk/lib/tools.jar:/home/apps/ora_hr/IHR45R/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/rt.jar:/home/apps/ora_hr/IHR45R/app
    s/apps_st/comn/java/lib/appsborg.zip:/home/apps/ora_hr/IHR45R/apps/tech_st/10.1.2/forms/java:/home/apps/ora_hr/IHR45R/apps/tech_st/10.1.2/forms/java/frmall.j
    ar:/home/apps/ora_hr/IHR45R/apps/tech_st/10.1.2/jlib/ewt3.jar:/home/apps/ora_hr/IHR45R/apps/tech_st/10.1.2/j2ee/OC4J_BI_Forms/applications/formsapp/formsweb/
    WEB-INF/lib/frmsrv.jar:/home/apps/ora_hr/IHR45R/apps/apps_st/comn/java/classes"
    Calling /home/apps/ora_hr/IHR45R/apps/tech_st/10.1.3/appsutil/jdk/jre/bin/java ...
    Exception in thread "main" java.sql.SQLRecoverableException: Io exception: Broken pipe
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:521)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:418)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:510)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at oracle.apps.ad.worker.AdJavaWorker.getAppsConnection(AdJavaWorker.java:1036)
    at oracle.apps.ad.worker.AdJavaWorker.main(AdJavaWorker.java:276)
    Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:103)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:147)
    at oracle.net.ns.DataPacket.send(DataPacket.java:150)
    at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:180)
    at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:169)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)
    ============================================================================================================================================
    Thanks and Regards,
    Jagadeesha

    Hi ,
    Thanks for our prompt response.
    After following Oracle Recommendation same error getting no improvement.
    Below is the alert log error.
    ================================================================================================
    Fatal NI connect error 12170.
    VERSION INFORMATION:
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    TCP/IP NT Protocol Adapter for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    Oracle Bequeath NT Protocol Adapter for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    Time: 01-NOV-2012 11:02:37
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12535
    TNS-12535: TNS:operation timed out
    ns secondary err code: 12606
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
    Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.16.0.194)(PORT=61100))
    WARNING: inbound connection timed out (ORA-3136)
    Thu Nov 01 11:02:45 2012
    ==============================================================================================
    Let me know how to check the processes we have 8 CPU and running with distrubed mode with 32 worker with each server 16.
    Let me know what i need to check in the /etc/hosts file.
    Thanks,
    Jagadeesha

  • Exception in thread "main" java.lang.NoSuchMethodError: com.sun.xml.wss.con

    Hi everyone,
    Just now i tried to run the 'simple' example in an JAXRPC Security part in the JWSDP 1.4 tutorial but got the following error:
    run-sample:
    [echo] Running the simple.TestClient program....
    [java] Service URL=http://localhost:8080/securesimple/Ping
    [java] Exception in thread "main" java.lang.NoSuchMethodError: com.sun.xml.wss.configuration.SecurityConfigurationXmlReader.readJAXRPCSecurityConfigurationString(Ljava/lang/String;Z)Lcom/sun/xml/wss/configuration/JAXRPCSecurityConfiguration;
    [java]      at com.sun.xml.rpc.security.SecurityPluginUtil.<init>(SecurityPluginUtil.java:128)
    [java]      at simple.PingPort_Ping_Stub.<clinit>(PingPort_Ping_Stub.java:40)
    [java]      at simple.PingService_Impl.getPing(PingService_Impl.java:68)
    [java]      at simple.TestClient.main(TestClient.java:27)
    Can anybody give me a clue?

    Vishal, thanks a lot for your reply. I used the App Server 2004Q4 beta and got the problem. When I switch to version 8.0.0_01 the things work well.
    But now I'm trying to understand this example and creating my own simple web app using encryption feature. From the files in the example dicrectory I can figure out the security applied at client by examining client stub files generated by the wscompile in the asant gen-client task. But I wonder when security is added to the server side. Is it when we use wsdeploy with the model part specifiedin jaxrpc-ri.xml? What is the procedure to apply the security to the web service?
    The last thing I want to ask is whether the deploytool bundled inside App Server can do the same things as ant task (eg. wsdeploy with some arguments).

  • Exception in thread "main" java.lang.NoSuchMethodError?

    This is the exact same error I recieved from running ListGames:
    Exception in thread "main" java.lang.NoSuchMethodError: ListGames.getConnection(Ljava/lang/String;)Ljava/sql/Connection;
    at ListGames.getGames(ListGames.java:21)
    at ListGames.main(ListGames.java:7)
    What's wrong?
    ListGames.java:
    import java.sql.*;
    import java.text.NumberFormat;
    import ...util.MysqlConnection; // purposely incomplete
    public class ListGames {
         static Connection conn = MysqlConnection.openMysqlConnection("ds_games");
         public static void main(String args[]) {
              NumberFormat cf = NumberFormat.getCurrencyInstance();
              ResultSet games = getGames();
              try {
                   while (games.next()) {
                        Game g = getGame(games);
                        String msg = Integer.toString(g.year) + ": " + g.title + " (" + cf.format(g.price) + ")";
                        System.out.println(msg);
              } catch (SQLException e) {
                   e.printStackTrace();
                   conn = MysqlConnection.closeMysqlConnection(conn);
         private static ResultSet getGames() {          
              try {
                   Statement s = conn.createStatement();
                   ResultSet rows = s.executeQuery("select title, year, price from my_ds_games order by year, price, title");
                   return rows;
              } catch (SQLException e) {
                   e.printStackTrace();
                   conn = MysqlConnection.closeMysqlConnection(conn);
              return null;
         private static Game getGame(ResultSet games) {
              try {
                   String title = games.getString("Title");
                   int year = games.getInt("Year");
                   double price = games.getDouble("Price");
                   return new Game(title, year, price);
              } catch (SQLException e) {
                   e.printStackTrace();
                   conn = MysqlConnection.closeMysqlConnection(conn);
              return null;
         private static class Game {
              public String title;
              public int year;
              public double price;
              public Game(String title, int year, double price) {
                   this.title = title;
                   this.year = year;
                   this.price = price;
    MysqlConnection.java:
    package ...util; // purposely incomplete
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public final class MysqlConnection {     
         public static final Connection openMysqlConnection(String database) {
              Connection conn = null;
              try {
                   Class.forName("com.mysql.jdbc.Driver");
                   conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/" + database, user, password); // username and password purposely uninitialized
              } catch(SQLException e) {
                   System.out.println("SQLException: " + e.getMessage());
                   System.out.println("SQLState: " + e.getSQLState());
                   System.out.println("VendorError: " + e.getErrorCode());
              } catch(Exception e) {
                   e.printStackTrace();
              } finally {
                   return conn;
         public static final Connection closeMysqlConnection(Connection conn) {
              try {
                   if (conn != null) {
                        conn.close();
                        if (conn == null) {
                             System.out.println("Conection Closed");
              } catch (SQLException e) {
                   e.printStackTrace();
              } finally {
                   return null;
    }

    Darkstar444 wrote:
    I deleted ListGames.class, ListGames$Games.class, and MysqlConnection.class but still the same thing.Then you didn't delete the version of ListGames.class which is actually being used when you run your application. This suggests that your classpath is pointing to an old version as well as to the version produced currently by the compiler. Or that there's an old version which you put into the Java extensions directory.

  • Exception in thread "main" java.lang.NoSuchMethodError: main -- Help

    I am new to Java programming and I have been working out of a book trying to learn the language. I am working on a Ubuntu system using Eclipse. I get an error when I try to run this app. It is: Exception in thread "main" java.lang.NoSuchMethodError: main. I have Googled it and read different possible solutions, but none have helped. Can someone help me solve this?
    Here is the code for battleshipGameTestDrive.java:_
    import java.util.ArrayList;
    public class battleshipGameTestDrive
         public static void main(String[] args, ArrayList<String> locations)      
              int numOfGuesses = 0;
              boolean isAlive = true;
              GameHelper helper = new GameHelper();
              battleshipGame ship = new battleshipGame();
              for (int ctr = 1; ctr < 4; ctr++)
                   int randomNum = (int) (Math.random() * 5);          
                   locations.add(Integer.toString(randomNum));
                   ship.setLocationCells(locations);
              while (isAlive == true){
                   String userGuess = helper.getUserInput("Enter a number (1-7): ");
                   numOfGuesses++;
                   String result = ship.checkYourself(userGuess);
                   if (result.equals("kill")){
                        isAlive = false;
                        System.out.println("You took " + numOfGuesses + " guesses");
                   } // close result if
              }  //end while loop
         }// end of main
    }// end of battleshipGameTestDrive class
    Here is the code for the battleshipGame class.java:_
    import java.util.ArrayList;
    public class battleshipGame {
         private ArrayList<String> locationCells;
         public void setLocationCells(ArrayList<String> loc){
              locationCells = loc;
         public String checkYourself(String userInput){
              String result = "miss";          
              int index = locationCells.indexOf(userInput);
              if (index >= 0){
                   locationCells.remove(index);
                   if (locationCells.isEmpty()){
                        result = "kill";
                   }else{
                        result = "hit";
                   }// close if
              }// closer outer if
              return result;
         }     //close method
    }     //close class

    Hello,
    I saw your short message youe sent to someone who had a problem : Exception in thread "main" java.lang.NoSuchMethodError :main
    So I was thinking maybe you could help me I struggle with this code fro 3weeks, this is a code I save it later as
    import java.awt.*;
    import java.awt.event.*;
    class Party {
    public void makeInvitation(){
    Frame f = new Frame();
    Label l = new Label("Party at Tom's");
    Button b = new Button("Sure");
    Button c = new Button("Noo...");
    Panel p = new Panel();
    p.add(l);
    I write this code in Notepad++ than I save it as java file with looks like this : Java source file (*.java)
    - than in Command Prompt I write : javac Party.java as usual and it comes with this error below Exception in thread "main" .......
    I have no idea what's wrong with it.Can you help me
    Thank you in advance

Maybe you are looking for

  • Windows Vista 64 bit unknown error -69

    Can anyone help please - I've recently brought a new laptop which uses Vista 64 bit. I have downloaded itunes 8, however every time I open itunes or try to use a disk to transfer library from my old computer it gives me an error message 'An unknown e

  • Foreign exchange reporting : how to include Inhouse Cash Accounts correctly

    Hello, I want to report the foreign exchange risk position of a mother company (euro based) which is also hosting the inhouse cash center. This means that the foreign currency balances held by the affiliates with the IHC are part of the fx exposure o

  • Horizontal menu bar moves between different pages

    Hello, I have all of the page properties to the same values; however I am noticing the horizontal menu bar at different levels when I load my pages.  The website is AbileneDentist.com. Any idea on what could be causing this to occur? Thanks, Mark

  • User Exit IN f-63

    Hi Forum I need to found one user exit in f-63 transaction when the user save it, unfortunely i haven´t found anyone. Some one knows how can i do it ? Thnks Josué Cruz

  • How to unmerge skype and hotmail account?

    whenever I receive a message from live messenger, both live messenger and skype flash on my taskbar, I dont like this...