This may sound like a dumb question, but you did create the DSN on the machine where Tomcat is running, didn't you? And you did configure it with the full path to where you put it in the web application, ending with "...\WEB-INF\something.mdb", right?
Joined: Apr 26, 2006
of course i configured the dsn to E:\sw\tc\webapps\dba\WEB-INF when running the app in core java as well as accessing it through a servlet.
please help this is causing a real headache. everything is configured properly. everything in the browser runs fine and i get a blank page as expected, as there are no print writer statements. but in the stdout folder of the tomcat\log directory i dont get the proper out put. in fact the model is not able to access the database at all after calling it from the servlet rateher then calling from the main() in core java. i tried this on 2 systems. xp and win 2000.
java.sql.SQLException: General error at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source) at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.example.dba.go(dba.java:24) at com.example.invoke.doPost(invoke.java:16) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)
looks like after making the core java file into a model and accessing it through a servlet is somehow making the dsn unavailable i think.
i have created both system dsn and user dsn. still it dosent work. but how can this happen when tomcat is configured to use the same jvm? the default jvm should access the dsn. is there any problem with the location of the mdb file?
Joined: Apr 25, 2005
hey, it worked on my system.
I just created user dsn. Placed both the classes invoke and dba in classes folder. Made all the servlet entries in web.xml. Mapped it by *.servlet.
Thats the total configuration which I have made.
My tomcat version is 5.5.8.
I am able to fetch the data from servlet as well as from java program.
Joined: Apr 26, 2006
can u post the web.xml as well as what do u mean by map *.servlets? if it works there, it should work here also. can u give me step by step procedure what u did please? also specify which dsn u created and where u placed ur mdb file. by the way here is the web.xml i used.