I tried everything that I can find there, if someone can help me, I will be eternally grateful (and much more free in due time).
Basically, I have an error in Tomcat 7.0 (both when starting in Eclipse and through startup.bat) that says this as soon as my dynamic web applications start receiving data:
Cannot create JDBC driver of class '' for connect URL 'null' 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)
I have a sqljdbc4.jar file in my tomcat \ lib directory. I also tried putting this in my WEB-INF / lib and even in my JDK lib directories. I do not think sqljdbc.jar will work as it is for older JDK / JREs than mine.
I heard that the context.xml and web.xml files are critical to work.
snippet web.xml:
<resource-ref> <description>LBI DB Connection</description> <res-ref-name>jdbc/LBIDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> <resource-ref> <description>OR DB Connection</description> <res-ref-name>jdbc/ORDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
context.xml
<Context> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name="jdbc/LBIDB" auth="Container" type="javax.sql.DataSource" username="***" password="***" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver:localhost;DatabaseName=YYBackOffice;SelectMethod=cursor;" maxActive="8" maxIdle="4"/> <Resource name="jdbc/ORDB" auth="Container" type="javax.sql.DataSource" username="***" password="***" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver:localhost;DatabaseName=XXBackOffice;SelectMethod=cursor;" maxActive="8" maxIdle="4"/>
The Context tab ultimately has a closing tab.
Please, help! If you need more information, please let me know. Also, I'm not sure which context.xml file should be changed, there are 2 in Tomcat directories, one in the / conf folder and one in the webapps / appname / META-INF folder. Sorry if this sounds like I'm a little rookie because I am!
In addition, I saw many different examples of url = "..." of the context.xml part, some of which include port numbers. I tried several things on the Internet, but nothing works (nothing helps online, this is my exact data environment, I also believe that it is difficult that this application requests two different databases at a given time).
Thoughts?