Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Why MySQL DataSource Configuration not working in eclipse wtp 2
Why MySQL DataSource Configuration not working in eclipse wtp 2 [message #195920] Tue, 10 July 2007 08:26 Go to next message
Eclipse UserFriend
Originally posted by: vonleixy.gmail.com

I used to add the configuration in the server.xml (the file can be found
under IDE/"Project Explorer"/Servers/"Tomcat v5.5 Server @
localhost-config"/server.xml)

The configuration is as below:

<Host>
........
<Context crossContext="true" debug="5" docBase="my_project" path=""
reloadable="false">
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver"
maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/my_project"
password="my_project" type=" javax.sql.DataSource"
url="jdbc:mysql://localhost:3306/my_project?autoReconnect=true"
username="my_project"/>
</Context>
</Host>

It used to work well. Yesterday I removed the server by mistake, but I
could no longer restore this.

Anybody has any clue on that. Also in general what is the proper way to
add MySQL datasource into Eclipse WTP?
Re: Why MySQL DataSource Configuration not working in eclipse wtp 2 [message #196098 is a reply to message #195920] Wed, 11 July 2007 17:10 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Is this still not working? If so, what is the error you are getting?
I'm not aware of a reason why it wouldn't work when added back unless
something else was lost when the deletion occurred.

To avoid this issue in the future, you can create a META-INF/context.xml
file in the WebContent folder of your project. For details see:

http://www.eclipse.org/webtools/faq/TomcatServerFAQ.php#info _10

Cheers,
Larry

Ray wrote:
>
>
> I used to add the configuration in the server.xml (the file can be found
> under IDE/"Project Explorer"/Servers/"Tomcat v5.5 Server @
> localhost-config"/server.xml)
>
> The configuration is as below:
>
> <Host>
> .......
> <Context crossContext="true" debug="5" docBase="my_project" path=""
> reloadable="false"> <Resource auth="Container"
> driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30"
> maxWait="10000" name="jdbc/my_project" password="my_project" type="
> javax.sql.DataSource"
> url="jdbc:mysql://localhost:3306/my_project?autoReconnect=true"
> username="my_project"/>
> </Context>
> </Host>
>
> It used to work well. Yesterday I removed the server by mistake, but I
> could no longer restore this.
> Anybody has any clue on that. Also in general what is the proper way to
> add MySQL datasource into Eclipse WTP?
>
>
>
Re: Why MySQL DataSource Configuration not working in eclipse wtp 2 [message #196286 is a reply to message #195920] Thu, 12 July 2007 11:38 Go to previous message
Eclipse UserFriend
Originally posted by: vonleixy.gmail.com

Ray wrote:

I works after I move the conext to META-INF/context.xml. It is a clean
solution because I don't need to update server.xml for republishing.

Thanks a lot,
Ray



> I used to add the configuration in the server.xml (the file can be found
> under IDE/"Project Explorer"/Servers/"Tomcat v5.5 Server @
> localhost-config"/server.xml)

> The configuration is as below:

> <Host>
> ........
> <Context crossContext="true" debug="5" docBase="my_project" path=""
> reloadable="false">
> <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver"
> maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/my_project"
> password="my_project" type=" javax.sql.DataSource"
> url="jdbc:mysql://localhost:3306/my_project?autoReconnect=true"
> username="my_project"/>
> </Context>
> </Host>

> It used to work well. Yesterday I removed the server by mistake, but I
> could no longer restore this.

> Anybody has any clue on that. Also in general what is the proper way to
> add MySQL datasource into Eclipse WTP?
Hi Larry,

It works after I move the Context definition to META-INF/context.xml.

I don't why changing the server.xml didn't work. The same server.xml
worked on my friend's machine.

Still META-INF/context.xml is a better approach. I don't need to change
server.xml each time a update the context-root for republishing.

Thanks a lot,
Ray
Previous Topic:Why the new publish delays ?
Next Topic:requires plug-in "org.eclipse.wst.server.core (1.0.103)", or equivalent.
Goto Forum:
  


Current Time: Thu Apr 25 10:53:24 GMT 2024

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

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

Back to the top