Home » Language IDEs » ServerTools (WTP) » JDBC Driver (or classpath) problem
JDBC Driver (or classpath) problem [message #75248] |
Sun, 20 February 2005 16:38  |
Eclipse User |
|
|
|
Hi,
I'm developing a web application using 1.0M2 and Tomcat 4.1.31 and I have
the following problem:
When I run the application from eclipse, I get the following error
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null', cause: java.sql.SQLException: No suitable
driver
I have the driver in the project, and even copied it to the WEB-INF/lib
without success. Putting it in the common/lib, common/endorosed, etc
didn't help.
When trying to run the Tomcat outside eclipse, all went smoothly. Does it
sound familiar to anyone? Does someone can explain If I've done something
wrong or is it a bug?
Thanks,
David
|
|
|
Re: JDBC Driver (or classpath) problem [message #75299 is a reply to message #75248] |
Sun, 20 February 2005 23:48   |
Eclipse User |
|
|
|
Hi ,
I had this problem too .
Verify if this problem happen after that you restart the application , if
yes , verify if your application have the jdbc configurated , because when a
restart my application i lose my configuration of jdbc .
sorry by my bad inglish .
Daniel
"David Rabinowitz" <david@mobimate.com> escreveu na mensagem
news:cvb00b$b96$1@www.eclipse.org...
> Hi,
>
> I'm developing a web application using 1.0M2 and Tomcat 4.1.31 and I have
> the following problem:
> When I run the application from eclipse, I get the following error
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> class '' for connect URL 'null', cause: java.sql.SQLException: No suitable
> driver
> I have the driver in the project, and even copied it to the WEB-INF/lib
> without success. Putting it in the common/lib, common/endorosed, etc
> didn't help.
>
> When trying to run the Tomcat outside eclipse, all went smoothly. Does it
> sound familiar to anyone? Does someone can explain If I've done something
> wrong or is it a bug?
>
> Thanks,
> David
>
|
|
|
Re: JDBC Driver (or classpath) problem [message #75367 is a reply to message #75299] |
Mon, 21 February 2005 04:30   |
Eclipse User |
|
|
|
Hi,
Here is what helped me:
* Moved the server definition to the project (worked only after
re-installing the Eclipse)
* Added the JDBC driver to the WEB-INF/lib - quite annoying as it is in
the common/lib of the targeted server already. When it was just added to
the build bath, it didn't work.
Has anyone else experience this? If so, I guess it should be fixed
before 1.0 is out.
David
Daniel wrote:
> Hi ,
>
> I had this problem too .
> Verify if this problem happen after that you restart the application , if
> yes , verify if your application have the jdbc configurated , because when a
> restart my application i lose my configuration of jdbc .
>
> sorry by my bad inglish .
>
> Daniel
>
>
> "David Rabinowitz" <david@mobimate.com> escreveu na mensagem
> news:cvb00b$b96$1@www.eclipse.org...
>
>>Hi,
>>
>>I'm developing a web application using 1.0M2 and Tomcat 4.1.31 and I have
>>the following problem:
>>When I run the application from eclipse, I get the following error
>>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
>>class '' for connect URL 'null', cause: java.sql.SQLException: No suitable
>>driver
>>I have the driver in the project, and even copied it to the WEB-INF/lib
>>without success. Putting it in the common/lib, common/endorosed, etc
>>didn't help.
>>
>>When trying to run the Tomcat outside eclipse, all went smoothly. Does it
>>sound familiar to anyone? Does someone can explain If I've done something
>>wrong or is it a bug?
>>
>>Thanks,
>>David
>>
>
>
>
|
|
|
Re: JDBC Driver (or classpath) problem [message #75850 is a reply to message #75367] |
Tue, 22 February 2005 13:05   |
Eclipse User |
|
|
|
In article <cvc9nv$eq1$1@www.eclipse.org>, david@mobimate.com says...
> Hi,
>
> Here is what helped me:
> * Moved the server definition to the project (worked only after
> re-installing the Eclipse)
> * Added the JDBC driver to the WEB-INF/lib - quite annoying as it is in
> the common/lib of the targeted server already. When it was just added to
> the build bath, it didn't work.
>
> Has anyone else experience this? If so, I guess it should be fixed
> before 1.0 is out.
>
> David
>
> Daniel wrote:
> > Hi ,
> >
> > I had this problem too .
> > Verify if this problem happen after that you restart the application , if
> > yes , verify if your application have the jdbc configurated , because when a
> > restart my application i lose my configuration of jdbc .
> >
> > sorry by my bad inglish .
> >
> > Daniel
> >
> >
> > "David Rabinowitz" <david@mobimate.com> escreveu na mensagem
> > news:cvb00b$b96$1@www.eclipse.org...
> >
> >>Hi,
> >>
> >>I'm developing a web application using 1.0M2 and Tomcat 4.1.31 and I have
> >>the following problem:
> >>When I run the application from eclipse, I get the following error
> >>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> >>class '' for connect URL 'null', cause: java.sql.SQLException: No suitable
> >>driver
> >>I have the driver in the project, and even copied it to the WEB-INF/lib
> >>without success. Putting it in the common/lib, common/endorosed, etc
> >>didn't help.
> >>
> >>When trying to run the Tomcat outside eclipse, all went smoothly. Does it
> >>sound familiar to anyone? Does someone can explain If I've done something
> >>wrong or is it a bug?
> >>
> >>Thanks,
> >>David
> >>
> >
Hi David,
If you are using JNDI lookup to get a connection for the specific
Driver, you have to add the resource within your server.xml to match
with the one used within your web.xml. You can edit the server.xml
outside of eclipse or you have to have a server perspective to be able
to edit the xml.
- Edit the server.xml
- find the <Context> for your app
- open up the /> of the context and create a complet closer </Context>.
- Put between <Context> and </Context> the next
<Resource name="jdbc/MyDS" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/MyDS">
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/mydatabase?autoReconnect=true
/value>
</parameter>
<parameter>
<name>validationQuery</name>
<value>select now()</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value >
</parameter>
<parameter>
<name>username</name>
<value>MyUser</value>
</parameter>
<parameter>
<name>password</name>
<value>mypwd</value>
</parameter>
</ResourceParams>
6. copy mysql-connector-java-3.1.6-bin.jar to the jakarta-tomcat-5.0.28
\common\lib\ if you want to have a global jdbc driver solution (In this
case you can put the ResourceParams also within the global resources
secton.
or within the WEB-INF\lib of your project when you want it project
dependend.
All this is also possible throuh the TomCat admin application if you
want to.
Hope this help a bit
|
|
|
Re: JDBC Driver (or classpath) problem [message #75884 is a reply to message #75850] |
Tue, 22 February 2005 14:31   |
Eclipse User |
|
|
|
Hi guys,
You can edit the server.xml available under the "Servers" project to
add this information. You can get to this file within the Project Explorer
(really any navigator) and edit it using the fancy XML Source Page Editor.
Kind Regards,
Michael D. Elder
"Peter Zweers" <pezet2000@hotmail.com> wrote in message
news:MPG.1c8592d5ae4de575989681@news.eclipse.org...
> In article <cvc9nv$eq1$1@www.eclipse.org>, david@mobimate.com says...
> > Hi,
> >
> > Here is what helped me:
> > * Moved the server definition to the project (worked only after
> > re-installing the Eclipse)
> > * Added the JDBC driver to the WEB-INF/lib - quite annoying as it is in
> > the common/lib of the targeted server already. When it was just added to
> > the build bath, it didn't work.
> >
> > Has anyone else experience this? If so, I guess it should be fixed
> > before 1.0 is out.
> >
> > David
> >
> > Daniel wrote:
> > > Hi ,
> > >
> > > I had this problem too .
> > > Verify if this problem happen after that you restart the application
, if
> > > yes , verify if your application have the jdbc configurated , because
when a
> > > restart my application i lose my configuration of jdbc .
> > >
> > > sorry by my bad inglish .
> > >
> > > Daniel
> > >
> > >
> > > "David Rabinowitz" <david@mobimate.com> escreveu na mensagem
> > > news:cvb00b$b96$1@www.eclipse.org...
> > >
> > >>Hi,
> > >>
> > >>I'm developing a web application using 1.0M2 and Tomcat 4.1.31 and I
have
> > >>the following problem:
> > >>When I run the application from eclipse, I get the following error
> > >>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
of
> > >>class '' for connect URL 'null', cause: java.sql.SQLException: No
suitable
> > >>driver
> > >>I have the driver in the project, and even copied it to the
WEB-INF/lib
> > >>without success. Putting it in the common/lib, common/endorosed, etc
> > >>didn't help.
> > >>
> > >>When trying to run the Tomcat outside eclipse, all went smoothly. Does
it
> > >>sound familiar to anyone? Does someone can explain If I've done
something
> > >>wrong or is it a bug?
> > >>
> > >>Thanks,
> > >>David
> > >>
> > >
> Hi David,
>
> If you are using JNDI lookup to get a connection for the specific
> Driver, you have to add the resource within your server.xml to match
> with the one used within your web.xml. You can edit the server.xml
> outside of eclipse or you have to have a server perspective to be able
> to edit the xml.
>
> - Edit the server.xml
> - find the <Context> for your app
> - open up the /> of the context and create a complet closer </Context>.
> - Put between <Context> and </Context> the next
> <Resource name="jdbc/MyDS" type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/MyDS">
> <parameter>
> <name>url</name>
> <value>jdbc:mysql://localhost:3306/mydatabase?autoReconnect=true
> /value>
> </parameter>
> <parameter>
> <name>validationQuery</name>
> <value>select now()</value>
> </parameter>
> <parameter>
> <name>maxIdle</name>
> <value>30</value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>10</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>com.mysql.jdbc.Driver</value>
> </parameter>
> <parameter>
> <name>maxWait</name>
> <value>10000</value>
> </parameter>
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value >
> </parameter>
> <parameter>
> <name>username</name>
> <value>MyUser</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>mypwd</value>
> </parameter>
> </ResourceParams>
>
> 6. copy mysql-connector-java-3.1.6-bin.jar to the jakarta-tomcat-5.0.28
> \common\lib\ if you want to have a global jdbc driver solution (In this
> case you can put the ResourceParams also within the global resources
> secton.
> or within the WEB-INF\lib of your project when you want it project
> dependend.
>
> All this is also possible throuh the TomCat admin application if you
> want to.
>
> Hope this help a bit
>
>
>
>
|
|
|
Re: JDBC Driver (or classpath) problem [message #76312 is a reply to message #75884] |
Wed, 23 February 2005 16:22  |
Eclipse User |
|
|
|
Note that if you use a current build (i.e. post M2) and your Web Project
contains a META-INF/context.xml, the children of this context.xml's
<context> element will be included in the <context> element written to
the server.xml during the publish operation. For details, see:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=82812
Note that feature this was implemented prior to the new support for
flexible project structure. I will likely need to update it to work
appropriately when using the flexible project structure.
Cheers,
Larry
Michael D. Elder wrote:
> Hi guys,
>
> You can edit the server.xml available under the "Servers" project to
> add this information. You can get to this file within the Project Explorer
> (really any navigator) and edit it using the fancy XML Source Page Editor.
>
> Kind Regards,
>
> Michael D. Elder
>
>
> "Peter Zweers" <pezet2000@hotmail.com> wrote in message
> news:MPG.1c8592d5ae4de575989681@news.eclipse.org...
>
>>In article <cvc9nv$eq1$1@www.eclipse.org>, david@mobimate.com says...
>>
>>>Hi,
>>>
>>>Here is what helped me:
>>>* Moved the server definition to the project (worked only after
>>>re-installing the Eclipse)
>>>* Added the JDBC driver to the WEB-INF/lib - quite annoying as it is in
>>>the common/lib of the targeted server already. When it was just added to
>>>the build bath, it didn't work.
>>>
>>>Has anyone else experience this? If so, I guess it should be fixed
>>>before 1.0 is out.
>>>
>>>David
>>>
>>>Daniel wrote:
>>>
>>>>Hi ,
>>>>
>>>>I had this problem too .
>>>>Verify if this problem happen after that you restart the application
>
> , if
>
>>>>yes , verify if your application have the jdbc configurated , because
>
> when a
>
>>>>restart my application i lose my configuration of jdbc .
>>>>
>>>>sorry by my bad inglish .
>>>>
>>>>Daniel
>>>>
>>>>
>>>>"David Rabinowitz" <david@mobimate.com> escreveu na mensagem
>>>>news:cvb00b$b96$1@www.eclipse.org...
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I'm developing a web application using 1.0M2 and Tomcat 4.1.31 and I
>
> have
>
>>>>>the following problem:
>>>>>When I run the application from eclipse, I get the following error
>>>>>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
>
> of
>
>>>>>class '' for connect URL 'null', cause: java.sql.SQLException: No
>
> suitable
>
>>>>>driver
>>>>>I have the driver in the project, and even copied it to the
>
> WEB-INF/lib
>
>>>>>without success. Putting it in the common/lib, common/endorosed, etc
>>>>>didn't help.
>>>>>
>>>>>When trying to run the Tomcat outside eclipse, all went smoothly. Does
>
> it
>
>>>>>sound familiar to anyone? Does someone can explain If I've done
>
> something
>
>>>>>wrong or is it a bug?
>>>>>
>>>>>Thanks,
>>>>>David
>>>>>
>>>>
>>Hi David,
>>
>>If you are using JNDI lookup to get a connection for the specific
>>Driver, you have to add the resource within your server.xml to match
>>with the one used within your web.xml. You can edit the server.xml
>>outside of eclipse or you have to have a server perspective to be able
>>to edit the xml.
>>
>>- Edit the server.xml
>>- find the <Context> for your app
>>- open up the /> of the context and create a complet closer </Context>.
>>- Put between <Context> and </Context> the next
>><Resource name="jdbc/MyDS" type="javax.sql.DataSource"/>
>> <ResourceParams name="jdbc/MyDS">
>> <parameter>
>><name>url</name>
>><value>jdbc:mysql://localhost:3306/mydatabase?autoReconnect=true
>>/value>
>> </parameter>
>> <parameter>
>><name>validationQuery</name>
>><value>select now()</value>
>> </parameter>
>> <parameter>
>><name>maxIdle</name>
>><value>30</value>
>> </parameter>
>> <parameter>
>><name>maxActive</name>
>><value>10</value>
>> </parameter>
>> <parameter>
>><name>driverClassName</name>
>><value>com.mysql.jdbc.Driver</value>
>> </parameter>
>> <parameter>
>><name>maxWait</name>
>><value>10000</value>
>> </parameter>
>> <parameter>
>><name>factory</name>
>><value>org.apache.commons.dbcp.BasicDataSourceFactory</value >
>> </parameter>
>> <parameter>
>><name>username</name>
>><value>MyUser</value>
>> </parameter>
>> <parameter>
>><name>password</name>
>><value>mypwd</value>
>> </parameter>
>></ResourceParams>
>>
>>6. copy mysql-connector-java-3.1.6-bin.jar to the jakarta-tomcat-5.0.28
>>\common\lib\ if you want to have a global jdbc driver solution (In this
>>case you can put the ResourceParams also within the global resources
>>secton.
>>or within the WEB-INF\lib of your project when you want it project
>>dependend.
>>
>>All this is also possible throuh the TomCat admin application if you
>>want to.
>>
>>Hope this help a bit
>>
>>
>>
>>
>
>
>
|
|
|
Goto Forum:
Current Time: Mon Jul 07 18:53:10 EDT 2025
Powered by FUDForum. Page generated in 0.04970 seconds
|