Hi Govind,

I don't know what's wrong. Do you need a file other than server.xml to make
your config work?

Also, the Cactus console says:

>    [cactus] setUp() has been called
>    [cactus] junit.framework.AssertionFailedError: setUp() has been called
>    [cactus] at
> unitTests.com.amerisourcebergen.crm.webui.actions.TestLogin.setUp(TestLogi
> n.java:80)

But in your TestLogin code I don't see any assert in setUp() that would
print this... I would suggest you look at line 80 and check what you have
there.

-Vincent

> -----Original Message-----
> From: Govind Deshpande [mailto:[EMAIL PROTECTED]
> Sent: mardi 21 d�cembre 2004 19:53
> To: [email protected]
> Subject: Cannot create JDBC driver of class with Tomcat 4.1.27 and Cactus
> 
> Hi! all,
> I am running into a problem where I get a "Cannot create JDBC driver
> of class" error.
> Pardon me if this problem has already been adressed on the mailing
> list. I am running
> my Cactus tests via ANT. The cactified war is created. Then ANT runs the
> tests on tomcat 4x container. I specify the server.xml that I would
> like my cactus
> tests to use. My container definition is as follows.
> 
>               <tomcat4x if="Tomcat.home"
>                   dir="${Tomcat.home}" port="${cactus.port}"
>                       serverxml="C:/Projects/build/server.xml"
>                   output="testOutput/tomcat4x.out-${to.tstamp}"
>                   todir="testOutput/tomcat4x-${to.tstamp}"/>
> 
> My context in the specified server.xml is as follows. This
> configuration creates the correct
> datasource when I run the application on tomcat without using Cactus.
> I just can find
> the datasource only through cactus. This server.xml is correctly
> copied into the temp
> directory cactus uses to run the tests.
> 
>         <Context path="/abcrm"
>            docBase="abcrm-cactified.war"
>            debug="0"
>            reloadable="true" crossContext="true">
>           <Resource name="jdbc/abcrmDataSource"
>               auth="Container"
>               type="javax.sql.DataSource" />
>         <ResourceParams name="jdbc/abcrmDataSource">
>             <parameter>
>               <name>factory</name>
> 
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>             </parameter>
> 
>             <parameter>
>               <name>maxActive</name>
>               <value>20</value>
>             </parameter>
> 
>             <parameter>
>               <name>maxIdle</name>
>               <value>30</value>
>             </parameter>
> 
>             <parameter>
>               <name>maxWait</name>
>               <value>10000</value>
>             </parameter>
> 
>             <parameter>
>               <name>username</name>
>               <value>sa</value>
>             </parameter>
>             <parameter>
>               <name>password</name>
>               <value>visualdb</value>
>             </parameter>
> 
>             <parameter>
>               <name>driverClassName</name>
>               <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
>             </parameter>
> 
>             <parameter>
>               <name>url</name>
> 
> <value>jdbc:microsoft:sqlserver://10.0.10.174:1433;DatabaseName=ABC_CRM_De
> v;selectMethod=cursor</value>
>             </parameter>
> 
>           </ResourceParams>
>         </Context>
> 
> 
> My JUnit class is as follows:
> 
> public class TestLogin extends TestCase {
>     public static Test suite() {
>         ServletTestSuite suite = new ServletTestSuite();
>         suite.addTestSuite(TestLogin.class);
>         return suite;
>     }
>     public void setUp()
>     { }
>     public void testTemplate() {
>         UserLogic userLogic = null;
>         User user = null;
>         try {
>             userLogic = (UserLogic)
> BusinessManager.getInstance().getObject(
>                     UserLogic.class);
>             user = userLogic.authenticateUser("gdeshpande");
>             assertNull("User should not have been null", user);
>         } catch (UserAuthenticationException e) {
>             e.printStackTrace();
>         } catch (CRMApplicationException e) {
>             e.printStackTrace();
>         }
>     }
>     public void tearDown()
>     {}
> }
> 
> 
> The application log stack trace I get is as follows.
> 
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
> of class '' for connect URL 'null', cause:
> java.lang.NullPointerException
>       at java.lang.String.regionMatches(String.java:950)
>       at com.microsoft.jdbc.base.BaseURLParser.parse(Unknown Source)
>       at com.microsoft.jdbc.base.BaseDriver.acceptsURL(Unknown Source)
>       at java.sql.DriverManager.getDriver(DriverManager.java:232)
>       at

[snip]
> 
> I get the following from the cactus console output.
>    [cactus] Testsuite:
> unitTests.com.amerisourcebergen.crm.webui.actions.TestLogin
>    [cactus] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.829 sec
>    [cactus] Testcase: testTemplate(org.apache.cactus.ServletTestCase):
>       FAILED
>    [cactus] setUp() has been called
>    [cactus] junit.framework.AssertionFailedError: setUp() has been called
>    [cactus] at
> unitTests.com.amerisourcebergen.crm.webui.actions.TestLogin.setUp(TestLogi
> n.java:80)

[snip]
 
> Sorry for the long post. I greatly appreciate any help I can get.
> thanks,
> govind
> --
> Govind Deshpande
> [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to