You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Claire Wall <cl...@kurtosys.com> on 2004/02/27 11:34:26 UTC

microsoft sqlserver driver & struts

Hi,

I am trying to use microsoft's jdbc driver with my struts application, but to no avail. Here is my datasource definition:

  <data-source key="DB" type="org.apache.commons.dbcp.BasicDataSource">
   <set-property property="description" value="My SqlServer pool"/>
   <set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
   <set-property property="url" value="jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME"/>
   <set-property property="username" value="xxx"/>
   <set-property property="password" value="xxx"/>
   <set-property property="maxActive" value="20"/>
   <set-property property="maxCount" value="20"/>
   <set-property property="minCount" value="2"/>
   <set-property property="maxWait" value="5000"/>
   <set-property property="defaultAutoCommit" value="false"/>
   <set-property property="defaultReadOnly" value="false"/>
  </data-source>

I have the required jars located in the WEB-INF/lib of my application which is running on Tomcat 4.1.29. When i try to connect to the database using this driver from a test class, it connects no problem so i know that the url and driver class name are correct. So the problem must be the type of DataSource which I am to use. Does anybody know which datasource to use with Microsoft's sqlserver driver? I tried using the DataSource that is in the mssqlserver jar but this didnt work either.

The error that I get is an Invalid DataSource.

Any help would be really appreciated!

Thanks
Claire


Re: microsoft sqlserver driver & struts

Posted by Claire Wall <cl...@kurtosys.com>.
nope, that didnt work either :(

Anybody else out there use SQL Server and connects to it via Microsoft's SQL
Server JDBC driver? there must be somebody....

Thanks
Claire

----- Original Message -----
From: "Mark Lowe" <ma...@talk21.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, February 27, 2004 12:14 PM
Subject: Re: microsoft sqlserver driver & struts


> Ah okay.. If you've had the same stuff running with another database
> i'm tree-barking. No I've never used and hope never to use M$ sql
> server. Postgres, mysql and oracle so I'm signing off this thread.
>
> but before i go try this.
>
> jdbc:microsoft:sqlserver://SERVERNAME:1433;SelectMethod=cursor
>
>
>
> On 27 Feb 2004, at 12:56, Claire Wall wrote:
>
> > Mark,
> >
> > My problem is that I'm switching JDBC drivers - before I was using
> > weblogic's JDBC driver for SQL Server and I've been using that for a
> > long
> > time now and never had any problems. Now I'm trying to ditch the
> > weblogic
> > driver and in its place use Microsoft's JDBC driver for SQLServer.
> > Sorry,
> > should've mentioned that before. I'm not sure that showing the code for
> > getting the datasource is going to help because I'm assuming that this
> > is
> > not the problem - the problem is surely to do with the type of
> > datasource.
> >
> > I had a similiarish problem trying to use an Oracle database - in the
> > end
> > the type of datasource was the problem and not how I retrieved it in my
> > actions.
> >
> > Have you used Microsoft's SQL Server 2000 JDBC driver with struts
> > before,
> > and if so, what type of datasource do we use? Can't find anywhere that
> > says
> > anything about it. Cant be too difficult..
> >
> > Thanks
> > Claire
> >
> > ----- Original Message -----
> > From: "Mark Lowe" <ma...@talk21.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Friday, February 27, 2004 11:43 AM
> > Subject: Re: microsoft sqlserver driver & struts
> >
> >
> >>
> >> Can i see the bits of code in the servlets (non action servlets) at
> >> start up that retrieve the datasource? And an example from any
> >> actions.
> >> Also see the load on start up order as i imagine that the struts
> >> servlet needs to load before your servlets to be able to access the
> >> datasource.
> >>
> >>
> >> On 27 Feb 2004, at 12:39, Claire Wall wrote:
> >>
> >>> It gets thrown when the application starts, but then more errors
> >>> occur
> >>> as
> >>> there are several servlets which load upon start-up - the data source
> >>> is
> >>> null at this point (NullPointerException's are being thrown) and so
> >>> the
> >>> errors are thrown when these classes try to access the database.
> >>>
> >>> ----- Original Message -----
> >>> From: "Mark Lowe" <ma...@talk21.com>
> >>> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>> Sent: Friday, February 27, 2004 11:29 AM
> >>> Subject: Re: microsoft sqlserver driver & struts
> >>>
> >>>
> >>>> Does the error get thrown when you attempt to access the data source
> >>>> or
> >>>> at startup?
> >>>>
> >>>>
> >>>> On 27 Feb 2004, at 11:34, Claire Wall wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I am trying to use microsoft's jdbc driver with my struts
> >>>>> application,
> >>>>> but to no avail. Here is my datasource definition:
> >>>>>
> >>>>>   <data-source key="DB"
> >>>>> type="org.apache.commons.dbcp.BasicDataSource">
> >>>>>    <set-property property="description" value="My SqlServer pool"/>
> >>>>>    <set-property property="driverClassName"
> >>>>> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
> >>>>>    <set-property property="url"
> >>>>> value="jdbc:microsoft:sqlserver://SERVERNAME:1433;
> >>>>> DatabaseName=DBNAME"/>
> >>>>>    <set-property property="username" value="xxx"/>
> >>>>>    <set-property property="password" value="xxx"/>
> >>>>>    <set-property property="maxActive" value="20"/>
> >>>>>    <set-property property="maxCount" value="20"/>
> >>>>>    <set-property property="minCount" value="2"/>
> >>>>>    <set-property property="maxWait" value="5000"/>
> >>>>>    <set-property property="defaultAutoCommit" value="false"/>
> >>>>>    <set-property property="defaultReadOnly" value="false"/>
> >>>>>   </data-source>
> >>>>>
> >>>>> I have the required jars located in the WEB-INF/lib of my
> >>>>> application
> >>>>> which is running on Tomcat 4.1.29. When i try to connect to the
> >>>>> database using this driver from a test class, it connects no
> >>>>> problem
> >>>>> so i know that the url and driver class name are correct. So the
> >>>>> problem must be the type of DataSource which I am to use. Does
> >>>>> anybody
> >>>>> know which datasource to use with Microsoft's sqlserver driver? I
> >>>>> tried using the DataSource that is in the mssqlserver jar but this
> >>>>> didnt work either.
> >>>>>
> >>>>> The error that I get is an Invalid DataSource.
> >>>>>
> >>>>> Any help would be really appreciated!
> >>>>>
> >>>>> Thanks
> >>>>> Claire
> >>>>>
> >>>>
> >>>>
> >>>> --------------------------------------------------------------------
> >>>> -
> >>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Mark Lowe <ma...@talk21.com>.
Ah okay.. If you've had the same stuff running with another database  
i'm tree-barking. No I've never used and hope never to use M$ sql  
server. Postgres, mysql and oracle so I'm signing off this thread.

but before i go try this.

jdbc:microsoft:sqlserver://SERVERNAME:1433;SelectMethod=cursor



On 27 Feb 2004, at 12:56, Claire Wall wrote:

> Mark,
>
> My problem is that I'm switching JDBC drivers - before I was using
> weblogic's JDBC driver for SQL Server and I've been using that for a  
> long
> time now and never had any problems. Now I'm trying to ditch the  
> weblogic
> driver and in its place use Microsoft's JDBC driver for SQLServer.  
> Sorry,
> should've mentioned that before. I'm not sure that showing the code for
> getting the datasource is going to help because I'm assuming that this  
> is
> not the problem - the problem is surely to do with the type of  
> datasource.
>
> I had a similiarish problem trying to use an Oracle database - in the  
> end
> the type of datasource was the problem and not how I retrieved it in my
> actions.
>
> Have you used Microsoft's SQL Server 2000 JDBC driver with struts  
> before,
> and if so, what type of datasource do we use? Can't find anywhere that  
> says
> anything about it. Cant be too difficult..
>
> Thanks
> Claire
>
> ----- Original Message -----
> From: "Mark Lowe" <ma...@talk21.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, February 27, 2004 11:43 AM
> Subject: Re: microsoft sqlserver driver & struts
>
>
>>
>> Can i see the bits of code in the servlets (non action servlets) at
>> start up that retrieve the datasource? And an example from any  
>> actions.
>> Also see the load on start up order as i imagine that the struts
>> servlet needs to load before your servlets to be able to access the
>> datasource.
>>
>>
>> On 27 Feb 2004, at 12:39, Claire Wall wrote:
>>
>>> It gets thrown when the application starts, but then more errors  
>>> occur
>>> as
>>> there are several servlets which load upon start-up - the data source
>>> is
>>> null at this point (NullPointerException's are being thrown) and so  
>>> the
>>> errors are thrown when these classes try to access the database.
>>>
>>> ----- Original Message -----
>>> From: "Mark Lowe" <ma...@talk21.com>
>>> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>> Sent: Friday, February 27, 2004 11:29 AM
>>> Subject: Re: microsoft sqlserver driver & struts
>>>
>>>
>>>> Does the error get thrown when you attempt to access the data source
>>>> or
>>>> at startup?
>>>>
>>>>
>>>> On 27 Feb 2004, at 11:34, Claire Wall wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am trying to use microsoft's jdbc driver with my struts
>>>>> application,
>>>>> but to no avail. Here is my datasource definition:
>>>>>
>>>>>   <data-source key="DB"
>>>>> type="org.apache.commons.dbcp.BasicDataSource">
>>>>>    <set-property property="description" value="My SqlServer pool"/>
>>>>>    <set-property property="driverClassName"
>>>>> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>>>>>    <set-property property="url"
>>>>> value="jdbc:microsoft:sqlserver://SERVERNAME:1433;
>>>>> DatabaseName=DBNAME"/>
>>>>>    <set-property property="username" value="xxx"/>
>>>>>    <set-property property="password" value="xxx"/>
>>>>>    <set-property property="maxActive" value="20"/>
>>>>>    <set-property property="maxCount" value="20"/>
>>>>>    <set-property property="minCount" value="2"/>
>>>>>    <set-property property="maxWait" value="5000"/>
>>>>>    <set-property property="defaultAutoCommit" value="false"/>
>>>>>    <set-property property="defaultReadOnly" value="false"/>
>>>>>   </data-source>
>>>>>
>>>>> I have the required jars located in the WEB-INF/lib of my  
>>>>> application
>>>>> which is running on Tomcat 4.1.29. When i try to connect to the
>>>>> database using this driver from a test class, it connects no  
>>>>> problem
>>>>> so i know that the url and driver class name are correct. So the
>>>>> problem must be the type of DataSource which I am to use. Does
>>>>> anybody
>>>>> know which datasource to use with Microsoft's sqlserver driver? I
>>>>> tried using the DataSource that is in the mssqlserver jar but this
>>>>> didnt work either.
>>>>>
>>>>> The error that I get is an Invalid DataSource.
>>>>>
>>>>> Any help would be really appreciated!
>>>>>
>>>>> Thanks
>>>>> Claire
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Claire Wall <cl...@kurtosys.com>.
Mark,

My problem is that I'm switching JDBC drivers - before I was using
weblogic's JDBC driver for SQL Server and I've been using that for a long
time now and never had any problems. Now I'm trying to ditch the weblogic
driver and in its place use Microsoft's JDBC driver for SQLServer. Sorry,
should've mentioned that before. I'm not sure that showing the code for
getting the datasource is going to help because I'm assuming that this is
not the problem - the problem is surely to do with the type of datasource.

I had a similiarish problem trying to use an Oracle database - in the end
the type of datasource was the problem and not how I retrieved it in my
actions.

Have you used Microsoft's SQL Server 2000 JDBC driver with struts before,
and if so, what type of datasource do we use? Can't find anywhere that says
anything about it. Cant be too difficult..

Thanks
Claire

----- Original Message -----
From: "Mark Lowe" <ma...@talk21.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, February 27, 2004 11:43 AM
Subject: Re: microsoft sqlserver driver & struts


>
> Can i see the bits of code in the servlets (non action servlets) at
> start up that retrieve the datasource? And an example from any actions.
> Also see the load on start up order as i imagine that the struts
> servlet needs to load before your servlets to be able to access the
> datasource.
>
>
> On 27 Feb 2004, at 12:39, Claire Wall wrote:
>
> > It gets thrown when the application starts, but then more errors occur
> > as
> > there are several servlets which load upon start-up - the data source
> > is
> > null at this point (NullPointerException's are being thrown) and so the
> > errors are thrown when these classes try to access the database.
> >
> > ----- Original Message -----
> > From: "Mark Lowe" <ma...@talk21.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Friday, February 27, 2004 11:29 AM
> > Subject: Re: microsoft sqlserver driver & struts
> >
> >
> >> Does the error get thrown when you attempt to access the data source
> >> or
> >> at startup?
> >>
> >>
> >> On 27 Feb 2004, at 11:34, Claire Wall wrote:
> >>
> >>> Hi,
> >>>
> >>> I am trying to use microsoft's jdbc driver with my struts
> >>> application,
> >>> but to no avail. Here is my datasource definition:
> >>>
> >>>   <data-source key="DB"
> >>> type="org.apache.commons.dbcp.BasicDataSource">
> >>>    <set-property property="description" value="My SqlServer pool"/>
> >>>    <set-property property="driverClassName"
> >>> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
> >>>    <set-property property="url"
> >>> value="jdbc:microsoft:sqlserver://SERVERNAME:1433;
> >>> DatabaseName=DBNAME"/>
> >>>    <set-property property="username" value="xxx"/>
> >>>    <set-property property="password" value="xxx"/>
> >>>    <set-property property="maxActive" value="20"/>
> >>>    <set-property property="maxCount" value="20"/>
> >>>    <set-property property="minCount" value="2"/>
> >>>    <set-property property="maxWait" value="5000"/>
> >>>    <set-property property="defaultAutoCommit" value="false"/>
> >>>    <set-property property="defaultReadOnly" value="false"/>
> >>>   </data-source>
> >>>
> >>> I have the required jars located in the WEB-INF/lib of my application
> >>> which is running on Tomcat 4.1.29. When i try to connect to the
> >>> database using this driver from a test class, it connects no problem
> >>> so i know that the url and driver class name are correct. So the
> >>> problem must be the type of DataSource which I am to use. Does
> >>> anybody
> >>> know which datasource to use with Microsoft's sqlserver driver? I
> >>> tried using the DataSource that is in the mssqlserver jar but this
> >>> didnt work either.
> >>>
> >>> The error that I get is an Invalid DataSource.
> >>>
> >>> Any help would be really appreciated!
> >>>
> >>> Thanks
> >>> Claire
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Mark Lowe <ma...@talk21.com>.
Can i see the bits of code in the servlets (non action servlets) at 
start up that retrieve the datasource? And an example from any actions. 
Also see the load on start up order as i imagine that the struts 
servlet needs to load before your servlets to be able to access the 
datasource.


On 27 Feb 2004, at 12:39, Claire Wall wrote:

> It gets thrown when the application starts, but then more errors occur 
> as
> there are several servlets which load upon start-up - the data source 
> is
> null at this point (NullPointerException's are being thrown) and so the
> errors are thrown when these classes try to access the database.
>
> ----- Original Message -----
> From: "Mark Lowe" <ma...@talk21.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, February 27, 2004 11:29 AM
> Subject: Re: microsoft sqlserver driver & struts
>
>
>> Does the error get thrown when you attempt to access the data source 
>> or
>> at startup?
>>
>>
>> On 27 Feb 2004, at 11:34, Claire Wall wrote:
>>
>>> Hi,
>>>
>>> I am trying to use microsoft's jdbc driver with my struts 
>>> application,
>>> but to no avail. Here is my datasource definition:
>>>
>>>   <data-source key="DB" 
>>> type="org.apache.commons.dbcp.BasicDataSource">
>>>    <set-property property="description" value="My SqlServer pool"/>
>>>    <set-property property="driverClassName"
>>> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>>>    <set-property property="url"
>>> value="jdbc:microsoft:sqlserver://SERVERNAME:1433;
>>> DatabaseName=DBNAME"/>
>>>    <set-property property="username" value="xxx"/>
>>>    <set-property property="password" value="xxx"/>
>>>    <set-property property="maxActive" value="20"/>
>>>    <set-property property="maxCount" value="20"/>
>>>    <set-property property="minCount" value="2"/>
>>>    <set-property property="maxWait" value="5000"/>
>>>    <set-property property="defaultAutoCommit" value="false"/>
>>>    <set-property property="defaultReadOnly" value="false"/>
>>>   </data-source>
>>>
>>> I have the required jars located in the WEB-INF/lib of my application
>>> which is running on Tomcat 4.1.29. When i try to connect to the
>>> database using this driver from a test class, it connects no problem
>>> so i know that the url and driver class name are correct. So the
>>> problem must be the type of DataSource which I am to use. Does 
>>> anybody
>>> know which datasource to use with Microsoft's sqlserver driver? I
>>> tried using the DataSource that is in the mssqlserver jar but this
>>> didnt work either.
>>>
>>> The error that I get is an Invalid DataSource.
>>>
>>> Any help would be really appreciated!
>>>
>>> Thanks
>>> Claire
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Claire Wall <cl...@kurtosys.com>.
It gets thrown when the application starts, but then more errors occur as
there are several servlets which load upon start-up - the data source is
null at this point (NullPointerException's are being thrown) and so the
errors are thrown when these classes try to access the database.

----- Original Message -----
From: "Mark Lowe" <ma...@talk21.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, February 27, 2004 11:29 AM
Subject: Re: microsoft sqlserver driver & struts


> Does the error get thrown when you attempt to access the data source or
> at startup?
>
>
> On 27 Feb 2004, at 11:34, Claire Wall wrote:
>
> > Hi,
> >
> > I am trying to use microsoft's jdbc driver with my struts application,
> > but to no avail. Here is my datasource definition:
> >
> >   <data-source key="DB" type="org.apache.commons.dbcp.BasicDataSource">
> >    <set-property property="description" value="My SqlServer pool"/>
> >    <set-property property="driverClassName"
> > value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
> >    <set-property property="url"
> > value="jdbc:microsoft:sqlserver://SERVERNAME:1433;
> > DatabaseName=DBNAME"/>
> >    <set-property property="username" value="xxx"/>
> >    <set-property property="password" value="xxx"/>
> >    <set-property property="maxActive" value="20"/>
> >    <set-property property="maxCount" value="20"/>
> >    <set-property property="minCount" value="2"/>
> >    <set-property property="maxWait" value="5000"/>
> >    <set-property property="defaultAutoCommit" value="false"/>
> >    <set-property property="defaultReadOnly" value="false"/>
> >   </data-source>
> >
> > I have the required jars located in the WEB-INF/lib of my application
> > which is running on Tomcat 4.1.29. When i try to connect to the
> > database using this driver from a test class, it connects no problem
> > so i know that the url and driver class name are correct. So the
> > problem must be the type of DataSource which I am to use. Does anybody
> > know which datasource to use with Microsoft's sqlserver driver? I
> > tried using the DataSource that is in the mssqlserver jar but this
> > didnt work either.
> >
> > The error that I get is an Invalid DataSource.
> >
> > Any help would be really appreciated!
> >
> > Thanks
> > Claire
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Mark Lowe <ma...@talk21.com>.
Does the error get thrown when you attempt to access the data source or  
at startup?


On 27 Feb 2004, at 11:34, Claire Wall wrote:

> Hi,
>
> I am trying to use microsoft's jdbc driver with my struts application,  
> but to no avail. Here is my datasource definition:
>
>   <data-source key="DB" type="org.apache.commons.dbcp.BasicDataSource">
>    <set-property property="description" value="My SqlServer pool"/>
>    <set-property property="driverClassName"  
> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>    <set-property property="url"  
> value="jdbc:microsoft:sqlserver://SERVERNAME:1433; 
> DatabaseName=DBNAME"/>
>    <set-property property="username" value="xxx"/>
>    <set-property property="password" value="xxx"/>
>    <set-property property="maxActive" value="20"/>
>    <set-property property="maxCount" value="20"/>
>    <set-property property="minCount" value="2"/>
>    <set-property property="maxWait" value="5000"/>
>    <set-property property="defaultAutoCommit" value="false"/>
>    <set-property property="defaultReadOnly" value="false"/>
>   </data-source>
>
> I have the required jars located in the WEB-INF/lib of my application  
> which is running on Tomcat 4.1.29. When i try to connect to the  
> database using this driver from a test class, it connects no problem  
> so i know that the url and driver class name are correct. So the  
> problem must be the type of DataSource which I am to use. Does anybody  
> know which datasource to use with Microsoft's sqlserver driver? I  
> tried using the DataSource that is in the mssqlserver jar but this  
> didnt work either.
>
> The error that I get is an Invalid DataSource.
>
> Any help would be really appreciated!
>
> Thanks
> Claire
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Mark Lowe <ma...@talk21.com>.
Just a guess . but its looking for the old GenericDataSource have the  
the struts-legacy.jar in your lib directory?

There's also some weird BillGates-tastic  argument you have to pass  
though with the url string. But i have no experience with ms sql  
server.

On 1 Mar 2004, at 21:28, Danko Desancic wrote:

> Hi,
>
> newbie to struts and I have similar problem namely I added a  
> datasource in my struts-config.xml and after that I can't even reload  
> my app.
> Non - struts applications are using this driver without problems.  
> Bellow are stack trace from tomcat log (5.0.18) and part of my  
> struts-config.
> I have all three MS jar files in both my WEB-INF\lib and  
> CATALINA-HOME\common\lib. I did try  both types   
> "org.apache.commons.dbcp.BasicDataSource"
> and "com.microsoft.jdbc.sqlserver.SQLServerDriver" without any success
>
> <data-source key="ContactDB"  
> type="org.apache.commons.dbcp.BasicDataSource">
>    <set-property property="driverClassName"  
> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>    <set-property property="url"  
> value="jdbc:microsoft:sqlserver://localhost:1433; 
> databaseName=CONTACT"/>
>    <set-property property="username" value="***"/>
>    <set-property property="password" value="***"/>
>    <set-property property="maxActive" value="20"/>
>    <set-property property="maxWait" value="5000"/>
>    <set-property property="defaultAutoCommit" value="true"/>
> </data-source>
>
>
> 2004-03-01 15:18:02 StandardContext[/manager]Manager: restart:  
> Reloading web application at '/contact-struts'
> 2004-03-01 15:18:03  
> StandardContext[/contact-struts]StandardWrapper.Throwable
> java.lang.NoClassDefFoundError:  
> org/apache/struts/legacy/GenericDataSource
>    at java.lang.ClassLoader.defineClass0(Native Method)
>    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
>    at  
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java: 
> 123)
>    at  
> org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappCl 
> assLoader.java:1677)
>    at  
> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoade 
> r.java:900)
>    at  
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade 
> r.java:1350)
>    at  
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade 
> r.java:1230)
>    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>    at  
> org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServ 
> let.java:1084)
>    at  
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
>    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
>    at  
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.ja 
> va:1044)
>    at  
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java: 
> 887)
>    at  
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext. 
> java:3960)
>    at  
> org.apache.catalina.core.StandardContext.start(StandardContext.java: 
> 4283)
>    at  
> org.apache.catalina.core.StandardContext.reload(StandardContext.java: 
> 2992)
>    at  
> org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java: 
> 1019)
>    at  
> org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java: 
> 377)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>    at  
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic 
> ationFilterChain.java:284)
>    at  
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil 
> terChain.java:204)
>    at  
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal 
> ve.java:257)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCo 
> ntextValve.java:245)
>    at  
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal 
> ve.java:199)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato 
> rBase.java:587)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:149)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav 
> a:195)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav 
> a:164)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:149)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve 
> .java:156)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
>    at  
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java: 
> 206)
>    at  
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
> 828)
>    at  
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process 
> Connection(Http11Protocol.java:700)
>    at  
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java: 
> 584)
>    at  
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo 
> l.java:683)
>    at java.lang.Thread.run(Thread.java:534)
>
> 2004-03-01 15:18:03 StandardContext[/contact-struts]Servlet  
> /contact-struts threw load() exception
> javax.servlet.ServletException: Servlet.init() for servlet  
> contact-struts threw exception
>    at  
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.ja 
> va:1086)
>    at  
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java: 
> 887)
>    at  
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext. 
> java:3960)
>    at  
> org.apache.catalina.core.StandardContext.start(StandardContext.java: 
> 4283)
>    at  
> org.apache.catalina.core.StandardContext.reload(StandardContext.java: 
> 2992)
>    at  
> org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java: 
> 1019)
>    at  
> org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java: 
> 377)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>    at  
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic 
> ationFilterChain.java:284)
>    at  
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil 
> terChain.java:204)
>    at  
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal 
> ve.java:257)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCo 
> ntextValve.java:245)
>    at  
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal 
> ve.java:199)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato 
> rBase.java:587)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:149)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav 
> a:195)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav 
> a:164)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:149)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve 
> .java:156)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
>    at  
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java: 
> 206)
>    at  
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
> 828)
>    at  
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process 
> Connection(Http11Protocol.java:700)
>    at  
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java: 
> 584)
>    at  
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo 
> l.java:683)
>    at java.lang.Thread.run(Thread.java:534)
> ----- Root Cause -----
> java.lang.NoClassDefFoundError:  
> org/apache/struts/legacy/GenericDataSource
>    at java.lang.ClassLoader.defineClass0(Native Method)
>    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
>    at  
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java: 
> 123)
>    at  
> org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappCl 
> assLoader.java:1677)
>    at  
> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoade 
> r.java:900)
>    at  
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade 
> r.java:1350)
>    at  
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade 
> r.java:1230)
>    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>    at  
> org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServ 
> let.java:1084)
>    at  
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
>    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
>    at  
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.ja 
> va:1044)
>    at  
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java: 
> 887)
>    at  
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext. 
> java:3960)
>    at  
> org.apache.catalina.core.StandardContext.start(StandardContext.java: 
> 4283)
>    at  
> org.apache.catalina.core.StandardContext.reload(StandardContext.java: 
> 2992)
>    at  
> org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java: 
> 1019)
>    at  
> org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java: 
> 377)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>    at  
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic 
> ationFilterChain.java:284)
>    at  
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil 
> terChain.java:204)
>    at  
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal 
> ve.java:257)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCo 
> ntextValve.java:245)
>    at  
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal 
> ve.java:199)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato 
> rBase.java:587)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:149)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav 
> a:195)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav 
> a:164)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:149)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve 
> .java:156)
>    at  
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC 
> ontext.java:151)
>    at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 564)
>    at  
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
>    at  
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java: 
> 206)
>    at  
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
> 828)
>    at  
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process 
> Connection(Http11Protocol.java:700)
>    at  
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java: 
> 584)
>    at  
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo 
> l.java:683)
>    at java.lang.Thread.run(Thread.java:534)
>
> Any suggestions?
>
> Thanks  Danko
>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Danko Desancic <dd...@northernobjects.com>.
Hi,

newbie to struts and I have similar problem namely I added a datasource 
in my struts-config.xml and after that I can't even reload my app.
Non - struts applications are using this driver without problems. Bellow 
are stack trace from tomcat log (5.0.18) and part of my struts-config.
I have all three MS jar files in both my WEB-INF\lib and 
CATALINA-HOME\common\lib. I did try  both types  
"org.apache.commons.dbcp.BasicDataSource"
and "com.microsoft.jdbc.sqlserver.SQLServerDriver" without any success

<data-source key="ContactDB" type="org.apache.commons.dbcp.BasicDataSource">
    <set-property property="driverClassName" 
value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
    <set-property property="url" 
value="jdbc:microsoft:sqlserver://localhost:1433;databaseName=CONTACT"/>
    <set-property property="username" value="***"/>
    <set-property property="password" value="***"/>
    <set-property property="maxActive" value="20"/>
    <set-property property="maxWait" value="5000"/>
    <set-property property="defaultAutoCommit" value="true"/>
</data-source>


2004-03-01 15:18:02 StandardContext[/manager]Manager: restart: Reloading 
web application at '/contact-struts'
2004-03-01 15:18:03 
StandardContext[/contact-struts]StandardWrapper.Throwable
java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at 
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1677)
    at 
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:900)
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1350)
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at 
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1084)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
    at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
    at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3960)
    at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4283)
    at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2992)
    at 
org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java:1019)
    at 
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:377)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
    at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:587)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
    at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
    at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
    at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
    at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)

2004-03-01 15:18:03 StandardContext[/contact-struts]Servlet 
/contact-struts threw load() exception
javax.servlet.ServletException: Servlet.init() for servlet 
contact-struts threw exception
    at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1086)
    at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
    at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3960)
    at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4283)
    at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2992)
    at 
org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java:1019)
    at 
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:377)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
    at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:587)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
    at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
    at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
    at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
    at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)
----- Root Cause -----
java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at 
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1677)
    at 
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:900)
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1350)
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at 
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1084)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
    at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
    at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3960)
    at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4283)
    at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2992)
    at 
org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java:1019)
    at 
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:377)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
    at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:587)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
    at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
    at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
    at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
    at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)

Any suggestions?

Thanks  Danko

>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: microsoft sqlserver driver & struts

Posted by Tim Coy <ti...@timco.net.au>.
I am using SQL Server 7
With the microsoft driver no problem


Connection URL needs to be
jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME;SelectMethod=
Cursor

Refer to
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181


-- 
Tim Coy
Timco Electronics Pty Ltd
tim@timco.net.au



com.microsoft.jdbc.sqlserver.SQLServerDriver


> Hi,
> 
> I am trying to use microsoft's jdbc driver with my struts application, but to
> no avail. Here is my datasource definition:
> 
> <data-source key="DB" type="org.apache.commons.dbcp.BasicDataSource">
>  <set-property property="description" value="My SqlServer pool"/>
>  <set-property property="driverClassName"
> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>  <set-property property="url"
> value="jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME"/>
>  <set-property property="username" value="xxx"/>
>  <set-property property="password" value="xxx"/>
>  <set-property property="maxActive" value="20"/>
>  <set-property property="maxCount" value="20"/>
>  <set-property property="minCount" value="2"/>
>  <set-property property="maxWait" value="5000"/>
>  <set-property property="defaultAutoCommit" value="false"/>
>  <set-property property="defaultReadOnly" value="false"/>
> </data-source>
> 
> I have the required jars located in the WEB-INF/lib of my application which is
> running on Tomcat 4.1.29. When i try to connect to the database using this
> driver from a test class, it connects no problem so i know that the url and
> driver class name are correct. So the problem must be the type of DataSource
> which I am to use. Does anybody know which datasource to use with Microsoft's
> sqlserver driver? I tried using the DataSource that is in the mssqlserver jar
> but this didnt work either.
> 
> The error that I get is an Invalid DataSource.
> 
> Any help would be really appreciated!
> 
> Thanks
> Claire
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org