M5: problem with datasources [message #116708] |
Wed, 06 July 2005 11:17  |
Eclipse User |
|
|
|
Originally posted by: cooll.free.fr
Hi !
I access via hibernate to an oracle datasource.
If I launch tomcat standalone, using the server.xml generated by wtp,
everything works fine.
I tomcat is launched from wtp, it doesn't work:
javax.servlet.ServletException: Could not find datasource
How can I make it work in WTP M5 ?
(the same source/configuration works also perfectly with M3)
The oracle driver is in the lib directory of tomcat, not in the web-inf/lib
Thanks
|
|
|
|
|
Re: M5: problem with datasources <solution> [message #144005 is a reply to message #119442] |
Sat, 15 October 2005 19:19   |
Eclipse User |
|
|
|
Hello,
I was getting the same error with my /META-INF/context.xml datasource
definitions. I was able to resolve the problem by configuring my datasource
using only attributes instead of elements. I discovered this worked after I
round this thread at the Java forums:
http://forum.java.sun.com/thread.jspa?threadID=567630&me ssageID=2803199
My resulting dataSource definition looks like this:
<Context path="/WTP" docBase="WebContent">
<Resource
name="jdbc/rides"
auth="Container"
scope="Shareable"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
url="jdbc:mysql://localhost/rides"
driverClassName="com.mysql.jdbc.Driver"
username="rides"
password="rides"
maxWait="3000"
maxIdle="100"
maxActive="10"/>
</Context>
Cass Costello wrote:
> Hey Lionel,
>
> Did you get this working? I'm having a similar issue with datasources.
> When I copy the eclipse-created web (from the .deployables dir) into the
> Tomcat webapps dir manually, everything's groovy. But when I run the
> webapp from within eclipse/wtp, the datasources aren't found.
>
> FYI - my datasources are configured in the [myapp]/META-INF/context.xml
> file. I'm using 3.1 final, M5 and Tomcat 5.5.9. I've tried moving the
> datasource configuration into eclipse's copy of the server.xml file to
> no avail.
>
> -Cass
>
> Lionel wrote:
>
>> Hi !
>
>
>> I access via hibernate to an oracle datasource.
>> If I launch tomcat standalone, using the server.xml generated by wtp,
>> everything works fine.
>> I tomcat is launched from wtp, it doesn't work:
>> javax.servlet.ServletException: Could not find datasource
>
>
>
>
>> How can I make it work in WTP M5 ?
>
>
>> (the same source/configuration works also perfectly with M3)
>
>
>> The oracle driver is in the lib directory of tomcat, not in the
>> web-inf/lib
>
>
>> Thanks
>
>
|
|
|
Re: M5: problem with datasources <solution> [message #144107 is a reply to message #144005] |
Mon, 17 October 2005 06:01  |
Eclipse User |
|
|
|
Originally posted by: cooll.free.fr
Mike Dalrymple wrote:
> Hello,
>
> I was getting the same error with my /META-INF/context.xml datasource
> definitions. I was able to resolve the problem by configuring my
> datasource using only attributes instead of elements.
I solved the problem by copying the context.xml from tomcat to eclipse's
tomcat server configuration directory.
|
|
|
Powered by
FUDForum. Page generated in 0.03395 seconds