You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ajay Ejantkar <aj...@yahoo.com> on 2001/05/16 16:44:11 UTC
running query servlet
I am attempting to run a servlet that allows a query to be submitted to
a database, and the results are returned. When I try to access the
servlet I get the following error:
Error: 500
Location: /myapp/query
Internal Servlet Error:
javax.servlet.ServletException: Query: can't initialize: null
at Query.init(Query.java:31)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
Root cause:
java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at Query.init(Query.java:26)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
Does anyone know what the cause of this could be thanks.
Ajay
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
question about setting up Apache and Tomcat
Posted by HDung <bb...@yahoo.com>.
Hello everybody,
I've had hard time in setting up Apache to talk to
Tomcat in WinNT.
I read some questions and answers similar to my
problem but they didn't help me either.
Hopefully, I can get help from this list.
Here is what I did:
-installed Tomcat 3.2.1
-installed Apache 1.3.14
-downloaded mod_jk.dll and put it under
c:/Apache/modules dir.
-added the following lines to httpd.conf
LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c
JkWorkersFile
/usr/local/tomcat/conf/workers.properties
JkLogFile /usr/local/apache/logs/mod_jk.log
JkLogLevel warn
Include "c:\tomcat\conf\mod_jk.conf-auto"
-commented out the connector to port 8080 in
server.xml
-Set classpath for Tomcat and Apache
-Use 8007 for ajp12
When I setup Tomcat stand alone, everything is fine.
The installation for Apache is also successful (I can
see the first page saying I'm successful in installing
Apache when go to http://localhost)
After setup Apache to talk to Tomcat, I go to
http://localhost/schart/test.jsp
(Schart is the directory where I put my jsp)
It can't find my file, looking in the log file, the
server looks for /apache/htdocs/schart/test.jsp
instead of looking for it in Tomcat. So, I know the
setup is not right and Apache can't talk to tomcat.
Please help.
Thank you so much!
Thao Nguyen
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
Re: running query servlet
Posted by Kevin Pang <la...@hotmail.com>.
It looks like servlet can't find the JDBC driver, make sure the driver in
Tomcat's classpath.
> at java.lang.Class.forName(Class.java:120)
regards,
Kevin