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



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

Have Programming Question? Ask it here!
 
 
 


priti tandel
exception in thread main while running servlet
3 Answer(s)      a year and 10 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
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
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
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
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
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
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
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
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
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
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
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
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
Get Thread Name
. The JVM provides an  application to execute the multiple thread running... returns you the information about the particular thread running in the code... Get Thread Name      
Trouble in running Dos Command from Java Servlet
Trouble in running Dos Command from Java Servlet  Hello All, I have... find the specified file. The above line of codes are in one servlet and from servlet I wants to run specified DOS Command. Can anyone help me out here ? I
Handle Null Pointer Exception while text file upload
Handle Null Pointer Exception while text file upload  I want the code for handling null pointer exception in jsp page. That is I need an error page for null pointer exception. The cause for null pointer exception is while
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
Thread
(Exception ex) { } } }; Thread mainth = new Thread(main... should produce the sum of 1 to 10, 11 to 20 and 21to 30 respectively. Main thread...); } catch(Exception ex) { } } }; Thread thread3 = new Thread
Thread
. On this state a thread is waiting for a turn on the processor. Running state ? A thread is in running state that means the thread is currently executing... in Running state: the scheduler select a thread from runnable pool. Dead state
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
The Currently Running Servlet is showing some Previously run Servlet's Output
The Currently Running Servlet is showing some Previously run Servlet's... for example, I have executed the ParameterServlet servlet where the output... am executing another different servlet, It is showing the same output
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
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
Advertisements
 

 

 

DMCA.com