Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Problems with Data Source in Tomcat v5.0.28
Problems with Data Source in Tomcat v5.0.28 [message #87206] Fri, 25 March 2005 11:05 Go to next message
Tom Colman is currently offline Tom ColmanFriend
Messages: 7
Registered: July 2009
Junior Member
Hello there,


I'm having troubles accessing a database connection pool.

I get the following error:


"No suitable driver found"


The oracle .jar file however is in my tomcat/common/lib directory but
Eclipse seems to start tomcat in a way these libs are not included.

How can I fix this ?



Greetings,
Tom Colman
Belgium
Re: Problems with Data Source in Tomcat v5.0.28 [message #87282 is a reply to message #87206] Fri, 25 March 2005 14:05 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
To start, Tomcat 5.0.28 only needs bootstrap.jar and tools.jar on the
classpath. As part of the startup process, Tomcat builds the
classloaders for "common/lib" and others. If Tomcat starts at all, then
Eclipse probably isn't the cause of the "No suitable driver found"
error. It's more likely a typo or configuration issue.

Cheers,
Larry

Tom Colman wrote:
> Hello there,
>
>
> I'm having troubles accessing a database connection pool.
>
> I get the following error:
>
>
> "No suitable driver found"
>
>
> The oracle .jar file however is in my tomcat/common/lib directory but
> Eclipse seems to start tomcat in a way these libs are not included.
>
> How can I fix this ?
>
>
>
> Greetings,
> Tom Colman
> Belgium
Re: Problems with Data Source in Tomcat v5.0.28 [message #87312 is a reply to message #87206] Fri, 25 March 2005 16:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: laurentd75.yahoo.fr

Tom Colman wrote:
> The oracle .jar file however is in my tomcat/common/lib directory

Hi Tom, what do you mean by "oracle.jar", where did you get that from ??

To put things simply, Oracle JDBC drivers are distributed in a file named
"classes12.jar" also available in ZIP format (classes12.zip).

Note that with TOmcat though, putting the ZIP file in common/lib won't
work cos Tomcat doesn't seem to load ZIP archives in common/lib. So, you
just have to drop the JAR version (classes12.jar) insie common/lib, and
you should be ok.

And while I might be wrong, I also wouldn't think that your problem is
related in any way to Eclipse itself, whatever version you use.
Re: Problems with Data Source in Tomcat v5.0.28 [message #87534 is a reply to message #87206] Sun, 27 March 2005 16:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rajbsaini.yahoo.com

I had the same problem with datasource. In my case it was the problem of
correct datasource configuration. I was configurating Tomcat 5.5
datasource with syntex of 4.x. Please check your configuration file if
this is not the case for you.

Secondly, how you are you including the datasource configuration in
sever.xml file? I had this problem because, context.xml from
WebContents/META-INF was not included properly in the server.xml. Open
your sever.xml (located at
< worksapce\.metadata\.plugins\org.eclipse.wst.server.core\tmp 0\conf
directory in my case) and check if you have your Resource element
included properly. Pay attention to the driverClassName and url
attribute. Remember they were elements in 4.x and attributes in 5.x

Hope this solve your problem.

Regards,

Raj


Tom Colman wrote:
> Hello there,
>
>
> I'm having troubles accessing a database connection pool.
>
> I get the following error:
>
>
> "No suitable driver found"
>
>
> The oracle .jar file however is in my tomcat/common/lib directory but
> Eclipse seems to start tomcat in a way these libs are not included.
>
> How can I fix this ?
>
>
>
> Greetings,
> Tom Colman
> Belgium
Re: Problems with Data Source in Tomcat v5.0.28 [message #87905 is a reply to message #87312] Tue, 29 March 2005 08:53 Go to previous messageGo to next message
Tom Colman is currently offline Tom ColmanFriend
Messages: 7
Registered: July 2009
Junior Member
Laurent D wrote:
> Tom Colman wrote:
>
>> The oracle .jar file however is in my tomcat/common/lib directory
>
>
> Hi Tom, what do you mean by "oracle.jar", where did you get that from ??
>
> To put things simply, Oracle JDBC drivers are distributed in a file
> named "classes12.jar" also available in ZIP format (classes12.zip).
>
> Note that with TOmcat though, putting the ZIP file in common/lib won't
> work cos Tomcat doesn't seem to load ZIP archives in common/lib. So, you
> just have to drop the JAR version (classes12.jar) insie common/lib, and
> you should be ok.
>
> And while I might be wrong, I also wouldn't think that your problem is
> related in any way to Eclipse itself, whatever version you use.
>
>
>
Hello Laurent,


I use the ojdbc14.jar for Oracle 10g.
This file worked before.

It is thus a jar, not a ZIP.
It could have been a possible error, of course.


thanks,
Tom
Re: Problems with Data Source in Tomcat v5.0.28 [message #87920 is a reply to message #87534] Tue, 29 March 2005 09:08 Go to previous messageGo to next message
Tom Colman is currently offline Tom ColmanFriend
Messages: 7
Registered: July 2009
Junior Member
Raj Saini wrote:
> I had the same problem with datasource. In my case it was the problem of
> correct datasource configuration. I was configurating Tomcat 5.5
> datasource with syntex of 4.x. Please check your configuration file if
> this is not the case for you.
>
> Secondly, how you are you including the datasource configuration in
> sever.xml file? I had this problem because, context.xml from
> WebContents/META-INF was not included properly in the server.xml. Open
> your sever.xml (located at
> < worksapce\.metadata\.plugins\org.eclipse.wst.server.core\tmp 0\conf
> directory in my case) and check if you have your Resource element
> included properly. Pay attention to the driverClassName and url
> attribute. Remember they were elements in 4.x and attributes in 5.x
>
> Hope this solve your problem.
>
> Regards,
>
> Raj
>
>
> Tom Colman wrote:
>
>> Hello there,
>>
>>
>> I'm having troubles accessing a database connection pool.
>>
>> I get the following error:
>>
>>
>> "No suitable driver found"
>>
>>
>> The oracle .jar file however is in my tomcat/common/lib directory but
>> Eclipse seems to start tomcat in a way these libs are not included.
>>
>> How can I fix this ?
>>
>>
>>
>> Greetings,
>> Tom Colman
>> Belgium

Hello Raj (are you from India ?),


I am using eclipse 3.1M5 with wtp 1.0m3. I can edit the server.xml file
in Eclipse (very handy).

We have a working 5.0.24 with "old-style" elements. I will try the
"attributes"-approach however.

Why do I need a META-INF/context.xml. I put my content-element in the
server.xml or does that no longer work ?

Previously I had a GlobalResources DataSource with a ResourceLink. I
will try a context-based DataSource. Perhaps that works better for me
since you can put the jdbc drivers in the WEB-INF/lib directory.


Greetings,
Tom
Re: Problems with Data Source in Tomcat v5.0.28 [message #87983 is a reply to message #87920] Tue, 29 March 2005 11:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rajbsaini.yahoo.com

Hi Tom,


> Hello Raj (are you from India ?),

Yes I am from India.
>
>
> I am using eclipse 3.1M5 with wtp 1.0m3. I can edit the server.xml file
> in Eclipse (very handy).

Did you check that your changes are not overwritten?
>
> We have a working 5.0.24 with "old-style" elements. I will try the
> "attributes"-approach however.

I am not sure about 5.0.xx. Old style Resource mapping did not work for
me in 5.5.
>
> Why do I need a META-INF/context.xml. I put my content-element in the
> server.xml or does that no longer work ?

I feel (I am not sure though) server.xml get overwritten when you
publish your project. You can verify this. I have this configuration
working for me.
>
> Previously I had a GlobalResources DataSource with a ResourceLink. I
> will try a context-based DataSource. Perhaps that works better for me
> since you can put the jdbc drivers in the WEB-INF/lib directory.

You dont need to put your JDBC drivers in your WEB-INF/lib directory. It
is better to put the in common directory ($TOMCAT_HOME/common/lib) as it
can be shared among web applications.

Regards,

Raj
>
>
> Greetings,
> Tom
Re: Problems with Data Source in Tomcat v5.0.28 [message #88578 is a reply to message #87920] Wed, 30 March 2005 02:27 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Hi Tom,

The main advantage of using a META-INF/context.xml is that it won't
disappear if you remove the Web project from the server.

The server.xml you see under the Servers project isn't the one used when
the Tomcat server is run. A copy is made under a "tmp" subdirectory of
".metadata\.plugins\org.eclipse.wst.server.core" which the running
Tomcat uses. This copy is made during the publish operation. If the
Web project contains a META-INF/context.xml, the child elements in that
file are included in the Context element in the "published" server.xml.
This achieves the same thing as your hand editing of the server.xml,
without the risk of loss. The META-INF/context.xml can also have the
same effect if you create a war file from the project and deploy it to a
"production" Tomcat server.

Cheers,
Larry

Tom Colman wrote:
> Raj Saini wrote:
>
>> I had the same problem with datasource. In my case it was the problem
>> of correct datasource configuration. I was configurating Tomcat 5.5
>> datasource with syntex of 4.x. Please check your configuration file if
>> this is not the case for you.
>>
>> Secondly, how you are you including the datasource configuration in
>> sever.xml file? I had this problem because, context.xml from
>> WebContents/META-INF was not included properly in the server.xml. Open
>> your sever.xml (located at
>> < worksapce\.metadata\.plugins\org.eclipse.wst.server.core\tmp 0\conf
>> directory in my case) and check if you have your Resource element
>> included properly. Pay attention to the driverClassName and url
>> attribute. Remember they were elements in 4.x and attributes in 5.x
>>
>> Hope this solve your problem.
>>
>> Regards,
>>
>> Raj
>>
>>
>> Tom Colman wrote:
>>
>>> Hello there,
>>>
>>>
>>> I'm having troubles accessing a database connection pool.
>>>
>>> I get the following error:
>>>
>>>
>>> "No suitable driver found"
>>>
>>>
>>> The oracle .jar file however is in my tomcat/common/lib directory but
>>> Eclipse seems to start tomcat in a way these libs are not included.
>>>
>>> How can I fix this ?
>>>
>>>
>>>
>>> Greetings,
>>> Tom Colman
>>> Belgium
>
>
> Hello Raj (are you from India ?),
>
>
> I am using eclipse 3.1M5 with wtp 1.0m3. I can edit the server.xml file
> in Eclipse (very handy).
>
> We have a working 5.0.24 with "old-style" elements. I will try the
> "attributes"-approach however.
>
> Why do I need a META-INF/context.xml. I put my content-element in the
> server.xml or does that no longer work ?
>
> Previously I had a GlobalResources DataSource with a ResourceLink. I
> will try a context-based DataSource. Perhaps that works better for me
> since you can put the jdbc drivers in the WEB-INF/lib directory.
>
>
> Greetings,
> Tom
Previous Topic:WTP Server settings/metadata...
Next Topic:Missing libraries
Goto Forum:
  


Current Time: Tue Aug 27 23:56:08 GMT 2024

Powered by FUDForum. Page generated in 0.04420 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top