I've tried just about everything I can find out there, if someone is able to help me out, I will be eternally grateful (and a lot more free in my time).
Basically, I have an error in Tomcat 7.0 (both when running within Eclipse and via startup.bat) that says this once data begins to be accessed by my dynamic web application:
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 the sqljdbc4.jar file in my tomcat\lib directory. I have also tried putting this in my WEB-INF/lib, and even my JDK lib directories. I don't think sqljdbc.jar will work, as it is intended for older JDK/JRE installs than mine.
I've heard the context.xml and web.xml files are crucial in getting this to work.
web.xml snippet:
<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>
<!-- Default set of monitored resources -->
<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 does have a closing tab, eventually.
Please help! If you need any more information, please let me know. Also, I'm not sure which context.xml ought to be modified, there are 2 in the Tomcat directories, one in the /conf folder, and one in the webapps/appname/META-INF folder. Sorry if it sounds like I'm a bit of a rookie, that's because I am!
Also, I've seen many different examples of the url="..." part of the context.xml, some including port numbers. I have tried several things out online, but nothing seems to work (doesn't help nothing online is my exact data environment, also I suppose it's challenging that this app queries two different DBs at given times).
Thoughts?