Re: Newbie - JDBC problem Name is not bound in this context

2004-08-10 Thread d_l
On 9 Aug 2004 at 18:34, ohaya ohaya-at-cox.net |Tomcat User List| wrote:

 I'm assuming you meant Tomcat Administration, not Tomcat Manager
 :)...

Sorry .. I did mean Tomcat Administration ..

 Ok, if I go to where you indicated, it shows all of the tree-type
 display of Contexts:
 
 /
 /admin
 /balancer
 /jsp-examples
 /manager
 /new
 /servlets-examples
 /tomcat-docs
 /webdav
 Something labeled Logger for Host(localhost)
 
 Are you saying that all of the above Contexts don't show up under
 Contexts?

I also see exactly the same list .. except your created new 
webbapp .. and including the default webapps such as jsp-examples 
and servlets-examples  which have no equivalent context files in 
CATALINA\localhost\ .. and show as blank entries in Tomcat 
Adminstrator.

but I'm sure (as QM said)  it will all become much clearer in the 
course of time !







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread d_l
Can you clarify what version of Tomcat you are using?

It seems that there is a configuration change .. from Tomcat4 to Tomcat5 ..

the context goes in to \conf\Catalina\localhost\webappname.xml .. for each 
webapp.

Here is a reference I found in my own digging around ..
___


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

which states ..
Please note that for tomcat 5.x, unlike tomcat 4.x, it is NOT recommended to place 
Context elements directly in the server.xml file. Instead, put them in the META-
INF/context.xml directory of your WAR file or the conf directory as described above. 

___

BUT .. in my Tomcat 5.0.27 ..  I only see three webappname.xml files in above 
location ..

admin.xml
balancer.xml
manager.xml


no other webappname.xml files (context.xml files) show up such as

jsp-examples.xml
servlets-examples.xml

I don't understand why you have jsp-examples.xml and I don't see that file (only the 
three above).

 so I added just the ResourceLink to jsp-examples.xml, 
bounced Tomcat, and VOILA!!!  It worked!! 

Where is the default context information when there is no webappname.xml?
There is no context entry in server.xml.
...

And I confirm that there is no webapps\examples\in my configuration ..

replaced, it seems, by the two separate webapps above.

...

I'm still puzzled.

_


On 7 Aug 2004 at 21:47, ohaya ohaya-at-cox.net |Tomcat User List| wrote:

 
 Hi Arthur,
 
 Guess what?  I think that I've found where the Contexts ended up!!
 
 I was digging around the Tomcat directories, and I found that at [TOMCAT
 HOME]\conf\Catalina\localhost, there was a bunch of .XML files, one
 named after each of the webapps, e.g., jsp-examples.xml.  And, it looks
 like each of these are the Context for the respective webapps.
 
 My test JSP is in jsp-examples, so I added just the ResourceLink to
 jsp-examples.xml, bounced Tomcat, and VOILA!!!  It worked!!
 
 
 BTW, I am curious about something.  It seems that my installation seems
 a bit non-standard.  All the docs that I've seen talk about 'examples',
 but in my case, I don't have an 'examples' directory or webapp, just a
 'jsp-examples'.  Do you, or does anyone else know if this is something
 that has changed in the distribution?
 
 Thanks for all of your help!!
 
 Jim




RE: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread Shapira, Yoav

Hola,

It seems that there is a configuration change .. from Tomcat4 to
Tomcat5 ..

NSS ;)  There are definitely multiple configuration changes between the
two, it's a major release after all.

And I confirm that there is no webapps\examples\in my configuration ..

replaced, it seems, by the two separate webapps above.

Yup, in the docs when we refer to examples it's generally to both JSP
and Servlet examples, since there's no difference between the two from
the Tomcat perspective.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread ohaya
d_1,

Answers/comments below, interspersed...

Jim


d_l wrote:
 
 Can you clarify what version of Tomcat you are using?


d_1,

I'm running Tomcat 5.0.27...


 
 It seems that there is a configuration change .. from Tomcat4 to Tomcat5 ..
 
 the context goes in to \conf\Catalina\localhost\webappname.xml .. for each
 webapp.
 
 Here is a reference I found in my own digging around ..
 ___
 
 http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html
 
 which states ..
 Please note that for tomcat 5.x, unlike tomcat 4.x, it is NOT recommended to place
 Context elements directly in the server.xml file. Instead, put them in the META-
 INF/context.xml directory of your WAR file or the conf directory as described above.
 
 ___
 
 BUT .. in my Tomcat 5.0.27 ..  I only see three webappname.xml files in above
 location ..
 
 admin.xml
 balancer.xml
 manager.xml
 
 no other webappname.xml files (context.xml files) show up such as
 
 jsp-examples.xml
 servlets-examples.xml
 
 I don't understand why you have jsp-examples.xml and I don't see that file (only the
 three above).


No, I seem to have a .XML for each webapp.  I didn't create them, they
were just there.  Here's a 'dir' (I did create the 'new.xml' is for a
new test webapp that I'm working with):

E:\Tomcat\jakarta-tomcat-5.0.27\conf\Catalina\localhostdir
 Volume in drive E is DATA
 Volume Serial Number is CE83-0200

 Directory of E:\Tomcat\jakarta-tomcat-5.0.27\conf\Catalina\localhost

08/05/2004  11:41p  DIR  .
08/05/2004  11:41p  DIR  ..
08/07/2004  01:09p 370 admin.xml
08/07/2004  01:09p 160 balancer.xml
08/07/2004  01:09p 339 manager.xml
08/07/2004  01:09p 176 webdav.xml
08/07/2004  01:09p 566 servlets-examples.xml
08/07/2004  08:53p 634 jsp-examples.xml
08/07/2004  01:09p 186 tomcat-docs.xml
08/08/2004  12:35a 239 ROOT.xml
08/08/2004  07:00p 243 new.xml
   9 File(s)  2,913 bytes
   2 Dir(s)  22,732,374,016 bytes free






 
  so I added just the ResourceLink to jsp-examples.xml,
 bounced Tomcat, and VOILA!!!  It worked!! 
 
 Where is the default context information when there is no webappname.xml?
 There is no context entry in server.xml.
 ...
 
 And I confirm that there is no webapps\examples\in my configuration ..
 
 replaced, it seems, by the two separate webapps above.
 
 ...
 
 I'm still puzzled.


On my system, it looks like there IS a webappname.xml, for each
webapp, and in each case, the Context is in these .XML files.

Thanks re. the 'examples' question.  That was causing me to wonder if
there was something wrong with my installation.


As to your implied question above of why do I have all the .XML files,
whereas you only have 3?, is it possible that whoever built the Tomcat
installation created it that way?

FYI, I did my Tomcat installation from the Tomcat binaries for 5.0.27
(in a .zip file) that I found at http://www.apache.org, but I didn't
look closely at what was where after I unzipped the distribution, so it
may be that the .XML files were already in the distribution.  So I don't
know if they were there immediately after the unzip.  All I know is that
they're there now, and I didn't create them.

It does seem that you have to manually create these .XML files, as with
the new.xml, which I had to create manually, because when I started
Tomcat up without the new.xml file, I saw some errors on startup.

Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread QM
On Mon, Aug 09, 2004 at 09:29:51AM -0400, ohaya wrote:
:  BUT .. in my Tomcat 5.0.27 ..  I only see three webappname.xml files in above
:  location ..
:  
:  admin.xml
:  balancer.xml
:  manager.xml
:  
:  no other webappname.xml files (context.xml files) show up such as

If there is no context.xml, as with the examples, then Tomcat won't
create (copy) the file to {tomcat}/conf/{...}.

Take note: if you are using a WAR file and make changes to the internal
context.xml file, delete the one under {tomcat}/conf/{...} before you
bounce the process.  At least for now, Tomcat doesn't check a whether a
WAR file's context.xml is newer than its copy under the conf dir.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread ohaya


QM wrote:
 
 On Mon, Aug 09, 2004 at 09:29:51AM -0400, ohaya wrote:
 :  BUT .. in my Tomcat 5.0.27 ..  I only see three webappname.xml files in above
 :  location ..
 : 
 :  admin.xml
 :  balancer.xml
 :  manager.xml
 : 
 :  no other webappname.xml files (context.xml files) show up such as
 
 If there is no context.xml, as with the examples, then Tomcat won't
 create (copy) the file to {tomcat}/conf/{...}.
 
 Take note: if you are using a WAR file and make changes to the internal
 context.xml file, delete the one under {tomcat}/conf/{...} before you
 bounce the process.  At least for now, Tomcat doesn't check a whether a
 WAR file's context.xml is newer than its copy under the conf dir.
 


QM,

A couple of questions:

1) Any idea why d_l has only the 3 .xml files in
[tomcat]/conf/[...], whereas I have a bunch?  As I indicated in an
earlier msg, I didn't create them.

2) When you and others refer to context.xml, are you referring to a
file that is literally named context.xml, or do you mean an file
containing the webapp's Context that is named webappname.xml?  I've
seen references to context.xml in various places, but there are no
files named context.xml in my Tomcat subdirs.

Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread d_l
On 9 Aug 2004 at 9:29, ohaya ohaya-at-cox.net |Tomcat User List| wrote:

 As to your implied question above of why do I have all the .XML files,
 whereas you only have 3?, is it possible that whoever built the Tomcat
 installation created it that way?

My 5.0.27 binary was straight out of the can from the Apache site .. and I configured 
it myself on my localhost. I've tried to download Tomcat 5.0.27 afresh several times 
.. 
always getting the same results .. three context.xml files.

context.xml files here ..

C:\Program Files\Apache Group\Tomcat 5.0\conf\Catalina\localhost

I can also see references to context for all webapps in Admin Manager
Tomcat server | Service (CATALINA) | Host (localhost) ..  but they are empty entries 
in Admin Manager ..

but no sign of the jsp-examples.xml and servlets-examples.xml files.

The jsp and servlets examples all work .. so it must be a glitch somewhere in setting 
up.

dl






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread ohaya

 
 From: d_l [EMAIL PROTECTED]
 Date: 2004/08/09 Mon AM 10:24:12 EDT
 To: [EMAIL PROTECTED]
 Subject: Re: Newbie - JDBC problem Name is not bound in this context
 
 On 9 Aug 2004 at 9:29, ohaya ohaya-at-cox.net |Tomcat User List| wrote:
 
  As to your implied question above of why do I have all the .XML files,
  whereas you only have 3?, is it possible that whoever built the Tomcat
  installation created it that way?
 
 My 5.0.27 binary was straight out of the can from the Apache site .. and I 
 configured 
 it myself on my localhost. I've tried to download Tomcat 5.0.27 afresh several times 
 .. 
 always getting the same results .. three context.xml files.
 
 context.xml files here ..
 
 C:\Program Files\Apache Group\Tomcat 5.0\conf\Catalina\localhost
 
 I can also see references to context for all webapps in Admin Manager
 Tomcat server | Service (CATALINA) | Host (localhost) ..  but they are empty entries 
 in Admin Manager ..
 
 but no sign of the jsp-examples.xml and servlets-examples.xml files.
 
 The jsp and servlets examples all work .. so it must be a glitch somewhere in 
 setting 
 up.

That is really weird!  I'll try to unzip the original .ZIP that I downloaded, and see 
if the other .xml files are there to begin with, but I won't be able to do that until 
this evening.  Will post back then.

Jim


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread QM
On Mon, Aug 09, 2004 at 10:14:04AM -0400, ohaya wrote:
: 1) Any idea why d_l has only the 3 .xml files in
: [tomcat]/conf/[...], whereas I have a bunch?  As I indicated in an
: earlier msg, I didn't create them.
: 2) When you and others refer to context.xml, are you referring to a
: file that is literally named context.xml, or do you mean an file
: containing the webapp's Context that is named webappname.xml?

Please read

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

My previous message will make more sense then, and both of your
questions should be answered.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread d_l
On 9 Aug 2004 at 12:37, QM qm300-at-brandxdev.net |Tomcat User Li wrote:
 
   http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html
 
 My previous message will make more sense then, and both of your
 questions should be answered.
 
I referred to that same link in an earlier posting .. but I'm afraid it is 
still not clear to me (after reading that tome again) why two separate 
installers of Tomcat 5.0.27 should see different content 
(webapps.xml) in ..\Catalina\locahost\

Something must be different between the two 5.0.27 setups .. can 
you offer another clue? Are you referring to Automatic Application 
Deployment?

Sure enough, the second question (on webappsname.xml) is 
answered clearly enough.

Thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread ohaya


d_l wrote:
 
 On 9 Aug 2004 at 12:37, QM qm300-at-brandxdev.net |Tomcat User Li wrote:
 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html
 
  My previous message will make more sense then, and both of your
  questions should be answered.
 
 I referred to that same link in an earlier posting .. but I'm afraid it is
 still not clear to me (after reading that tome again) why two separate
 installers of Tomcat 5.0.27 should see different content
 (webapps.xml) in ..\Catalina\locahost\
 
 Something must be different between the two 5.0.27 setups .. can
 you offer another clue? Are you referring to Automatic Application
 Deployment?
 
 Sure enough, the second question (on webappsname.xml) is
 answered clearly enough.
 
 Thanks.


d_l,

I just got back, and as I mentioned earlier, I unzipped the original
.ZIP file, and I guess at least PART of the mystery is solved. 
Immediately after unzipping the file, I checked in the
conf\Catalina\localhost directory, and there are only the 3 .xml files
that you mentioned.

Now the thing that I'm wondering is where did those others come from. 
At this point, it's clear that Tomcat must've created them (I'm 100%
sure I didn't create them), at some point.  I'm just not sure when or
why...

Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread QM
On Mon, Aug 09, 2004 at 05:00:22PM -0400, ohaya wrote:
: I just got back, and as I mentioned earlier, I unzipped the original
: .ZIP file, and I guess at least PART of the mystery is solved. 
: Immediately after unzipping the file, I checked in the
: conf\Catalina\localhost directory, and there are only the 3 .xml files
: that you mentioned.
: 
: Now the thing that I'm wondering is where did those others come from. 
: At this point, it's clear that Tomcat must've created them (I'm 100%
: sure I didn't create them), at some point.  I'm just not sure when or
: why...

There are 2 ways for the {tomcat}/conf/{...}.xml files to be created:

1/ META-INF/context.xml is extracted from a WAR file when it is deployed
 and copied there.
 (Unless the matching XML file already exists under conf/, in which case
  the WAR file's context.xml is ignored)

2/ The file is manually copied there by someone.

The servlet-examples.xml and jsp-examples.xml files are included in the
default Tomcat distro, and remain there unless explicitly removed.  For
example, to address the issue mentioned in point #1, I periodically
clear out the conf/{...}/*.xml files.


Here's an experiment and learning exercise for you: edit server.xml,
change the Engine element's name attr, then bounce Tomcat.  Notice
under {tomcat}/conf/ there's a new dir that matches the Engine name.

What files are under that directory, now?


I realize this may be confusing at times because there's a lot to
absorb when leaping into Tomcat (or any container, for that matter).
Give it time, and soon you'll know all of this by heart. =)

btw, if you use separate Tomcat instances (check the docs for
CATALINA_HOME vs CATALINA_BASE) then this is moot: the only
context-related XML files under {instance dir}/conf/ will be the ones
for your webapps, not the samples. ;)  But that's another story for
another day.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread d_l
On 9 Aug 2004 at 17:00, ohaya ohaya-at-cox.net |Tomcat User List| wrote:

 Now the thing that I'm wondering is where did those others come from. 
 At this point, it's clear that Tomcat must've created them (I'm 100%
 sure I didn't create them), at some point.  I'm just not sure when or
 why...

Jim .. thanks for taking the time to check this out ..

I'll try to track down when/how they are created .. as a learning 
experience .. probably something to do with automatic application 
deployment (that's my best guess).

Look in Manager | Tomcat Server | Service (CATALINA) | Host 
(localhost) ..  the context references are defined therein (but in my 
case blank entries for the jsp-examples and servlets-examples).

dl


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread ohaya


 
 There are 2 ways for the {tomcat}/conf/{...}.xml files to be created:
 
 1/ META-INF/context.xml is extracted from a WAR file when it is deployed
  and copied there.
  (Unless the matching XML file already exists under conf/, in which case
   the WAR file's context.xml is ignored)
 
 2/ The file is manually copied there by someone.


QM,

I'll try the experiment that you suggested, but FYI, there are no .WAR
files in either the unzipped directories from just unzipping, or in any
subdirectories under my working [TOMCAT HOME].  If those extra .xml
files got created because of #1 above, would you expect to find some
files named .war?

Also, there are no directories named META-INF or files called
context.xml.

I'll post back in a bit after I've tried the bit with changing the
Engine name...

Jim



 
 The servlet-examples.xml and jsp-examples.xml files are included in the
 default Tomcat distro, and remain there unless explicitly removed.  For
 example, to address the issue mentioned in point #1, I periodically
 clear out the conf/{...}/*.xml files.
 
 Here's an experiment and learning exercise for you: edit server.xml,
 change the Engine element's name attr, then bounce Tomcat.  Notice
 under {tomcat}/conf/ there's a new dir that matches the Engine name.
 
 What files are under that directory, now?
 
 I realize this may be confusing at times because there's a lot to
 absorb when leaping into Tomcat (or any container, for that matter).
 Give it time, and soon you'll know all of this by heart. =)
 
 btw, if you use separate Tomcat instances (check the docs for
 CATALINA_HOME vs CATALINA_BASE) then this is moot: the only
 context-related XML files under {instance dir}/conf/ will be the ones
 for your webapps, not the samples. ;)  But that's another story for
 another day.
 
 -QM
 
 --
 
 software  -- http://www.brandxdev.net
 tech news -- http://www.RoarNetworX.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-09 Thread ohaya


d_l wrote:
 
 On 9 Aug 2004 at 17:00, ohaya ohaya-at-cox.net |Tomcat User List| wrote:
 
  Now the thing that I'm wondering is where did those others come from.
  At this point, it's clear that Tomcat must've created them (I'm 100%
  sure I didn't create them), at some point.  I'm just not sure when or
  why...
 
 Jim .. thanks for taking the time to check this out ..
 
 I'll try to track down when/how they are created .. as a learning
 experience .. probably something to do with automatic application
 deployment (that's my best guess).
 
 Look in Manager | Tomcat Server | Service (CATALINA) | Host
 (localhost) ..  the context references are defined therein (but in my
 case blank entries for the jsp-examples and servlets-examples).


d_l,

I'm assuming you meant Tomcat Administration, not Tomcat Manager
:)...

Ok, if I go to where you indicated, it shows all of the tree-type
display of Contexts:

/
/admin
/balancer
/jsp-examples
/manager
/new
/servlets-examples
/tomcat-docs
/webdav
Something labeled Logger for Host(localhost)

Are you saying that all of the above Contexts don't show up under
Contexts?

Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Newbie - JDBC problem Name is not bound in this context

2004-08-07 Thread ohaya
Hi,

I just got Tomcat 5.0.27 installed (with Apache 2.0.50), and am trying
to get a simple JDBC JSP working.  The JSP is called 'test.jsp'.

I have the JDBC-ODBC bridge installed and am going through that.  I've
been using the bridge driver from standalone Java applications, so I
think that is working ok, but even with a really simple JSP, I'm getting
an Name jdbc is not bound in this context error.

I'm including my server.xml, test.jsp, and the error details below.

I was wondering if anyone could tell me what I'm doing wrong?

Thanks,
Jim



Here's my server.xml:

?xml version='1.0' encoding='utf-8'?
Server
  Listener
className=org.apache.catalina.mbeans.ServerLifecycleListener/
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/
  GlobalNamingResources
Environment name=simpleValue type=java.lang.Integer
value=30/
Resource auth=Container description=User database that can be
updated and saved name=UserDatabase
type=org.apache.catalina.UserDatabase/
Resource name=jdbc/jimnew type=javax.sql.DataSource/
ResourceParams name=UserDatabase
  parameter
namefactory/name
   
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams
ResourceParams name=jdbc/jimnew
  parameter
namevalidationQuery/name
value/value
  /parameter
  parameter
nameurl/name
valuejdbc:odbc:PROD/value
  /parameter
  parameter
namepassword/name
valuepassword/value
  /parameter
  parameter
namemaxActive/name
value4/value
  /parameter
  parameter
namemaxWait/name
value5000/value
  /parameter
  parameter
namedriverClassName/name
valuesun.jdbc.odbc.JdbcOdbcDriver/value
  /parameter
  parameter
nameusername/name
valuejim/value
  /parameter
  parameter
namemaxIdle/name
value2/value
  /parameter
/ResourceParams
  /GlobalNamingResources
  Service name=Catalina
Connector acceptCount=100 connectionTimeout=2
disableUploadTimeout=true port=9090 redirectPort=8443
maxSpareThreads=75 maxThreads=150 minSpareThreads=25
/Connector
Connector enableLookups=true port=8009 protocol=AJP/1.3
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler
redirectPort=8443
/Connector
Engine defaultHost=localhost name=Catalina
  Host appBase=webapps name=localhost
Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_log. suffix=.txt timestamp=true/
  /Host
  Logger className=org.apache.catalina.logger.FileLogger
prefix=catalina_log. suffix=.txt timestamp=true/
  Realm className=org.apache.catalina.realm.UserDatabaseRealm/
/Engine
  /Service
/Server


and here's my JSP:


%@ page import='java.sql.*, javax.sql.*, javax.naming.*' %
%
Context ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(java:comp/env/jdbc/jimnew);

Connection conn = ds.getConnection();

try {
  Statement stmt = conn.createStatement();
  ResultSet rs = stmt.executeQuery(select * from certrequest_db);

  %h2Brooms:/h2%
while (rs.next()) { %
%= rs.getString(1) % %= rs.getString(2) %br%
  }
} finally {
  conn.close();
}
%


The exact error I'm getting is:

type Exception report

message 

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception 

javax.servlet.ServletException: Name jdbc is not bound in this Context

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.test_jsp._jspService(test_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause 

javax.naming.NameNotFoundException: Name jdbc is not bound in this
Context
org.apache.naming.NamingContext.lookup(NamingContext.java:768)
org.apache.naming.NamingContext.lookup(NamingContext.java:138)
org.apache.naming.NamingContext.lookup(NamingContext.java:779)
org.apache.naming.NamingContext.lookup(NamingContext.java:138)
org.apache.naming.NamingContext.lookup(NamingContext.java:779)
org.apache.naming.NamingContext.lookup(NamingContext.java:151)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
javax.naming.InitialContext.lookup(InitialContext.java:347)

Re: Newbie - JDBC problem Name is not bound in this context

2004-08-07 Thread Dennis Dai
On 8/7/2004 8:24 AM, ohaya wrote:
Hi,
I just got Tomcat 5.0.27 installed (with Apache 2.0.50), and am trying
to get a simple JDBC JSP working.  The JSP is called 'test.jsp'.
I have the JDBC-ODBC bridge installed and am going through that.  I've
been using the bridge driver from standalone Java applications, so I
think that is working ok, but even with a really simple JSP, I'm getting
an Name jdbc is not bound in this context error.
I'm including my server.xml, test.jsp, and the error details below.
I was wondering if anyone could tell me what I'm doing wrong?
[snipped]

and here's my JSP:
...
Context ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(java:comp/env/jdbc/jimnew);
I'm not a JNDI expert but you can try this:
Context ic = new InitialContext();
Context ctx = (Context) ic.lookup(java:comp/env);
DataSource ds = (DataSource) ic.lookup(jdbc/jimnew);
--
Dennis Dai
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Newbie - JDBC problem Name is not bound in this context

2004-08-07 Thread ohaya

 I'm not a JNDI expert but you can try this:
 
 Context ic = new InitialContext();
 Context ctx = (Context) ic.lookup(java:comp/env);
 DataSource ds = (DataSource) ic.lookup(jdbc/jimnew);
 


Hi Dennis,

I've been wrestling with this problem for most of today, and at this
point, I don't think the problem is with the code, but rather, I think
it's some kind of problem with configuration.  What it looks like is
that Tomcat, for some reason, doesn't think that there is a resource
called 'jdbc/jimnew', even though 'jdbc/jimnew' appears to exist in
GlobalNamingResources in server.xml.

After working on this for hours, I'm a bit confused about this, as my
impression was that if a resource was defined in GlobalNamingResources,
then any application would be able to access that resource.

I kind of cheated a bit with my small test page, and maybe that's why
things aren't working.

When Tomcat installed, it had a bunch of demo applications at
http://myhost/jsp-examples.  Just for this (I thought) quick test, I
created a single JSP file, test.jsp in the jsp-examples directory,
because I didn't want to go through all of the things to set up a new
application in Tomcat, and I thought that my test.jsp would be
automatically able to see the resources in GlobalNamingResources.

Well, I'm either doing something wrong, or my assumption was wrong,
because I keep getting that error (jdbc not bound in this context),
and I can't find any way around it.  I've tried adding the resource-ref,
res-ref-name, res-type, and res-auth to the web.xml in the
jsp-examples\WEB-INF directory, but even that didn't do the trick.

At this point, I'm kind of stuck, and I'm hoping that someone on this
list can tell me how I might be able to make this resource visible to my
test.jsp.

If I can't figure that out, I'm probably going to just try doing the
JDBC stuff directly, without JNDI, etc...

Thanks for trying...

Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-07 Thread D'Alessandro, Arthur
Add a resourcelink to your context definition.

 -Original Message-
From:   ohaya [mailto:[EMAIL PROTECTED]
Sent:   Sat Aug 07 18:07:42 2004
To: Tomcat Users List
Subject:Re: Newbie - JDBC problem Name is not bound in this context


 I'm not a JNDI expert but you can try this:
 
 Context ic = new InitialContext();
 Context ctx = (Context) ic.lookup(java:comp/env);
 DataSource ds = (DataSource) ic.lookup(jdbc/jimnew);
 


Hi Dennis,

I've been wrestling with this problem for most of today, and at this
point, I don't think the problem is with the code, but rather, I think
it's some kind of problem with configuration.  What it looks like is
that Tomcat, for some reason, doesn't think that there is a resource
called 'jdbc/jimnew', even though 'jdbc/jimnew' appears to exist in
GlobalNamingResources in server.xml.

After working on this for hours, I'm a bit confused about this, as my
impression was that if a resource was defined in GlobalNamingResources,
then any application would be able to access that resource.

I kind of cheated a bit with my small test page, and maybe that's why
things aren't working.

When Tomcat installed, it had a bunch of demo applications at
http://myhost/jsp-examples.  Just for this (I thought) quick test, I
created a single JSP file, test.jsp in the jsp-examples directory,
because I didn't want to go through all of the things to set up a new
application in Tomcat, and I thought that my test.jsp would be
automatically able to see the resources in GlobalNamingResources.

Well, I'm either doing something wrong, or my assumption was wrong,
because I keep getting that error (jdbc not bound in this context),
and I can't find any way around it.  I've tried adding the resource-ref,
res-ref-name, res-type, and res-auth to the web.xml in the
jsp-examples\WEB-INF directory, but even that didn't do the trick.

At this point, I'm kind of stuck, and I'm hoping that someone on this
list can tell me how I might be able to make this resource visible to my
test.jsp.

If I can't figure that out, I'm probably going to just try doing the
JDBC stuff directly, without JNDI, etc...

Thanks for trying...

Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-07 Thread ohaya


D'Alessandro, Arthur wrote:
 
 Add a resourcelink to your context definition.


Arthur,

I'm kind of (well, really) new to Tomcat, so could you clarify?  

Am I right that you mean to add that to the server.xml?

At least with the distribution that I installed, which I posted with my
original msg, when I looked at the server.xml, there was hardly anything
in it, i.e., no Context, etc.  I think that there was basically just the
SERVER, RESOURCE, RESOURCE PARAMS, and SERVICE.

Given that that's the case, can I add JUST a RESOURCELINK, or do I
need to add a CONTEXT also?

Like I said, this is almost all new to me, so it's a little confusing...

Thanks,
Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Newbie - JDBC problem Name is not bound in this context

2004-08-07 Thread D'Alessandro, Arthur
Context cachingAllowed=true docBase=yourwebappname.war debug=99
path=/yourwebappname privileged=false reloadable=true
swallowOutput=true
  ResourceLink name=jdbc/jimnew global=jdbc/jimnew
type=javax.sql.DataSource/
/Context

Either in your server.xml, or as 'context.xml' in your webapps /META-INF
folder..

 

-Original Message-
From: ohaya [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 07, 2004 8:11 PM
To: Tomcat Users List
Subject: Re: Newbie - JDBC problem Name is not bound in this context



D'Alessandro, Arthur wrote:
 
 Add a resourcelink to your context definition.


Arthur,

I'm kind of (well, really) new to Tomcat, so could you clarify?  

Am I right that you mean to add that to the server.xml?

At least with the distribution that I installed, which I posted with my
original msg, when I looked at the server.xml, there was hardly anything
in it, i.e., no Context, etc.  I think that there was basically just the
SERVER, RESOURCE, RESOURCE PARAMS, and SERVICE.

Given that that's the case, can I add JUST a RESOURCELINK, or do I
need to add a CONTEXT also?

Like I said, this is almost all new to me, so it's a little confusing...

Thanks,
Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie - JDBC problem Name is not bound in this context

2004-08-07 Thread ohaya


D'Alessandro, Arthur wrote:
 
 Context cachingAllowed=true docBase=yourwebappname.war debug=99
 path=/yourwebappname privileged=false reloadable=true
 swallowOutput=true
   ResourceLink name=jdbc/jimnew global=jdbc/jimnew
 type=javax.sql.DataSource/
 /Context
 
 Either in your server.xml, or as 'context.xml' in your webapps /META-INF
 folder..
 


Hi Arthur,

Guess what?  I think that I've found where the Contexts ended up!!

I was digging around the Tomcat directories, and I found that at [TOMCAT
HOME]\conf\Catalina\localhost, there was a bunch of .XML files, one
named after each of the webapps, e.g., jsp-examples.xml.  And, it looks
like each of these are the Context for the respective webapps.

My test JSP is in jsp-examples, so I added just the ResourceLink to
jsp-examples.xml, bounced Tomcat, and VOILA!!!  It worked!!


BTW, I am curious about something.  It seems that my installation seems
a bit non-standard.  All the docs that I've seen talk about 'examples',
but in my case, I don't have an 'examples' directory or webapp, just a
'jsp-examples'.  Do you, or does anyone else know if this is something
that has changed in the distribution?

Thanks for all of your help!!

Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JDBC Problem

2003-11-24 Thread ANA JUNQUERA FERREIRAS
---BeginMessage---
Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.

I'm working for my owner, who can be reached
at [EMAIL PROTECTED]

FAQ - Frequently asked questions of the [EMAIL PROTECTED] list.

None available yet.


--- Administrative commands for the tomcat-user list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   [EMAIL PROTECTED]

To remove your address from the list, send a message to:
   [EMAIL PROTECTED]

Send mail to the following for info and FAQ for this list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

Similar addresses exist for the digest list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

To get messages 123 through 145 (a maximum of 100 per request), mail:
   [EMAIL PROTECTED]

To get an index with subject and author for messages 123-456 , mail:
   [EMAIL PROTECTED]

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   [EMAIL PROTECTED]

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example [EMAIL PROTECTED], just add a hyphen and your
address (with '=' instead of '@') after the command word:
[EMAIL PROTECTED]

To stop subscription for this address, mail:
[EMAIL PROTECTED]

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
[EMAIL PROTECTED] Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: [EMAIL PROTECTED]
Received: (qmail 1259 invoked from network); 24 Nov 2003 19:00:39 -
Received: from unknown (HELO correo.tid.es) (193.145.240.2)
  by daedalus.apache.org with SMTP; 24 Nov 2003 19:00:39 -
Received: from conversion-daemon.tid.hi.inet by tid.hi.inet
 (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003))
 id [EMAIL PROTECTED] for [EMAIL PROTECTED]; Mon,
 24 Nov 2003 20:00:42 +0100 (MET)
Received: from boecillo9 (boecillo9.hi.inet [10.95.41.229])
 by tid.hi.inet (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003))
 with SMTP id [EMAIL PROTECTED] for
 [EMAIL PROTECTED]; Mon, 24 Nov 2003 20:00:42 +0100 (MET)
Date: Mon, 24 Nov 2003 20:00:41 +0100
From: Ana Junquera Ferreras [EMAIL PROTECTED]
Subject: JDBC Problem
To: [EMAIL PROTECTED]
Message-id: [EMAIL PROTECTED]
MIME-version: 1.0
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 8BIT
Importance: Normal
X-Priority: 3 (Normal)
X-MSMail-priority: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

Hi,
I have a problem with JDBC. I am using JDK1.3.1, tomcat 4.1.24 with
Microsoft Access 2000 and when I am trying to close an opened connection I
get the following message:

EXCEPCION: java.sql.SQLException: General error
at
sun.jdbc.odbc.JdbcOdbc.throwGenericSQLException(JdbcOdbc.java:6160)
at sun.jdbc.odbc.JdbcOdbc.SQLFreeEnv(JdbcOdbc.java:2742)
at
sun.jdbc.odbc.JdbcOdbcDriver.closeConnection(JdbcOdbcDriver.java:842)
at
sun.jdbc.odbc.JdbcOdbcConnection.close(JdbcOdbcConnection.java:736)
at
es.tid.teledomo.asistel.FormularioTeleasistencia.liberarConexionTelea
sistencia(FormularioTeleasistencia.java:3431)
at
es.tid.teledomo.asistel.FormularioTeleasistencia.listaConfiguracion(F
ormularioTeleasistencia.java:3604)
at org.apache.jsp.menu_jsp._jspService(menu_jsp.java:106)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:210)


I have the same problem with tomcat 3.2 ...

java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.throwGenericSQLException(JdbcOdbc.java:6155)
at sun.jdbc.odbc.JdbcOdbc.SQLFreeEnv(JdbcOdbc.java:2737)
at sun.jdbc.odbc.JdbcOdbcDriver.closeConnection(JdbcOdbcDriver.java:837)
at sun.jdbc.odbc.JdbcOdbcConnection.close(JdbcOdbcConnection.java:731)
at
es.tid.teledomo.avisos.ConexionBaseDatos.liberarConexionAvisos(ConexionBaseD
atos.java)
at
es.tid.teledomo.avisos.ConexionBaseDatos.leerTablaAvisos(ConexionBaseDatos.j
ava)
at
jsps.avisos._0002fjsps_0002favisos_0002fdejar_0005favisos_0002ejspdejar_0005
favisos_jsp_0._jspService(_0002fjsps_0002favisos_0002fdejar_0005favisos_0002
ejspdejar_0005favisos_jsp_0.java:1147

Tomcat JDBC problem

2003-06-06 Thread Jason Lanpher
Hi all,

I am having a problem making the MySQL JDBC driver version 3
work with Tomcat correctly.  I had previously used MySQL JDBC driver
version 1 and developed a couple of programs to access my MySQL
database.  The programs worked just fine with this version of the
driver.  When I went to upgrade to the newest version of the MySQL JDBC
driver I get errors in my programs saying there is an error before the
beginning of the result set.  I am wondering if I am not installing the
driver correctly.  All I did for the JDBC driver version 1 was to place
the jar file in CATALINA_HOME/common/lib  I also made a CLASSPATH
variable and referenced the package.  Since this worked I thought the it
should still work for the JDBC driver version 3.  But for some reason it
does not.

Does anybody have any experience setting up JDBC driver 2 or 3
for MySQL that could give me a few tips on installation.

Thanks in advance,

Jason Lanpher
 
[EMAIL PROTECTED]
 
http://www.stealthnetworking.com
 


 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat JDBC problem

2003-06-06 Thread Pitre, Russell
are you using   com.mysql.jdbc.Driver?




-Original Message-
From: Jason Lanpher [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 11:08 AM
To: 'Tomcat Users List'
Subject: Tomcat JDBC problem


Hi all,

I am having a problem making the MySQL JDBC driver version 3
work with Tomcat correctly.  I had previously used MySQL JDBC driver
version 1 and developed a couple of programs to access my MySQL
database.  The programs worked just fine with this version of the
driver.  When I went to upgrade to the newest version of the MySQL JDBC
driver I get errors in my programs saying there is an error before the
beginning of the result set.  I am wondering if I am not installing the
driver correctly.  All I did for the JDBC driver version 1 was to place
the jar file in CATALINA_HOME/common/lib  I also made a CLASSPATH
variable and referenced the package.  Since this worked I thought the it
should still work for the JDBC driver version 3.  But for some reason it
does not.

Does anybody have any experience setting up JDBC driver 2 or 3
for MySQL that could give me a few tips on installation.

Thanks in advance,

Jason Lanpher
 
[EMAIL PROTECTED]
 
http://www.stealthnetworking.com
 


 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat JDBC problem

2003-06-06 Thread Jason Lanpher
Yes I am using com.mysql.jdbc.Driver

Here is the rest of the version numbers of the system.

RedHat 7.2 system
MySQL  3.56
Java   1.4.1_02
JDBC/MySQL 3.08





Jason Lanpher
 
[EMAIL PROTECTED]
 
http://www.stealthnetworking.com
 

Remember there are only 10 types of people in this world.  Those who
understand Binary and those who don't.

 


-Original Message-
From: Pitre, Russell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 10:25 AM
To: Tomcat Users List
Subject: RE: Tomcat JDBC problem


are you using   com.mysql.jdbc.Driver?




-Original Message-
From: Jason Lanpher [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 11:08 AM
To: 'Tomcat Users List'
Subject: Tomcat JDBC problem


Hi all,

I am having a problem making the MySQL JDBC driver version 3
work with Tomcat correctly.  I had previously used MySQL JDBC driver
version 1 and developed a couple of programs to access my MySQL
database.  The programs worked just fine with this version of the
driver.  When I went to upgrade to the newest version of the MySQL JDBC
driver I get errors in my programs saying there is an error before the
beginning of the result set.  I am wondering if I am not installing the
driver correctly.  All I did for the JDBC driver version 1 was to place
the jar file in CATALINA_HOME/common/lib  I also made a CLASSPATH
variable and referenced the package.  Since this worked I thought the it
should still work for the JDBC driver version 3.  But for some reason it
does not.

Does anybody have any experience setting up JDBC driver 2 or 3
for MySQL that could give me a few tips on installation.

Thanks in advance,

Jason Lanpher
 
[EMAIL PROTECTED]
 
http://www.stealthnetworking.com
 


 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat JDBC problem

2003-06-06 Thread Pitre, Russell
I definitely new to all this stuff but i was able to successfully use
the driver

here's what i did...

1.. Put mysql-connector-java-3.0.8-stable-bin.jarin
CATALINA_HOME\common\lib
2.. Didn't worry about setting the classpath for it...
3.. Server.xml stuff

parameter

nameusername/name

valuetomcat/value
/parameter
parameter

namepassword/name

valuesinner/value
/parameter

!-- Class name for
MySQL jdbc driver--
parameter
namedriverClassName/name

valuecom.mysql.jdbc.Driver/value
/parameter

!--JDBC Connection
URL--
parameter
nameurl/name

valuejdbc:mysql://localhost/tomcatbook?autoReconnect=true/value
/parameter
/ResourceParams

4.  Web.xml stuff

resource-ref
descriptionDB Connection/description
res-ref-namejdbc/Show/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref




Hope this helps!


Regards,
Russ


-Original Message-
From: Jason Lanpher [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 11:38 AM
To: 'Tomcat Users List'
Subject: RE: Tomcat JDBC problem


Yes I am using com.mysql.jdbc.Driver

Here is the rest of the version numbers of the system.

RedHat 7.2 system
MySQL  3.56
Java   1.4.1_02
JDBC/MySQL 3.08





Jason Lanpher
 
[EMAIL PROTECTED]
 
http://www.stealthnetworking.com
 

Remember there are only 10 types of people in this world.  Those who
understand Binary and those who don't.

 


-Original Message-
From: Pitre, Russell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 10:25 AM
To: Tomcat Users List
Subject: RE: Tomcat JDBC problem


are you using   com.mysql.jdbc.Driver?




-Original Message-
From: Jason Lanpher [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 11:08 AM
To: 'Tomcat Users List'
Subject: Tomcat JDBC problem


Hi all,

I am having a problem making the MySQL JDBC driver version 3
work with Tomcat correctly.  I had previously used MySQL JDBC driver
version 1 and developed a couple of programs to access my MySQL
database.  The programs worked just fine with this version of the
driver.  When I went to upgrade to the newest version of the MySQL JDBC
driver I get errors in my programs saying there is an error before the
beginning of the result set.  I am wondering if I am not installing the
driver correctly.  All I did for the JDBC driver version 1 was to place
the jar file in CATALINA_HOME/common/lib  I also made a CLASSPATH
variable and referenced the package.  Since this worked I thought the it
should still work for the JDBC driver version 3.  But for some reason it
does not.

Does anybody have any experience setting up JDBC driver 2 or 3
for MySQL that could give me a few tips on installation.

Thanks in advance,

Jason Lanpher
 
[EMAIL PROTECTED]
 
http://www.stealthnetworking.com
 


 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat, PreparedStatement JDBC problem

2003-02-10 Thread Mufaddal
Hi Everybody

I am using tomcat on Mac OS X. One of my servlets does the following:

1. I am creating a table ROLE as follows:
 
___

stmt.executeUpdate( CREATE TABLE ROLE (			+
ID			INTEGER NOT NULL AUTO_INCREMENT, 	+
NAME		VARCHAR(20) NOT NULL, 			+
OWNERID		INTEGER NOT NULL, 			+
PRIMARY KEY( ID )		+
));
 
___


2. I want to insert (ID, name, ownerid) in the above table .. if ID !=  
-1 and only (name, ownerid) if ID == -1;
   I do this as follows:
 
___

PreparedStatement pstmt = null;

if(roleId != -1)
{
pstmt = con.prepareStatement(INSERT INTO ROLE VALUES  
(?,?,?));
pstmt.setInt(1, roleId);
pstmt.setString(2, roleName);
pstmt.setInt(3, ownerId);
 }
else
{
pstmt = con.prepareStatement(INSERT INTO ROLE VALUES  
(?,?));
pstmt.setString(1, roleName);
pstmt.setInt(2, ownerId);
}

pstmt.executeUpdate();
 
___

It throws an exception at pstmt.executeUpdate() .. saying:
 
___
java.sql.SQLException: General error,  message from server: Column  
count doesn't match value count at row 1
 
___

Therefore I understood that maybe i need to make a change to the above  
code as follows:
 
___
			...
		   // SAME AS BEFORE 		
			...
		   else
{
pstmt = con.prepareStatement(INSERT INTO ROLE VALUES  
(?,?));
pstmt.setString(2, roleName);
pstmt.setInt(3, ownerId);
}

pstmt.executeUpdate();

 
___
Now it gives me an error saying:
 
___
Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 2
 
___

Does anybody know what i am doing wrong here ?

Thanks in advance
Mufaddal.


RE: Tomcat, PreparedStatement JDBC problem

2003-02-10 Thread Filip Hanik
It is a sql problem

if(roleId != -1)
{
pstmt = con.prepareStatement(INSERT INTO ROLE (ID,NAME,OWNERID) VALUES  (?,?,?));
   ^^
pstmt.setInt(1, roleId);
pstmt.setString(2, roleName);
pstmt.setInt(3, ownerId);
}
else
{
pstmt = con.prepareStatement(INSERT INTO ROLE (NAME,OWNERID) VALUES  (?,?));
   ^^
pstmt.setString(1, roleName);
pstmt.setInt(2, ownerId);
}

-Original Message-
From: Mufaddal [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 09, 2003 9:46 PM
To: Tomcat List
Subject: Tomcat, PreparedStatement JDBC problem


Hi Everybody

I am using tomcat on Mac OS X. One of my servlets does the following:

1. I am creating a table ROLE as follows:
 
___

 stmt.executeUpdate( CREATE TABLE ROLE (  +
 IDINTEGER NOT NULL AUTO_INCREMENT,   +
 NAME  VARCHAR(20) NOT NULL,  +
 OWNERID   INTEGER NOT NULL,  +
 PRIMARY KEY( ID )+
 ));
 
___


2. I want to insert (ID, name, ownerid) in the above table .. if ID !=  
-1 and only (name, ownerid) if ID == -1;
I do this as follows:
 
___

 PreparedStatement pstmt = null;

 if(roleId != -1)
 {
 pstmt = con.prepareStatement(INSERT INTO ROLE VALUES  
(?,?,?));
 pstmt.setInt(1, roleId);
 pstmt.setString(2, roleName);
 pstmt.setInt(3, ownerId);
  }
 else
 {
 pstmt = con.prepareStatement(INSERT INTO ROLE VALUES  
(?,?));
 pstmt.setString(1, roleName);
 pstmt.setInt(2, ownerId);
 }

 pstmt.executeUpdate();
 
___

It throws an exception at pstmt.executeUpdate() .. saying:
 
___
java.sql.SQLException: General error,  message from server: Column  
count doesn't match value count at row 1
 
___

Therefore I understood that maybe i need to make a change to the above  
code as follows:
 
___
...
   // SAME AS BEFORE
...
   else
 {
 pstmt = con.prepareStatement(INSERT INTO ROLE VALUES  
(?,?));
 pstmt.setString(2, roleName);
 pstmt.setInt(3, ownerId);
 }

 pstmt.executeUpdate();

 
___
Now it gives me an error saying:
 
___
Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 2
 
___

Does anybody know what i am doing wrong here ?

Thanks in advance
Mufaddal.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




JDBC problem

2002-09-25 Thread Ryan

I just downloaded the latest mySQL JDBC driver and have placed the directory
that the jar extracts into the CLASSPATH.

I am trying to load the driver with this line:
Class.forName(org.gjt.mm.mysql.Driver).newInstance();

All I have done is set the CLASSPATH and restart tomcat.
Is there anything else that needs to be done?

-ryan
The Original X-tra Strength Non-Aspirin Caplets


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




AW: JDBC problem

2002-09-25 Thread Dominik Jednoralski

tomcat ignores the classpath setting. place the .jar file in

$TOMCAT_HOME/webapps/root/web-inf/lib

i hope that'll work
dominik

-Ursprüngliche Nachricht-
Von: Ryan [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 25. September 2002 09:32
An: [EMAIL PROTECTED]
Betreff: JDBC problem


I just downloaded the latest mySQL JDBC driver and have placed the directory
that the jar extracts into the CLASSPATH.

I am trying to load the driver with this line:
Class.forName(org.gjt.mm.mysql.Driver).newInstance();

All I have done is set the CLASSPATH and restart tomcat.
Is there anything else that needs to be done?

-ryan
The Original X-tra Strength Non-Aspirin Caplets


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JDBC problem

2002-09-25 Thread Ryan

Thank you, this worked!
However, now, the next line of code gives me problems:
Connection C = DriverManager.getConnection(jdbc:mysql://localhost/tob,
user, pass);

Gives me the error :
javax.servlet.ServletException: Invalid authorization specification: Access
denied for user: '[EMAIL PROTECTED]' (Using password: YES)

When I run mysql --user=user -p
with the same user/pass as in the getConnection() method, everything works
fine.

-thanx, ryan


- Original Message -
From: Dominik Jednoralski [EMAIL PROTECTED]
To: Tomcat User Help [EMAIL PROTECTED]
Sent: Tuesday, September 24, 2002 12:34 AM
Subject: AW: JDBC problem


 tomcat ignores the classpath setting. place the .jar file in

 $TOMCAT_HOME/webapps/root/web-inf/lib

 i hope that'll work
 dominik

 -Ursprüngliche Nachricht-
 Von: Ryan [mailto:[EMAIL PROTECTED]]
 Gesendet: Mittwoch, 25. September 2002 09:32
 An: [EMAIL PROTECTED]
 Betreff: JDBC problem


 I just downloaded the latest mySQL JDBC driver and have placed the
directory
 that the jar extracts into the CLASSPATH.

 I am trying to load the driver with this line:
 Class.forName(org.gjt.mm.mysql.Driver).newInstance();

 All I have done is set the CLASSPATH and restart tomcat.
 Is there anything else that needs to be done?

 -ryan
 The Original X-tra Strength Non-Aspirin Caplets


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JDBC problem

2002-09-25 Thread Martin Jacobson

Ryan wrote:

 Thank you, this worked!
 However, now, the next line of code gives me problems:
 Connection C = DriverManager.getConnection(jdbc:mysql://localhost/tob,
 user, pass);
 
 Gives me the error :
 javax.servlet.ServletException: Invalid authorization specification: Access
 denied for user: '[EMAIL PROTECTED]' (Using password: YES)
 
 When I run mysql --user=user -p
 with the same user/pass as in the getConnection() method, everything works
 fine.
 
 -thanx, ryan
 
 


I had the same problem. The point is that tomcat passes the45.dhs.org 
as the host name, and NOT localhost. Therefore, you have to GRANT 
privileges to the user on this host in MySQL for the connection to work.

HTH,
Martin



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JDBC problem

2002-09-25 Thread Ryan

great, thanx couldn't quite get the grants changed right, so I found
that 127.0.0.1 worked fine.

-gratzie
 ryan


- Original Message -
From: Martin Jacobson [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, September 25, 2002 1:34 AM
Subject: Re: JDBC problem


 Ryan wrote:

  Thank you, this worked!
  However, now, the next line of code gives me problems:
  Connection C = DriverManager.getConnection(jdbc:mysql://localhost/tob,
  user, pass);
 
  Gives me the error :
  javax.servlet.ServletException: Invalid authorization specification:
Access
  denied for user: '[EMAIL PROTECTED]' (Using password: YES)
 
  When I run mysql --user=user -p
  with the same user/pass as in the getConnection() method, everything
works
  fine.
 
  -thanx, ryan
 
 


 I had the same problem. The point is that tomcat passes the45.dhs.org
 as the host name, and NOT localhost. Therefore, you have to GRANT
 privileges to the user on this host in MySQL for the connection to work.

 HTH,
 Martin



 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




warp / jdbc problem

2002-08-01 Thread Rob King

Hi,
I'm having problems connecting to mysql from tomcat when (only when) going
via the warp connector. (with roller in this example - I'm assuming it's not
app specific)
I point a browser to http://localhost:8080/roller/ and everything works - db
access no problem.
I point a browser to http://localhost/roller/ and I see the webapp html no
problem, but I get the exception below whenever it tries to hit mysql.
thanks in advance for any help on this (chunks of httpd.conf/server.xml 
versions at the bottom if they can aid diagnosis)
rob.

Catalina.start: LifecycleException:  Exception opening database connection:
java.sql.SQLException
LifecycleException:  Exception opening database connection:
java.sql.SQLException
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:681)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1173)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2185)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
- Root Cause -
java.sql.SQLException
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:606)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:679)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1173)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2185)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Stopping service Tomcat-Standalone
Stopping service Tomcat-Apache
Catalina.stop: LifecycleException:  Not started
LifecycleException:  Not started
at org.apache.catalina.connector.warp.WarpConnector.stop(Unknown
Source)
at
org.apache.catalina.core.StandardService.stop(StandardService.java:546)
at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2220)
at org.apache.catalina.startup.Catalina.start(Catalina.java:541)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

HTTPD.CONF

VirtualHost *
ServerName www.whatever
DocumentRoot /home/www/public_html
WebAppConnection conn  warp  localhost:8008
WebAppDeploy roller  conn  /roller
WebAppInfo /webapp-info
/VirtualHost

SERVER.XML

  Service name=Tomcat-Apache

Connector className=org.apache.catalina.connector.warp.WarpConnector
 port=8008 minProcessors=5 maxProcessors=75
 enableLookups=true appBase=webapps
 acceptCount=10 debug=0/

Engine className=org.apache.catalina.connector.warp.WarpEngine
 name=Apache debug=0

  Logger className=org.apache.catalina.logger.FileLogger
  prefix=apache_log. suffix=.txt
  timestamp=true/

  Realm className=org.apache.catalina.realm.MemoryRealm /
/Engine

  /Service


VERSIONS
--
tomcat 4.1.7 (also tried 4.0.4)
mysql-3.23.51
Apache/1.3.26
mm.mysql-2.0.14

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: warp / jdbc problem

2002-08-01 Thread rsequeira


You haven't configured you JDBC realm in the Warp connector section. My
guess is thaat you have it configured for the Tomcat-Standalone. You will
need to replicate the configuration in the Tomcat-Apache section too.

RS



   

  Rob King   

  [EMAIL PROTECTED]   To:   
[EMAIL PROTECTED]  
   cc: 

  08/01/02 04:38 PMSubject:  warp / jdbc problem   

  Please respond to

  Tomcat Users

  List

   

   





Hi,
I'm having problems connecting to mysql from tomcat when (only when) going
via the warp connector. (with roller in this example - I'm assuming it's
not
app specific)
I point a browser to http://localhost:8080/roller/ and everything works -
db
access no problem.
I point a browser to http://localhost/roller/ and I see the webapp html no
problem, but I get the exception below whenever it tries to hit mysql.
thanks in advance for any help on this (chunks of httpd.conf/server.xml 
versions at the bottom if they can aid diagnosis)
rob.

Catalina.start: LifecycleException:  Exception opening database connection:
java.sql.SQLException
LifecycleException:  Exception opening database connection:
java.sql.SQLException
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:681)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1173)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2185)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39

)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl

.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
- Root Cause -
java.sql.SQLException
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:606)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:679)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1173)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2185)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39

)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl

.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Stopping service Tomcat-Standalone
Stopping service Tomcat-Apache
Catalina.stop: LifecycleException:  Not started
LifecycleException:  Not started
at org.apache.catalina.connector.warp.WarpConnector.stop(Unknown
Source)
at
org.apache.catalina.core.StandardService.stop(StandardService.java:546)
at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2220)
at org.apache.catalina.startup.Catalina.start(Catalina.java:541)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39

jakarta + MySQL / JDBC Problem

2002-04-02 Thread subceero

Hello everyone,

I'm running tomcat on a linux system. My test JSP-Page runs fine, but if I
try to connect to a mySQL-database, all I get is a Class loading error .
Does anyone know what this could mean? Is some class missing? what do I need
to run JDBC? Do I need to configure tomcat to access a DB?

Thanks for your help!


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: jakarta + MySQL / JDBC Problem

2002-04-02 Thread Peter Choe

do you have the jdbc driver for the mySQL?

At 12:52 PM 4/2/2002, subceero wrote:
Hello everyone,

I'm running tomcat on a linux system. My test JSP-Page runs fine, but if I
try to connect to a mySQL-database, all I get is a Class loading error .
Does anyone know what this could mean? Is some class missing? what do I need
to run JDBC? Do I need to configure tomcat to access a DB?

Thanks for your help!


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: jakarta + MySQL / JDBC Problem

2002-04-02 Thread Thomas Gideon

On Tue, Apr 02, 2002 at 07:52:44PM +0200, subceero wrote:
 Hello everyone,
 
 I'm running tomcat on a linux system. My test JSP-Page runs fine, but if I
 try to connect to a mySQL-database, all I get is a Class loading error .
 Does anyone know what this could mean? Is some class missing? what do I need
 to run JDBC? Do I need to configure tomcat to access a DB?

Are the JDBC jars for MySQL somewhere where they are accessible to your
JSP?  If you did not copy or link the JDBC jar somewhere underneath your
Tomcat install directory, like $CATALINA_HOME/common/lib, chances are that
is the problem.  I.e. the DriverManager is trying to load the JDBC driver
you requested but the class in question is nowhere on the classpath that
the JSP knows about.

Thomas
-- 

Why is American beer served cold? So you can tell it from urine. -- David
Moulton

mailto:[EMAIL PROTECTED]
http://www.gideonfamily.org/tom/
jabber:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: jakarta + MySQL / JDBC Problem

2002-04-02 Thread subceero

Hello,

Unfortunately, it still doesn't run. I have no idea where tomcat expects
those jar file to be ( I have downloaded the JDBC-Driver for mysql, the file
is named
mm.mysql-2.0.4-bin.jar) and copied it to $JAKARTA_HOME/common/lib, but still
the same Class loading error . Maybe I need to put it elsewhere? I also do
not know if JDBC is working at all ! Is there a way to check this? do I have
to configure this separatlely somwhere in jakarta?

thank you for your help again

subceero




- Original Message -
From: Thomas Gideon [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 7:58 PM
Subject: Re: jakarta + MySQL / JDBC Problem


 On Tue, Apr 02, 2002 at 07:52:44PM +0200, subceero wrote:
  Hello everyone,
 
  I'm running tomcat on a linux system. My test JSP-Page runs fine, but if
I
  try to connect to a mySQL-database, all I get is a Class loading error
.
  Does anyone know what this could mean? Is some class missing? what do I
need
  to run JDBC? Do I need to configure tomcat to access a DB?

 Are the JDBC jars for MySQL somewhere where they are accessible to your
 JSP?  If you did not copy or link the JDBC jar somewhere underneath your
 Tomcat install directory, like $CATALINA_HOME/common/lib, chances are that
 is the problem.  I.e. the DriverManager is trying to load the JDBC driver
 you requested but the class in question is nowhere on the classpath that
 the JSP knows about.

 Thomas
 --

 Why is American beer served cold? So you can tell it from urine. --
David
 Moulton

 mailto:[EMAIL PROTECTED]
 http://www.gideonfamily.org/tom/
 jabber:[EMAIL PROTECTED]

 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: jakarta + MySQL / JDBC Problem

2002-04-02 Thread Thomas Gideon

On Tue, Apr 02, 2002 at 09:26:59PM +0200, subceero wrote:
 
 Unfortunately, it still doesn't run. I have no idea where tomcat expects
 those jar file to be ( I have downloaded the JDBC-Driver for mysql, the file
 is named
 mm.mysql-2.0.4-bin.jar) and copied it to $JAKARTA_HOME/common/lib, but still
 the same Class loading error . Maybe I need to put it elsewhere? I also do
 not know if JDBC is working at all ! Is there a way to check this? do I have
 to configure this separatlely somwhere in jakarta?

Extract your JDBC logic from your JSP (here's one of the many advantages to
Model 2 architecture, that logic would already be separated and you could
drive it via a main method outside of Tomcat) and run it as a standard Java
app.  I always test my database code in this manner in all the classes I
deploy on Tomcat.

I have been using PostgreSQL and saw a similar message to the one on your
original request for help, which is why I responded.  However, copying the
relevant JDBC jars from my database install into common/lib solved my
problem.  You might also try putting the jar in WEB-INF/lib inside of your
web application, that's the next place I would think to try.

Thomas
-- 

I never drink beer before Noon.  Lucky for me, it is always after Noon
somewhere. -- Ron the Drunken Webmaster

mailto:[EMAIL PROTECTED]
http://www.gideonfamily.org/tom/
jabber:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




JDBC Problem

2002-02-07 Thread Mark Peterson

I am experiencing a JDBC problem.

I am attempting to execute the Java servlet from chapter 13 of the book
entitled “JSP, Servlets, and MySQL” by David Harms; ISBN: 0764547879.

But in Tomcat I get error message “org.gjt.mm.mysql.Driver” which is the
name of the mm jdbc driver.

The following steps have been completed:

- Confirmed that Tomcat and MySQL were installed and configured.
- Edited the server.XML file so the mm driver will be used.
- Set the CLASSPATH variable to the following: c:\tomcat\lib
- Copied the “mm.mysql-2.0.6.1.jar” file to the following path:
“c:\tomcat\lib”

The following software has been installed and configured:

Tomcat 3.2.3
MySQL 3.23.47
Windows NT Server 4.0 (Service Pack 6)
JDBC driver: mm.mysql-2.0.6.1

Here's a portion of the server.XML file:

RequestInterceptor
className=org.apache.tomcat.request.AccessInterceptor
debug=0 /

!-- Check permissions using the simple xml file. You can
 plug more advanced authentication modules.
--
RequestInterceptor
className=org.apache.tomcat.request.SimpleRealm
debug=0 /

   !-- UnComment the following and comment out the
above to get a JDBC realm.
Other options for driverName:
  driverName=oracle.jdbc.driver.OracleDriver
  connectionURL=jdbc:oracle:thin:@ntserver:1521:ORCL
  connectionName=scott
  connectionPassword=tiger
--
  driverName=org.gjt.mm.mysql.Driver
  connectionURL=jdbc:mysql://localhost/authority

  connectionName=test
  connectionPassword=test
!--
connectionName and connectionPassword are optional.
--

Any help would be appreciated.

Thanks,

Mark Peterson


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: JDBC Problem

2002-02-07 Thread Karthikeyan.K.V

Mark,
Try to put the mysql-driver jar file  in the WEB-INF\lib
directory which will under tomcat\webapps\Your application directory.This
maybe a classpath problem.

Karthik

- Original Message -
From: Mark Peterson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 5:03 PM
Subject: JDBC Problem


 I am experiencing a JDBC problem.

 I am attempting to execute the Java servlet from chapter 13 of the book
 entitled JSP, Servlets, and MySQL by David Harms; ISBN: 0764547879.

 But in Tomcat I get error message org.gjt.mm.mysql.Driver which is the
 name of the mm jdbc driver.

 The following steps have been completed:

 - Confirmed that Tomcat and MySQL were installed and configured.
 - Edited the server.XML file so the mm driver will be used.
 - Set the CLASSPATH variable to the following: c:\tomcat\lib
 - Copied the mm.mysql-2.0.6.1.jar file to the following path:
 c:\tomcat\lib

 The following software has been installed and configured:

 Tomcat 3.2.3
 MySQL 3.23.47
 Windows NT Server 4.0 (Service Pack 6)
 JDBC driver: mm.mysql-2.0.6.1

 Here's a portion of the server.XML file:

 RequestInterceptor
 className=org.apache.tomcat.request.AccessInterceptor
 debug=0 /

 !-- Check permissions using the simple xml file. You can
  plug more advanced authentication modules.
 --
 RequestInterceptor
 className=org.apache.tomcat.request.SimpleRealm
 debug=0 /

!-- UnComment the following and comment out the
 above to get a JDBC realm.
 Other options for driverName:
   driverName=oracle.jdbc.driver.OracleDriver
   connectionURL=jdbc:oracle:thin:@ntserver:1521:ORCL
   connectionName=scott
   connectionPassword=tiger
 --
   driverName=org.gjt.mm.mysql.Driver
   connectionURL=jdbc:mysql://localhost/authority

   connectionName=test
   connectionPassword=test
 !--
 connectionName and connectionPassword are optional.
 --

 Any help would be appreciated.

 Thanks,

 Mark Peterson


 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: JDBC Problem

2002-02-07 Thread colin . madere

Also try the TOMCAT_HOME/lib/common or the TOMCAT_HOME/lib/apps directory
(/apps is for libraries shared by all web-apps under Tomcat)

 --
 From: Karthikeyan.K.V[SMTP:[EMAIL PROTECTED]]
 Reply To: Tomcat Users List
 Sent: Thursday, February 07, 2002 5:40 PM
 To:   Tomcat Users List; [EMAIL PROTECTED]
 Subject:  Re: JDBC Problem
 
 Mark,
 Try to put the mysql-driver jar file  in the WEB-INF\lib
 directory which will under tomcat\webapps\Your application
 directory.This
 maybe a classpath problem.
 
 Karthik
 
 - Original Message -
 From: Mark Peterson [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, February 07, 2002 5:03 PM
 Subject: JDBC Problem
 
 
  I am experiencing a JDBC problem.
 
  I am attempting to execute the Java servlet from chapter 13 of the book
  entitled JSP, Servlets, and MySQL by David Harms; ISBN: 0764547879.
 
  But in Tomcat I get error message org.gjt.mm.mysql.Driver which is the
  name of the mm jdbc driver.
 
  The following steps have been completed:
 
  - Confirmed that Tomcat and MySQL were installed and configured.
  - Edited the server.XML file so the mm driver will be used.
  - Set the CLASSPATH variable to the following: c:\tomcat\lib
  - Copied the mm.mysql-2.0.6.1.jar file to the following path:
  c:\tomcat\lib
 
  The following software has been installed and configured:
 
  Tomcat 3.2.3
  MySQL 3.23.47
  Windows NT Server 4.0 (Service Pack 6)
  JDBC driver: mm.mysql-2.0.6.1
 
  Here's a portion of the server.XML file:
 
  RequestInterceptor
  className=org.apache.tomcat.request.AccessInterceptor
  debug=0 /
 
  !-- Check permissions using the simple xml file. You can
   plug more advanced authentication modules.
  --
  RequestInterceptor
  className=org.apache.tomcat.request.SimpleRealm
  debug=0 /
 
 !-- UnComment the following and comment out the
  above to get a JDBC realm.
  Other options for driverName:
driverName=oracle.jdbc.driver.OracleDriver
connectionURL=jdbc:oracle:thin:@ntserver:1521:ORCL
connectionName=scott
connectionPassword=tiger
  --
driverName=org.gjt.mm.mysql.Driver
connectionURL=jdbc:mysql://localhost/authority
 
connectionName=test
connectionPassword=test
  !--
  connectionName and connectionPassword are optional.
  --
 
  Any help would be appreciated.
 
  Thanks,
 
  Mark Peterson
 
 
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]
 
 
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: JDBC Problem

2001-10-25 Thread James Chuang

Can't see how this is a tomcat question, but the Oracle connect string
should be:

jdbc:oracle:thin:@hostname:port:DBID

so using your example, it should be something like:

jdbc.oracle:thin:@hostname:1521:dbname


- Original Message -
From: The Duke [EMAIL PROTECTED]
To: Tomcat-user Mailinglist [EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 3:26 AM
Subject: JDBC Problem


 When I want to open a connection to the oracle database I get a sql
exception and the message that the Network Adapter could not establish the
connection.

 I use following :
 - oracle.jdbc.driver.OracleDriver
 - jdbc:oracle:thin://hostname/dbname

 Can anyone help?

 Dennis


 Make a difference, help support the relief efforts in the U.S.
 http://clubs.lycos.com/live/events/september11.asp




JSP-JDBC-Problem

2001-10-25 Thread Hostmaster of the day

Hi there !

I got the following problem :

Our Tomcat 3.2.1 (RH 6.2) server is located in New York.
twz1jdbcForMysql-1.0.4-GA is installed.

Our mySQL 3.23. (RH 6.1) server is located in Baltimore.
Remote '%' access is enabled.

I'm trying to access from our NY server to the mySQL db in
Baltimore using : 

databaseURL =
jdbc:z1MySQL://www.domain.com:3306/database?user=correctuserpassword=
**;

All I get is an Internal Servlet Error
javax.servlet.ServletException: The url cannot be null

I don't know what this mean.

What is my fault and what can I do against it.

Thank you,
HotD*




JDBC Problem

2001-10-24 Thread The Duke

When I want to open a connection to the oracle database I get a sql exception and the 
message that the Network Adapter could not establish the connection.

I use following :
- oracle.jdbc.driver.OracleDriver
- jdbc:oracle:thin://hostname/dbname

Can anyone help?

Dennis


Make a difference, help support the relief efforts in the U.S.
http://clubs.lycos.com/live/events/september11.asp



RE: JDBC Problem with Ultradev

2001-07-05 Thread James Radvan

For those of you that are still having problems with this, make sure your
driver is present in the Tomcat /webapps/[mywebapp]/WEB-INF/classes
directory and select 'use driver on application server' in your connection
setup in Ultradev. 

-
James Radvan
Websphere Analyst/Architect
London, UK
[EMAIL PROTECTED]
+44 7990 624899


-Original Message-
From: James Radvan [mailto:[EMAIL PROTECTED]]
Sent: 03 July 2001 14:07
To: '[EMAIL PROTECTED]'
Subject: RE: JDBC Problem with Ultradev




Click here to visit the Argos home page http://www.argos.co.uk

The information contained in this message or any of its attachments may be privileged 
and confidential, and is intended exclusively for the addressee.
The views expressed may not be official policy, but the personal views of the 
originator.  
If you are not the addressee, any disclosure, reproduction, distribution, 
dissemination or use of this communication is not authorised.
If you have received this message in error, please advise the sender by using the 
reply facility in your e-mail software.
All messages sent and received by Argos Ltd are monitored for virus, high risk file 
extensions, and inappropriate content.  As a result users should be aware that mail 
may be accessed.





RE: JDBC Problem with Ultradev

2001-07-03 Thread James Radvan

Although this certainly is off topic, this person is trying to develop JSP
for Tomcat on the Ultradev IDE.  The Macromedia newsgroups are notoriously
unhelpful when it comes to JSP/JDBC, mainly due to lack of knowledge, and I
suspect that this list goes out to some people very knowledgeable in this
area.

That being said, there's a lot of documentation both in the Ultradev docs
and on the Macromedia website for how to configure JDBC for live data
preview, and you should probably state that you've checked all of this and
that this list is your last resort if that is the case, rather than posting
here to save yourself the effort.

Most JDBC live data preview connection problems in Ultradev are due to
misconfigured classpaths, absent, misplaced or misnamed driver jar's, and
lack of plain old trawling through the docs.  Make sure you've checked these
first.  The drivers need to be in the Ultradev file system as well, in one
of the subfolders detailed in the Ultradev online help.

James
-
James Radvan
Websphere Analyst/Architect
London, UK
[EMAIL PROTECTED]
+44 7990 624899


-Original Message-
From: pete [mailto:[EMAIL PROTECTED]]
Sent: 03 July 2001 05:46
To: [EMAIL PROTECTED]
Subject: Re: JDBC Problem with Ultradev


And this has what to do with tomcat? 




Click here to visit the Argos home page http://www.argos.co.uk

The information contained in this message or any of its attachments may be privileged 
and confidential, and is intended exclusively for the addressee.
The views expressed may not be official policy, but the personal views of the 
originator.  
If you are not the addressee, any disclosure, reproduction, distribution, 
dissemination or use of this communication is not authorised.
If you have received this message in error, please advise the sender by using the 
reply facility in your e-mail software.
All messages sent and received by Argos Ltd are monitored for virus, high risk file 
extensions, and inappropriate content.  As a result users should be aware that mail 
may be accessed.





JDBC Problem with Ultradev

2001-07-02 Thread Christi's Mail

I am attempting to connect to my MySQL install using Ultradev4 and I am
having not luck.  I am using a Linux/MySQL/Apache/Tomcat combo on my server.
MySQL works fine, so does Apache  Tomcat, and they are configure to work
together and serve up JSP's with no problems.  I also have the 2.04 mm.mysql
JDBC driver in my classpath but I cannot get Ultradev to connect to the
database.




Re: JDBC Problem with Ultradev

2001-07-02 Thread pete

And this has what to do with tomcat? Last i checked this was a tomcat 
list, not a jdbc or ultradev list, whatever ultradev is.

If your problem is tomcat-specific, you'll find many helping hands here, 
but please do not post unrelated problems to this list, as it just 
clutters up everyones inboxes.

-Pete


 I am attempting to connect to my MySQL install using Ultradev4 and I am
 having not luck.  I am using a Linux/MySQL/Apache/Tomcat combo on my server.
 MySQL works fine, so does Apache  Tomcat, and they are configure to work
 together and serve up JSP's with no problems.  I also have the 2.04 mm.mysql
 JDBC driver in my classpath but I cannot get Ultradev to connect to the
 database.






jdk1.3.0_02 tomcat 3.2.1 jdbc problem

2001-06-06 Thread rohit kamath

when I run tomcat as a nt service, I have problems connecting to the 
database.  It gives me jdbc not found error.  But if I stop the service 
and run it as an application it has no problems connecting to the database.

can anyone help.

Rohit
_
Get your FREE download of MSN Explorer at http://explorer.msn.com




Re: jdk1.3.0_02 tomcat 3.2.1 jdbc problem

2001-06-06 Thread Gary Dale

Could be one of two problems. When you run it as a service, it probably 
is running as system but when you run it as an app, it runs with your 
user id. Check the privieleges!

Or it could be the jdk1.3 problem. It won't run as a service - shuts 
down when you log off! I'm not sure it is fixed in jdk 1.3.2 but I'm 
using 1.2.x which doesn't have this problem.



rohit kamath wrote:

 when I run tomcat as a nt service, I have problems connecting to the 
 database.  It gives me jdbc not found error.  But if I stop the 
 service and run it as an application it has no problems connecting to 
 the database.

 can anyone help.

 Rohit
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com








RE: jdk1.3.0_02 tomcat 3.2.1 jdbc problem

2001-06-06 Thread Nibler Jeff R. (PDX1JRN)

Sounds a lot like the problem I just had.  It's been so long since I have
messed with jdbc, but if I recall correctly, the class files for jdbc aren't
part of the standard classes are they?  If they aren't, and you have to
include them in your CLASSPATH environment variable, then you will have to
add those in manually to the wrapper.properties file in the \conf
subdirectory directory of Tomcat.  It would look like:
wrapper.class_path=$(wrapper.java_home)\lib\whatever.jar
Add each entry from your CLASSPATH environment variable like the line above.
Apparently (as I have found out today), Tomcat will ignore your CLASSPATH
variable when run as a service.

Hope this helps you!

-Jeff

-Original Message-
From: rohit kamath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 11:56 AM
To: [EMAIL PROTECTED]
Subject: jdk1.3.0_02 tomcat 3.2.1 jdbc problem


when I run tomcat as a nt service, I have problems connecting to the 
database.  It gives me jdbc not found error.  But if I stop the service 
and run it as an application it has no problems connecting to the database.

can anyone help.

Rohit
_
Get your FREE download of MSN Explorer at http://explorer.msn.com



jdbc problem

2001-01-28 Thread shlomi sarfati

Hi 
I have a small problem with setting a connection to an oracle database 
every time that I start the tomcat with the following code I cant get the server to 
start 
this is the code within the server.xml :

+ADw-RequestInterceptor className+AD0AIg-org.apache.tomcat.request.JDBCRealm+ACI-
 debug+AD0AIg-99+ACI-
 driverName+AD0AIg-oracle.jdbc.driver.OracleDriver+ACI-
 connectionURL+AD0AIg-jdbc:oracle:thin:+AEA-198.165.124.36:1521:myvxs+ACI-
 connectionName+AD0AIg-name+ACI-
 connectionPassword+AD0AIg-password+ACI-/+AD4-

and another question 

can you set a connection  pool with the tomcat ??
thanks for the attention 

shlomi 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]