?
Solved

noclassdef found error

Posted on 2005-04-25
2
Medium Priority
?
400 Views
Last Modified: 2010-03-31
can someone tell me what i'm doing wrong here..thanks..

i keep getting this error
Exception in thread "main" java.lang.NoSuchMethodError: main


import oracle.jdbc.driver.OracleDriver;
import java.sql.*;
import java.util.*;
import java.io.*;
import java.net.URL;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.MultipartPostMethod;
import org.apache.commons.logging.*;
import org.apache.commons.codec.*;


public class uploadVoip
{

  public uploadVoip() throws SQLException {

 generateFile();

 String targetURL = "http://signup.callplus.co/Upload.aspx";

 File targetFile = new File("/data/usr/swiftel/peoplevoip.CSV");

MultipartPostMethod filePost =
                        new MultipartPostMethod(targetURL);

                    try {
                                    filePost.addParameter("fileProvisioningData", targetFile);
                                    filePost.addParameter(targetFile.getName(), targetFile);
                        HttpClient client = new HttpClient();
                        client.setConnectionTimeout(5000);
                        int status = client.executeMethod(filePost);
                        if (status == HttpStatus.SC_OK) {
                           System.out.println(filePost.getResponseBodyAsString());
                        } else {
                            System.out.println( "ss1" );
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    } finally {
                        filePost.releaseConnection();
                    }

  }
  public void generateFile() throws SQLException {
          CallableStatement cs;

          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

          Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.1.1.1.:1521:PROD", "jan", "lte");


          String sql = "BEGIN SUB.WEB_INTERFACE.GENERATE_VOIP; END;";

          PreparedStatement pstmt = conn.prepareStatement(sql);

          pstmt.execute();


          pstmt.close();
          conn.commit();
          conn.close();


    }
static public void main()  throws SQLException {

        try {
            new uploadVoip();
        }
        catch( SQLException ie ) {
            ie.printStackTrace();
        }
    }

}

0
Comment
Question by:desiboy1974
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 13863631
> static public void main()  throws SQLException {

should be:

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

Author Comment

by:desiboy1974
ID: 13863673
dam..:)...forgot about that..thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question