Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSF-Questions exception in thread main while running servlet
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


priti tandel
exception in thread main while running servlet
3 Answer(s)      2 years and 2 months ago
Posted in : Java Server Faces Questions


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


Advertisement
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
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
:\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
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
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
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... in Java Programming Language. These are Java Main Thread and the Child Thread
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
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
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
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
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
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
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
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
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 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
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
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
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
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
Java Exception Thread
Java Exception Thread     ... to Overcome this Thread Exception in Java Program In the preceding code, we... RunnableExample { public static void main(String args[]) { Thread threada = new
Diff between Runnable Interface and Thread class while using threads
Diff between Runnable Interface and Thread class while using threads  Diff between Runnable Interface and Thread class while using threads   Hi Friend, Difference: 1)If you want to extend the Thread class
Advertisements
 

 

 

DMCA.com