Hello again,
I looked again in different forums, and it seems that there are many
who have encountered my problem. I found a solution in Sun forums in the
following
thread
http://forums.sun.com/thread.jspa?threadID=567630
The user named 0_kevin_0 suggests that the Ressource element be defined
directly inside the server.xml file of the
Tomcat server, rather than in
context.xml of the web application (this was the method for older versions of Tomcat).
I proceeded according to his method, but at the same time I modified a little my servlet
I added three System.out.println inside the servlet in order to better see where exactly the problem is
my servlet:
After running, I saw that the first two messages were printed, that is,
Ok, the environment java/env exists
Ok, the dataSource was created successfully
And right after connection = dataSource.getConnection(); I have the
following error message in the Netbeans Tomcat tab:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class ' ' for connect URL 'null'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at servlets.Servlet1.doPost(Servlet1.java:51)
at servlets.Servlet1.doGet(Servlet1.java:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
at java.sql.DriverManager.getDriver(DriverManager.java:253)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
... 17 more
I'm going to show you the complete content of my server.xml file, inside the
<GlobalNamingResources> </GlobalNamingResources> I have added the
Ressource definition for Oracle (it is between the following lines:
<!-- ********** Oracle 11g Ressource definition (begin) ************ -->
.
.
.
<!-- ********** Oracle 11g Ressource definition (End) ************ -->
And then in Netbeans, my context.xml for my application is
And my web.xml file for my web application
What do you think? Where did I make a mistake (or maybe several mistakes?!)
Thank you very much for your attention,
Kind Regards,