'Context path /magnoliaAuthor is already in use' was in the log because
I created the context file while tomcat was running. It doesn't generate
any errors otherwise.


I tried just a ResourceLink in the '../META-INF/context.xml' file, but
no improvement. I still have the 'Resource' element in 'server.xml'
because I don't know where else to put a global resource.

        <Context path="" docBase="" debug="0">
            <ResourceLink name="jdbc/sapdb" global="jdbc/sapdb"
type="javax.sql.DataSource"/>
        </Context>



The JNDI name is OK in '../tomcat/conf/web.xml'...

    <resource-ref>
        <res-ref-name>jdbc/sapdb</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>

...as well as in 'context.xml' and 'server.xml'. I've had this sort of
connection running on 1.1 and 2.0.

The JDBC driver JAR is in '../tomcat/common.lib/'.


If the 'ResourceLink' works in context.xml, I shouldn't need the
'resource-ref' in web.xml, should I?

Since my global JNDI-named 'Resource' is in sever.xml, is there an
element I could add which would make the Resource available to all
webapps (contexts)?

Can you drop a global resource xml file into META-INF like you can a
context?




-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 09, 2005 8:39 AM
To: [email protected]
Subject: Re: [magnolia-user] place a DBCP Resource element so it can be
used globally?

>> Cannot create JDBC driver of class '' for connect URL 'null'"


This is typically caused by some mismatch in JNDI resource name among
the three places where database connection information needs to be
spec'd.  I would check the context.xml, web.xml, and your code to be
sure they are all have the right JNDI name.  Most stuff is also case
sensitive in Java so be sure to check that as well.

In putting magnoliaAuthor.xml into Catalina/localhost, did you stop the
webapp or tomcat before doing this?  If the webapp is already running, I
would expect an error like 'Context path /magnoliaAuthor is already in
use'.  The only other cause of this I can think of is if you get a
double launch of the webapp because a copy of context.xml exists in both
the war and Catalina/localhost

--David

Robert Van Overmeiren wrote:

>Hello,
>
>While setting up a database connection in my 2.1 RC3 Magnolia instance,

>after adding the 'resource-ref' to 'web.xml', and not wanting to add 
>the global 'Resource' to 'server.xml', I tried adding a 'context.xml' 
>file (with context name and a dbase 'Resource') to META-INF, but still
get...
>
>"JspException: Unable to get connection, DataSource invalid:
>"org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver 
>of class '' for connect URL 'null'"

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to