exception in thread main while running servlet

exception in thread main while running servlet

I got exception in thread main no such method error while running servlet. I have added servlet.api.jar file in classpath.my classpath is C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Demo\WEB-INF\lib\mysql-connector-java-5.1.22\mysql-connector-java-5.1.22-bin.jar

View Answers

October 4, 2012 at 5:01 PM

Put mysql-connector-java-5.1.22-bin.jar in tomcat lib also. Restart your server then run your code.


October 5, 2012 at 11:47 AM

tnx for rply.my problem got solved when i set classpath=%classpath%;.; fom cmd prompt.Now this exception got resolved but browser doesnot show out put.When i tried database conn code in java pgm having main method it runs properly .But when i added same code to servlet browser doesn't show any output.control doesn't reach toward Class.forName(com.mysql.jdbcDriver).the line before class.forName got printed but line after not printed


October 8, 2012 at 10:25 PM

hi,

May be becoz of mysql jar file.its not recognized by tamcat.can u show ur code?









Related Tutorials/Questions & Answers:
exception in thread main while running servlet
exception in thread main while running servlet  I got exception in thread main no such method error while running servlet. I have added...\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation
Exception in thread "main" java.lang.ClassCastException
Exception in thread "main" java.lang.ClassCastException  I am trying to connect the database. I am stuck with this exception that is getting thrown...(); ResultSet rs = stmt.executeQuery(query); String s = ""; while (rs.next()) { // do
Advertisements
Exception in thread "main" java.lang.ClassCastException
Exception in thread "main" java.lang.ClassCastException  I am trying to connect the database. I am stuck with this exception that is getting thrown...(); ResultSet rs = stmt.executeQuery(query); String s = ""; while (rs.next()) { // do
exception in thread main java.lang.unsupportedclassversionerror in ubuntu
exception in thread main java.lang.unsupportedclassversionerror in ubuntu  Hi, In Ubuntu I am trying to run Java program and its throwing exception. exception in thread main java.lang.unsupportedclassversionerror in ubuntu How
exception in thread main java.lang.unsupportedclassversionerror in eclipse
exception in thread main java.lang.unsupportedclassversionerror in eclipse  Hi, I am trying to run a library which is from some other project. But it throws exception in thread main java.lang.unsupportedclassversionerror
getting classnotfound exception while running login application
getting classnotfound exception while running login application  hi... to bean 'loginController' while setting bean property 'urlMap' with key [TypedStringValue: value [/login.html], target type [null]]; nested exception
Records are not inserting in to main table while running the mysql stored procedure.
Records are not inserting in to main table while running the mysql stored procedure.  Hi, Im migrating procedures from oracle to MySql.In that procedure records are not inserted into main table from temp table.But im getting msg
exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
exception in thread main java.lang.unsupportedclassversionerror unsupported... getting the this error :exception in thread main...!"); } } for example: javac xxx.java-->comping java xxxx:error :exception in thread main
exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
exception in thread main java.lang.unsupportedclassversionerror unsupported... is compling but runtime i am getting the exception in thread main.... Thanks  my code is class xxx { public static void main(String
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: TESTING is not mapped [FROM TESTING]
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: TESTING...(HiberTest.java:18) Exception in thread "main...)); } } } couldn't connect to tDB using, SQL statements. Exception in thread "main
error of HTTP Status 404 while running servlet on apache tomcat server
error of HTTP Status 404 while running servlet on apache tomcat server  i have followed the steps given here.Also hava put servlet-api in lib folder... the apache tomcat page. It mean that my tomcat server is up and running. but whn i
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger  Hi, How to solve following error? Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
Exception in thread
Exception in thread   Hi, In my code following error is coming: Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject I have imported: import org.json.JSONObject; but its not working. What
Exception in thread
Exception in thread   Hi, In my code following error is coming: Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject I have imported: import org.json.JSONObject; but its not working. What
Exception in thread
:\mail.jar SendMailTLSDFC Exception in thread "main" java.lang.NoClassDefFoundError...Exception in thread   Hi, I have created a java file for sending a file to my mail. I am using mail.jar file. I am able to create .class file
Exception in Thread
Exception in Thread    i am developing a rmi application in eclipse... client and generate connection with server i have following exception : Blockquote Exception in thread "RMI TCP Connection(idle
While running jsp
While running jsp  I found this error when i run the client.jsp can anyone help me javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8080/WebService1/MyWebService?wsdl. It failed with: http
error while running a jsp page in netbeans
error while running a jsp page in netbeans  this is error that come under column "java db processes" in netbeans Exception in thread "main" java.lang.ExceptionInInitializerError
Main Thread and Child Thread
and Child Threads used in Programming. Main thread is automatically created when program runs. Child Thread gets created by the main thread . Java Main... 1 this thread is main 1 this thread is Child 2 this thread is Child 3
Im getting this error while running JPA project
Im getting this error while running JPA project  Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] Unable to configure EntityManagerFactory
exception in servlet
exception in servlet  If a servlet is not properly initialized, what exception may be thrown?   During initialization or service of a request, the servlet instance can throw an UnavailableException
Running threads in servlet only once - JSP-Servlet
process while mail thread is running. these two separate threads has to run...Running threads in servlet only once  Hi All, I am developing a project with multiple threads which will run to check database continuously
difference between main thread and child thread?
difference between main thread and child thread?  any one give correct exact difference.   in jsp 7 implicit objects are available those... information regarding the Servlet configuration, stored in the Config object 6
How to Differenciate Main Thread and Child Thread in Java
How to Differenciate Main Thread and Child Thread in Java  hi... Main Thread and Java Child Thread. Please Suggest any example or online link... Language. These are Java Main Thread and the Child Thread. The Below reference
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException  ... is clicking I getting the error : Exception in thread "AWT-EventQueue-0... { Image m; Thread t; NextPage(final String uname
problem running a servlet on tomcat.
problem running a servlet on tomcat.  i have followed the steps given... suppose that should mean that my tomcat server is up and running. but whn i try to run my servlet that is placed in the directories as it has been mentioned here
error while running the applet - Java Beginners
error while running the applet  import java.applet.Applet; import...); ++num; } } } } i have problem while running the code , error...(); System.exit(0); } catch(Exception e
how to solve the nullPointer Exception in main - Java Beginners
: Exception in thread "main" java.lang.NullPointerException...how to solve the nullPointer Exception in main  New to Java ,pls help me how fix Null pointer Exception in main: two files , split .java another
thread with in the servlet..? - JSP-Servlet
thread with in the servlet  Please explain me the concept of Java thread ..and it's use with Servlet.Thanks in advance
MAin error
MAin error  Error while running hello program in another dir rather in bin. path is already set. java -version jdk1.6.0_24 no error while compilation but @ d tym of runnin error in main class is generated Exception in thread
How to skip test while running maven build
How to skip test while running maven build  Hi, By default maven mvn... to run the test again and again while developing application. I want to skip the test while building my application. How to skip test while running maven build
Getting an exception - JSP-Servlet
running it will throwing an exception please help me sir thanks...Getting an exception   sir i am Getting following exception when... org.apache.poi.poifs.filesystem.POIFSFileSystem; public class ReadExcelFile { public static void main(String
How to put our own wanted thread into running state..?
How to put our own wanted thread into running state..?  How to put our own wanted thread into the running state by stopping already running one
Exception while inserting image in oracle using java
Exception while inserting image in oracle using java  import java.sql.*; import java.io.*; class Oracle2 { public static void main(String args[])throws Exception { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver
Exception handling in super and subclass while implementing inheritance,,?
Exception handling in super and subclass while implementing inheritance,,?  How to implement Superclass Exceptions with SubClass while implementing Inheritance concept in core java.? Please answer for this with sample code
Jsp.jasper exception - JSP-Servlet
Jsp.jasper exception   Thank for u answer for yesterday question I am geeting an exception while running the code exception org.apache.jasper.JasperException: Index: 2, Size: 2
Nullpointer Exception - JSP-Servlet
of the servlet program? how can i solve this exception ? HTTP Status 500... Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
Getting an exception - JSP-Servlet
Getting an exception  Dear Sir , While sending a mail am getting an following exception javax.mail.MessagingException: 554 mail server permanently rejected message (#5. 3.0)so how to over come from this please help
exception in jsp - JSP-Servlet
exception in jsp  hi my code is given below.while running that code i got exception like given below.plz any body help me HTTP Status 500... Exception report message description The server encountered
i got an exception while accept to a jsp
i got an exception while accept to a jsp  type Exception report... () that prevented it from fulfilling this request. exception...; ****thanks for your answer, exception comes through unicode format
Getting an exception - JSP-Servlet
Getting an exception  sir i m Getting an following exception while... SoftWare Engg 10000 javax.mail.MessagingException: IOException while sending message; nested exception is: java.io.FileNotFoundException
Servlet os running commands issues - Development process
Servlet os running commands issues  hello, i want the help regarding the running os commands through servlet. so please send it either on my personal email address or send it on the rose india servlet tutorial. thanx n
Getting an exception - JSP-Servlet
exception please help me sir if an changes tel me sir thanks in advance... = mySheet.rowIterator(); while (rowIter.hasNext()) { HSSFRow myRow = (HSSFRow... cellStoreVector = new Vector(); while (cellIter.hasNext()) { HSSFCell myCell
Getting an exception - JSP-Servlet
Getting an exception  Dear sir,while executing this code i am getting... of a is " + f); } } //following is an exception org.apache.jasper.JasperException: An exception occurred processing JSP page /jsp/newTestMES3.jsp at line
Java Exception Thread
Java Exception Thread     ... interface( java .lang. thread) Understand Exception in Threads. 1.A class name... is to be normal termination or caught exception.  5.runner = new Thread
Exception - JSP-Servlet
Exception  Hi team, This is Ragavendran.R. I am getting java.lang.StringIndexOutOfBoundsException: String out of range : 6 error while compiling the following program in JSP charting application: Plz reply
sql exception - JSP-Servlet
sql exception  Dear sir , I am working in a web-based project, In my system it is working fine but at client side getting the following exception so how to resolve this help me... java.sql.SQLException: ORA-28231
Getting an exception - JSP-Servlet
Getting an exception  thanks sir for u r reply ,but i already added that jar file sir even though i m getting an exception sir please help me sir ... thanks in advance..  Hi Friend, You can do one thing, replace
Exception handling - JSP-Servlet
Exception handling  I have added DSN 'online_exam' in Administrative... the following exception type Exception report message description The server.... exception org.apache.jasper.JasperException
Handling exception in jsp - JSP-Servlet
Handling exception in jsp  Hai..... Could you please tell me "How to handle Servlet Exception object in jsp pages?"  Hi friend, For solving the problem visit to : http://www.roseindia.net/jsp

Ads