You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Konstantin Kolinko <kn...@gmail.com> on 2009/07/14 12:19:26 UTC
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
2009/7/14 Neil Youngman <Ne...@wirefast.com>:
> I'm having trouble getting Oracle access from Axis2 to work under
> Tomcat 6. I've spent a lot of time Googling and prodding and poking
> the application and I haven't found a solution that works for me.
>
> Oddly the configuration I'm using seems to work for another
> application.
>
> Let's start with the configuration in axis2/META-INF/context.xml,
> which is:
>
(...)
Look at $CATALINA_BASE/conf/Catalina/localhost/<your web app name>.xml
That is a copy of your context.xml file that Tomcat creates when the
app is deployed. This copy takes precedence over its original. Maybe
your Resource isn't defined there.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Rainer Frey <ra...@inxmail.de>.
On Tuesday 14 July 2009 14:31:06 Caldarale, Charles R wrote:
> > From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
> > Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
> > URL 'null'
> >
> > That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf
>
> Regardless, the lack of an [engine] subdirectory is an indication that you
> may not be running Tomcat from where you think you are.
Maybe 'WSAM' is the engine name. Maybe the OP should post his complete
server.xml.
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Caldarale, Charles R wrote:
>> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
>> That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf
>
> Regardless, the lack of an [engine] subdirectory is an indication that you may not be running Tomcat from where you think you are.
>
> 1) What's in $CATALINA_HOME/conf?
$ ls -l /usr/local/apache-tomcat-6.0.16/conf
total 92
-rw------- 1 root root 8568 Jan 28 2008 catalina.policy
-rw------- 1 root root 3665 Jan 28 2008 catalina.properties
-rw------- 1 root root 1396 Jan 28 2008 context.xml
-rw------- 1 root root 3664 Jan 28 2008 logging.properties
-rw------- 1 root root 6462 Jan 28 2008 server.xml
-rw------- 1 root root 1107 Jan 28 2008 tomcat-users.xml
-rw------- 1 root root 51226 Jan 28 2008 web.xml
$
> 2) What do the startup scripts display for the $CATALINA_xxx variables when you bring up Tomcat?
Using CATALINA_BASE: /home/tomcat6/wsam
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.16
Using CATALINA_TMPDIR: /home/tomcat6/wsam/temp
Using JRE_HOME: /usr/java/jdk1.6.0_06
That looks correct to me, but as you say:
> The fact that the JDBC-ODBC bridge shows up in the stack trace says that your published <Resource> config is not the one being used.
The <resource> config is in /home/tomcat6/wsam/webapps/axis2/META-INF/context.xml
Again that seems right to me, but obviously I am missing something.
Neil Youngman
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rainer Frey [mailto:rainer.frey@inxmail.de]
> Subject: Re: [ERROR] Cannot create JDBC driver of class '' for connect
> URL 'null'
>
> > Tomcat won't create the [engine]/[host] directory until it
> > needs to, such as when copying a <Context> element from a
> > META-INF/context.xml file.
>
> Has Tomcat 6 done that since initial release?
No, the [appName].xml file used to be created just when expanding a .war (and possibly some other conditions).
> To the OP: what exact version are you using?
He's already shown us: 6.0.16.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Rainer Frey <ra...@inxmail.de>.
On Tuesday 14 July 2009 15:56:07 Caldarale, Charles R wrote:
> > From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
> > Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
> > URL 'null'
> >
> > As an experiment I removed the WSAM directory and several restarts have
> > not recreated it.
>
> Tomcat won't create the [engine]/[host] directory until it needs to, such
> as when copying a <Context> element from a META-INF/context.xml file.
Has Tomcat 6 done that since initial release? I vaguely remember reading s.th.
related in 6.0.20 change log.
To the OP: what exact version are you using?
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
> URL 'null'
>
> As an experiment I removed the WSAM directory and several restarts have
> not recreated it.
Tomcat won't create the [engine]/[host] directory until it needs to, such as when copying a <Context> element from a META-INF/context.xml file. Since that directory is not being created, either you're not running Tomcat from where you think you are, or the <Context> element in your webapp's META-INF/context.xml file is not being recognized. Might want to double-check spelling of everything, since the XML files are case-sensitive.
Could also try a fresh install of 6.0.20 and see if that works.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Caldarale, Charles R wrote:
>> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
>> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
>> URL 'null'
>>
>> I should have realised that WSAM is the engine name from server.xml
>
> So what's under the WSAM directory?
There was a localhost subdirectory, which was completely empty.
As an experiment I removed the WSAM directory and several restarts have not recreated it.
Neil Youngman
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
> URL 'null'
>
> I should have realised that WSAM is the engine name from server.xml
So what's under the WSAM directory?
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Rainer Frey wrote:
> Maybe 'WSAM' is the engine name. Maybe the OP should post his complete
> server.xml.
Rainer is of course right. I should have realised that WSAM is the engine name from server.xml
The server.xml is quite simple.
$ cat /home/tomcat6/wsam/conf/server.xml
<?xml version='1.0' encoding='utf-8'?>
<Server port="4582">
<Service name="WSAM">
<Connector debug="10000" port="4580" />
<Engine name="WSAM" defaultHost="localhost">
<Host name="localhost"
appBase="webapps"
unpackWARs="true"
autoDeploy="true"
xmlValidation="false"
xmlNamespaceAware="false" />
</Engine>
</Service>
</Server>
Neil Youngman
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Neil,
>
> Just a few comments on your connection acquisition code:
>
> On 7/14/2009 12:45 PM, Neil Youngman wrote:
>> private static final String CONTEXT_NAME = "java:/comp/env";
>> private static final String DB_NAME = "jdbc/AppDatabase";
>
> If you have the same class in two applications (except for these two
> constants), why not use the same class plus a configuration file?
It's not the same class, but they share the code that connects to the database. It might be advantageous to factor it out, but they are currently small self contained apps.
>> private static Connection getConnection ()
>> throws Exception, SQLException
>> {
>> if( DATA_SOURCE == null )
>
> Hmm... a DataSource object is not guaranteed to be threadsafe. I would
> not bother to cache the DataSource object in your class: at least not in
> a static field.
OK, I'm happy to drop that.
> The "performance hit" you experience from performing repeated JNDI
> lookups is negligible, and your code has the benefit of always getting
> the "current" DataSource from the directory.
>
>> // Get the data source (from context.xml)
>> try
>> {
>> Class.forName("oracle.jdbc.OracleDriver");
>
> This line of code is not necessary at all, for several reasons:
>
> 1. The connection pool will already make sure this class is loaded
>
> 2. Standard JDBC practice is to call Class.forName(driver).newInstance()
> to make sure that the driver is, in fact, registered with the DriverManager.
>
> 3. A driver used with a DataSource does not bother to register itself
> with the DriverManager (see javadoc for javax.sql.DataSource).
>
> This is all you need:
>
>> Context initContext = new InitialContext();
>> Context envContext = (Context) initContext.lookup(CONTEXT_NAME);
>> DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME);
>
> That's it.
>
>> catch (Exception ex)
>> {
>> System.err.println( ex );
>> ex.printStackTrace();
>> throw ex;
>> }
>
>
> This exception handler doesn't add much: the caller has the opportunity
> to catch this exception, so why log it at this level?
I prefer not to rely on the caller logging exceptions. I want to be sure that I get a full stack trace and I can't always rely on the caller to provide it.
> If I were you, I'd try these steps to resolve your problem:
>
> 1. Remove the 'factory' attribute from your <Resource> declaration
> 2. Remove commons-dbcp-*.jar from WEB-INF/lib
I've already done both of these.
> This has a fair chance of working. Any particular reason you want to use
> a webapp-provided connection pool factory?
I think that was a hangover from tomcat 5. I've removed that, to no obvious effect.
Thanks for the pointers. I've still got a long way to go before I'm an expert and all the feedback helps.
Neil Youngman
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Neil,
Just a few comments on your connection acquisition code:
On 7/14/2009 12:45 PM, Neil Youngman wrote:
> private static final String CONTEXT_NAME = "java:/comp/env";
> private static final String DB_NAME = "jdbc/AppDatabase";
If you have the same class in two applications (except for these two
constants), why not use the same class plus a configuration file?
> private static Connection getConnection ()
> throws Exception, SQLException
> {
> if( DATA_SOURCE == null )
Hmm... a DataSource object is not guaranteed to be threadsafe. I would
not bother to cache the DataSource object in your class: at least not in
a static field.
The "performance hit" you experience from performing repeated JNDI
lookups is negligible, and your code has the benefit of always getting
the "current" DataSource from the directory.
> // Get the data source (from context.xml)
> try
> {
> Class.forName("oracle.jdbc.OracleDriver");
This line of code is not necessary at all, for several reasons:
1. The connection pool will already make sure this class is loaded
2. Standard JDBC practice is to call Class.forName(driver).newInstance()
to make sure that the driver is, in fact, registered with the DriverManager.
3. A driver used with a DataSource does not bother to register itself
with the DriverManager (see javadoc for javax.sql.DataSource).
This is all you need:
> Context initContext = new InitialContext();
> Context envContext = (Context) initContext.lookup(CONTEXT_NAME);
> DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME);
That's it.
> catch (Exception ex)
> {
> System.err.println( ex );
> ex.printStackTrace();
> throw ex;
> }
This exception handler doesn't add much: the caller has the opportunity
to catch this exception, so why log it at this level?
If I were you, I'd try these steps to resolve your problem:
1. Remove the 'factory' attribute from your <Resource> declaration
2. Remove commons-dbcp-*.jar from WEB-INF/lib
This has a fair chance of working. Any particular reason you want to use
a webapp-provided connection pool factory?
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkpc0SgACgkQ9CaO5/Lv0PD2WACghKVp2vvrk2F9m78R2lwcFGNp
JMcAn0g1W2O2C6h9dcRihYdClENiXIv1
=u5uA
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Caldarale, Charles R wrote:
>> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
>> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
>> URL 'null'
>>
>> private static final String DB_NAME = "jdbc/InterceptDatabase";
>
> But your <Context> has:
>
> <Resource name="jdbc/AppDatabase"
Oops. It's late in the day and I'm getting careless. That's from a different application. I'll try to copy from the correct editor window this time.
private static final String CONTEXT_NAME = "java:/comp/env";
private static final String DB_NAME = "jdbc/AppDatabase";
...
private static Connection getConnection ()
throws Exception, SQLException
{
if( DATA_SOURCE == null )
{
// Get the data source (from context.xml)
try
{
Class.forName("oracle.jdbc.OracleDriver");
Context initContext = new InitialContext();
Context envContext = (Context) initContext.lookup(CONTEXT_NAME);
DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME);
}
catch (Exception ex)
{
System.err.println( ex );
ex.printStackTrace();
throw ex;
}
}
return DATA_SOURCE.getConnection(); // line 208
}
Neil Youngman
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
> URL 'null'
>
> private static final String DB_NAME = "jdbc/InterceptDatabase";
But your <Context> has:
<Resource name="jdbc/AppDatabase"
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Christopher Schultz wrote:
>> Either way, it's
>> typically a disconnect between the <Resource .../> and it's use in the
>> jsp/servlet code.
>
> He didn't post his code. It would be good to see what is on line 208 in
> com.wirefast.wsam.service.WMSSubmissionService.getConnection.
Oops. I meant to include that.
private static final String CONTEXT_NAME = "java:/comp/env";
private static final String DB_NAME = "jdbc/InterceptDatabase";
...
private static Connection getConnection ()
throws Exception, SQLException
{
if( DATA_SOURCE == null )
{
// Get the data source (from context.xml)
try
{
Class.forName("oracle.jdbc.OracleDriver");
Context initContext = new InitialContext();
Context envContext = (Context) initContext.lookup(CONTEXT_NAME);
DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME);
}
catch (Exception ex)
{
System.err.println( ex );
ex.printStackTrace();
throw ex;
}
}
return DATA_SOURCE.getConnection(); // line 208
}
Neil Youngman
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David,
On 7/14/2009 11:29 AM, David Smith wrote:
> In the past, it's typically been caused by some misspell of the JNDI
> name between the <Resource ..../> element and the
> <resource-ref>...</resource-ref> in the WEB-INF/web.xml.
I've never had to use a <resourcr-ref> element in web.xml for a
<Resourcre> defined in META-INF/context.xml. I've even created incorrect
<resource-ref> elements in web.xml and not had a problem. I /do/ have
them in there, though, just in case :)
> I'd have to go
> back to the original post to tell if that's the case here or not.
Tsk, tsk. It was only a few hours ago:
META-INF/context.xml:
> <Resource name="jdbc/AppDatabase"
web.xml:
> <resource-ref>
> <description>DB Connection</description>
> <res-ref-name>jdbc/AppDatabase</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
Looks good to me.
> Either that or the resource was declared as a global resource without
> the requisite <ResourceLink /> in the context.
Nope, it was done in the recommended way (from the Tomcat docs, and
checked multiple times according to the OP).
> Either way, it's
> typically a disconnect between the <Resource .../> and it's use in the
> jsp/servlet code.
He didn't post his code. It would be good to see what is on line 208 in
com.wirefast.wsam.service.WMSSubmissionService.getConnection.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkpcqD0ACgkQ9CaO5/Lv0PBSBACaA3d45tyyA7K62NtHS4NWZ7FA
9KcAn0xqAVHruti85qkheBztd25N/n0d
=N63Z
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by David Smith <dn...@cornell.edu>.
In the past, it's typically been caused by some misspell of the JNDI
name between the <Resource ..../> element and the
<resource-ref>...</resource-ref> in the WEB-INF/web.xml. I'd have to go
back to the original post to tell if that's the case here or not.
Either that or the resource was declared as a global resource without
the requisite <ResourceLink /> in the context. Either way, it's
typically a disconnect between the <Resource .../> and it's use in the
jsp/servlet code.
Having said all that, I'm certain there are a few cases that blow what I
just wrote out of the water. :-)
--David
Christopher Schultz wrote:
> Chuck,
>
> On 7/14/2009 8:31 AM, Caldarale, Charles R wrote:
> > The fact that the JDBC-ODBC bridge shows up in the stack trace says
> > that your published <Resource> config is not the one being used.
>
> Actually, I think it's the driver registration that's failing. Since the
> DriverManager is being asked to get an appropriate driver for a
> particular URL, all available drivers will be queried, including the
> JdbcOdbcDriver. It's presence in the stack trace is misleading, but not
> particularly troubling.
>
> What /is/ interesting is that this is the /first time ever/ I've seen a
> complete stack trace including all the "Caused by" elements from someone
> getting this error. I'll quote it because I think it's important:
>
> Caused by: 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(BasicDataSourcejava:880)
> at
> com.wirefast.wsam.service.WMSSubmissionService.getConnection(WMSSubmissionService.java:208)
> at
> com.wirefast.wsam.service.WMSSubmissionService.submitMessage(WMSSubmissionService.java:570)
> ... 25 more
> 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)
> ... 28 more
>
>
> The root cause is a NullPointerException within the
> JdbcOdbcDriver.acceptsURL call: basically, this driver is not properly
> checking its arguments for null (it's probably doing something like
> if(url.startsWith("jdbc:odbc:")) which means it'll blow up if the URL is
> null.
>
> The URL may or may not be null, in spite of this error message. I wonder
> if the message itself is inaccurate. I haven't traced through the code,
> but it would be nice to know what's going on.
>
> This error has come up over and over on this list and the solution
> usually ends up being that you just have to throw out your configuration
> and start over again, and everything seems to work out just fine. It
> would be nice to know what the real problem is.
>
> -chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chuck,
On 7/14/2009 8:31 AM, Caldarale, Charles R wrote:
> The fact that the JDBC-ODBC bridge shows up in the stack trace says
> that your published <Resource> config is not the one being used.
Actually, I think it's the driver registration that's failing. Since the
DriverManager is being asked to get an appropriate driver for a
particular URL, all available drivers will be queried, including the
JdbcOdbcDriver. It's presence in the stack trace is misleading, but not
particularly troubling.
What /is/ interesting is that this is the /first time ever/ I've seen a
complete stack trace including all the "Caused by" elements from someone
getting this error. I'll quote it because I think it's important:
Caused by: 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(BasicDataSourcejava:880)
at
com.wirefast.wsam.service.WMSSubmissionService.getConnection(WMSSubmissionService.java:208)
at
com.wirefast.wsam.service.WMSSubmissionService.submitMessage(WMSSubmissionService.java:570)
... 25 more
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)
... 28 more
The root cause is a NullPointerException within the
JdbcOdbcDriver.acceptsURL call: basically, this driver is not properly
checking its arguments for null (it's probably doing something like
if(url.startsWith("jdbc:odbc:")) which means it'll blow up if the URL is
null.
The URL may or may not be null, in spite of this error message. I wonder
if the message itself is inaccurate. I haven't traced through the code,
but it would be nice to know what's going on.
This error has come up over and over on this list and the solution
usually ends up being that you just have to throw out your configuration
and start over again, and everything seems to work out just fine. It
would be nice to know what the real problem is.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkpcoc8ACgkQ9CaO5/Lv0PALJACgj45GZ7AYEjHMTb8RLIK4lqAN
nsQAoMBLjWnRKHdyEvMOjhJYitSaP/wp
=r5kk
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
> URL 'null'
>
> That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf
Regardless, the lack of an [engine] subdirectory is an indication that you may not be running Tomcat from where you think you are.
1) What's in $CATALINA_HOME/conf?
2) What do the startup scripts display for the $CATALINA_xxx variables when you bring up Tomcat?
The fact that the JDBC-ODBC bridge shows up in the stack trace says that your published <Resource> config is not the one being used.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Caldarale, Charles R wrote:
>> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
>> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
>> URL 'null'
>>
>> Using CATALINA_BASE: /home/tomcat6/wsam
>>
>> $ ls -l /home/tomcat6/wsam/conf/
>> total 28
>> -rw-r--r-- 1 tomcat6 tomcat6 426 Jul 10 13:45 server.xml
>> -rw-r--r-- 1 tomcat6 tomcat6 436 Jul 10 13:43 server.xml~
>> -rw-r--r-- 1 tomcat6 tomcat6 15305 Jul 8 14:26 transform.xsl
>> drwxrwxr-x 3 tomcat6 tomcat6 4096 Jan 28 14:09 WSAM
>> $
>
> It's unlikely that's the real Tomcat conf directory - there's not enough stuff in there to get Tomcat started. You either have a very broken installation, or the Tomcat you're actually using is installed somewhere else.
That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf
Neil Youngman
Neil Youngman
Developer
Wirefast Limited
Wirefast provides secure corporate messaging services.
See our messaging solutions at http://www.wirefast.com/
Please consider the environment.
Does this email or attachment need to be printed?
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this email. Please
notify the sender immediately by email if you have received this
email by mistake and delete this email from your system.
Email transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of email transmission.
Wirefast Limited is registered in England & Wales
Company number: 03865860
Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL
'null'
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Neil Youngman [mailto:Neil.Youngman@wirefast.com]
> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
> URL 'null'
>
> Using CATALINA_BASE: /home/tomcat6/wsam
>
> $ ls -l /home/tomcat6/wsam/conf/
> total 28
> -rw-r--r-- 1 tomcat6 tomcat6 426 Jul 10 13:45 server.xml
> -rw-r--r-- 1 tomcat6 tomcat6 436 Jul 10 13:43 server.xml~
> -rw-r--r-- 1 tomcat6 tomcat6 15305 Jul 8 14:26 transform.xsl
> drwxrwxr-x 3 tomcat6 tomcat6 4096 Jan 28 14:09 WSAM
> $
It's unlikely that's the real Tomcat conf directory - there's not enough stuff in there to get Tomcat started. You either have a very broken installation, or the Tomcat you're actually using is installed somewhere else.
I'd suggest starting over with a clean installation and work up from there.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Posted by Neil Youngman <Ne...@wirefast.com>.
Konstantin Kolinko wrote:
> Look at $CATALINA_BASE/conf/Catalina/localhost/<your web app name>.xml
>
> That is a copy of your context.xml file that Tomcat creates when the
> app is deployed. This copy takes precedence over its original. Maybe
> your Resource isn't defined there.
I can't see any sign that tomcat is creating such a file. There is no $CATALINA_BASE/conf/Catalina directory.
Using CATALINA_BASE: /home/tomcat6/wsam
$ ls -l /home/tomcat6/wsam/conf/
total 28
-rw-r--r-- 1 tomcat6 tomcat6 426 Jul 10 13:45 server.xml
-rw-r--r-- 1 tomcat6 tomcat6 436 Jul 10 13:43 server.xml~
-rw-r--r-- 1 tomcat6 tomcat6 15305 Jul 8 14:26 transform.xsl
drwxrwxr-x 3 tomcat6 tomcat6 4096 Jan 28 14:09 WSAM
$
Directory WSAM just contains an empty localhost subdirectory.
Neil Youngman
Neil Youngman
Developer
Wirefast Limited
Wirefast provides secure corporate messaging services.
See our messaging solutions at http://www.wirefast.com/
Please consider the environment.
Does this email or attachment need to be printed?
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this email. Please
notify the sender immediately by email if you have received this
email by mistake and delete this email from your system.
Email transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of email transmission.
Wirefast Limited is registered in England & Wales
Company number: 03865860
Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ