You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Len Popp <le...@gmail.com> on 2008/03/10 15:42:10 UTC

Re: Eclipse with tomcat and mysql

What version of Eclipse are you using, and what extensions are you
using for your webapp project (e.g. Web Standard Tools or Sysdeo
Tomcat plug-in)?
-- 
Len

On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com> wrote:
> Hello,
>
>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>
>  In Eclipse, I have set up a project and have added a Tomcat server and added the project to the server.
>  The project consists of a simple example of a standard struts architecture for the MVC.
>
>  Model: Artist.java, ArtistSearchService.java
>  View: search.jsp, SearchForm.java
>  Controller: ArtistSearchAction.java
>
>  The ArtistSearchSerview.java connects to mysql, searches for Artists and creates Artists objects.
>
>  If I deploy this to Tomcat, every thing works fine.
>
>  But when I run inside Eclipse it will not connect to the database. I get the errors listed below.
>  Funny thing is, in Eclipse I have also tried setting a data source for this database.
>  This also works fine and I can connect to the DB from the data source, but I still get the error.
>
>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>
>  Thanks in advance for the help,
>  Kevin
>
>  HTTP Status 500 -
>
>  --------------------------------------------------------------------------------
>
>  type Exception report
>
>  message
>
>  description The server encountered an internal error () that prevented it from fulfilling this request.
>
>  exception
>
>  javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null'
>         org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
>         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>  root cause
>
>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
>         org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
>         org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>         model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>         controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>         org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>         org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>         org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>         org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>         org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>         org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>         org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>  root cause
>
>  java.sql.SQLException: No suitable driver
>         java.sql.DriverManager.getDriver(Unknown Source)
>         org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
>         org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>         model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>         controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>         org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>         org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>         org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>         org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>         org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>         org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>         org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>  note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.
>
>
>  --------------------------------------------------------------------------------
>
>  Apache Tomcat/5.5.26
>
>
>
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by Martin Gainty <mg...@hotmail.com>.
Kevin-

tomcat shutdown

from Eclipse
install sysdeo
Go to preferences and then navigate to Sysdeo Tomcat option.
Here your will find a property 'Source Path'.
Select your project that you want to debug.
Save your changes and start tomcat again.

Be mindful Eclipse IDE likes to run in its *own environment* so using sysdeo
for TC is path of least resistance
make sure you translate any JDBC realms from legacy TC over to Sysdeo's
server.xml

HTH
Martin-
----- Original Message -----
From: <ke...@witten-enterprises.com>
To: "Len Popp" <le...@gmail.com>; "Tomcat Users List"
<us...@tomcat.apache.org>
Sent: Monday, March 10, 2008 10:49 AM
Subject: Re: Eclipse with tomcat and mysql


> Eclipse (Eurpoa) version 3.1.1
>
> I am using the Web Standard Tools. (The project I created is a Dynamic Web
> Project).
>
> I do NOT have the Sysdeo Tomcat plugin. Would this help?
>
> Thanks,
> Kevin
>
> ----- Original Message -----
> From: "Len Popp" <le...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>;
> <ke...@witten-enterprises.com>
> Sent: Monday, March 10, 2008 6:42 AM
> Subject: Re: Eclipse with tomcat and mysql
>
>
> > What version of Eclipse are you using, and what extensions are you
> > using for your webapp project (e.g. Web Standard Tools or Sysdeo
> > Tomcat plug-in)?
> > --
> > Len
> >
> > On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com> wrote:
> >> Hello,
> >>
> >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
> >>
> >>  In Eclipse, I have set up a project and have added a Tomcat server and
> >> added the project to the server.
> >>  The project consists of a simple example of a standard struts
> >> architecture for the MVC.
> >>
> >>  Model: Artist.java, ArtistSearchService.java
> >>  View: search.jsp, SearchForm.java
> >>  Controller: ArtistSearchAction.java
> >>
> >>  The ArtistSearchSerview.java connects to mysql, searches for Artists
and
> >> creates Artists objects.
> >>
> >>  If I deploy this to Tomcat, every thing works fine.
> >>
> >>  But when I run inside Eclipse it will not connect to the database. I
get
> >> the errors listed below.
> >>  Funny thing is, in Eclipse I have also tried setting a data source for
> >> this database.
> >>  This also works fine and I can connect to the DB from the data source,
> >> but I still get the error.
> >>
> >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
> >>
> >>  Thanks in advance for the help,
> >>  Kevin
> >>
> >>  HTTP Status 500 -
> >>
>
>  -------------------------------------------------------------------------
-------
> >>
> >>  type Exception report
> >>
> >>  message
> >>
> >>  description The server encountered an internal error () that prevented
> >> it from fulfilling this request.
> >>
> >>  exception
> >>
> >>  javax.servlet.ServletException: Cannot create JDBC driver of class ''
> >> for connect URL 'null'
> >>
> >>
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequest
Processor.java:286)
> >>
> >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> >>
> >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> >>  root cause
> >>
> >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> >> driver of class '' for connect URL 'null'
> >>
> >>
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
java:1150)
> >>
> >>
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:880)
> >>
> >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
> >>
controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
> >>
> >>
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction
java:58)
> >>
> >>
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecu
teAction.java:67)
> >>
> >>
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase
java:51)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:30
4)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequest
Processor.java:283)
> >>
> >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> >>
> >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> >>  root cause
> >>
> >>  java.sql.SQLException: No suitable driver
> >>         java.sql.DriverManager.getDriver(Unknown Source)
> >>
> >>
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
java:1143)
> >>
> >>
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:880)
> >>
> >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
> >>
controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
> >>
> >>
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction
java:58)
> >>
> >>
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecu
teAction.java:67)
> >>
> >>
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase
java:51)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:30
4)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequest
Processor.java:283)
> >>
> >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> >>
> >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> >>  note The full stack trace of the root cause is available in the Apache
> >> Tomcat/5.5.26 logs.
> >>
> >>
>
>  -------------------------------------------------------------------------
-------
> >>
> >>  Apache Tomcat/5.5.26
> >>
> >>
> >>
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Eclipse with tomcat and mysql

Posted by Larry Isaacs <La...@sas.com>.
For some info about the Tomcat support in the Web Tools Platform of Eclipse, see this FAQ:

http://wiki.eclipse.org/WTP_Tomcat_FAQ

If you happen to have put your mysql driver jar in shared/lib, then this question might explain the behavior:

http://wiki.eclipse.org/WTP_Tomcat_FAQ#Why_are_classes_in_my_Tomcat_installation.27s_shared.2Flib_not_seen_by_my_Web_application.3F

If your mysql server access depends on changes to the server.xml made after the Eclipse Tomcat server was created, see this question:

http://wiki.eclipse.org/WTP_Tomcat_FAQ#When_I_create_my_first_Tomcat_server.2C_why_is_a_Servers_project_created_in_my_workspace.3F

If neither of these covers your situation, check the other questions to see if any might explain what is different between your Tomcat installation and the Tomcat server in Eclipse.

Cheers,
Larry

P.S. That FAQ page can be fairly slow to come up, perhaps because of its size.  Be patient.


> -----Original Message-----
> From: kevin@witten-enterprises.com [mailto:kevin@witten-
> enterprises.com]
> Sent: Monday, March 10, 2008 11:50 AM
> To: Len Popp; Tomcat Users List
> Subject: Re: Eclipse with tomcat and mysql
>
> Eclipse (Eurpoa) version 3.1.1
>
> I am using the Web Standard Tools. (The project I created is a Dynamic
> Web
> Project).
>
> I do NOT have the Sysdeo Tomcat plugin. Would this help?
>
> Thanks,
> Kevin
>
> ----- Original Message -----
> From: "Len Popp" <le...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>;
> <ke...@witten-enterprises.com>
> Sent: Monday, March 10, 2008 6:42 AM
> Subject: Re: Eclipse with tomcat and mysql
>
>
> > What version of Eclipse are you using, and what extensions are you
> > using for your webapp project (e.g. Web Standard Tools or Sysdeo
> > Tomcat plug-in)?
> > --
> > Len
> >
> > On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com>
> wrote:
> >> Hello,
> >>
> >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
> >>
> >>  In Eclipse, I have set up a project and have added a Tomcat server
> and
> >> added the project to the server.
> >>  The project consists of a simple example of a standard struts
> >> architecture for the MVC.
> >>
> >>  Model: Artist.java, ArtistSearchService.java
> >>  View: search.jsp, SearchForm.java
> >>  Controller: ArtistSearchAction.java
> >>
> >>  The ArtistSearchSerview.java connects to mysql, searches for
> Artists and
> >> creates Artists objects.
> >>
> >>  If I deploy this to Tomcat, every thing works fine.
> >>
> >>  But when I run inside Eclipse it will not connect to the database.
> I get
> >> the errors listed below.
> >>  Funny thing is, in Eclipse I have also tried setting a data source
> for
> >> this database.
> >>  This also works fine and I can connect to the DB from the data
> source,
> >> but I still get the error.
> >>
> >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
> >>
> >>  Thanks in advance for the help,
> >>  Kevin
> >>
> >>  HTTP Status 500 -
> >>
> >>  -------------------------------------------------------------------
> -------------
> >>
> >>  type Exception report
> >>
> >>  message
> >>
> >>  description The server encountered an internal error () that
> prevented
> >> it from fulfilling this request.
> >>
> >>  exception
> >>
> >>  javax.servlet.ServletException: Cannot create JDBC driver of class
> ''
> >> for connect URL 'null'
> >>
> >>
> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRe
> questProcessor.java:286)
> >>
> >>
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> >>
> >>
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> >>  root cause
> >>
> >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> >> driver of class '' for connect URL 'null'
> >>
> >>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataS
> ource.java:1150)
> >>
> >>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSour
> ce.java:880)
> >>
> >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
> >>
> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
> >>
> >>
> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteA
> ction.java:58)
> >>
> >>
> org.apache.struts.chain.commands.AbstractExecuteAction.execute(Abstract
> ExecuteAction.java:67)
> >>
> >>
> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionComman
> dBase.java:51)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.ja
> va:304)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRe
> questProcessor.java:283)
> >>
> >>
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> >>
> >>
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> >>  root cause
> >>
> >>  java.sql.SQLException: No suitable driver
> >>         java.sql.DriverManager.getDriver(Unknown Source)
> >>
> >>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataS
> ource.java:1143)
> >>
> >>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSour
> ce.java:880)
> >>
> >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
> >>
> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
> >>
> >>
> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteA
> ction.java:58)
> >>
> >>
> org.apache.struts.chain.commands.AbstractExecuteAction.execute(Abstract
> ExecuteAction.java:67)
> >>
> >>
> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionComman
> dBase.java:51)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.ja
> va:304)
> >>
> >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
> >>
> >>
> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRe
> questProcessor.java:283)
> >>
> >>
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> >>
> >>
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> >>  note The full stack trace of the root cause is available in the
> Apache
> >> Tomcat/5.5.26 logs.
> >>
> >>
> >>  -------------------------------------------------------------------
> -------------
> >>
> >>  Apache Tomcat/5.5.26
> >>
> >>
> >>
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by ke...@witten-enterprises.com.
I tried it with the upper case also and it still does not work.

<Context reloadable="true" path="/musicDB" debug="5" crosscontext="true" 
docbase="musicDB">

      <Logger timestamp="true" suffix=".txt" prefix="localhost_musicDB_log" 
classname="org.apache.catalina.logger.FileLogger">

      <Resource name="jdbc/musicDB" auth="Container" 
type="javax.sql.DataSource"

            username="javauser" password="javadude"

            driverClassName="com.mysql.jdbc.Driver"

            url="jdbc:mysql://localhost:3306/musicDB?autoReconnect=true"

            maxwait="5000" maxactive="4" maxidle="2"/>

</Context>



I still get an exception: java.sql.SQLException: No suitable driver



Thanks for your help,

Kevin


----- Original Message ----- 
From: "David Smith" <dn...@cornell.edu>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, March 10, 2008 5:52 PM
Subject: Re: Eclipse with tomcat and mysql


> For the most part -- just remember case matters.  It's Context, not 
> context.  Same is true for Logger and Resource as well.
>
> See http://tomcat.apache.org/tomcat-5.5-doc/config/index.html for further 
> information regarding tomcat config.  BTW, what about the 5.5 docs 
> specifically doesn't seem correct?
>
> --David
>
> kevin@witten-enterprises.com wrote:
>>
>> So I found this out the hard way. Eclipse overwrote my 
>> $CATALINA_HOME/conf/Catalina/localhost/<webapp>.xml
>>
>> Now I can't see to get the DB connected outside of Eclipse either. I 
>> can't remember what the syntax on the context was since I had to try many 
>> different suggestions I found on the web before one worked. The TC docs 
>> don't seems to be correct for version 5.5.
>>
>> Is thie the correct syntax?
>>
>> <context reloadable="true" path="/musicDB" debug="5" crosscontext="true" 
>> docbase="musicDB">
>>
>>      <logger timestamp="true" suffix=".txt" 
>> prefix="localhost_musicDB_log." 
>> classname="org.apache.catalina.logger.FileLogger">
>>
>>      <resource username="javauser" password="javadude"
>>
>>            url="jdbc:mysql://localhost:3306/musicDB?autoReconnect=true"
>>
>>            type="javax.sql.DataSource" auth="Container" 
>> name="jdbc/musicDB"
>>
>>            driverclassname="com.mysql.jdbc.Driver" maxwait="5000"
>>
>>            maxactive="4" maxidle="2"/>
>>
>> </context>
>>
>>
>>
>> Thanks
>>
>> Kevin
>>
>>
>>
>> ----- Original Message ----- From: "Len Popp" <le...@gmail.com>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Monday, March 10, 2008 4:42 PM
>> Subject: Re: Eclipse with tomcat and mysql
>>
>>
>>> So you're putting the <webapp>.xml file into conf/Catalina yourself,
>>> right? That could be the problem because of the way Web Standard Tools
>>> copies files around (or doesn't) when you "Publish" the webapp. I
>>> don't know all the details, but some files in workspace/Servers/Tomcat
>>> v5.5 Server are copied to another directory deep under the workspace
>>> dir.
>>>
>>> The usual place to put the <Context> declaration is inside the webapp,
>>> in the file META-INF/context.xml. Tomcat copies that file at startup
>>> to $CATALINA_HOME/conf/Catalina/localhost/<webapp>.xml. And that still
>>> works under Eclipse. Try doing it that way, unless you have a strong
>>> reason to keep the <Context> declaration outside of the webapp itself.
>>> -- 
>>> Len
>>>
>>>
>>> On Mon, Mar 10, 2008 at 2:42 PM,  <ke...@witten-enterprises.com> wrote:
>>>> This did not work either.
>>>>
>>>>  There is a "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at
>>>>  localhost-config" directory which contains a copy of the tomcat conf 
>>>> files
>>>>  such as server.xml.
>>>>  I tried adding the DB driver context to this server.xml file but got 
>>>> the
>>>>  same issue.
>>>>
>>>>  For Tomcat 5.5 I had to add the database context to
>>>>  <TOMCATDIR>/conf/Catalina/localhost/<webappname>.xml
>>>>  It would not work in the <TOMCATDIR>/conf/server.xml
>>>>
>>>>  So I also tried copying the <TOMCATDIR>/conf/Catalina to
>>>>  "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at 
>>>> localhost-config/Catalina"
>>>>
>>>>  Neither of these worked.
>>>>
>>>>
>>>>  Kevin
>>>>
>>>>
>>>>  ----- Original Message -----
>>>>  From: "Len Popp" <le...@gmail.com>
>>>>  To: "Tomcat Users List" <us...@tomcat.apache.org>
>>>>
>>>>
>>>> Sent: Monday, March 10, 2008 8:54 AM
>>>>  Subject: Re: Eclipse with tomcat and mysql
>>>>
>>>>
>>>>  > Web Standard Tools makes copies of some of the Tomcat config files,
>>>>  > which might be causing your problem. In particular, if you've 
>>>> defined
>>>>  > your JDBC resource in server.xml it might not be seen by Tomcat when
>>>>  > you run it from Eclipse. If that's the case, update the copy of
>>>>  > server.xml in your Eclipse workspace (it might be in
>>>>  > workspace/Servers/Tomcat v5.5 Server @ localhost-config but I think
>>>>  > that depends on settings and version). And remember to click 
>>>> "Publish"
>>>>  > in the servers window.
>>>>  > --
>>>>  > Len
>>>>  >
>>>>  > On Mon, Mar 10, 2008 at 11:49 AM,  <ke...@witten-enterprises.com> 
>>>> wrote:
>>>>  >> Eclipse (Eurpoa) version 3.1.1
>>>>  >>
>>>>  >>  I am using the Web Standard Tools. (The project I created is a 
>>>> Dynamic
>>>>  >> Web
>>>>  >>  Project).
>>>>  >>
>>>>  >>  I do NOT have the Sysdeo Tomcat plugin. Would this help?
>>>>  >>
>>>>  >>  Thanks,
>>>>  >>  Kevin
>>>>  >>
>>>>  >>
>>>>  >>
>>>>  >>  ----- Original Message -----
>>>>  >>  From: "Len Popp" <le...@gmail.com>
>>>>  >>  To: "Tomcat Users List" <us...@tomcat.apache.org>;
>>>>  >>  <ke...@witten-enterprises.com>
>>>>  >>  Sent: Monday, March 10, 2008 6:42 AM
>>>>  >>  Subject: Re: Eclipse with tomcat and mysql
>>>>  >>
>>>>  >>
>>>>  >>  > What version of Eclipse are you using, and what extensions are 
>>>> you
>>>>  >>  > using for your webapp project (e.g. Web Standard Tools or Sysdeo
>>>>  >>  > Tomcat plug-in)?
>>>>  >>  > --
>>>>  >>  > Len
>>>>  >>  >
>>>>  >>  > On Mon, Mar 10, 2008 at 11:32 AM, 
>>>> <ke...@witten-enterprises.com>
>>>>  >> wrote:
>>>>  >>  >> Hello,
>>>>  >>  >>
>>>>  >>  >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>>>>  >>  >>
>>>>  >>  >>  In Eclipse, I have set up a project and have added a Tomcat 
>>>> server
>>>>  >> and
>>>>  >>  >> added the project to the server.
>>>>  >>  >>  The project consists of a simple example of a standard struts
>>>>  >>  >> architecture for the MVC.
>>>>  >>  >>
>>>>  >>  >>  Model: Artist.java, ArtistSearchService.java
>>>>  >>  >>  View: search.jsp, SearchForm.java
>>>>  >>  >>  Controller: ArtistSearchAction.java
>>>>  >>  >>
>>>>  >>  >>  The ArtistSearchSerview.java connects to mysql, searches for 
>>>> Artists
>>>>  >> and
>>>>  >>  >> creates Artists objects.
>>>>  >>  >>
>>>>  >>  >>  If I deploy this to Tomcat, every thing works fine.
>>>>  >>  >>
>>>>  >>  >>  But when I run inside Eclipse it will not connect to the 
>>>> database. I
>>>>  >> get
>>>>  >>  >> the errors listed below.
>>>>  >>  >>  Funny thing is, in Eclipse I have also tried setting a data 
>>>> source
>>>>  >> for
>>>>  >>  >> this database.
>>>>  >>  >>  This also works fine and I can connect to the DB from the data
>>>>  >> source,
>>>>  >>  >> but I still get the error.
>>>>  >>  >>
>>>>  >>  >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>>>>  >>  >>
>>>>  >>  >>  Thanks in advance for the help,
>>>>  >>  >>  Kevin
>>>>  >>  >>
>>>>  >>  >>  HTTP Status 500 -
>>>>  >>  >>
>>>>  >>
>>>>  >> 
>>>>  >>  --------------------------------------------------------------------------------
>>>>
>>>>  >>  >>
>>>>  >>  >>  type Exception report
>>>>  >>  >>
>>>>  >>  >>  message
>>>>  >>  >>
>>>>  >>  >>  description The server encountered an internal error () that
>>>>  >> prevented
>>>>  >>  >> it from fulfilling this request.
>>>>  >>  >>
>>>>  >>  >>  exception
>>>>  >>  >>
>>>>  >>  >>  javax.servlet.ServletException: Cannot create JDBC driver of 
>>>> class
>>>>  >> ''
>>>>  >>  >> for connect URL 'null'
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>>>  >>  >>
>>>>  >>  >> 
>>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>>  >>  >>
>>>>  >>  >>  root cause
>>>>  >>  >>
>>>>  >>  >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create 
>>>> JDBC
>>>>  >>  >> driver of class '' for connect URL 'null'
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>>>  >>  >>
>>>>  >>  >> 
>>>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>>>  >>  >>
>>>>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>>>>  >>  >>
>>>>  >>  >> 
>>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>>>>  >>  >>
>>>>  >>  >> 
>>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>>>  >>  >>
>>>>  >>  >> 
>>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>>  >>  >>
>>>>  >>  >>  root cause
>>>>  >>  >>
>>>>  >>  >>  java.sql.SQLException: No suitable driver
>>>>  >>  >>         java.sql.DriverManager.getDriver(Unknown Source)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>>>  >>  >>
>>>>  >>  >> 
>>>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>>>  >>  >>
>>>>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>>>>  >>  >>
>>>>  >>  >> 
>>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>>>>  >>  >>
>>>>  >>  >> 
>>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>>>>  >>  >>
>>>>  >>  >>
>>>>  >> 
>>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>>>  >>  >>
>>>>  >>  >> 
>>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>>  >>  >>
>>>>  >>  >>  note The full stack trace of the root cause is available in 
>>>> the
>>>>  >> Apache
>>>>  >>  >> Tomcat/5.5.26 logs.
>>>>  >>  >>
>>>>  >>  >>
>>>>  >>
>>>>  >> 
>>>>  >>  --------------------------------------------------------------------------------
>>>>
>>>>  >>  >>
>>>>  >>  >>  Apache Tomcat/5.5.26
>>>>  >>  >>
>>>>  >>  >>
>>>>  >>  >>
>>>>  >>  >>
>>>>  >>  >>
>>>>  >>
>>>>  >>
>>>>  >
>>>>
>>>>
>>>> > ---------------------------------------------------------------------
>>>>  > To start a new topic, e-mail: users@tomcat.apache.org
>>>>  > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>  > For additional commands, e-mail: users-help@tomcat.apache.org
>>>>  >
>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>>>  To start a new topic, e-mail: users@tomcat.apache.org
>>>>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>  For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by ke...@witten-enterprises.com.
Ah. Thanks for the clarification. that's a big help.

Kevin


----- Original Message ----- 
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, March 10, 2008 7:44 PM
Subject: RE: Eclipse with tomcat and mysql


> From: kevin@witten-enterprises.com 
> [mailto:kevin@witten-enterprises.com] 
> Subject: Re: Eclipse with tomcat and mysql
> 
> But the funny thing is the docs say to put path and docBase in.

The path and docBase attributes are used only when the <Context> element
is in server.xml, not when it's in a webapp's META-INF/context.xml or in
conf/Catalina/[host]/[appname].xml.  The docBase attribute can be used
in the latter case, but only when the webapp is deployed somewhere other
than under the <Host> appBase directory.

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Eclipse with tomcat and mysql

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kevin@witten-enterprises.com 
> [mailto:kevin@witten-enterprises.com] 
> Subject: Re: Eclipse with tomcat and mysql
> 
> But the funny thing is the docs say to put path and docBase in.

The path and docBase attributes are used only when the <Context> element
is in server.xml, not when it's in a webapp's META-INF/context.xml or in
conf/Catalina/[host]/[appname].xml.  The docBase attribute can be used
in the latter case, but only when the webapp is deployed somewhere other
than under the <Host> appBase directory.

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by ke...@witten-enterprises.com.
Removing the path and docBase worked. Or maybe it was that I deleted tomcat 
and unziped it again. Not sure which.
But the funny thing is the docs say to put path and docBase in. That is 
where I get it from:

Section 2 Context configuration
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

<Context path="/DBTest" docBase="DBTest"
        debug="5" reloadable="true" crossContext="true">...Now if I can get 
it to work with eclipse I'll be all set.Thanks for all your help,Kevin
----- Original Message ----- 
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, March 10, 2008 6:57 PM
Subject: RE: Eclipse with tomcat and mysql


> From: kevin@witten-enterprises.com
> [mailto:kevin@witten-enterprises.com]
> Subject: Re: Eclipse with tomcat and mysql
>
> <Context path="/musicDB" docBase="musicDB"
>         debug="5" reloadable="true" crossContext="true">

Remove the path and docBase attributes - they're not allowed here.

>   <Resource name="jdbc/musicDB" auth="Container"
> type="javax.sql.DataSource"
>                maxActive="100" maxIdle="30" maxWait="10000"
>                username="javauser" password="javadude"
> driverClassName="com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost:3306/musicDb?autoReconnect=true"/>

Where did you put the driver jar?  Is the database up and running on the
same box Tomcat is?  Is it configured for port 3306?  Does the above
work when you get Eclipse out of the way?

> This did not work so I tried the one in lower case which I
> found in an example on the web.

The web is a great example of Sturgeon's law: "90% of everything is
crap."  Use the real doc, not somebody's misremembered ramblings.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Eclipse with tomcat and mysql

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kevin@witten-enterprises.com 
> [mailto:kevin@witten-enterprises.com] 
> Subject: Re: Eclipse with tomcat and mysql
> 
> <Context path="/musicDB" docBase="musicDB"
>         debug="5" reloadable="true" crossContext="true">

Remove the path and docBase attributes - they're not allowed here.

>   <Resource name="jdbc/musicDB" auth="Container" 
> type="javax.sql.DataSource"
>                maxActive="100" maxIdle="30" maxWait="10000"
>                username="javauser" password="javadude" 
> driverClassName="com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost:3306/musicDb?autoReconnect=true"/>

Where did you put the driver jar?  Is the database up and running on the
same box Tomcat is?  Is it configured for port 3306?  Does the above
work when you get Eclipse out of the way?

> This did not work so I tried the one in lower case which I 
> found in an example on the web.

The web is a great example of Sturgeon's law: "90% of everything is
crap."  Use the real doc, not somebody's misremembered ramblings.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by ke...@witten-enterprises.com.
I removed the logger still did not work.

You mentioned that the resource also was not right? what is the correct 
resource statement?

As for the does, the first thing I tried was the context below
which I got from the docs section "2. Context configuration" at 
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

<Context path="/musicDB" docBase="musicDB"

        debug="5" reloadable="true" crossContext="true">


  <Resource name="jdbc/musicDB" auth="Container" type="javax.sql.DataSource"

               maxActive="100" maxIdle="30" maxWait="10000"

               username="javauser" password="javadude" 
driverClassName="com.mysql.jdbc.Driver"

               url="jdbc:mysql://localhost:3306/musicDb?autoReconnect=true"/>

</Context>


This did not work so I tried the one in lower case which I found in an 
example on the web.

Thanks,
Kevin

----- Original Message ----- 
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, March 10, 2008 6:04 PM
Subject: RE: Eclipse with tomcat and mysql


> From: David Smith [mailto:dns4@cornell.edu]
> Subject: Re: Eclipse with tomcat and mysql
>
> For the most part -- just remember case matters.  It's Context, not
> context.  Same is true for Logger and Resource as well.

Note that there is no <Logger> element in 5.5, and the posted <resource>
[sic] didn't look it came from a current level.  Sounds like the OP was
using some out of date doc.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Eclipse with tomcat and mysql

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: David Smith [mailto:dns4@cornell.edu] 
> Subject: Re: Eclipse with tomcat and mysql
> 
> For the most part -- just remember case matters.  It's Context, not 
> context.  Same is true for Logger and Resource as well.

Note that there is no <Logger> element in 5.5, and the posted <resource>
[sic] didn't look it came from a current level.  Sounds like the OP was
using some out of date doc.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by David Smith <dn...@cornell.edu>.
For the most part -- just remember case matters.  It's Context, not 
context.  Same is true for Logger and Resource as well.

See http://tomcat.apache.org/tomcat-5.5-doc/config/index.html for 
further information regarding tomcat config.  BTW, what about the 5.5 
docs specifically doesn't seem correct?

--David

kevin@witten-enterprises.com wrote:
>
> So I found this out the hard way. Eclipse overwrote my 
> $CATALINA_HOME/conf/Catalina/localhost/<webapp>.xml
>
> Now I can't see to get the DB connected outside of Eclipse either. I 
> can't remember what the syntax on the context was since I had to try 
> many different suggestions I found on the web before one worked. The 
> TC docs don't seems to be correct for version 5.5.
>
> Is thie the correct syntax?
>
> <context reloadable="true" path="/musicDB" debug="5" 
> crosscontext="true" docbase="musicDB">
>
>      <logger timestamp="true" suffix=".txt" 
> prefix="localhost_musicDB_log." 
> classname="org.apache.catalina.logger.FileLogger">
>
>      <resource username="javauser" password="javadude"
>
>            url="jdbc:mysql://localhost:3306/musicDB?autoReconnect=true"
>
>            type="javax.sql.DataSource" auth="Container" 
> name="jdbc/musicDB"
>
>            driverclassname="com.mysql.jdbc.Driver" maxwait="5000"
>
>            maxactive="4" maxidle="2"/>
>
> </context>
>
>
>
> Thanks
>
> Kevin
>
>
>
> ----- Original Message ----- From: "Len Popp" <le...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, March 10, 2008 4:42 PM
> Subject: Re: Eclipse with tomcat and mysql
>
>
>> So you're putting the <webapp>.xml file into conf/Catalina yourself,
>> right? That could be the problem because of the way Web Standard Tools
>> copies files around (or doesn't) when you "Publish" the webapp. I
>> don't know all the details, but some files in workspace/Servers/Tomcat
>> v5.5 Server are copied to another directory deep under the workspace
>> dir.
>>
>> The usual place to put the <Context> declaration is inside the webapp,
>> in the file META-INF/context.xml. Tomcat copies that file at startup
>> to $CATALINA_HOME/conf/Catalina/localhost/<webapp>.xml. And that still
>> works under Eclipse. Try doing it that way, unless you have a strong
>> reason to keep the <Context> declaration outside of the webapp itself.
>> -- 
>> Len
>>
>>
>> On Mon, Mar 10, 2008 at 2:42 PM,  <ke...@witten-enterprises.com> wrote:
>>> This did not work either.
>>>
>>>  There is a "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at
>>>  localhost-config" directory which contains a copy of the tomcat 
>>> conf files
>>>  such as server.xml.
>>>  I tried adding the DB driver context to this server.xml file but 
>>> got the
>>>  same issue.
>>>
>>>  For Tomcat 5.5 I had to add the database context to
>>>  <TOMCATDIR>/conf/Catalina/localhost/<webappname>.xml
>>>  It would not work in the <TOMCATDIR>/conf/server.xml
>>>
>>>  So I also tried copying the <TOMCATDIR>/conf/Catalina to
>>>  "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at 
>>> localhost-config/Catalina"
>>>
>>>  Neither of these worked.
>>>
>>>
>>>  Kevin
>>>
>>>
>>>  ----- Original Message -----
>>>  From: "Len Popp" <le...@gmail.com>
>>>  To: "Tomcat Users List" <us...@tomcat.apache.org>
>>>
>>>
>>> Sent: Monday, March 10, 2008 8:54 AM
>>>  Subject: Re: Eclipse with tomcat and mysql
>>>
>>>
>>>  > Web Standard Tools makes copies of some of the Tomcat config files,
>>>  > which might be causing your problem. In particular, if you've 
>>> defined
>>>  > your JDBC resource in server.xml it might not be seen by Tomcat when
>>>  > you run it from Eclipse. If that's the case, update the copy of
>>>  > server.xml in your Eclipse workspace (it might be in
>>>  > workspace/Servers/Tomcat v5.5 Server @ localhost-config but I think
>>>  > that depends on settings and version). And remember to click 
>>> "Publish"
>>>  > in the servers window.
>>>  > --
>>>  > Len
>>>  >
>>>  > On Mon, Mar 10, 2008 at 11:49 AM,  <ke...@witten-enterprises.com> 
>>> wrote:
>>>  >> Eclipse (Eurpoa) version 3.1.1
>>>  >>
>>>  >>  I am using the Web Standard Tools. (The project I created is a 
>>> Dynamic
>>>  >> Web
>>>  >>  Project).
>>>  >>
>>>  >>  I do NOT have the Sysdeo Tomcat plugin. Would this help?
>>>  >>
>>>  >>  Thanks,
>>>  >>  Kevin
>>>  >>
>>>  >>
>>>  >>
>>>  >>  ----- Original Message -----
>>>  >>  From: "Len Popp" <le...@gmail.com>
>>>  >>  To: "Tomcat Users List" <us...@tomcat.apache.org>;
>>>  >>  <ke...@witten-enterprises.com>
>>>  >>  Sent: Monday, March 10, 2008 6:42 AM
>>>  >>  Subject: Re: Eclipse with tomcat and mysql
>>>  >>
>>>  >>
>>>  >>  > What version of Eclipse are you using, and what extensions 
>>> are you
>>>  >>  > using for your webapp project (e.g. Web Standard Tools or Sysdeo
>>>  >>  > Tomcat plug-in)?
>>>  >>  > --
>>>  >>  > Len
>>>  >>  >
>>>  >>  > On Mon, Mar 10, 2008 at 11:32 AM,  
>>> <ke...@witten-enterprises.com>
>>>  >> wrote:
>>>  >>  >> Hello,
>>>  >>  >>
>>>  >>  >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>>>  >>  >>
>>>  >>  >>  In Eclipse, I have set up a project and have added a Tomcat 
>>> server
>>>  >> and
>>>  >>  >> added the project to the server.
>>>  >>  >>  The project consists of a simple example of a standard struts
>>>  >>  >> architecture for the MVC.
>>>  >>  >>
>>>  >>  >>  Model: Artist.java, ArtistSearchService.java
>>>  >>  >>  View: search.jsp, SearchForm.java
>>>  >>  >>  Controller: ArtistSearchAction.java
>>>  >>  >>
>>>  >>  >>  The ArtistSearchSerview.java connects to mysql, searches 
>>> for Artists
>>>  >> and
>>>  >>  >> creates Artists objects.
>>>  >>  >>
>>>  >>  >>  If I deploy this to Tomcat, every thing works fine.
>>>  >>  >>
>>>  >>  >>  But when I run inside Eclipse it will not connect to the 
>>> database. I
>>>  >> get
>>>  >>  >> the errors listed below.
>>>  >>  >>  Funny thing is, in Eclipse I have also tried setting a data 
>>> source
>>>  >> for
>>>  >>  >> this database.
>>>  >>  >>  This also works fine and I can connect to the DB from the data
>>>  >> source,
>>>  >>  >> but I still get the error.
>>>  >>  >>
>>>  >>  >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>>>  >>  >>
>>>  >>  >>  Thanks in advance for the help,
>>>  >>  >>  Kevin
>>>  >>  >>
>>>  >>  >>  HTTP Status 500 -
>>>  >>  >>
>>>  >>
>>>  >>  >>  
>>> -------------------------------------------------------------------------------- 
>>>
>>>  >>  >>
>>>  >>  >>  type Exception report
>>>  >>  >>
>>>  >>  >>  message
>>>  >>  >>
>>>  >>  >>  description The server encountered an internal error () that
>>>  >> prevented
>>>  >>  >> it from fulfilling this request.
>>>  >>  >>
>>>  >>  >>  exception
>>>  >>  >>
>>>  >>  >>  javax.servlet.ServletException: Cannot create JDBC driver 
>>> of class
>>>  >> ''
>>>  >>  >> for connect URL 'null'
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>>  >>  >>
>>>  >>  >> 
>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>  >>  >>
>>>  >>  >>  root cause
>>>  >>  >>
>>>  >>  >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot 
>>> create JDBC
>>>  >>  >> driver of class '' for connect URL 'null'
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) 
>>>
>>>  >>  >>
>>>  >>  >> 
>>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>>  >>  >>
>>>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) 
>>>
>>>  >>  >>
>>>  >>  >> 
>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) 
>>>
>>>  >>  >>
>>>  >>  >> 
>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>>  >>  >>
>>>  >>  >> 
>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>  >>  >>
>>>  >>  >>  root cause
>>>  >>  >>
>>>  >>  >>  java.sql.SQLException: No suitable driver
>>>  >>  >>         java.sql.DriverManager.getDriver(Unknown Source)
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) 
>>>
>>>  >>  >>
>>>  >>  >> 
>>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>>  >>  >>
>>>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) 
>>>
>>>  >>  >>
>>>  >>  >> 
>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) 
>>>
>>>  >>  >>
>>>  >>  >> 
>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) 
>>>
>>>  >>  >>
>>>  >>  >>
>>>  >> 
>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>>  >>  >>
>>>  >>  >> 
>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>>  >>  >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>  >>  >>
>>>  >>  >>  note The full stack trace of the root cause is available in 
>>> the
>>>  >> Apache
>>>  >>  >> Tomcat/5.5.26 logs.
>>>  >>  >>
>>>  >>  >>
>>>  >>
>>>  >>  >>  
>>> -------------------------------------------------------------------------------- 
>>>
>>>  >>  >>
>>>  >>  >>  Apache Tomcat/5.5.26
>>>  >>  >>
>>>  >>  >>
>>>  >>  >>
>>>  >>  >>
>>>  >>  >>
>>>  >>
>>>  >>
>>>  >
>>>
>>>
>>> > ---------------------------------------------------------------------
>>>  > To start a new topic, e-mail: users@tomcat.apache.org
>>>  > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>  > For additional commands, e-mail: users-help@tomcat.apache.org
>>>  >
>>>
>>>
>>>  ---------------------------------------------------------------------
>>>  To start a new topic, e-mail: users@tomcat.apache.org
>>>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>  For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by ke...@witten-enterprises.com.
So I found this out the hard way. Eclipse overwrote my 
$CATALINA_HOME/conf/Catalina/localhost/<webapp>.xml

Now I can't see to get the DB connected outside of Eclipse either. I can't 
remember what the syntax on the context was since I had to try many 
different suggestions I found on the web before one worked. The TC docs 
don't seems to be correct for version 5.5.

Is thie the correct syntax?

<context reloadable="true" path="/musicDB" debug="5" crosscontext="true" 
docbase="musicDB">

      <logger timestamp="true" suffix=".txt" prefix="localhost_musicDB_log." 
classname="org.apache.catalina.logger.FileLogger">

      <resource username="javauser" password="javadude"

            url="jdbc:mysql://localhost:3306/musicDB?autoReconnect=true"

            type="javax.sql.DataSource" auth="Container" name="jdbc/musicDB"

            driverclassname="com.mysql.jdbc.Driver" maxwait="5000"

            maxactive="4" maxidle="2"/>

</context>



Thanks

Kevin



----- Original Message ----- 
From: "Len Popp" <le...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, March 10, 2008 4:42 PM
Subject: Re: Eclipse with tomcat and mysql


> So you're putting the <webapp>.xml file into conf/Catalina yourself,
> right? That could be the problem because of the way Web Standard Tools
> copies files around (or doesn't) when you "Publish" the webapp. I
> don't know all the details, but some files in workspace/Servers/Tomcat
> v5.5 Server are copied to another directory deep under the workspace
> dir.
>
> The usual place to put the <Context> declaration is inside the webapp,
> in the file META-INF/context.xml. Tomcat copies that file at startup
> to $CATALINA_HOME/conf/Catalina/localhost/<webapp>.xml. And that still
> works under Eclipse. Try doing it that way, unless you have a strong
> reason to keep the <Context> declaration outside of the webapp itself.
> -- 
> Len
>
>
> On Mon, Mar 10, 2008 at 2:42 PM,  <ke...@witten-enterprises.com> wrote:
>> This did not work either.
>>
>>  There is a "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at
>>  localhost-config" directory which contains a copy of the tomcat conf 
>> files
>>  such as server.xml.
>>  I tried adding the DB driver context to this server.xml file but got the
>>  same issue.
>>
>>  For Tomcat 5.5 I had to add the database context to
>>  <TOMCATDIR>/conf/Catalina/localhost/<webappname>.xml
>>  It would not work in the <TOMCATDIR>/conf/server.xml
>>
>>  So I also tried copying the <TOMCATDIR>/conf/Catalina to
>>  "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at 
>> localhost-config/Catalina"
>>
>>  Neither of these worked.
>>
>>
>>  Kevin
>>
>>
>>  ----- Original Message -----
>>  From: "Len Popp" <le...@gmail.com>
>>  To: "Tomcat Users List" <us...@tomcat.apache.org>
>>
>>
>> Sent: Monday, March 10, 2008 8:54 AM
>>  Subject: Re: Eclipse with tomcat and mysql
>>
>>
>>  > Web Standard Tools makes copies of some of the Tomcat config files,
>>  > which might be causing your problem. In particular, if you've defined
>>  > your JDBC resource in server.xml it might not be seen by Tomcat when
>>  > you run it from Eclipse. If that's the case, update the copy of
>>  > server.xml in your Eclipse workspace (it might be in
>>  > workspace/Servers/Tomcat v5.5 Server @ localhost-config but I think
>>  > that depends on settings and version). And remember to click "Publish"
>>  > in the servers window.
>>  > --
>>  > Len
>>  >
>>  > On Mon, Mar 10, 2008 at 11:49 AM,  <ke...@witten-enterprises.com> 
>> wrote:
>>  >> Eclipse (Eurpoa) version 3.1.1
>>  >>
>>  >>  I am using the Web Standard Tools. (The project I created is a 
>> Dynamic
>>  >> Web
>>  >>  Project).
>>  >>
>>  >>  I do NOT have the Sysdeo Tomcat plugin. Would this help?
>>  >>
>>  >>  Thanks,
>>  >>  Kevin
>>  >>
>>  >>
>>  >>
>>  >>  ----- Original Message -----
>>  >>  From: "Len Popp" <le...@gmail.com>
>>  >>  To: "Tomcat Users List" <us...@tomcat.apache.org>;
>>  >>  <ke...@witten-enterprises.com>
>>  >>  Sent: Monday, March 10, 2008 6:42 AM
>>  >>  Subject: Re: Eclipse with tomcat and mysql
>>  >>
>>  >>
>>  >>  > What version of Eclipse are you using, and what extensions are you
>>  >>  > using for your webapp project (e.g. Web Standard Tools or Sysdeo
>>  >>  > Tomcat plug-in)?
>>  >>  > --
>>  >>  > Len
>>  >>  >
>>  >>  > On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com>
>>  >> wrote:
>>  >>  >> Hello,
>>  >>  >>
>>  >>  >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>>  >>  >>
>>  >>  >>  In Eclipse, I have set up a project and have added a Tomcat 
>> server
>>  >> and
>>  >>  >> added the project to the server.
>>  >>  >>  The project consists of a simple example of a standard struts
>>  >>  >> architecture for the MVC.
>>  >>  >>
>>  >>  >>  Model: Artist.java, ArtistSearchService.java
>>  >>  >>  View: search.jsp, SearchForm.java
>>  >>  >>  Controller: ArtistSearchAction.java
>>  >>  >>
>>  >>  >>  The ArtistSearchSerview.java connects to mysql, searches for 
>> Artists
>>  >> and
>>  >>  >> creates Artists objects.
>>  >>  >>
>>  >>  >>  If I deploy this to Tomcat, every thing works fine.
>>  >>  >>
>>  >>  >>  But when I run inside Eclipse it will not connect to the 
>> database. I
>>  >> get
>>  >>  >> the errors listed below.
>>  >>  >>  Funny thing is, in Eclipse I have also tried setting a data 
>> source
>>  >> for
>>  >>  >> this database.
>>  >>  >>  This also works fine and I can connect to the DB from the data
>>  >> source,
>>  >>  >> but I still get the error.
>>  >>  >>
>>  >>  >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>>  >>  >>
>>  >>  >>  Thanks in advance for the help,
>>  >>  >>  Kevin
>>  >>  >>
>>  >>  >>  HTTP Status 500 -
>>  >>  >>
>>  >>
>>  >> 
>>  >>  --------------------------------------------------------------------------------
>>  >>  >>
>>  >>  >>  type Exception report
>>  >>  >>
>>  >>  >>  message
>>  >>  >>
>>  >>  >>  description The server encountered an internal error () that
>>  >> prevented
>>  >>  >> it from fulfilling this request.
>>  >>  >>
>>  >>  >>  exception
>>  >>  >>
>>  >>  >>  javax.servlet.ServletException: Cannot create JDBC driver of 
>> class
>>  >> ''
>>  >>  >> for connect URL 'null'
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>  >>  >>
>>  >>  >> 
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>  >>  >> 
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>  >>  >> 
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>  >>  >>
>>  >>  >>  root cause
>>  >>  >>
>>  >>  >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create 
>> JDBC
>>  >>  >> driver of class '' for connect URL 'null'
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>  >>  >>
>>  >>  >> 
>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>  >>  >>
>>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>>  >>  >>
>>  >>  >> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>>  >>  >>
>>  >>  >> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>  >>  >>
>>  >>  >> 
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>  >>  >> 
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>  >>  >> 
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>  >>  >>
>>  >>  >>  root cause
>>  >>  >>
>>  >>  >>  java.sql.SQLException: No suitable driver
>>  >>  >>         java.sql.DriverManager.getDriver(Unknown Source)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>  >>  >>
>>  >>  >> 
>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>  >>  >>
>>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>>  >>  >>
>>  >>  >> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>>  >>  >>
>>  >>  >> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>>  >>  >>
>>  >>  >>
>>  >> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>  >>  >>
>>  >>  >> 
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>  >>  >> 
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>  >>  >> 
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>  >>  >>
>>  >>  >>  note The full stack trace of the root cause is available in the
>>  >> Apache
>>  >>  >> Tomcat/5.5.26 logs.
>>  >>  >>
>>  >>  >>
>>  >>
>>  >> 
>>  >>  --------------------------------------------------------------------------------
>>  >>  >>
>>  >>  >>  Apache Tomcat/5.5.26
>>  >>  >>
>>  >>  >>
>>  >>  >>
>>  >>  >>
>>  >>  >>
>>  >>
>>  >>
>>  >
>>
>>
>> > ---------------------------------------------------------------------
>>  > To start a new topic, e-mail: users@tomcat.apache.org
>>  > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>  > For additional commands, e-mail: users-help@tomcat.apache.org
>>  >
>>
>>
>>  ---------------------------------------------------------------------
>>  To start a new topic, e-mail: users@tomcat.apache.org
>>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>  For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by Len Popp <le...@gmail.com>.
So you're putting the <webapp>.xml file into conf/Catalina yourself,
right? That could be the problem because of the way Web Standard Tools
copies files around (or doesn't) when you "Publish" the webapp. I
don't know all the details, but some files in workspace/Servers/Tomcat
v5.5 Server are copied to another directory deep under the workspace
dir.

The usual place to put the <Context> declaration is inside the webapp,
in the file META-INF/context.xml. Tomcat copies that file at startup
to $CATALINA_HOME/conf/Catalina/localhost/<webapp>.xml. And that still
works under Eclipse. Try doing it that way, unless you have a strong
reason to keep the <Context> declaration outside of the webapp itself.
-- 
Len


On Mon, Mar 10, 2008 at 2:42 PM,  <ke...@witten-enterprises.com> wrote:
> This did not work either.
>
>  There is a "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at
>  localhost-config" directory which contains a copy of the tomcat conf files
>  such as server.xml.
>  I tried adding the DB driver context to this server.xml file but got the
>  same issue.
>
>  For Tomcat 5.5 I had to add the database context to
>  <TOMCATDIR>/conf/Catalina/localhost/<webappname>.xml
>  It would not work in the <TOMCATDIR>/conf/server.xml
>
>  So I also tried copying the <TOMCATDIR>/conf/Catalina to
>  "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at localhost-config/Catalina"
>
>  Neither of these worked.
>
>
>  Kevin
>
>
>  ----- Original Message -----
>  From: "Len Popp" <le...@gmail.com>
>  To: "Tomcat Users List" <us...@tomcat.apache.org>
>
>
> Sent: Monday, March 10, 2008 8:54 AM
>  Subject: Re: Eclipse with tomcat and mysql
>
>
>  > Web Standard Tools makes copies of some of the Tomcat config files,
>  > which might be causing your problem. In particular, if you've defined
>  > your JDBC resource in server.xml it might not be seen by Tomcat when
>  > you run it from Eclipse. If that's the case, update the copy of
>  > server.xml in your Eclipse workspace (it might be in
>  > workspace/Servers/Tomcat v5.5 Server @ localhost-config but I think
>  > that depends on settings and version). And remember to click "Publish"
>  > in the servers window.
>  > --
>  > Len
>  >
>  > On Mon, Mar 10, 2008 at 11:49 AM,  <ke...@witten-enterprises.com> wrote:
>  >> Eclipse (Eurpoa) version 3.1.1
>  >>
>  >>  I am using the Web Standard Tools. (The project I created is a Dynamic
>  >> Web
>  >>  Project).
>  >>
>  >>  I do NOT have the Sysdeo Tomcat plugin. Would this help?
>  >>
>  >>  Thanks,
>  >>  Kevin
>  >>
>  >>
>  >>
>  >>  ----- Original Message -----
>  >>  From: "Len Popp" <le...@gmail.com>
>  >>  To: "Tomcat Users List" <us...@tomcat.apache.org>;
>  >>  <ke...@witten-enterprises.com>
>  >>  Sent: Monday, March 10, 2008 6:42 AM
>  >>  Subject: Re: Eclipse with tomcat and mysql
>  >>
>  >>
>  >>  > What version of Eclipse are you using, and what extensions are you
>  >>  > using for your webapp project (e.g. Web Standard Tools or Sysdeo
>  >>  > Tomcat plug-in)?
>  >>  > --
>  >>  > Len
>  >>  >
>  >>  > On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com>
>  >> wrote:
>  >>  >> Hello,
>  >>  >>
>  >>  >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>  >>  >>
>  >>  >>  In Eclipse, I have set up a project and have added a Tomcat server
>  >> and
>  >>  >> added the project to the server.
>  >>  >>  The project consists of a simple example of a standard struts
>  >>  >> architecture for the MVC.
>  >>  >>
>  >>  >>  Model: Artist.java, ArtistSearchService.java
>  >>  >>  View: search.jsp, SearchForm.java
>  >>  >>  Controller: ArtistSearchAction.java
>  >>  >>
>  >>  >>  The ArtistSearchSerview.java connects to mysql, searches for Artists
>  >> and
>  >>  >> creates Artists objects.
>  >>  >>
>  >>  >>  If I deploy this to Tomcat, every thing works fine.
>  >>  >>
>  >>  >>  But when I run inside Eclipse it will not connect to the database. I
>  >> get
>  >>  >> the errors listed below.
>  >>  >>  Funny thing is, in Eclipse I have also tried setting a data source
>  >> for
>  >>  >> this database.
>  >>  >>  This also works fine and I can connect to the DB from the data
>  >> source,
>  >>  >> but I still get the error.
>  >>  >>
>  >>  >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>  >>  >>
>  >>  >>  Thanks in advance for the help,
>  >>  >>  Kevin
>  >>  >>
>  >>  >>  HTTP Status 500 -
>  >>  >>
>  >>
>  >>  >>  --------------------------------------------------------------------------------
>  >>  >>
>  >>  >>  type Exception report
>  >>  >>
>  >>  >>  message
>  >>  >>
>  >>  >>  description The server encountered an internal error () that
>  >> prevented
>  >>  >> it from fulfilling this request.
>  >>  >>
>  >>  >>  exception
>  >>  >>
>  >>  >>  javax.servlet.ServletException: Cannot create JDBC driver of class
>  >> ''
>  >>  >> for connect URL 'null'
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>  >>  >>
>  >>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>  >>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>  >>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >>  >>
>  >>  >>  root cause
>  >>  >>
>  >>  >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
>  >>  >> driver of class '' for connect URL 'null'
>  >>  >>
>  >>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
>  >>  >>
>  >>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>  >>  >>
>  >>  >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>  >>  >>
>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>  >>  >>
>  >>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>  >>
>  >>  >>
>  >> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>  >>  >>
>  >>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>  >>  >>
>  >>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>  >>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>  >>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >>  >>
>  >>  >>  root cause
>  >>  >>
>  >>  >>  java.sql.SQLException: No suitable driver
>  >>  >>         java.sql.DriverManager.getDriver(Unknown Source)
>  >>  >>
>  >>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
>  >>  >>
>  >>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>  >>  >>
>  >>  >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>  >>  >>
>  >> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>  >>  >>
>  >>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>  >>
>  >>  >>
>  >> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>  >>  >>
>  >>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>  >>  >>
>  >>  >>
>  >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>  >>  >>
>  >>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>  >>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>  >>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >>  >>
>  >>  >>  note The full stack trace of the root cause is available in the
>  >> Apache
>  >>  >> Tomcat/5.5.26 logs.
>  >>  >>
>  >>  >>
>  >>
>  >>  >>  --------------------------------------------------------------------------------
>  >>  >>
>  >>  >>  Apache Tomcat/5.5.26
>  >>  >>
>  >>  >>
>  >>  >>
>  >>  >>
>  >>  >>
>  >>
>  >>
>  >
>
>
> > ---------------------------------------------------------------------
>  > To start a new topic, e-mail: users@tomcat.apache.org
>  > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>  > For additional commands, e-mail: users-help@tomcat.apache.org
>  >
>
>
>  ---------------------------------------------------------------------
>  To start a new topic, e-mail: users@tomcat.apache.org
>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by ke...@witten-enterprises.com.
This did not work either.

There is a "<EclipseWorkspace>/Servers/Tomcat v5.5 Server at 
localhost-config" directory which contains a copy of the tomcat conf files 
such as server.xml.
I tried adding the DB driver context to this server.xml file but got the 
same issue.

For Tomcat 5.5 I had to add the database context to 
<TOMCATDIR>/conf/Catalina/localhost/<webappname>.xml
It would not work in the <TOMCATDIR>/conf/server.xml

So I also tried copying the <TOMCATDIR>/conf/Catalina to 
"<EclipseWorkspace>/Servers/Tomcat v5.5 Server at localhost-config/Catalina"

Neither of these worked.

Kevin


----- Original Message ----- 
From: "Len Popp" <le...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, March 10, 2008 8:54 AM
Subject: Re: Eclipse with tomcat and mysql


> Web Standard Tools makes copies of some of the Tomcat config files,
> which might be causing your problem. In particular, if you've defined
> your JDBC resource in server.xml it might not be seen by Tomcat when
> you run it from Eclipse. If that's the case, update the copy of
> server.xml in your Eclipse workspace (it might be in
> workspace/Servers/Tomcat v5.5 Server @ localhost-config but I think
> that depends on settings and version). And remember to click "Publish"
> in the servers window.
> -- 
> Len
>
> On Mon, Mar 10, 2008 at 11:49 AM,  <ke...@witten-enterprises.com> wrote:
>> Eclipse (Eurpoa) version 3.1.1
>>
>>  I am using the Web Standard Tools. (The project I created is a Dynamic 
>> Web
>>  Project).
>>
>>  I do NOT have the Sysdeo Tomcat plugin. Would this help?
>>
>>  Thanks,
>>  Kevin
>>
>>
>>
>>  ----- Original Message -----
>>  From: "Len Popp" <le...@gmail.com>
>>  To: "Tomcat Users List" <us...@tomcat.apache.org>;
>>  <ke...@witten-enterprises.com>
>>  Sent: Monday, March 10, 2008 6:42 AM
>>  Subject: Re: Eclipse with tomcat and mysql
>>
>>
>>  > What version of Eclipse are you using, and what extensions are you
>>  > using for your webapp project (e.g. Web Standard Tools or Sysdeo
>>  > Tomcat plug-in)?
>>  > --
>>  > Len
>>  >
>>  > On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com> 
>> wrote:
>>  >> Hello,
>>  >>
>>  >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>>  >>
>>  >>  In Eclipse, I have set up a project and have added a Tomcat server 
>> and
>>  >> added the project to the server.
>>  >>  The project consists of a simple example of a standard struts
>>  >> architecture for the MVC.
>>  >>
>>  >>  Model: Artist.java, ArtistSearchService.java
>>  >>  View: search.jsp, SearchForm.java
>>  >>  Controller: ArtistSearchAction.java
>>  >>
>>  >>  The ArtistSearchSerview.java connects to mysql, searches for Artists 
>> and
>>  >> creates Artists objects.
>>  >>
>>  >>  If I deploy this to Tomcat, every thing works fine.
>>  >>
>>  >>  But when I run inside Eclipse it will not connect to the database. I 
>> get
>>  >> the errors listed below.
>>  >>  Funny thing is, in Eclipse I have also tried setting a data source 
>> for
>>  >> this database.
>>  >>  This also works fine and I can connect to the DB from the data 
>> source,
>>  >> but I still get the error.
>>  >>
>>  >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>>  >>
>>  >>  Thanks in advance for the help,
>>  >>  Kevin
>>  >>
>>  >>  HTTP Status 500 -
>>  >>
>> 
>>  >>  --------------------------------------------------------------------------------
>>  >>
>>  >>  type Exception report
>>  >>
>>  >>  message
>>  >>
>>  >>  description The server encountered an internal error () that 
>> prevented
>>  >> it from fulfilling this request.
>>  >>
>>  >>  exception
>>  >>
>>  >>  javax.servlet.ServletException: Cannot create JDBC driver of class 
>> ''
>>  >> for connect URL 'null'
>>  >>
>>  >> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
>>  >>
>>  >> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>  >>
>>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>  >>
>>  >>  root cause
>>  >>
>>  >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
>>  >> driver of class '' for connect URL 'null'
>>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
>>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>  >>
>>  >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>  >> 
>> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>  >>
>>  >> 
>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>>  >>
>>  >> 
>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>>  >>
>>  >> 
>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>>  >>
>>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>
>>  >> 
>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>>  >>
>>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>
>>  >> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>>  >>
>>  >> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>  >>
>>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>  >>
>>  >>  root cause
>>  >>
>>  >>  java.sql.SQLException: No suitable driver
>>  >>         java.sql.DriverManager.getDriver(Unknown Source)
>>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
>>  >>
>>  >> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>  >>
>>  >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>  >> 
>> controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>>  >>
>>  >> 
>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>>  >>
>>  >> 
>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>>  >>
>>  >> 
>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>>  >>
>>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>
>>  >> 
>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>>  >>
>>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>>  >>
>>  >> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>>  >>
>>  >> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>>  >>
>>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>  >>
>>  >>  note The full stack trace of the root cause is available in the 
>> Apache
>>  >> Tomcat/5.5.26 logs.
>>  >>
>>  >>
>> 
>>  >>  --------------------------------------------------------------------------------
>>  >>
>>  >>  Apache Tomcat/5.5.26
>>  >>
>>  >>
>>  >>
>>  >>
>>  >>
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by Len Popp <le...@gmail.com>.
Web Standard Tools makes copies of some of the Tomcat config files,
which might be causing your problem. In particular, if you've defined
your JDBC resource in server.xml it might not be seen by Tomcat when
you run it from Eclipse. If that's the case, update the copy of
server.xml in your Eclipse workspace (it might be in
workspace/Servers/Tomcat v5.5 Server @ localhost-config but I think
that depends on settings and version). And remember to click "Publish"
in the servers window.
-- 
Len

On Mon, Mar 10, 2008 at 11:49 AM,  <ke...@witten-enterprises.com> wrote:
> Eclipse (Eurpoa) version 3.1.1
>
>  I am using the Web Standard Tools. (The project I created is a Dynamic Web
>  Project).
>
>  I do NOT have the Sysdeo Tomcat plugin. Would this help?
>
>  Thanks,
>  Kevin
>
>
>
>  ----- Original Message -----
>  From: "Len Popp" <le...@gmail.com>
>  To: "Tomcat Users List" <us...@tomcat.apache.org>;
>  <ke...@witten-enterprises.com>
>  Sent: Monday, March 10, 2008 6:42 AM
>  Subject: Re: Eclipse with tomcat and mysql
>
>
>  > What version of Eclipse are you using, and what extensions are you
>  > using for your webapp project (e.g. Web Standard Tools or Sysdeo
>  > Tomcat plug-in)?
>  > --
>  > Len
>  >
>  > On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com> wrote:
>  >> Hello,
>  >>
>  >>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>  >>
>  >>  In Eclipse, I have set up a project and have added a Tomcat server and
>  >> added the project to the server.
>  >>  The project consists of a simple example of a standard struts
>  >> architecture for the MVC.
>  >>
>  >>  Model: Artist.java, ArtistSearchService.java
>  >>  View: search.jsp, SearchForm.java
>  >>  Controller: ArtistSearchAction.java
>  >>
>  >>  The ArtistSearchSerview.java connects to mysql, searches for Artists and
>  >> creates Artists objects.
>  >>
>  >>  If I deploy this to Tomcat, every thing works fine.
>  >>
>  >>  But when I run inside Eclipse it will not connect to the database. I get
>  >> the errors listed below.
>  >>  Funny thing is, in Eclipse I have also tried setting a data source for
>  >> this database.
>  >>  This also works fine and I can connect to the DB from the data source,
>  >> but I still get the error.
>  >>
>  >>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>  >>
>  >>  Thanks in advance for the help,
>  >>  Kevin
>  >>
>  >>  HTTP Status 500 -
>  >>
>  >>  --------------------------------------------------------------------------------
>  >>
>  >>  type Exception report
>  >>
>  >>  message
>  >>
>  >>  description The server encountered an internal error () that prevented
>  >> it from fulfilling this request.
>  >>
>  >>  exception
>  >>
>  >>  javax.servlet.ServletException: Cannot create JDBC driver of class ''
>  >> for connect URL 'null'
>  >>
>  >> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
>  >>
>  >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>  >>
>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >>
>  >>  root cause
>  >>
>  >>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
>  >> driver of class '' for connect URL 'null'
>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>  >>
>  >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>  >>         controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>  >>
>  >> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>  >>
>  >> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>  >>
>  >> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>  >>
>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>
>  >> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>  >>
>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>
>  >> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>  >>
>  >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>  >>
>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >>
>  >>  root cause
>  >>
>  >>  java.sql.SQLException: No suitable driver
>  >>         java.sql.DriverManager.getDriver(Unknown Source)
>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
>  >>
>  >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>  >>
>  >> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>  >>         controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>  >>
>  >> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>  >>
>  >> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>  >>
>  >> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>  >>
>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>
>  >> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>  >>
>  >> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>  >>
>  >> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>  >>
>  >> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>  >>
>  >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>  >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >>
>  >>  note The full stack trace of the root cause is available in the Apache
>  >> Tomcat/5.5.26 logs.
>  >>
>  >>
>  >>  --------------------------------------------------------------------------------
>  >>
>  >>  Apache Tomcat/5.5.26
>  >>
>  >>
>  >>
>  >>
>  >>
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Eclipse with tomcat and mysql

Posted by ke...@witten-enterprises.com.
Eclipse (Eurpoa) version 3.1.1

I am using the Web Standard Tools. (The project I created is a Dynamic Web 
Project).

I do NOT have the Sysdeo Tomcat plugin. Would this help?

Thanks,
Kevin

----- Original Message ----- 
From: "Len Popp" <le...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>; 
<ke...@witten-enterprises.com>
Sent: Monday, March 10, 2008 6:42 AM
Subject: Re: Eclipse with tomcat and mysql


> What version of Eclipse are you using, and what extensions are you
> using for your webapp project (e.g. Web Standard Tools or Sysdeo
> Tomcat plug-in)?
> -- 
> Len
>
> On Mon, Mar 10, 2008 at 11:32 AM,  <ke...@witten-enterprises.com> wrote:
>> Hello,
>>
>>  I'm having trouble getting Eclipse to work with Mysql/Tomcat.
>>
>>  In Eclipse, I have set up a project and have added a Tomcat server and 
>> added the project to the server.
>>  The project consists of a simple example of a standard struts 
>> architecture for the MVC.
>>
>>  Model: Artist.java, ArtistSearchService.java
>>  View: search.jsp, SearchForm.java
>>  Controller: ArtistSearchAction.java
>>
>>  The ArtistSearchSerview.java connects to mysql, searches for Artists and 
>> creates Artists objects.
>>
>>  If I deploy this to Tomcat, every thing works fine.
>>
>>  But when I run inside Eclipse it will not connect to the database. I get 
>> the errors listed below.
>>  Funny thing is, in Eclipse I have also tried setting a data source for 
>> this database.
>>  This also works fine and I can connect to the DB from the data source, 
>> but I still get the error.
>>
>>  So how do you use Eclipse with Tomcat and MySQL? Any ideas?
>>
>>  Thanks in advance for the help,
>>  Kevin
>>
>>  HTTP Status 500 -
>>
>>  --------------------------------------------------------------------------------
>>
>>  type Exception report
>>
>>  message
>>
>>  description The server encountered an internal error () that prevented 
>> it from fulfilling this request.
>>
>>  exception
>>
>>  javax.servlet.ServletException: Cannot create JDBC driver of class '' 
>> for connect URL 'null'
>> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
>> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>> 
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>>  root cause
>>
>>  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC 
>> driver of class '' for connect URL 'null'
>> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
>> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>> 
>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>         controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>> 
>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>> 
>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>> 
>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>> 
>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>> 
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>>  root cause
>>
>>  java.sql.SQLException: No suitable driver
>>         java.sql.DriverManager.getDriver(Unknown Source)
>> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
>> 
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>> 
>> model.ArtistSearchService.selectArtists(ArtistSearchService.java:30)
>>         controller.ArtistSearchAction.execute(ArtistSearchAction.java:34)
>> 
>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
>> 
>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
>> 
>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
>> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>> 
>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
>> 
>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
>> 
>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
>> 
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>> 
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>>  note The full stack trace of the root cause is available in the Apache 
>> Tomcat/5.5.26 logs.
>>
>>
>>  --------------------------------------------------------------------------------
>>
>>  Apache Tomcat/5.5.26
>>
>>
>>
>>
>> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org