Need help!

2005-04-22 Thread Sergey Livanov

Client's server with applications stops ~ 1 in two days.
Configuration: Win2003 server, sp4, Tomcat 5.12, Oracle 9.2.
I'd like to ask a couple of questions

1. Is there a method to have a load on 80 роrt, determine the number of
   inquiries and see how the system operates?

2. Do I need the Shareable parameter in в web.xml?
  
  Database Reference
  ORAPOOL
  javax.sql.DataSource
  Container
  Shareable
   

3. Are my Tomcat Connection pool parameters normal?
 

 
 
     factory
 org.apache.commons.dbcp.BasicDataSourceFactory
 
 
     driverClassName
 oracle.jdbc.driver.OracleDriver
     
     
     url
        jdbc:oracle:thin:@192.168.0.10:1521:APPL
 
 
     username
     username
     
     
     password
     pwd
     
             
             maxActive
             80
             
         
             maxIdle
             40
             
             
             maxWait
             1
             
 
 removeAbandoned
 true
 
 
 removeAbandonedTimeout
 60
 
 
 logAbandoned
 true
 

    

Any advises ?


Help & advises are appreciated !


regards,
 Sergey  mailto:[EMAIL PROTECTED]


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



Help with JDBCRealm config on Tomcat 4.1

2005-04-22 Thread joelsherriff
Hope someone can help me - I'm still a relative newbie to tomcat, am baffled
at this point and I can't even get it configured so that I
can get debug info to find out what's wrong.

I've added a context to my server.xml for the webapp I'm trying to set up
JDBCRealm authentication for:

  


  

And, of course, added the supporting tables and roles to my database.  When
I attempt to access a page from the webapp,
my login.jsp page is displayed, and when I attempt to login, my error.jsp
page is displayed.   I didn't expect this to work
correctly the first time I configured it,  and it's not, but my problem is
that I can't figure out how to debug it at all.  The
Logger I have configured in the webapp's Context does nothing - doesn't
create the log file and nothing is logged
anywhere else either.   How can I further debug it?

Now, if I take the Realm out of the Context (applying it to the entire
server), I get an exception in my catalina_log:

2005-04-22 15:26:10 JDBCRealm[Standalone]: Exception performing
authentication
java.sql.SQLException: org.gjt.mm.mysql.Driver
 at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:588)
 at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:343)

Though it doesn't say it precisely, I think this implies that it's not
connecting to the DB, but the db, user and password values are all correct.

Basically, I have three problems:  why can't I get logging to work from
within a specific context,  am I doing something wrong in my attempt
to get JDBCRealm authentication to work, and what is the right way to debug
the problem further, if the solution isn't obvious?

Also, I've added to my webapp's web.xml file:



Entire Application
/*


users




FORM
Users

/login.jsp
/error.jsp





Some Stuff

users






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


RE: Need help exporting contexts not under webapps/

2005-04-19 Thread J. Ryan Earl
Yea, I accidently hit the send button on the last email before I was done
writing it, but it's working.  I just had to create two context files under
conf/Catalina/localhost/

-ryan

-Original Message-
From: Gurumoorthy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 1:33 PM
To: Tomcat Users List
Subject: Re: Need help exporting contexts not under webapps/


Did you manage to get it right ?
I would recommend that you use lower case context path name

Regards
Guru
- Original Message -
From: "J. Ryan Earl" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, April 19, 2005 6:56 PM
Subject: RE: Need help exporting contexts not under webapps/


> Thanks for the reply, I actually figured it a few hours later.  I was
trying
> to do 2/ in your list.  I added a PICS.xml and a DOCS.xml under the
> ${CATALINA_HOME}/conf/Catalina/localhost/ directory which gave me the PICS
> and DOCS contexts.  ie:
>
> [EMAIL PROTECTED] localhost]$ pwd
> /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost
> [EMAIL PROTECTED] localhost]$ ls
> DOCS.xml  host-manager.xml  manager.xml  PICS.xml
> [EMAIL PROTECTED] localhost]$ cat PICS.xml
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
> [EMAIL PROTECTED] localhost]$ cat PICS.xml
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
> [EMAIL PROTECTED] localhost]$ cat PICS.xml DOCS.xml
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
>
>
>
> -Original Message-
> From: QM [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 18, 2005 8:30 PM
> To: Tomcat Users List
> Subject: Re: Need help exporting contexts not under webapps/
>
>
> On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote:
> : So my question is, in short, given a directory structure of static
files,
> : how do you get Tomcat to serve said static content off of an arbitrary
> URI?
>
> So, are you trying to
> 1/ have a Tomcat-run webapp serve content that exists outside of the
> context path?
>
> 2/ setup the static content as its own webapp (context)?
>
>
> For #1, the (portable, spec-friendly) way is to write a servlet or
> filter to intercept requests for a given URI, open the matching file as
> an InputStream, and push the data to the client via the Response
> OutputStream.
>
> For #2, I don't remember the exact syntax off the top of my head so I
> won't waste your time with something that may not work. =) But it's
> definitely possible for a webapp to not exist under the "webapps/"
> directory.
>
> Just make sure said webapp has a WEB-INF directory and a web.xml.  Even
> a web.xml of just
> 
> should do.
>
> -QM
>
> --
>
> software   -- http://www.brandxdev.net/
> tech news  -- http://www.RoarNetworX.com/
> code scan  -- http://www.JxRef.org/
>
> -
> 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]



Re: Need help exporting contexts not under webapps/

2005-04-19 Thread Gurumoorthy
Did you manage to get it right ?
I would recommend that you use lower case context path name

Regards
Guru
- Original Message -
From: "J. Ryan Earl" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, April 19, 2005 6:56 PM
Subject: RE: Need help exporting contexts not under webapps/


> Thanks for the reply, I actually figured it a few hours later.  I was
trying
> to do 2/ in your list.  I added a PICS.xml and a DOCS.xml under the
> ${CATALINA_HOME}/conf/Catalina/localhost/ directory which gave me the PICS
> and DOCS contexts.  ie:
>
> [EMAIL PROTECTED] localhost]$ pwd
> /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost
> [EMAIL PROTECTED] localhost]$ ls
> DOCS.xml  host-manager.xml  manager.xml  PICS.xml
> [EMAIL PROTECTED] localhost]$ cat PICS.xml
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
> [EMAIL PROTECTED] localhost]$ cat PICS.xml
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
> [EMAIL PROTECTED] localhost]$ cat PICS.xml DOCS.xml
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
>   privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> 
>
>
>
> -Original Message-
> From: QM [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 18, 2005 8:30 PM
> To: Tomcat Users List
> Subject: Re: Need help exporting contexts not under webapps/
>
>
> On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote:
> : So my question is, in short, given a directory structure of static
files,
> : how do you get Tomcat to serve said static content off of an arbitrary
> URI?
>
> So, are you trying to
> 1/ have a Tomcat-run webapp serve content that exists outside of the
> context path?
>
> 2/ setup the static content as its own webapp (context)?
>
>
> For #1, the (portable, spec-friendly) way is to write a servlet or
> filter to intercept requests for a given URI, open the matching file as
> an InputStream, and push the data to the client via the Response
> OutputStream.
>
> For #2, I don't remember the exact syntax off the top of my head so I
> won't waste your time with something that may not work. =) But it's
> definitely possible for a webapp to not exist under the "webapps/"
> directory.
>
> Just make sure said webapp has a WEB-INF directory and a web.xml.  Even
> a web.xml of just
> 
> should do.
>
> -QM
>
> --
>
> software   -- http://www.brandxdev.net/
> tech news  -- http://www.RoarNetworX.com/
> code scan  -- http://www.JxRef.org/
>
> -
> 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: Need help exporting contexts not under webapps/

2005-04-19 Thread J. Ryan Earl
Thanks for the reply, I actually figured it a few hours later.  I was trying
to do 2/ in your list.  I added a PICS.xml and a DOCS.xml under the
${CATALINA_HOME}/conf/Catalina/localhost/ directory which gave me the PICS
and DOCS contexts.  ie:

[EMAIL PROTECTED] localhost]$ pwd
/home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost
[EMAIL PROTECTED] localhost]$ ls
DOCS.xml  host-manager.xml  manager.xml  PICS.xml
[EMAIL PROTECTED] localhost]$ cat PICS.xml


[EMAIL PROTECTED] localhost]$ cat PICS.xml


[EMAIL PROTECTED] localhost]$ cat PICS.xml DOCS.xml







-Original Message-
From: QM [mailto:[EMAIL PROTECTED]
Sent: Monday, April 18, 2005 8:30 PM
To: Tomcat Users List
Subject: Re: Need help exporting contexts not under webapps/


On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote:
: So my question is, in short, given a directory structure of static files,
: how do you get Tomcat to serve said static content off of an arbitrary
URI?

So, are you trying to
1/ have a Tomcat-run webapp serve content that exists outside of the
context path?

2/ setup the static content as its own webapp (context)?


For #1, the (portable, spec-friendly) way is to write a servlet or
filter to intercept requests for a given URI, open the matching file as
an InputStream, and push the data to the client via the Response
OutputStream.

For #2, I don't remember the exact syntax off the top of my head so I
won't waste your time with something that may not work. =) But it's
definitely possible for a webapp to not exist under the "webapps/"
directory.

Just make sure said webapp has a WEB-INF directory and a web.xml.  Even
a web.xml of just

should do.

-QM

--

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

-
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: Need help exporting contexts not under webapps/

2005-04-19 Thread Fritz Schneider
Guru,

I got it! Forget about aegean.xml! The key us server.xml! I was able to move
my ROOT directory by adding the following to my  container in
server.xml:

 
  WEB-INF/web.xml 
 

Then all of my subdirectories under c:\www showed up on the server,
including aegean. Other contexts continue to be recognized as deployed apps.

Fritz
-Original Message-
From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED]

Sent: Tuesday, April 19, 2005 5:45 AM
To: 'Tomcat Users List'
Subject: RE: Need help exporting contexts not under webapps/

Hello,

In your aegean.xml  try 



  WEB-INF/web.xml



and then stop and start tocmat. 
Go to the manager application and see if you can see the application
started ? 
if not try to start it. If yes then try the link
http://www.peacham.com/aegean
If it does not look into the logs 


Regards
Guru 

-Original Message-
From: Fritz Schneider [mailto:[EMAIL PROTECTED] 
Sent: 19 April 2005 13:25
To: 'Tomcat Users List'
Subject: RE: Need help exporting contexts not under webapps/


Guru,

Earl isn't the only one trying to do this. Here are the details for my
attempts which may or may not be similar to his:

 - Running TC 5.5.8, JVM 1.5.0_02-b09 under Win XP Pro SP2
 - I have a set of static pages (starting with index.htm) stored at
C:\www\aegean
 - C:\www\agean\WEB-INF\web.xml contains 
 - I wish to access them as http://www.peacham.com/aegean
 - aegean is just one of many such directories.
 - It works if I copy it to {TOMCAT_BASE}\webapps\aegean but that creates
maintenance headaches by coupling the TC directory structure to the web site
directory structure.
 - I have tried building a webapps/aegean directory with just WEB-INF and
adding aegean.xml to {TOMCAT-BASE}\conf\Catalina\localhost containing:



  WEB-INF/web.xml


but all I get is 404 errors and no hint of other errors in the logs. I have
tried a couple of variations with equally poor results.

Thanks for any help you can give

Fritz

-Original Message-
From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED]

Sent: Tuesday, April 19, 2005 1:10 AM
To: 'Tomcat Users List'
Subject: RE: Need help exporting contexts not under webapps/

Not clear what you want.

Send me the details

Where is your static document ( The directory )
How do want to access it ? ( the URL )  
Which version of TOMCAT YOU ARE USING 
Send me your server.xml 

Regards
Guru 

-Original Message-
From: J. Ryan Earl [mailto:[EMAIL PROTECTED] 
Sent: 18 April 2005 19:16
To: tomcat-user@jakarta.apache.org
Subject: Need help exporting contexts not under webapps/


Hello,

I'm in the process of bringing an in-house application up under Tomcat.
Previously we were using Jetty as the servlet container, but for various
reason I'm trying to get said application running with Tomcat 5.5.9 and Java
1.5.0.

The problem I'm having is that there are two directories with a large amount
of static files (pictures, videos, documents, and other forms of media) that
are mounted outside of the webapps/ home.  Under Jetty, there is a
configuration directive that I can use to export these directories under a
URL path.  I'm trying to do that in Tomcat, and the documentation has been
somewhat confusing.

What I've gathered is that this type of configuration should be put under
${CATALINA_HOME}/conf/context.xml however I have been able to do this
successfully.  I've tried putting the following in context.xml but it gives
me errors:




So my question is, in short, given a directory structure of static files,
how do you get Tomcat to serve said static content off of an arbitrary URI?
Ideas?

Thanks in advance,
-ryan


-
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]


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



RE: Need help exporting contexts not under webapps/

2005-04-19 Thread Raghupathy,Gurumoorthy
Hello,

In your aegean.xml  try 



  WEB-INF/web.xml



and then stop and start tocmat. 
Go to the manager application and see if you can see the application
started ? 
if not try to start it. If yes then try the link
http://www.peacham.com/aegean
If it does not look into the logs 


Regards
Guru 

-Original Message-
From: Fritz Schneider [mailto:[EMAIL PROTECTED] 
Sent: 19 April 2005 13:25
To: 'Tomcat Users List'
Subject: RE: Need help exporting contexts not under webapps/


Guru,

Earl isn't the only one trying to do this. Here are the details for my
attempts which may or may not be similar to his:

 - Running TC 5.5.8, JVM 1.5.0_02-b09 under Win XP Pro SP2
 - I have a set of static pages (starting with index.htm) stored at
C:\www\aegean
 - C:\www\agean\WEB-INF\web.xml contains 
 - I wish to access them as http://www.peacham.com/aegean
 - aegean is just one of many such directories.
 - It works if I copy it to {TOMCAT_BASE}\webapps\aegean but that creates
maintenance headaches by coupling the TC directory structure to the web site
directory structure.
 - I have tried building a webapps/aegean directory with just WEB-INF and
adding aegean.xml to {TOMCAT-BASE}\conf\Catalina\localhost containing:



  WEB-INF/web.xml


but all I get is 404 errors and no hint of other errors in the logs. I have
tried a couple of variations with equally poor results.

Thanks for any help you can give

Fritz

-Original Message-
From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED]

Sent: Tuesday, April 19, 2005 1:10 AM
To: 'Tomcat Users List'
Subject: RE: Need help exporting contexts not under webapps/

Not clear what you want.

Send me the details

Where is your static document ( The directory )
How do want to access it ? ( the URL )  
Which version of TOMCAT YOU ARE USING 
Send me your server.xml 

Regards
Guru 

-Original Message-
From: J. Ryan Earl [mailto:[EMAIL PROTECTED] 
Sent: 18 April 2005 19:16
To: tomcat-user@jakarta.apache.org
Subject: Need help exporting contexts not under webapps/


Hello,

I'm in the process of bringing an in-house application up under Tomcat.
Previously we were using Jetty as the servlet container, but for various
reason I'm trying to get said application running with Tomcat 5.5.9 and Java
1.5.0.

The problem I'm having is that there are two directories with a large amount
of static files (pictures, videos, documents, and other forms of media) that
are mounted outside of the webapps/ home.  Under Jetty, there is a
configuration directive that I can use to export these directories under a
URL path.  I'm trying to do that in Tomcat, and the documentation has been
somewhat confusing.

What I've gathered is that this type of configuration should be put under
${CATALINA_HOME}/conf/context.xml however I have been able to do this
successfully.  I've tried putting the following in context.xml but it gives
me errors:




So my question is, in short, given a directory structure of static files,
how do you get Tomcat to serve said static content off of an arbitrary URI?
Ideas?

Thanks in advance,
-ryan


-
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]



RE: Need help exporting contexts not under webapps/

2005-04-19 Thread Fritz Schneider
Guru,

Earl isn't the only one trying to do this. Here are the details for my
attempts which may or may not be similar to his:

 - Running TC 5.5.8, JVM 1.5.0_02-b09 under Win XP Pro SP2
 - I have a set of static pages (starting with index.htm) stored at
C:\www\aegean
 - C:\www\agean\WEB-INF\web.xml contains 
 - I wish to access them as http://www.peacham.com/aegean
 - aegean is just one of many such directories.
 - It works if I copy it to {TOMCAT_BASE}\webapps\aegean but that creates
maintenance headaches by coupling the TC directory structure to the web site
directory structure.
 - I have tried building a webapps/aegean directory with just WEB-INF and
adding aegean.xml to {TOMCAT-BASE}\conf\Catalina\localhost containing:



  WEB-INF/web.xml


but all I get is 404 errors and no hint of other errors in the logs. I have
tried a couple of variations with equally poor results.

Thanks for any help you can give

Fritz

-Original Message-
From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED]

Sent: Tuesday, April 19, 2005 1:10 AM
To: 'Tomcat Users List'
Subject: RE: Need help exporting contexts not under webapps/

Not clear what you want.

Send me the details

Where is your static document ( The directory )
How do want to access it ? ( the URL )  
Which version of TOMCAT YOU ARE USING 
Send me your server.xml 

Regards
Guru 

-Original Message-
From: J. Ryan Earl [mailto:[EMAIL PROTECTED] 
Sent: 18 April 2005 19:16
To: tomcat-user@jakarta.apache.org
Subject: Need help exporting contexts not under webapps/


Hello,

I'm in the process of bringing an in-house application up under Tomcat.
Previously we were using Jetty as the servlet container, but for various
reason I'm trying to get said application running with Tomcat 5.5.9 and Java
1.5.0.

The problem I'm having is that there are two directories with a large amount
of static files (pictures, videos, documents, and other forms of media) that
are mounted outside of the webapps/ home.  Under Jetty, there is a
configuration directive that I can use to export these directories under a
URL path.  I'm trying to do that in Tomcat, and the documentation has been
somewhat confusing.

What I've gathered is that this type of configuration should be put under
${CATALINA_HOME}/conf/context.xml however I have been able to do this
successfully.  I've tried putting the following in context.xml but it gives
me errors:




So my question is, in short, given a directory structure of static files,
how do you get Tomcat to serve said static content off of an arbitrary URI?
Ideas?

Thanks in advance,
-ryan


-
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: Need help exporting contexts not under webapps/

2005-04-19 Thread Raghupathy,Gurumoorthy
Not clear what you want.

Send me the details

Where is your static document ( The directory )
How do want to access it ? ( the URL )  
Which version of TOMCAT YOU ARE USING 
Send me your server.xml 

Regards
Guru 

-Original Message-
From: J. Ryan Earl [mailto:[EMAIL PROTECTED] 
Sent: 18 April 2005 19:16
To: tomcat-user@jakarta.apache.org
Subject: Need help exporting contexts not under webapps/


Hello,

I'm in the process of bringing an in-house application up under Tomcat.
Previously we were using Jetty as the servlet container, but for various
reason I'm trying to get said application running with Tomcat 5.5.9 and Java
1.5.0.

The problem I'm having is that there are two directories with a large amount
of static files (pictures, videos, documents, and other forms of media) that
are mounted outside of the webapps/ home.  Under Jetty, there is a
configuration directive that I can use to export these directories under a
URL path.  I'm trying to do that in Tomcat, and the documentation has been
somewhat confusing.

What I've gathered is that this type of configuration should be put under
${CATALINA_HOME}/conf/context.xml however I have been able to do this
successfully.  I've tried putting the following in context.xml but it gives
me errors:




So my question is, in short, given a directory structure of static files,
how do you get Tomcat to serve said static content off of an arbitrary URI?
Ideas?

Thanks in advance,
-ryan


-
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: Need help exporting contexts not under webapps/

2005-04-18 Thread QM
On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote:
: So my question is, in short, given a directory structure of static files,
: how do you get Tomcat to serve said static content off of an arbitrary URI?

So, are you trying to
1/ have a Tomcat-run webapp serve content that exists outside of the
context path?

2/ setup the static content as its own webapp (context)?


For #1, the (portable, spec-friendly) way is to write a servlet or
filter to intercept requests for a given URI, open the matching file as
an InputStream, and push the data to the client via the Response
OutputStream.

For #2, I don't remember the exact syntax off the top of my head so I
won't waste your time with something that may not work. =) But it's
definitely possible for a webapp to not exist under the "webapps/"
directory.

Just make sure said webapp has a WEB-INF directory and a web.xml.  Even
a web.xml of just

should do.

-QM

-- 

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

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



Need help exporting contexts not under webapps/

2005-04-18 Thread J. Ryan Earl
Hello,

I'm in the process of bringing an in-house application up under Tomcat.
Previously we were using Jetty as the servlet container, but for various
reason I'm trying to get said application running with Tomcat 5.5.9 and Java
1.5.0.

The problem I'm having is that there are two directories with a large amount
of static files (pictures, videos, documents, and other forms of media) that
are mounted outside of the webapps/ home.  Under Jetty, there is a
configuration directive that I can use to export these directories under a
URL path.  I'm trying to do that in Tomcat, and the documentation has been
somewhat confusing.

What I've gathered is that this type of configuration should be put under
${CATALINA_HOME}/conf/context.xml however I have been able to do this
successfully.  I've tried putting the following in context.xml but it gives
me errors:




So my question is, in short, given a directory structure of static files,
how do you get Tomcat to serve said static content off of an arbitrary URI?
Ideas?

Thanks in advance,
-ryan


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



Re: Single Sign On Help

2005-04-18 Thread shyam reddy
I am sorri for the 3 messages. I got a response from the first two messages 
that the message was not delivered as I didnt have an account. So I subcribed 
again and sent the email. Sorri for the trouble
shyam

Jason Bainbridge <[EMAIL PROTECTED]> wrote:
On 4/18/05, shyam reddy wrote:
> 
> Hi all,
> 
> I have two web applications which use the same JDBCRealm. I have tested the 
> realm and it works fine. I commented out the single sign on valve in the 
> server.xml . I tested the links from one application to another. The 
> protected resources still ask for the login information. It would be really 
> helpful if someone could help me out with this. I am using tomcat 5.0.29. I 
> have checked my logs and this is the output I am getting :

Why have you sent three emails about the same thing with different
subjects? It isn't going to help you get a response, if you have more
info to add then reply to your own post and keep it within the same
thread that way you're much more likely to get a response.

Regards,
-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

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



-
Do you Yahoo!?
 Make Yahoo! your home page   

Re: Single Sign On Help

2005-04-18 Thread Jason Bainbridge
On 4/18/05, shyam reddy <[EMAIL PROTECTED]> wrote:
> 
> Hi all,
> 
> I have two web applications which use the same JDBCRealm. I have tested the 
> realm and it works fine. I commented out the single sign on valve in the 
> server.xml . I tested the links from one application to another. The 
> protected resources still ask for the login information. It would be really 
> helpful if someone could help me out with this. I am using tomcat 5.0.29. I 
> have checked my logs and this is the output I am getting :

Why have you sent three emails about the same thing with different
subjects? It isn't going to help you get a response, if you have more
info to add then reply to your own post and keep it within the same
thread that way you're much more likely to get a response.

Regards,
-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

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



Single Sign On Help

2005-04-18 Thread shyam reddy

Hi all,

I have two web applications which use the same JDBCRealm. I have tested the 
realm and it works fine. I commented out the single sign on valve in the 
server.xml . I tested the links from one application to another. The protected 
resources still ask for the login information. It would be really helpful if 
someone could help me out with this. I am using tomcat 5.0.29. I have checked 
my logs and this is the output I am getting :

2005-04-18 10:12:19 SingleSignOn[localhost]:  Checking for SSO cookie
2005-04-18 10:12:19 SingleSignOn[localhost]:  SSO cookie is not present

and this is happening for every request. I checked my broowser settings and it 
allows cookies.

 

Thanks

shyam



Shyam  Gavulla,Software Engineer
www.interviewexchange.com
Boston, MA
USA
phone:617 515 6549






-
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.

RE: Help needed: Setting Tomcat5.5 to run with security manager in Windows XP

2005-04-16 Thread Caldarale, Charles R
> From: Nikolay Karasev [mailto:[EMAIL PROTECTED] 
> Subject: Help needed: Setting Tomcat5.5 to run with security manager
in Windows XP
> 
> however there is no file named "catalina.bat" in this directory.

The .bat files are only in the zip download.  If you're running Tomcat
as a service, there is no .bat file to edit; instead you can use the
Tomcat5w.exe program to set additional parameters (under the Java tab),
or edit the registry.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Help needed: Setting Tomcat5.5 to run with security manager in Windows XP

2005-04-16 Thread Nikolay Karasev
I cannot figure out how to set Tomcat 5.5.7 to be running under security 
manager.
Standard Tomcat help gives option as: %CATALINA_HOME%\bin\catalina start 
-security
however there is no file named "catalina.bat" in this directory. In fact 
there
are only these 4 files: bootstrap.jar, commons-logging-api.jar, tomcat5.exe
and tomcat5w.exe. There is no single *.bat file anywhere under 
%CATALINA_HOME%.

Any help?
Thanks
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Tomcat 4 issue help HTTP 404

2005-04-14 Thread Manoj Thomas
Getting HTTP 404 error while trying to run a servlet.
It says resourse not found
Please help!
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Help with tomcat 5.5

2005-04-13 Thread Anoop kumar V
the classes / jar files available for TC 5.5 are not the same in your
case - Check the commons/lib folder and the web-inf/lib folder.

Make sure all the classes/jar files in the above folders in 5.0 are
available and the same as in 5.5 - my guess is that some are missing
in 5.0.

if that does not solve - them copy paste the exact classNotFound and
someone will be able to help u in finding the right jar.

HTH,
Anoop

On 4/13/05, dummy <[EMAIL PROTECTED]> wrote:
> 
> Problem with tomcat 5.5.
> 
> Application running on tomcat 5.0 fine but when run on tomcat 5.5 alot of
> problem appeared like noclassfound.
> 
> Why is it so ?
> 
> Anybody have the same problem ?
> 
> How to solve ?
> 
> 


-- 
Thanks and best regards,
Anoop

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



Re: tomcat 5.5 help

2005-04-13 Thread David Smith
TC 5.5 moved to being built around JDK 5.  It works in JDK 1.4, but 
needs some extra classes that are included in the JDK 5 download.  What 
JDK are you using and if it's v 1.4, did you download and install the TC 
5.5 compatibility package as well?

--David
dummy wrote:
Problem with tomcat 5.5.
Application running on tomcat 5.0 is fine but when run on tomcat 5.5 alot of
problem appeared like noclassfound etc.
Why is it so ?
Anybody have the same problem ?
How to solve ?
 


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


RE: tomcat 5.5 help

2005-04-13 Thread Pawson, David
Just run through similar checks.

Clean install of 559,
html at /ROOT works
jsp  at webapps//index.jsp works
.class at webapps//WEB-INF/classes works.

Early problem was not using the jar files from 
the new installation for compiling.

Just need to check that logging works.
I think that has changed.

Not sure if that helps.
regards DaveP

-- 
DISCLAIMER:

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged.  If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system.

RNIB endeavours to ensure that emails and any attachments generated by
its staff are free from viruses or other contaminants.  However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent
those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk




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



RE: tomcat 5.5 help

2005-04-13 Thread Dale, Matt

I've had this problem with the activation jar required for emailing. My 
suspicion is that it is from a 1.4 J2EE so there is some funniness going on 
there but I haven't been able to solve it yet.

Would be interested in the answer to this.

Ta
Matt

-Original Message-
From: dummy [mailto:[EMAIL PROTECTED]
Sent: 13 April 2005 10:14
To: 'Tomcat (E-mail)'
Subject: tomcat 5.5 help
Importance: High



Problem with tomcat 5.5.

Application running on tomcat 5.0 is fine but when run on tomcat 5.5 alot of
problem appeared like noclassfound etc.

Why is it so ?

Anybody have the same problem ?

How to solve ?


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



tomcat 5.5 help

2005-04-13 Thread dummy

Problem with tomcat 5.5.

Application running on tomcat 5.0 is fine but when run on tomcat 5.5 alot of
problem appeared like noclassfound etc.

Why is it so ?

Anybody have the same problem ?

How to solve ?



Help with tomcat 5.5

2005-04-12 Thread dummy

Problem with tomcat 5.5.

Application running on tomcat 5.0 fine but when run on tomcat 5.5 alot of
problem appeared like noclassfound.

Why is it so ?

Anybody have the same problem ?

How to solve ?




Re: MISSING jar files and empty directories after installing TOMCAT 5.5.7 Help !!!

2005-04-12 Thread Mark Thomas
Maybe http://marc.theaimsgroup.com/?l=tomcat-user&m=104978978819668&w=2
Mark
Parveen Pasha wrote:
Can someone tell me why these files are missing after
installing tomcat5.5.7?
Installed instatlled tomcat 5.5.7 from
jakarta-tomcat-5.5.7.tar.gz (downloaded from
Apache.org) and installed jdk1.5.0_02
MISSING
jasper-compiler.jar -  

jasper-runtime.jar - 
jsp-api.jar - 

naming-common.jar -  
naming-factory.jar -  
naming-factory-dbcp.jar -  
naming-java.jar -  
naming-resources.jar - 
servlet-api.jar - 
tomcat-i18n-**.jar -   
catalina.jar -  
catalina-ant.jar -  
catalina-optional.jar  
commons-modeler.jar -  
servlets-x.jar -  
tomcat-coyote.jar -  
tomcat-http.jar -  
tomcat-ajp.jar -  
tomcat-util.jar -  

EMPTY DIRECTORIES:
$CATALINA_HOME/common/classes and
$CATALINA_HOME/common/endorsed are empty
$CATALINA_HOME/server/classes,  and
$CATALINA_HOME/server/lib 
$CATALINA_BASE/shared/classes, and
$CATALINA_BASE/shared/lib.

Common - $CATALINA_HOME/commons/i18n has the
following:   tomcat-i18n-en.jar,  tomcat-i18n-es.jar, 
tomcat-i18n-fr.jar and   tomcat-i18n-ja.jar

$CATALINA_HOME/common/lib only includes the following:
commons-el.jar -  
jasper-compiler-jdt.jar


-
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]


MISSING jar files and empty directories after installing TOMCAT 5.5.7 Help !!!

2005-04-12 Thread Parveen Pasha
Can someone tell me why these files are missing after
installing tomcat5.5.7?

Installed instatlled tomcat 5.5.7 from
jakarta-tomcat-5.5.7.tar.gz (downloaded from
Apache.org) and installed jdk1.5.0_02

MISSING
jasper-compiler.jar -  

jasper-runtime.jar - 
jsp-api.jar - 

naming-common.jar -  
naming-factory.jar -  
naming-factory-dbcp.jar -  
naming-java.jar -  
naming-resources.jar - 
servlet-api.jar - 
tomcat-i18n-**.jar -   
catalina.jar -  
catalina-ant.jar -  
catalina-optional.jar  
commons-modeler.jar -  
servlets-x.jar -  
tomcat-coyote.jar -  
tomcat-http.jar -  
tomcat-ajp.jar -  
tomcat-util.jar -  

EMPTY DIRECTORIES:

$CATALINA_HOME/common/classes and
$CATALINA_HOME/common/endorsed are empty
$CATALINA_HOME/server/classes,  and
$CATALINA_HOME/server/lib 
$CATALINA_BASE/shared/classes, and
$CATALINA_BASE/shared/lib.


Common - $CATALINA_HOME/commons/i18n has the
following:   tomcat-i18n-en.jar,  tomcat-i18n-es.jar, 
tomcat-i18n-fr.jar and   tomcat-i18n-ja.jar

$CATALINA_HOME/common/lib only includes the following:


commons-el.jar -  
jasper-compiler-jdt.jar



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



RE: HELP Tomcat CGI

2005-04-12 Thread zhicheng wang
hi,

first you need to test if the script will be happy to
execute: leave it where you want it to be called from
the browser and in shell to type
/path/to/script/test.pl

if it execute, then you know it is your tomcat config
problem. you may need to restart tomcat after change
the .xml file(?)

there is security concern about using cgi, does not
matter with tomcat or apache. but as you know tomcat
can run perl.

good luck

cheng

--- "Raghupathy,Gurumoorthy"
<[EMAIL PROTECTED]> wrote:
> Why don't you run perl in apache and integrate it
> with tomcat ?
> Tomcat should not be used with CGI ( security issues
> ) 
> 
> Guru
> 
> -Original Message-
> From: Scholtyssek Siegfried
> [mailto:[EMAIL PROTECTED] 
> Sent: 11 April 2005 09:29
> To: tomcat-user@jakarta.apache.org
> Subject: HELP Tomcat CGI
> Importance: High
> 
> 
> > Hello,
> > 
> > I use the Apache Tomcat.5.0.16 on the SUNOS 5.8  
> UNIX
> > 
> > With Tomcat we want execute cgi-scripts. So I
> modified all in web.xml
> > and removed the file servlets-cgi.renametojar to
> servlets-cgi.jar
> > If I start with Netscape the follow URL:
> > http://localhost:8080/cgi-bin/test.pl   so I get
> the follow ERROR:
> > 
> > Can't open perl Script ./test.pl No such
> file or direktory
> > Use -S to search $PATH for it.   
> > 
> > If I delete and make a follow link:
> > 
> > rm /usr/bin/perl
> > 
> > ln -s /usr/bin/ksh  /usr/bin/perlthen it is
> running.
> > 
> > Whats wrong ??? What I have to do, that it is
> running with ln -s
> > /usr/local/bin/perl  /usr/bin/perl 
> > 
> > In the first line of the test.pl I have still
> #!/usr/local/bin/perl
> > and I made chmod a+x test.pl and with command from
> xterm I can execute
> > it with the full path from the errormessage Can't
> open perl Script
> > .  !
> > 
> > Please help me because I will be else crazy
> :-)
> > 
> > Thanks and regards
> > 
> > Siggi
> > 
> > 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 

Best wishes
Z C Wang

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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



Help needed with Tomcat 5.5.7 admin app (MBeanServer is not available)

2005-04-11 Thread Fritz Schneider
Simon,

 

I had the same problem. Then I discovered that the admin app had to be
installed under ${Catalina.home}/server/webapps rather than just
${Catalina.home}/webapps. Once I moved the directory to where the Context
docBase said it was supposed to be, it started working.

 

Fritz

  _  

From: Simon Watson <[EMAIL PROTECTED]>
Subject: Help needed with Tomcat 5.5.7 admin app (MBeanServer is not
available)
Date: Sun, 06 Feb 2005 16:18:49 GMT

  _  

Hi there,
 
I've just installed Tomcat 5.5.7 (using the .exe installer on WinXP)
and, whilst the server and manager app work fine, I'm having problems
with the optional admin webapp.
 
I downloaded the admin zip file and extracted the files to the
appropriate locations. The admin app starts ok and I can log in, but
when I click on "Environmental Entries" (or try to add a datasource),
I get a 500 response with the message "MBeanServer is not available"
(stack trace from stdout log below).
 

 



Re: HELP Tomcat CGI

2005-04-11 Thread Mark Thomas
"Should not" is rather strong and a little misleading.
What you need to keep in mind is the warning in the docs.

CAUTION - CGI scripts are used to execute programs external to the 
Tomcat JVM. If you are using the Java SecurityManager this will bypass 
your security policy configuration in catalina.policy.


Mark
Raghupathy,Gurumoorthy wrote:
Why don't you run perl in apache and integrate it with tomcat ?
Tomcat should not be used with CGI ( security issues ) 

Guru
-Original Message-
From: Scholtyssek Siegfried [mailto:[EMAIL PROTECTED] 
Sent: 11 April 2005 09:29
To: tomcat-user@jakarta.apache.org
Subject: HELP Tomcat CGI
Importance: High


Hello,
I use the Apache Tomcat.5.0.16 on the SUNOS 5.8   UNIX
With Tomcat we want execute cgi-scripts. So I modified all in web.xml
and removed the file servlets-cgi.renametojar to servlets-cgi.jar
If I start with Netscape the follow URL:
http://localhost:8080/cgi-bin/test.pl   so I get the follow ERROR:
Can't open perl Script ./test.pl No such file or direktory
Use -S to search $PATH for it.   

If I delete and make a follow link:
rm /usr/bin/perl
ln -s /usr/bin/ksh  /usr/bin/perlthen it is running.
Whats wrong ??? What I have to do, that it is running with ln -s
/usr/local/bin/perl  /usr/bin/perl 

In the first line of the test.pl I have still #!/usr/local/bin/perl
and I made chmod a+x test.pl and with command from xterm I can execute
it with the full path from the errormessage Can't open perl Script
.  !
Please help me because I will be else crazy :-)
Thanks and regards
Siggi


-
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: DBCP Please Help Get Working Properly

2005-04-11 Thread David Smith
Well yes it does make a lot of sense, but is more a question answered by 
design patterns.  It's a little beyond the scope of Tomcat docs to 
address issues like separation of roles.  Both Struts and Spring 
projects address issues like this with the Model-View-Controller (MVC) 
pattern and there are innumerable books on the subject as well.  
Specific to data access methods, Hibernate also addresses this issue.

As far as step by step docs, you are best off picking a framework, 
getting a good book on it and go from there.

Hope this helps.
--David
Scott Purcell wrote:
Thank David for the below information.
This makes some sense, and I will try and make the changes. But this of course 
leads to a follow-up question. Why isn't there any decent documentation to get 
the DBCP running in Tomcat. I am talking about a simple example, that explains 
container versions, jsp versions, possibly better ways to use then putting the 
connection into a JSP page. Connecting in a JSP page is just plain dirty, I 
would like to connect in some class where I can call connections from. Does 
this make sense?
As I mentioned, I followed the example that comes with the documentation for my 
5.5 Tomcat that displays when you go to localhost.
So, is there any good documentation that shows how to do this, step by step?
Thanks,
Scott


-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Monday, April 11, 2005 8:18 AM
To: Tomcat Users List
Subject: Re: DBCP Please Help Get Working Properly
Ok, define 'no results'. In reality, the naming import isn't the only 
thing that changed. Your web.xml file *looks* like 2.3 spec from what I 
can see and you are using JSP 2.x spec syntax in your jsp. If you want 
the JSP 2.x spec features, you need to declare your web.xml file for 
servlet 2.4 spec. This should be up at the top of your web.xml (pasted 
from the specification for servlet 2.4):


http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”;
version=”2.4”>
Then just put all your servlet-mappings, etc., ... after that. The 
taglib declarations need to be inside a  element for the 2.4 
spec web.xml file too. That's how I'm guessing you have a 2.3 spec 
web.xml file. The full spec can be found at 
http://www.jcp.org/en/jsr/detail?id=154

--David
Scott Purcell wrote:
 

Hello,
I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named 
"testDB" and put it under $CATALINA_HOME/webapps/testDB. Then I created a 
testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.
// here it is



I have been following the notes from: 
http://localhost/tomcat-docs/jndi-datasource-examples-howto.html

I made sure I completed the rest of the tasks.
WEB-INF has the two tag locations, and the resource ref.
eg:
  
  /WEB-INF/sql.tld
  /WEB-INF/sql.tld
  
  
  /WEB-INF/c.tld
  /WEB-INF/c.tld
  

DB Connection
jdbc/testDB
javax.sql.DataSource
Container

I finally hit my jsp page which is this:
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>

select id, foo, bar from testdata



  DB Test


Results

  Foo ${row.foo}
  Bar ${row.bar}



And I get no results:
Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat 
4.1) code piece I had, I get results using the same settings:
package foo;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class DBTest {
String foo = "Not Connected";
int bar = -1;
  
public void init() {
  try{
Context ctx = new InitialContext();
if(ctx == null ) 
throw new Exception("Boom - No Context");

DataSource ds = 
  (DataSource)ctx.lookup(
 "java:comp/env/jdbc/testDB");

if (ds != null) {
  Connection conn = ds.getConnection();

  if(conn != null)  {
  foo = "Got Connection "+conn.toString();
  Statement stmt = conn.createStatement();
  ResultSet rst = 
  stmt.executeQuery(
"select id, foo, bar from testdata");
  while(rst.next()) {
 System.out.println("next ");
 foo=rst.getString(2);
 bar=rst.getInt(3);
  }
  conn.close();
  }
}
  }catch(Exception e) {
e.printStackTrace();
  }
}

public String getFoo() { return foo; }
public int getBar() { return bar;}
}
And using the above class works all day.
The only difference I see is that the class using a "naming" import and the jsp 
does not. Can anyone help.
Thanks,
Scott




-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 1:14 PM
To: Tom

RE: DBCP Please Help Get Working Properly

2005-04-11 Thread Scott Purcell
Thank David for the below information.

This makes some sense, and I will try and make the changes. But this of course 
leads to a follow-up question. Why isn't there any decent documentation to get 
the DBCP running in Tomcat. I am talking about a simple example, that explains 
container versions, jsp versions, possibly better ways to use then putting the 
connection into a JSP page. Connecting in a JSP page is just plain dirty, I 
would like to connect in some class where I can call connections from. Does 
this make sense?

As I mentioned, I followed the example that comes with the documentation for my 
5.5 Tomcat that displays when you go to localhost.

So, is there any good documentation that shows how to do this, step by step?


Thanks,
Scott






-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Monday, April 11, 2005 8:18 AM
To: Tomcat Users List
Subject: Re: DBCP Please Help Get Working Properly


Ok, define 'no results'. In reality, the naming import isn't the only 
thing that changed. Your web.xml file *looks* like 2.3 spec from what I 
can see and you are using JSP 2.x spec syntax in your jsp. If you want 
the JSP 2.x spec features, you need to declare your web.xml file for 
servlet 2.4 spec. This should be up at the top of your web.xml (pasted 
from the specification for servlet 2.4):



http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”;
version=”2.4”>

Then just put all your servlet-mappings, etc., ... after that. The 
taglib declarations need to be inside a  element for the 2.4 
spec web.xml file too. That's how I'm guessing you have a 2.3 spec 
web.xml file. The full spec can be found at 
http://www.jcp.org/en/jsr/detail?id=154

--David

Scott Purcell wrote:

>Hello,
>
>I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named 
>"testDB" and put it under $CATALINA_HOME/webapps/testDB. Then I created a 
>testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.
>
>// here it is
>debug="5" reloadable="true" crossContext="true">
>
> maxActive="100" maxIdle="30" maxWait="1"
>   username="javauser" password="javadude" 
> driverClassName="com.mysql.jdbc.Driver"
>   url="jdbc:mysql://localhost:3306/fritest?autoReconnect=true"/>
>
>
>I have been following the notes from: 
>http://localhost/tomcat-docs/jndi-datasource-examples-howto.html
>
>I made sure I completed the rest of the tasks.
>WEB-INF has the two tag locations, and the resource ref.
>eg:
>
>
>/WEB-INF/sql.tld
>/WEB-INF/sql.tld
>
>
>
>
>/WEB-INF/c.tld
>/WEB-INF/c.tld
>
>
>  
>  DB Connection
>  jdbc/testDB
>  javax.sql.DataSource
>  Container
>  
>
>I finally hit my jsp page which is this:
><%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
><%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
>
>
>select id, foo, bar from testdata
>
>
>
>  
>DB Test
>  
>  
>
>  Results
>  
>
>Foo ${row.foo}
>Bar ${row.bar}
>
>
>
>  
>
>
>And I get no results:
>
>Now I am pretty sure I have all configured. Because if I use a fallback 
>(Tomcat 4.1) code piece I had, I get results using the same settings:
>
>package foo;
>
>import javax.naming.*;
>import javax.sql.*;
>import java.sql.*;
>
>public class DBTest {
>
>  String foo = "Not Connected";
>  int bar = -1;
>
>  public void init() {
>try{
>  Context ctx = new InitialContext();
>  if(ctx == null ) 
>  throw new Exception("Boom - No Context");
>
>  DataSource ds = 
>(DataSource)ctx.lookup(
>   "java:comp/env/jdbc/testDB");
>
>  if (ds != null) {
>Connection conn = ds.getConnection();
>  
>if(conn != null)  {
>foo = "Got Connection "+conn.toString();
>Statement stmt = conn.createStatement();
>ResultSet rst = 
>stmt.executeQuery(
>      "select id, foo, bar from testdata");
>while(rst.next()) {
>   System.out.println("next ");
>   foo=rst.getString(2);
>   bar=rst.getInt(3);
>}
>conn.close();
>}
>  }
>}catch(Exception e) {
&g

Re: DBCP Please Help Get Working Properly

2005-04-11 Thread David Smith
Ok, define 'no results'. In reality, the naming import isn't the only 
thing that changed. Your web.xml file *looks* like 2.3 spec from what I 
can see and you are using JSP 2.x spec syntax in your jsp. If you want 
the JSP 2.x spec features, you need to declare your web.xml file for 
servlet 2.4 spec. This should be up at the top of your web.xml (pasted 
from the specification for servlet 2.4):


http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”;
version=”2.4”>
Then just put all your servlet-mappings, etc., ... after that. The 
taglib declarations need to be inside a  element for the 2.4 
spec web.xml file too. That's how I'm guessing you have a 2.3 spec 
web.xml file. The full spec can be found at 
http://www.jcp.org/en/jsr/detail?id=154

--David
Scott Purcell wrote:
Hello,
I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named 
"testDB" and put it under $CATALINA_HOME/webapps/testDB. Then I created a 
testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.
// here it is

 

I have been following the notes from: 
http://localhost/tomcat-docs/jndi-datasource-examples-howto.html

I made sure I completed the rest of the tasks.
WEB-INF has the two tag locations, and the resource ref.
eg:
   
   /WEB-INF/sql.tld
   /WEB-INF/sql.tld
   
   
   /WEB-INF/c.tld
   /WEB-INF/c.tld
   
 
 DB Connection
 jdbc/testDB
 javax.sql.DataSource
 Container
 
I finally hit my jsp page which is this:
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>

select id, foo, bar from testdata


 
   DB Test
 
 
 Results
 

   Foo ${row.foo}
   Bar ${row.bar}


 

And I get no results:
Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat 
4.1) code piece I had, I get results using the same settings:
package foo;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class DBTest {
 String foo = "Not Connected";
 int bar = -1;
   
 public void init() {
   try{
 Context ctx = new InitialContext();
 if(ctx == null ) 
 throw new Exception("Boom - No Context");

 DataSource ds = 
   (DataSource)ctx.lookup(
  "java:comp/env/jdbc/testDB");

 if (ds != null) {
   Connection conn = ds.getConnection();
 
   if(conn != null)  {
   foo = "Got Connection "+conn.toString();
   Statement stmt = conn.createStatement();
   ResultSet rst = 
   stmt.executeQuery(
 "select id, foo, bar from testdata");
   while(rst.next()) {
  System.out.println("next ");
  foo=rst.getString(2);
  bar=rst.getInt(3);
   }
   conn.close();
   }
 }
   }catch(Exception e) {
 e.printStackTrace();
   }
}

public String getFoo() { return foo; }
public int getBar() { return bar;}
}
And using the above class works all day.
The only difference I see is that the class using a "naming" import and the jsp 
does not. Can anyone help.
Thanks,
Scott




-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 1:14 PM
To: Tomcat Users List
Subject: Re: Add Context Path, Tomcat 5.5.7
Hi.
Take a look at this for where to put  elements:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
This is new with Tomcat 5.0 and is continued in Tomcat 5.5
--David
Scott Purcell wrote:
 

Hello,
I am following the information here to add DBCP to my application.
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
I am reading to add the 
Configure the JNDI DataSource in Tomcat by adding a declaration for your 
resource to $CATALINA_HOME/conf/server.xml.
Add this in between the  tag of the examples context and the  
tag closing the localhost definition.

So cool, I opened up the server.xml, but do not see any existing context or 
host tags in it. Here is my server.xml file. Does anyone know where I put the 
Context for the DBCP stuff? Thanks,
'










  
  
  
  




  
  
  
  


  
  

  
  

  
  
  

  
   
   
  
  














   
  
  
  


  
  
  
  
  
  

  




Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com <http://www.vertisinc.com/>  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

RE: HELP Tomcat CGI

2005-04-11 Thread Raghupathy,Gurumoorthy
Why don't you run perl in apache and integrate it with tomcat ?
Tomcat should not be used with CGI ( security issues ) 

Guru

-Original Message-
From: Scholtyssek Siegfried [mailto:[EMAIL PROTECTED] 
Sent: 11 April 2005 09:29
To: tomcat-user@jakarta.apache.org
Subject: HELP Tomcat CGI
Importance: High


> Hello,
> 
> I use the Apache Tomcat.5.0.16 on the SUNOS 5.8   UNIX
> 
> With Tomcat we want execute cgi-scripts. So I modified all in web.xml
> and removed the file servlets-cgi.renametojar to servlets-cgi.jar
> If I start with Netscape the follow URL:
> http://localhost:8080/cgi-bin/test.pl   so I get the follow ERROR:
> 
> Can't open perl Script ./test.pl No such file or direktory
> Use -S to search $PATH for it.   
> 
> If I delete and make a follow link:
> 
> rm /usr/bin/perl
> 
> ln -s /usr/bin/ksh  /usr/bin/perlthen it is running.
> 
> Whats wrong ??? What I have to do, that it is running with ln -s
> /usr/local/bin/perl  /usr/bin/perl 
> 
> In the first line of the test.pl I have still #!/usr/local/bin/perl
> and I made chmod a+x test.pl and with command from xterm I can execute
> it with the full path from the errormessage Can't open perl Script
> .  !
> 
> Please help me because I will be else crazy :-)
> 
> Thanks and regards
> 
> Siggi
> 
> 

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



HELP Tomcat CGI

2005-04-11 Thread Scholtyssek Siegfried
> Hello,
> 
> I use the Apache Tomcat.5.0.16 on the SUNOS 5.8   UNIX
> 
> With Tomcat we want execute cgi-scripts. So I modified all in web.xml
> and removed the file servlets-cgi.renametojar to servlets-cgi.jar
> If I start with Netscape the follow URL:
> http://localhost:8080/cgi-bin/test.pl   so I get the follow ERROR:
> 
> Can't open perl Script ./test.pl No such file or direktory
> Use -S to search $PATH for it.   
> 
> If I delete and make a follow link:
> 
> rm /usr/bin/perl
> 
> ln -s /usr/bin/ksh  /usr/bin/perlthen it is running.
> 
> Whats wrong ??? What I have to do, that it is running with ln -s
> /usr/local/bin/perl  /usr/bin/perl 
> 
> In the first line of the test.pl I have still #!/usr/local/bin/perl
> and I made chmod a+x test.pl and with command from xterm I can execute
> it with the full path from the errormessage Can't open perl Script
> .  !
> 
> Please help me because I will be else crazy :-)
> 
> Thanks and regards
> 
> Siggi
> 
> 


RE: DBCP Please Help Get Working Properly

2005-04-08 Thread Jay Burgess
My apologies, we're using 5.0.x and I hadn't realized they went away.  But maybe
the logs still will provide some useful info?

Jay
Vertical Technology Group
http://www.vtgroup.com/


 

-Original Message-
From: Robert Harrison [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 4:20 PM
To: Tomcat Users List
Subject: Re: DBCP Please Help Get Working Properly

Aren't debug levels in TC 5.5  inactive? Will need to set up log4j.

Bob

On Apr 8, 2005 5:15 PM, Jay Burgess <[EMAIL PROTECTED]> wrote:
> Do you have anything in your Tomcat log files that might help?  If not, you 
> can
> bump up the debug levels in server.xml and you might get some more info.
> 
> I also found that adding one of the two following listeners in my server.xml
> helped me debug my DBCP problems (I don't remember which one I added, but it
> should be obvious):
> 
>   className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
>  debug="9"/>
>   className="org.apache.catalina.core.NamingContextListener"
>  debug="9"/>
> 
> Jay
> Vertical Technology Group
> http://www.vtgroup.com/
> 
> 
> -Original Message-
> From: Scott Purcell [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 3:08 PM
> To: Tomcat Users List
> Subject: DBCP Please Help Get Working Properly
> 
> Hello,
> 
> I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named
> "testDB" and put it under $CATALINA_HOME/webapps/testDB. Then I created a
> testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.
> 
> // here it is
>  debug="5" reloadable="true" crossContext="true">
> 
>   maxActive="100" maxIdle="30" maxWait="1"
>username="javauser" password="javadude"
> driverClassName="com.mysql.jdbc.Driver"
>url="jdbc:mysql://localhost:3306/fritest?autoReconnect=true"/>
> 
> 
> I have been following the notes from:
> http://localhost/tomcat-docs/jndi-datasource-examples-howto.html
> 
> I made sure I completed the rest of the tasks.
> WEB-INF has the two tag locations, and the resource ref.
> eg:
> 
> 
> /WEB-INF/sql.tld
> /WEB-INF/sql.tld
> 
> 
> 
> /WEB-INF/c.tld
> /WEB-INF/c.tld
> 
> 
>   
>   DB Connection
>   jdbc/testDB
>   javax.sql.DataSource
>   Container
>   
> 
> I finally hit my jsp page which is this:
> <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
> 
> 
> select id, foo, bar from testdata
> 
> 
> 
>   
> DB Test
>   
>   
> 
>   Results
> 
> 
> Foo ${row.foo}
> Bar ${row.bar}
> 
> 
>   
> 
> 
> And I get no results:
> 
> Now I am pretty sure I have all configured. Because if I use a fallback 
> (Tomcat
> 4.1) code piece I had, I get results using the same settings:
> 
> package foo;
> 
> import javax.naming.*;
> import javax.sql.*;
> import java.sql.*;
> 
> public class DBTest {
> 
>   String foo = "Not Connected";
>   int bar = -1;
> 
>   public void init() {
> try{
>   Context ctx = new InitialContext();
>   if(ctx == null )
>   throw new Exception("Boom - No Context");
> 
>   DataSource ds =
> (DataSource)ctx.lookup(
>"java:comp/env/jdbc/testDB");
> 
>   if (ds != null) {
> Connection conn = ds.getConnection();
> 
> if(conn != null)  {
> foo = "Got Connection "+conn.toString();
> Statement stmt = conn.createStatement();
> ResultSet rst =
> stmt.executeQuery(
>   "select id, foo, bar from testdata");
> while(rst.next()) {
>System.out.println("next ");
>foo=rst.getString(2);
>bar=rst.getInt(3);
> }
> conn.close();
> }
>   }
> }catch(Exception e) {
>   e.printStackTrace();
> }
>  }
> 
>  public String getFoo() { return foo; }
>  public int getBar() { return bar;}
> }
> 
> And using the above class works all day.
> 
> The only difference I see is that the class using a "naming" import and the 
> jsp
> does not. Can anyone help.
> 
> Thanks,
> Scott
> 
> -Original Message-
> From: David Smi

Re: DBCP Please Help Get Working Properly

2005-04-08 Thread Robert Harrison
Aren't debug levels in TC 5.5  inactive? Will need to set up log4j.

Bob

On Apr 8, 2005 5:15 PM, Jay Burgess <[EMAIL PROTECTED]> wrote:
> Do you have anything in your Tomcat log files that might help?  If not, you 
> can
> bump up the debug levels in server.xml and you might get some more info.
> 
> I also found that adding one of the two following listeners in my server.xml
> helped me debug my DBCP problems (I don't remember which one I added, but it
> should be obvious):
> 
>   className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
>  debug="9"/>
>   className="org.apache.catalina.core.NamingContextListener"
>  debug="9"/>
> 
> Jay
> Vertical Technology Group
> http://www.vtgroup.com/
> 
> 
> -Original Message-
> From: Scott Purcell [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 3:08 PM
> To: Tomcat Users List
> Subject: DBCP Please Help Get Working Properly
> 
> Hello,
> 
> I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named
> "testDB" and put it under $CATALINA_HOME/webapps/testDB. Then I created a
> testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.
> 
> // here it is
>  debug="5" reloadable="true" crossContext="true">
> 
>   maxActive="100" maxIdle="30" maxWait="1"
>username="javauser" password="javadude"
> driverClassName="com.mysql.jdbc.Driver"
>url="jdbc:mysql://localhost:3306/fritest?autoReconnect=true"/>
> 
> 
> I have been following the notes from:
> http://localhost/tomcat-docs/jndi-datasource-examples-howto.html
> 
> I made sure I completed the rest of the tasks.
> WEB-INF has the two tag locations, and the resource ref.
> eg:
> 
> 
> /WEB-INF/sql.tld
> /WEB-INF/sql.tld
> 
> 
> 
> /WEB-INF/c.tld
> /WEB-INF/c.tld
> 
> 
>   
>   DB Connection
>   jdbc/testDB
>   javax.sql.DataSource
>   Container
>   
> 
> I finally hit my jsp page which is this:
> <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
> 
> 
> select id, foo, bar from testdata
> 
> 
> 
>   
> DB Test
>   
>   
> 
>   Results
> 
> 
> Foo ${row.foo}
> Bar ${row.bar}
> 
> 
>   
> 
> 
> And I get no results:
> 
> Now I am pretty sure I have all configured. Because if I use a fallback 
> (Tomcat
> 4.1) code piece I had, I get results using the same settings:
> 
> package foo;
> 
> import javax.naming.*;
> import javax.sql.*;
> import java.sql.*;
> 
> public class DBTest {
> 
>   String foo = "Not Connected";
>   int bar = -1;
> 
>   public void init() {
> try{
>   Context ctx = new InitialContext();
>   if(ctx == null )
>   throw new Exception("Boom - No Context");
> 
>   DataSource ds =
> (DataSource)ctx.lookup(
>"java:comp/env/jdbc/testDB");
> 
>   if (ds != null) {
> Connection conn = ds.getConnection();
> 
> if(conn != null)  {
> foo = "Got Connection "+conn.toString();
> Statement stmt = conn.createStatement();
> ResultSet rst =
> stmt.executeQuery(
>   "select id, foo, bar from testdata");
> while(rst.next()) {
>System.out.println("next ");
>foo=rst.getString(2);
>bar=rst.getInt(3);
> }
> conn.close();
> }
>   }
> }catch(Exception e) {
>   e.printStackTrace();
> }
>  }
> 
>  public String getFoo() { return foo; }
>  public int getBar() { return bar;}
> }
> 
> And using the above class works all day.
> 
> The only difference I see is that the class using a "naming" import and the 
> jsp
> does not. Can anyone help.
> 
> Thanks,
> Scott
> 
> -Original Message-
> From: David Smith [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 1:14 PM
> To: Tomcat Users List
> Subject: Re: Add Context Path, Tomcat 5.5.7
> 
> Hi.
> 
> Take a look at this for where to put  elements:
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
> 
> This is new with Tomcat 5.0 and is continued in Tomc

RE: DBCP Please Help Get Working Properly

2005-04-08 Thread Jay Burgess
Do you have anything in your Tomcat log files that might help?  If not, you can
bump up the debug levels in server.xml and you might get some more info.  

I also found that adding one of the two following listeners in my server.xml
helped me debug my DBCP problems (I don't remember which one I added, but it
should be obvious):




Jay
Vertical Technology Group
http://www.vtgroup.com/

 

-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 3:08 PM
To: Tomcat Users List
Subject: DBCP Please Help Get Working Properly

Hello,

I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named
"testDB" and put it under $CATALINA_HOME/webapps/testDB. Then I created a
testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.

// here it is


  


I have been following the notes from: 
http://localhost/tomcat-docs/jndi-datasource-examples-howto.html

I made sure I completed the rest of the tasks.
WEB-INF has the two tag locations, and the resource ref.
eg:


/WEB-INF/sql.tld
/WEB-INF/sql.tld




/WEB-INF/c.tld
/WEB-INF/c.tld


  
  DB Connection
  jdbc/testDB
  javax.sql.DataSource
  Container
  

I finally hit my jsp page which is this:
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>


select id, foo, bar from testdata



  
DB Test
  
  

  Results
  

Foo ${row.foo}
Bar ${row.bar}



  


And I get no results:

Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat
4.1) code piece I had, I get results using the same settings:

package foo;

import javax.naming.*;
import javax.sql.*;
import java.sql.*;

public class DBTest {

  String foo = "Not Connected";
  int bar = -1;

  public void init() {
try{
  Context ctx = new InitialContext();
  if(ctx == null ) 
  throw new Exception("Boom - No Context");

  DataSource ds = 
(DataSource)ctx.lookup(
   "java:comp/env/jdbc/testDB");

  if (ds != null) {
Connection conn = ds.getConnection();
  
if(conn != null)  {
foo = "Got Connection "+conn.toString();
Statement stmt = conn.createStatement();
ResultSet rst = 
stmt.executeQuery(
  "select id, foo, bar from testdata");
while(rst.next()) {
   System.out.println("next ");
   foo=rst.getString(2);
   bar=rst.getInt(3);
}
conn.close();
}
  }
}catch(Exception e) {
  e.printStackTrace();
}
 }

 public String getFoo() { return foo; }
 public int getBar() { return bar;}
}

And using the above class works all day.

The only difference I see is that the class using a "naming" import and the jsp
does not. Can anyone help.


Thanks,
Scott









-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 1:14 PM
To: Tomcat Users List
Subject: Re: Add Context Path, Tomcat 5.5.7


Hi.

Take a look at this for where to put  elements:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

This is new with Tomcat 5.0 and is continued in Tomcat 5.5

--David

Scott Purcell wrote:

>Hello,
> 
>I am following the information here to add DBCP to my application.
>http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
> 
>I am reading to add the  
>Configure the JNDI DataSource in Tomcat by adding a declaration for your
resource to $CATALINA_HOME/conf/server.xml.
>
>Add this in between the  tag of the examples context and the 
tag closing the localhost definition.
>
> 
>
>So cool, I opened up the server.xml, but do not see any existing context or
host tags in it. Here is my server.xml file. Does anyone know where I put the
Context for the DBCP stuff? Thanks,
>
>'
>
> 
>
> 
>
> 
>  
>  
>  
>  
> 
>  
>  
> 
>
>
> 
>
>  type="org.apache.catalina.UserDatabase"
>   description="User database that can be updated and saved"
>   factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>  pathname="conf/tomcat-users.xml" />
> 
>  
> 
>  
> 
>  
>  
> 
>
> 
>
>port="80"   maxThreads="150" minSpareThreads="25" 
>maxSpareThreads="75"
>   enableLookups="false" redirectPort="8443" acceptCount="100"
>   connectionTimeout="2" disableUploadTimeout="true"

RE: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Caldarale, Charles R
> From: Parveen Pasha [mailto:[EMAIL PROTECTED] 
> Subject: RE: Help !!! Tomcat 5.5.7 - cannot start
> 
> The output from catalina.out is :
> java.lang.ClassNotFoundException:
> org.apache.catalina.startup.Catalina
> at
> java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at
> java.security.AccessController.doPrivileged(Native Method)

Does the user doing the shutdown have proper access to the Tomcat files?
That particular class comes from catalina.jar in the
$CATALINA_HOME/server/lib directory.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Caldarale, Charles R
> From: Anoop kumar V [mailto:[EMAIL PROTECTED] 
> Subject: Re: Help !!! Tomcat 5.5.7 - cannot start
> 
> The jars that have been added to the classpath are shown - 
> ensure that u have catalina.jar or j2ee.jar.

Sorry, but that advice is simply wrong and following it can produce
serious Tomcat classloading problems.  If you are using the standard
startup and shutdown scripts supplied with the Tomcat download, the
CLASSPATH environment variable is not used.  Instead, the scripts set
the -cp parameter based on CATALINA_HOME, and the only item that should
be specified there is bootstrap.jar from $CATALINA_HOME/bin.

Tomcat does not need the j2ee.jar at all, and placing it within the
Tomcat environment can cause duplicate class problems with the subset of
J2EE that is already included in the Tomcat download.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Parveen Pasha
The output from catalina.out is :
java.lang.ClassNotFoundException:
org.apache.catalina.startup.Catalina
at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)

--- "Trice, Jim" <[EMAIL PROTECTED]> wrote:

> Sorry I meant $CATALINA_BASE/logs/catalina.out.
> 
> -Original Message-
> From: Trice, Jim [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 08, 2005 2:46 PM
> To: Tomcat Users List
> Subject: RE: Help !!! Tomcat 5.5.7 - cannot start
> 
> Look in $CATALINA_BASE/catalina.out for the startup
> error. The script
> redirects STDOUT and STDERR on startup but not
> shutdown.
> JT
> 
> -Original Message-
> From: Parveen Pasha [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 08, 2005 1:48 PM
> To: Tomcat Users List; Robert Harrison
> Subject: Re: Help !!! Tomcat 5.5.7 - cannot start
> 
> I am installing all this for the first time.
> 
> Where do you set the classpath, to include the
> catalina.jar? How do I know if tomcat is running?
> 
> ps -ef | grep tomcat yields the same result. Do not
> see any pid the output is a set of paths that has
> tomcat in it.
> 
> $JAVA_HOME and $CATLINA_HOME are set correctly.
> 
> I may have said it wrong that it is during startup I
> get the error. It is actually during execution of
> shutdown.sh. Sorry about that.
> 
> When I do:
> su - tomcat -c
>
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/startup.sh
> 
> I get:
> 
> Using CATALINA_BASE:  
> /usr/local/tomcat/jakarta-tomcat-5.5.7
> Using CATALINA_HOME:  
> /usr/local/tomcat/jakarta-tomcat-5.5.7
> Using CATALINA_TMPDIR:
> /usr/local/tomcat/jakarta-tomcat-5.5.7/temp
> Using JRE_HOME:   /usr/java/jdk1.5.0_02
> 
> [EMAIL PROTECTED] ~]# su - tomcat -c
>
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/shutdown.sh
> 
> I get:
> 
> Using CATALINA_BASE:  
> /usr/local/tomcat/jakarta-tomcat-5.5.7
> Using CATALINA_HOME:  
> /usr/local/tomcat/jakarta-tomcat-5.5.7
> Using CATALINA_TMPDIR:
> /usr/local/tomcat/jakarta-tomcat-5.5.7/temp
> Using JRE_HOME:   /usr/java/jdk1.5.0_02
> java.lang.ClassNotFoundException:
> org.apache.catalina.startup.Catalina
> at
>
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at
> java.security.AccessController.doPrivileged(Native
> Method)
> at
>
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at
>
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at
>
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
>
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
> at
>
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)
> 
> 
> --- Robert Harrison <[EMAIL PROTECTED]> wrote:
> > Does "echo $JAVA_HOME" show it set correctly?
> > Bob
> > 
> > On Apr 8, 2005 1:28 PM, Anoop kumar V
> > <[EMAIL PROTECTED]> wrote:
> > > Just make sure you have included catalina.jar
> file
> > in the classpath.
> > > 
> > > -Anoop
> > > 
> > > On Apr 8, 2005 1:23 PM, Parveen Pasha
> > <[EMAIL PROTECTED]> wrote:
> > > > Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02
> > > >
> > > > Changed the port to 8090 from the default 8080
> > > > port in server.xml.
> > > >
> > > > Did not install the runtime environment. only
> > > > installed jdk1.5.02 using the
> > > > rpm -iv jdk-1_5_0_02-linux-i586-rpm
> > > >
> > > > When I execute the startup.sh script, I
> receive
> > the
> > > > following error in Catalina.out
> > > >
> > > > java.lang.ClassNotFoundException:
> > > > org.apache.catalina.startup.Catalina
> > > > at
> > > >
> >
>
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > > > at
> > > >
> > java.security.AccessController.doPrivileged(Native
> > > > Method)
> > > > at
> > > >
> >
>
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > > > at
> > > >
> >
>
java.lang.ClassLoad

DBCP Please Help Get Working Properly

2005-04-08 Thread Scott Purcell
Hello,

I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named 
"testDB" and put it under $CATALINA_HOME/webapps/testDB. Then I created a 
testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.

// here it is


  


I have been following the notes from: 
http://localhost/tomcat-docs/jndi-datasource-examples-howto.html

I made sure I completed the rest of the tasks.
WEB-INF has the two tag locations, and the resource ref.
eg:


/WEB-INF/sql.tld
/WEB-INF/sql.tld




/WEB-INF/c.tld
/WEB-INF/c.tld


  
  DB Connection
  jdbc/testDB
  javax.sql.DataSource
  Container
  

I finally hit my jsp page which is this:
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>


select id, foo, bar from testdata



  
DB Test
  
  

  Results
  

Foo ${row.foo}
Bar ${row.bar}



  


And I get no results:

Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat 
4.1) code piece I had, I get results using the same settings:

package foo;

import javax.naming.*;
import javax.sql.*;
import java.sql.*;

public class DBTest {

  String foo = "Not Connected";
  int bar = -1;

  public void init() {
try{
  Context ctx = new InitialContext();
  if(ctx == null ) 
  throw new Exception("Boom - No Context");

  DataSource ds = 
(DataSource)ctx.lookup(
   "java:comp/env/jdbc/testDB");

  if (ds != null) {
Connection conn = ds.getConnection();
  
if(conn != null)  {
foo = "Got Connection "+conn.toString();
Statement stmt = conn.createStatement();
ResultSet rst = 
stmt.executeQuery(
  "select id, foo, bar from testdata");
while(rst.next()) {
   System.out.println("next ");
   foo=rst.getString(2);
   bar=rst.getInt(3);
}
conn.close();
}
  }
}catch(Exception e) {
  e.printStackTrace();
}
 }

 public String getFoo() { return foo; }
 public int getBar() { return bar;}
}

And using the above class works all day.

The only difference I see is that the class using a "naming" import and the jsp 
does not. Can anyone help.


Thanks,
Scott









-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 1:14 PM
To: Tomcat Users List
Subject: Re: Add Context Path, Tomcat 5.5.7


Hi.

Take a look at this for where to put  elements:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

This is new with Tomcat 5.0 and is continued in Tomcat 5.5

--David

Scott Purcell wrote:

>Hello,
> 
>I am following the information here to add DBCP to my application.
>http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
> 
>I am reading to add the instructions say to ".
> 
>Configure the JNDI DataSource in Tomcat by adding a declaration for your 
>resource to $CATALINA_HOME/conf/server.xml.
>
>Add this in between the  tag of the examples context and the  
>tag closing the localhost definition.
>
> 
>
>So cool, I opened up the server.xml, but do not see any existing context or 
>host tags in it. Here is my server.xml file. Does anyone know where I put the 
>Context for the DBCP stuff? Thanks,
>
>'
>
> 
>
> 
>
> 
>  
>  
>   className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>   className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
> 
>  
>  
> 
>
>
> 
>
>  type="org.apache.catalina.UserDatabase"
>   description="User database that can be updated and saved"
>   factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>  pathname="conf/tomcat-users.xml" />
> 
>  
> 
>  
> 
>  
>  
> 
>
> 
>
>port="80"   maxThreads="150" minSpareThreads="25" 
>maxSpareThreads="75"
>   enableLookups="false" redirectPort="8443" acceptCount="100"
>   connectionTimeout="2" disableUploadTimeout="true" />
>
> 
> 
> 
>
>
> 
>
>   enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
> 
>
>
>
> 
>
> 
> 
> 
>
>
> 
>  
>  
> 
>  
> 
>  
&

RE: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Trice, Jim
Sorry I meant $CATALINA_BASE/logs/catalina.out.

-Original Message-
From: Trice, Jim [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 2:46 PM
To: Tomcat Users List
Subject: RE: Help !!! Tomcat 5.5.7 - cannot start

Look in $CATALINA_BASE/catalina.out for the startup error. The script
redirects STDOUT and STDERR on startup but not shutdown.
JT

-Original Message-
From: Parveen Pasha [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 1:48 PM
To: Tomcat Users List; Robert Harrison
Subject: Re: Help !!! Tomcat 5.5.7 - cannot start

I am installing all this for the first time.

Where do you set the classpath, to include the
catalina.jar? How do I know if tomcat is running?

ps -ef | grep tomcat yields the same result. Do not
see any pid the output is a set of paths that has
tomcat in it.

$JAVA_HOME and $CATLINA_HOME are set correctly.

I may have said it wrong that it is during startup I
get the error. It is actually during execution of
shutdown.sh. Sorry about that.

When I do:
su - tomcat -c
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/startup.sh

I get:

Using CATALINA_BASE:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_HOME:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR:
/usr/local/tomcat/jakarta-tomcat-5.5.7/temp
Using JRE_HOME:   /usr/java/jdk1.5.0_02

[EMAIL PROTECTED] ~]# su - tomcat -c
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/shutdown.sh

I get:

Using CATALINA_BASE:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_HOME:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR:
/usr/local/tomcat/jakarta-tomcat-5.5.7/temp
Using JRE_HOME:   /usr/java/jdk1.5.0_02
java.lang.ClassNotFoundException:
org.apache.catalina.startup.Catalina
at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)


--- Robert Harrison <[EMAIL PROTECTED]> wrote:
> Does "echo $JAVA_HOME" show it set correctly?
> Bob
> 
> On Apr 8, 2005 1:28 PM, Anoop kumar V
> <[EMAIL PROTECTED]> wrote:
> > Just make sure you have included catalina.jar file
> in the classpath.
> > 
> > -Anoop
> > 
> > On Apr 8, 2005 1:23 PM, Parveen Pasha
> <[EMAIL PROTECTED]> wrote:
> > > Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02
> > >
> > > Changed the port to 8090 from the default 8080
> > > port in server.xml.
> > >
> > > Did not install the runtime environment. only
> > > installed jdk1.5.02 using the
> > > rpm -iv jdk-1_5_0_02-linux-i586-rpm
> > >
> > > When I execute the startup.sh script, I receive
> the
> > > following error in Catalina.out
> > >
> > > java.lang.ClassNotFoundException:
> > > org.apache.catalina.startup.Catalina
> > > at
> > >
>
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > > at
> > >
> java.security.AccessController.doPrivileged(Native
> > > Method)
> > > at
> > >
>
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > > at
> > >
>
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > > at
> > >
>
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> > > at
> > >
>
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
> > > at
> > >
>
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)
> > >
> > > Cannot view the default web applications
> included with
> > > Tomcat when accessing via  http://localhost:8090
> > >
> > > I receive the following message: The page cannot
> be
> > > displayed.
> > >
> > > I did not find any solution on the Web. Can
> someone
> > > help.
> > >
> > > Thanks! Thanks! 
> > >
> > > Parveen
> > >
> > >
>
-
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> > 
> > --
> > Thanks and best regards,
> > Anoop
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMA

RE: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Trice, Jim
Look in $CATALINA_BASE/catalina.out for the startup error. The script
redirects STDOUT and STDERR on startup but not shutdown.
JT

-Original Message-
From: Parveen Pasha [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 1:48 PM
To: Tomcat Users List; Robert Harrison
Subject: Re: Help !!! Tomcat 5.5.7 - cannot start

I am installing all this for the first time.

Where do you set the classpath, to include the
catalina.jar? How do I know if tomcat is running?

ps -ef | grep tomcat yields the same result. Do not
see any pid the output is a set of paths that has
tomcat in it.

$JAVA_HOME and $CATLINA_HOME are set correctly.

I may have said it wrong that it is during startup I
get the error. It is actually during execution of
shutdown.sh. Sorry about that.

When I do:
su - tomcat -c
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/startup.sh

I get:

Using CATALINA_BASE:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_HOME:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR:
/usr/local/tomcat/jakarta-tomcat-5.5.7/temp
Using JRE_HOME:   /usr/java/jdk1.5.0_02

[EMAIL PROTECTED] ~]# su - tomcat -c
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/shutdown.sh

I get:

Using CATALINA_BASE:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_HOME:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR:
/usr/local/tomcat/jakarta-tomcat-5.5.7/temp
Using JRE_HOME:   /usr/java/jdk1.5.0_02
java.lang.ClassNotFoundException:
org.apache.catalina.startup.Catalina
at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)


--- Robert Harrison <[EMAIL PROTECTED]> wrote:
> Does "echo $JAVA_HOME" show it set correctly?
> Bob
> 
> On Apr 8, 2005 1:28 PM, Anoop kumar V
> <[EMAIL PROTECTED]> wrote:
> > Just make sure you have included catalina.jar file
> in the classpath.
> > 
> > -Anoop
> > 
> > On Apr 8, 2005 1:23 PM, Parveen Pasha
> <[EMAIL PROTECTED]> wrote:
> > > Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02
> > >
> > > Changed the port to 8090 from the default 8080
> > > port in server.xml.
> > >
> > > Did not install the runtime environment. only
> > > installed jdk1.5.02 using the
> > > rpm -iv jdk-1_5_0_02-linux-i586-rpm
> > >
> > > When I execute the startup.sh script, I receive
> the
> > > following error in Catalina.out
> > >
> > > java.lang.ClassNotFoundException:
> > > org.apache.catalina.startup.Catalina
> > > at
> > >
>
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > > at
> > >
> java.security.AccessController.doPrivileged(Native
> > > Method)
> > > at
> > >
>
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > > at
> > >
>
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > > at
> > >
>
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> > > at
> > >
>
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
> > > at
> > >
>
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)
> > >
> > > Cannot view the default web applications
> included with
> > > Tomcat when accessing via  http://localhost:8090
> > >
> > > I receive the following message: The page cannot
> be
> > > displayed.
> > >
> > > I did not find any solution on the Web. Can
> someone
> > > help.
> > >
> > > Thanks! Thanks! 
> > >
> > > Parveen
> > >
> > >
>
-
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> > 
> > --
> > Thanks and best regards,
> > Anoop
> > 
> >
>
-
> > 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]



Re: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Anoop kumar V
The simplest thing to do would be to open a command prompt (if you are
on windows) and type
echo %CLASSPATH%
and then hit enter / return key.

The jars that have been added to the classpath are shown - ensure that
u have catalina.jar or j2ee.jar.

If you are not sure open the jar files using something like winzip and
check for the existence of the class file.

HTH
-Anoop

On Apr 8, 2005 1:41 PM, Robert Harrison <[EMAIL PROTECTED]> wrote:
> Does "echo $JAVA_HOME" show it set correctly?
> Bob
> 
> On Apr 8, 2005 1:28 PM, Anoop kumar V <[EMAIL PROTECTED]> wrote:
> > Just make sure you have included catalina.jar file in the classpath.
> >
> > -Anoop
> >
> > On Apr 8, 2005 1:23 PM, Parveen Pasha <[EMAIL PROTECTED]> wrote:
> > > Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02
> > >
> > > Changed the port to 8090 from the default 8080
> > > port in server.xml.
> > >
> > > Did not install the runtime environment. only
> > > installed jdk1.5.02 using the
> > > rpm -iv jdk-1_5_0_02-linux-i586-rpm
> > >
> > > When I execute the startup.sh script, I receive the
> > > following error in Catalina.out
> > >
> > > java.lang.ClassNotFoundException:
> > > org.apache.catalina.startup.Catalina
> > > at
> > > java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > > at
> > > java.security.AccessController.doPrivileged(Native
> > > Method)
> > > at
> > > java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > > at
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > > at
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> > > at
> > > org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
> > > at
> > > org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)
> > >
> > > Cannot view the default web applications included with
> > > Tomcat when accessing via  http://localhost:8090
> > >
> > > I receive the following message: The page cannot be
> > > displayed.
> > >
> > > I did not find any solution on the Web. Can someone
> > > help.
> > >
> > > Thanks! Thanks! 
> > >
> > > Parveen
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > --
> > Thanks and best regards,
> > Anoop
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> --
> 


-- 
Thanks and best regards,
Anoop

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



Re: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Parveen Pasha
I am installing all this for the first time.

Where do you set the classpath, to include the
catalina.jar? How do I know if tomcat is running?

ps -ef | grep tomcat yields the same result. Do not
see any pid the output is a set of paths that has
tomcat in it.

$JAVA_HOME and $CATLINA_HOME are set correctly.

I may have said it wrong that it is during startup I
get the error. It is actually during execution of
shutdown.sh. Sorry about that.

When I do:
su - tomcat -c
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/startup.sh

I get:

Using CATALINA_BASE:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_HOME:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR:
/usr/local/tomcat/jakarta-tomcat-5.5.7/temp
Using JRE_HOME:   /usr/java/jdk1.5.0_02

[EMAIL PROTECTED] ~]# su - tomcat -c
/usr/local/tomcat/jakarta-tomcat-5.5.7/bin/shutdown.sh

I get:

Using CATALINA_BASE:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_HOME:  
/usr/local/tomcat/jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR:
/usr/local/tomcat/jakarta-tomcat-5.5.7/temp
Using JRE_HOME:   /usr/java/jdk1.5.0_02
java.lang.ClassNotFoundException:
org.apache.catalina.startup.Catalina
at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)


--- Robert Harrison <[EMAIL PROTECTED]> wrote:
> Does "echo $JAVA_HOME" show it set correctly?
> Bob
> 
> On Apr 8, 2005 1:28 PM, Anoop kumar V
> <[EMAIL PROTECTED]> wrote:
> > Just make sure you have included catalina.jar file
> in the classpath.
> > 
> > -Anoop
> > 
> > On Apr 8, 2005 1:23 PM, Parveen Pasha
> <[EMAIL PROTECTED]> wrote:
> > > Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02
> > >
> > > Changed the port to 8090 from the default 8080
> > > port in server.xml.
> > >
> > > Did not install the runtime environment. only
> > > installed jdk1.5.02 using the
> > > rpm -iv jdk-1_5_0_02-linux-i586-rpm
> > >
> > > When I execute the startup.sh script, I receive
> the
> > > following error in Catalina.out
> > >
> > > java.lang.ClassNotFoundException:
> > > org.apache.catalina.startup.Catalina
> > > at
> > >
>
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > > at
> > >
> java.security.AccessController.doPrivileged(Native
> > > Method)
> > > at
> > >
>
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > > at
> > >
>
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > > at
> > >
>
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> > > at
> > >
>
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
> > > at
> > >
>
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)
> > >
> > > Cannot view the default web applications
> included with
> > > Tomcat when accessing via  http://localhost:8090
> > >
> > > I receive the following message: The page cannot
> be
> > > displayed.
> > >
> > > I did not find any solution on the Web. Can
> someone
> > > help.
> > >
> > > Thanks! Thanks! 
> > >
> > > Parveen
> > >
> > >
>
-
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> > 
> > --
> > Thanks and best regards,
> > Anoop
> > 
> >
>
-
> > 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: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Robert Harrison
Does "echo $JAVA_HOME" show it set correctly?
Bob

On Apr 8, 2005 1:28 PM, Anoop kumar V <[EMAIL PROTECTED]> wrote:
> Just make sure you have included catalina.jar file in the classpath.
> 
> -Anoop
> 
> On Apr 8, 2005 1:23 PM, Parveen Pasha <[EMAIL PROTECTED]> wrote:
> > Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02
> >
> > Changed the port to 8090 from the default 8080
> > port in server.xml.
> >
> > Did not install the runtime environment. only
> > installed jdk1.5.02 using the
> > rpm -iv jdk-1_5_0_02-linux-i586-rpm
> >
> > When I execute the startup.sh script, I receive the
> > following error in Catalina.out
> >
> > java.lang.ClassNotFoundException:
> > org.apache.catalina.startup.Catalina
> > at
> > java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > at
> > java.security.AccessController.doPrivileged(Native
> > Method)
> > at
> > java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > at
> > java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > at
> > java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> > at
> > org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
> > at
> > org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)
> >
> > Cannot view the default web applications included with
> > Tomcat when accessing via  http://localhost:8090
> >
> > I receive the following message: The page cannot be
> > displayed.
> >
> > I did not find any solution on the Web. Can someone
> > help.
> >
> > Thanks! Thanks! 
> >
> > Parveen
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> --
> Thanks and best regards,
> Anoop
> 
> -
> 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: Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Anoop kumar V
Just make sure you have included catalina.jar file in the classpath.

-Anoop

On Apr 8, 2005 1:23 PM, Parveen Pasha <[EMAIL PROTECTED]> wrote:
> Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02
> 
> Changed the port to 8090 from the default 8080
> port in server.xml.
> 
> Did not install the runtime environment. only
> installed jdk1.5.02 using the
> rpm -iv jdk-1_5_0_02-linux-i586-rpm
> 
> When I execute the startup.sh script, I receive the
> following error in Catalina.out
> 
> java.lang.ClassNotFoundException:
> org.apache.catalina.startup.Catalina
> at
> java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at
> java.security.AccessController.doPrivileged(Native
> Method)
> at
> java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at
> java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at
> java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
> at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)
> 
> Cannot view the default web applications included with
> Tomcat when accessing via  http://localhost:8090
> 
> I receive the following message: The page cannot be
> displayed.
> 
> I did not find any solution on the Web. Can someone
> help.
> 
> Thanks! Thanks! 
> 
> Parveen
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Thanks and best regards,
Anoop

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



Help !!! Tomcat 5.5.7 - cannot start

2005-04-08 Thread Parveen Pasha
Using Tomcat 5.5 + Fedora Core 3 + jdk1.5.02 

Changed the port to 8090 from the default 8080
port in server.xml. 

Did not install the runtime environment. only
installed jdk1.5.02 using the 
rpm -iv jdk-1_5_0_02-linux-i586-rpm

When I execute the startup.sh script, I receive the
following error in Catalina.out

java.lang.ClassNotFoundException:
org.apache.catalina.startup.Catalina
at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)


Cannot view the default web applications included with
Tomcat when accessing via  http://localhost:8090

I receive the following message: The page cannot be
displayed. 

I did not find any solution on the Web. Can someone
help.

Thanks! Thanks! 

Parveen



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



RE: Nested tag problem in tomcat 5.0.29..Please help

2005-04-07 Thread Folashade Adeyosoye
Can you post a sample code

-Original Message-
From: Narayan, Satya [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 07, 2005 2:10 AM
To: tomcat-user@jakarta.apache.org
Subject: Nested tag problem in tomcat 5.0.29..Please help



> Hi all,
> I am having problem compiling jsp pages with nested struts
> tags.
> Is this a known error ? I have a bean tag within a html tag which is
> causing a problem.
I tried the same web application in 4.1.29 it works perfectly fine but
with 5.0.29 and 5.0.28 it gives unable to compile class.

Somebody please help.

> Has anybody got this error.
> Kindly advise.
> 
> Thanks and Regards,
> Satya


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



Nested tag problem in tomcat 5.0.29..Please help

2005-04-06 Thread Narayan, Satya


> Hi all,
> I am having problem compiling jsp pages with nested struts
> tags.
> Is this a known error ? I have a bean tag within a html tag which is
> causing a problem.
I tried the same web application in 4.1.29 it works perfectly fine but
with 5.0.29 and 5.0.28 it gives unable to compile class.

Somebody please help.

> Has anybody got this error.
> Kindly advise.
> 
> Thanks and Regards,
> Satya


help with ssl certificate installation

2005-04-04 Thread Dave Salmon
Tomcat users,

I have received three .crt files from a certificate authority. From
reading 
several sources it seemed like the proper thing to do was

keytool -import -file GTECyberTrustGlobalRoot.crt -alias root
-trustcacerts 
-keystore mykey.jks 

keytool -import -file ComodoSecurityServicesCA.crt -alias comodo 
-trustcacerts -keystore mykey.jks -storepass 

keytool -import -file freerangeinc_virtual_vps-host_net.crt 
-alias tomcat -trustcacerts -keystore mykey.jks

This created the file mykey.jks which when viewed with 

keytool -list -file mykey.jks

seems like it has everything in it.

However when I point my server.xml file at mykey.jks I get an error
(below)

Could someone please tell me what I am missing here?

Thanks.

2005-04-04 21:39:52,741 ERROR
[org.apache.tomcat.util.net.PoolTcpEndpoint] 
Endpoint [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8443]]

ignored exception: java.net.SocketException: SSL handshake
errorjavax.net.ssl.SSLException: No available certificate or key
corresponds 
to the SSL cipher suites which are enabled.
java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException:

No available certificate or key corresponds to the SSL cipher suites
which are enabled.
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESocke
tFactory.java:113)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.
java:368)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:54
9)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:683)
at java.lang.Thread.run(Thread.java:595)


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



Re: connection pooling basic help please

2005-04-04 Thread Kwok Peng Tuck
Krishnakant Mane wrote:
hello,
I refered to the docs in tomcat 5 for connection
pooling.  the document is pritty comprehencive and I
understood the server.xml part of it.
but now I want to know how exactly can I use a
connection from the pool in my servlet.
the example in tomcat documentation is on a jsp based
applicatio.  but I don't understand how I use a pooled
connection in a servlet.
 

You use a pooled connection in a simillar manner to a driver managed 
connection, except that you look up a resource (JNDI in this case). In 
your servlet just look up the resource.

should I initialise the connection in the Init method?
how and when should I close the connection?
 

You should close the connection immediately when you are done with it. 
Best not to pass references of them around. You would close them as a 
you would in a driver managed connection, that is Connection.close() ;

and wat entries in the web.xml file will effect
connection pooling?
 

Please help it is really urgent.
thanks
Krishnakant.
Send instant messages to your online friends http://uk.messenger.yahoo.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: connection pooling basic help please

2005-04-02 Thread QM
On Sat, Apr 02, 2005 at 08:21:24PM +0100, Krishnakant Mane wrote:
: the example in tomcat documentation is on a jsp based
: applicatio.  but I don't understand how I use a pooled
: connection in a servlet.
: [snip]
: should I initialise the connection in the Init method?
:  how and when should I close the connection?


1/ please post a *new* message when writing to the list.  Replying to
an old (unrelated) message confuses thread-aware mailers, which makes
your question harder to find (and thus answer).


2/ I don't have the JSP sample in front of me, but there should be
plenty of examples of using a DataSource out on the web.  A little
Googling should turn them up.  The short version is:
 - perform a JNDI lookup to find the DataSource
 - pull a Connection from that data source
 - use the Connection to talk with a databse
 - call close() on that connection

You should hold on to the Connection for as short a period of time as
possible.  This is easier to manage if all of the database calls are
done from a particular set of objects (a data layer).

Having all of your components do the JNDI lookup, etc can get messy and
tough to maintain.  Isolate all of your data calls to a separate object
(or set of objects).  You could initialize these objects in a
ServletContextListener and either store them under Application scope or
in a singleton such that they would be globally available.

-QM


-- 
software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

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



connection pooling basic help please

2005-04-02 Thread Krishnakant Mane
hello,
I refered to the docs in tomcat 5 for connection
pooling.  the document is pritty comprehencive and I
understood the server.xml part of it.
but now I want to know how exactly can I use a
connection from the pool in my servlet.
the example in tomcat documentation is on a jsp based
applicatio.  but I don't understand how I use a pooled
connection in a servlet.
should I initialise the connection in the Init method?
 how and when should I close the connection?
and wat entries in the web.xml file will effect
connection pooling?
Please help it is really urgent.
thanks
Krishnakant.

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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



Re: Need Help w. Servlet Images.

2005-03-31 Thread QM
On Thu, Mar 31, 2005 at 02:42:10PM -0500, Steve R. Burrus wrote:
: Can someone/somebody please tell me just how exactly I go about viewing an 
image using both of the FileInputStream and the FileOutputStream classes in 
connection with the method "getRealPath()"??

Share your code, and we can help point out bugs.

Better yet: what does the stack trace indicate is the source of the
error?


: I have been failing to view the images due to always getting a 
"java.lang.NullPointerException" every time that I try to see the images in my 
browser. 

I recall getRealPath() doesn't work quite well inside packed WAR files,
if that's how you're running.  

If you're streaming images, why not place them outside of the webapp?
That lets the images and the webapp vary independently.

-QM

-- 

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

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



Need Help w. Servlet Images.

2005-03-31 Thread Steve R. Burrus

Can someone/somebody please tell me just how exactly I go about viewing an 
image using both of the FileInputStream and the FileOutputStream classes in 
connection with the method "getRealPath()"?? I have been failing to view the 
images due to always getting a "java.lang.NullPointerException" every time that 
I try to see the images in my browser. 

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

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



Re: connection pooling confusion help needed

2005-03-29 Thread Preeti Iyer
Hi,
Please follow the directions by user rmorriso on the following link.
It should work fine.
http://forums.devshed.com/archive/t-120081




On Fri, 25 Mar 2005 19:11:15 + (GMT), Krishnakant Mane
<[EMAIL PROTECTED]> wrote:
> hello all,
> im going to put a web application in java servlets
> with tomcat 5 on a production ready server for real
> time use.
> I am thinking of using connection pooling but I am a
> bit confused.  I have initialised all my connections
> in the servlet's init method and closed them in
> distroy method.
> so these connections are not closed untill the server
> is turned off.  now how will the connection pooling
> track these un closed connections?
> and I will like some one to make me understand with an
> example of how to implement connection pooling using
> mysql jdbc.  I will be happy if some one gives a
> complete example including how to define context and
> where.  and how to link it to a web application and
> how to call the connection from a pool.  I have some
> rough idea but the tomcat docs really confused me.
> so please help me understand this connection pooling
> concept
> thanks
> Krishnakant.
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.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: Help with SSL & Cert config

2005-03-27 Thread joelsherriff
There's a light at the end of this tunnel - I've got it mostly working - via
a browser anyway.  My previous trivial
problem was the imports of the CA and cert signed by that CA needed to be in
the opposite order - CA first, then
cert - so that keytool would accept the cert.

My next, and hopefully last problem is that I can't seem to get the command
to install the client cert in the java keystore correct.  I tried
just a simple

keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
client1.pem -alias myalias

But with or without this my java client can't connect - tomcat gives a
"certificate_unknown" exception.  The instructions I've been using don't
mention what to do to get the client cert in the java keystore.  They only
say:

create client cert request
have the ca sign it
generate a pkcs12 file form it
import the pkcs12 into the browser

nothing about importing the client cert into the java keystore.

 Is there some other step I need to perform before/instead of importing the
.pem into the cacerts file?


- Original Message - 
From: "joelsherriff" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Saturday, March 26, 2005 9:07 PM
Subject: Re: Help with SSL & Cert config


>
> > > #Import the CA certificate into the JDK certificate authorities
> keystore:
> > > keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
> > > ca.pem -alias myalias -keypass changeit
> > >
> >
> > This is either/or with truststoreFile (which, since you are using 4.1.x,
> is
> > done with the -Djavax.net.ssl.trustStore=/path/to/trust.store; for TC 3
&
> 5
> > it's configured like keystoreFile).  However, you need to trust your CA
> cert
> > (i.e. -trustcacerts).
>
> So if I understand you correctly, I need to add a -trustcacerts flag to
the
> keytool command above
> that imports the CA cert?  And, since I am using 4.1 I do need
> the -Djavax.net.ssl.trustStore=... in
> my CATALINA_OPTS because 4.1 doesn't support the truststoreFile= in the
> Coyote connector?
> Not trying to be dense (I come by that naturally), just want to be clear.
>
> > This (and everything I've said before) is assuming that you're using the
> > Coyote Connector.  I don't really remember how the (deprecated)
> > Http11Connector works (and don't care enough to look it up :).
>
> Assumption correct.
>
> > > # Create a file to hold CA's serial numbers.
> > > echo "02" > ca.srl
> > >
> > > # Create a keystore for web server.
> > > keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D, O=MyOrg,
> > > L=New
> > > York, S=New York, C=US" -keyalg RSA -keypass changeit -storepass
> > > changeit -keysize 1024 -keystore server.keystore -storetype JKS
> > >
> > > # Create a certificate request for web server:
> > > keytool -certreq -keyalg RSA -alias tomcat-sv -file
server.csr -keystore
> > > server.keystore -storepass changeit
> > >
> > > # Sign the certificate request:
> > > openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
> > > server.csr -out server.crt -days 365
> > >
> > > # Import the signed server certificate into the server keystore:
> > > keytool -import -alias tomcat-sv -keystore
> > > server.keystore -trustcacerts -file server.crt -storepass changeit
> > >
> >
> > It's good practice to import the server CA as well, so that JSSE can
send
> > the entire chain, but at this point, I imagine you just want it to work
> ;-).
>
> You can say that again.  But, when you say the "server CA", which file are
> you referring to?
>
> > It's also necessary if you are pointing your truststore to your
keystore.
> >
> > > I get a 'Failed to establish chain from reply' exception at his point.
> > >
> >
> > Since you re-created your CA, you would need to re-import it into your
> > browser.  However, I'm guessing that it's because of the lack of trust
> > mentioned above.
> >
> > >
> > >
> > > - Original Message - 
> > > From: "joelsherriff" <[EMAIL PROTECTED]>
> > > To: "Tomcat Users List" 
> > > Sent: Saturday, March 26, 2005 11:24 AM
> > > Subject: Re: Help with SSL & Cert config
> > >
> > >
> > >> Ah.  Thanks for the help, truly, but I'm still not getting there.  I
> > > didn't
> > >> even know about the truststoreFile so I googled it and saw mention
th

Re: Help with SSL & Cert config

2005-03-26 Thread joelsherriff

> > #Import the CA certificate into the JDK certificate authorities
keystore:
> > keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
> > ca.pem -alias myalias -keypass changeit
> >
>
> This is either/or with truststoreFile (which, since you are using 4.1.x,
is
> done with the -Djavax.net.ssl.trustStore=/path/to/trust.store; for TC 3 &
5
> it's configured like keystoreFile).  However, you need to trust your CA
cert
> (i.e. -trustcacerts).

So if I understand you correctly, I need to add a -trustcacerts flag to the
keytool command above
that imports the CA cert?  And, since I am using 4.1 I do need
the -Djavax.net.ssl.trustStore=... in
my CATALINA_OPTS because 4.1 doesn't support the truststoreFile= in the
Coyote connector?
Not trying to be dense (I come by that naturally), just want to be clear.

> This (and everything I've said before) is assuming that you're using the
> Coyote Connector.  I don't really remember how the (deprecated)
> Http11Connector works (and don't care enough to look it up :).

Assumption correct.

> > # Create a file to hold CA's serial numbers.
> > echo "02" > ca.srl
> >
> > # Create a keystore for web server.
> > keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D, O=MyOrg,
> > L=New
> > York, S=New York, C=US" -keyalg RSA -keypass changeit -storepass
> > changeit -keysize 1024 -keystore server.keystore -storetype JKS
> >
> > # Create a certificate request for web server:
> > keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore
> > server.keystore -storepass changeit
> >
> > # Sign the certificate request:
> > openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
> > server.csr -out server.crt -days 365
> >
> > # Import the signed server certificate into the server keystore:
> > keytool -import -alias tomcat-sv -keystore
> > server.keystore -trustcacerts -file server.crt -storepass changeit
> >
>
> It's good practice to import the server CA as well, so that JSSE can send
> the entire chain, but at this point, I imagine you just want it to work
;-).

You can say that again.  But, when you say the "server CA", which file are
you referring to?

> It's also necessary if you are pointing your truststore to your keystore.
>
> > I get a 'Failed to establish chain from reply' exception at his point.
> >
>
> Since you re-created your CA, you would need to re-import it into your
> browser.  However, I'm guessing that it's because of the lack of trust
> mentioned above.
>
> >
> >
> > - Original Message - 
> > From: "joelsherriff" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" 
> > Sent: Saturday, March 26, 2005 11:24 AM
> > Subject: Re: Help with SSL & Cert config
> >
> >
> >> Ah.  Thanks for the help, truly, but I'm still not getting there.  I
> > didn't
> >> even know about the truststoreFile so I googled it and saw mention that
> > the
> >> easiest thing to do is to set the truststoreFile = the keystoreFile,
> >> since
> >> that already has the CA cert in it.  So, I tried setting truststoreFile
> >> to
> >> point to my keystoreFile in server.xml.  That didn't help.  Then I saw
> > that
> >> there might be issues with setting truststoreFile in the server.xml in
> >> Tomcat 4.1 so I set it in CATALINA_OPTS like:
> >>
> >> -Djavax.net.ssl.trustStore="C:/Program Files/Apache Group/Tomcat
> >> 4.1/conf/server.keystore"
> >>
> >> and that didn't help either.  Anything else I'm missing?
> >>
> >>
> >> - Original Message - 
> >> From: "Bill Barker" <[EMAIL PROTECTED]>
> >> To: 
> >> Sent: Friday, March 25, 2005 10:13 PM
> >> Subject: Re: Help with SSL & Cert config
> >>
> >>
> >> >
> >> > "joelsherriff" <[EMAIL PROTECTED]> wrote in message
> >> > news:[EMAIL PROTECTED]
> >> > >I thought that's what this step:
> >> > >
> >> > > # Import the CA certificate into the server keystore:
> >> > > keytool -import -alias my_ca_alias -keystore
> >> > > server.keystore -trustcacerts -file ca.pem -keypass changeit
> >> > >
> >> > > was doing.  No?
> >> > >
> >> >
> >> > No.  That's putting it into your keystoreFile.  The keystoreFile is
to
> >

Re: Help with SSL & Cert config

2005-03-26 Thread Bill Barker

"joelsherriff" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Well I have more info now.  I turned on debugging and saw that I'm getting 
> a
> 'null cert chain' SSLHandshakeException.  So,
> I started from scratch and went through each of my steps one by one and 
> I've
> apparently got one of them wrong.  Now when
> I do these steps:
>
> # Create a private key and certificate request for your own CA:
> openssl req -new -subj "/C=US/ST=New York/L=New York/CN=akuma-c" -newkey
> rsa:1024 -nodes -out ca.csr -keyout ca.key
>
> # Create CA's self-signed certificate
> openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out 
> ca.pem
>
> #Import the CA certificate into the JDK certificate authorities keystore:
> keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
> ca.pem -alias myalias -keypass changeit
>

This is either/or with truststoreFile (which, since you are using 4.1.x, is 
done with the -Djavax.net.ssl.trustStore=/path/to/trust.store; for TC 3 & 5 
it's configured like keystoreFile).  However, you need to trust your CA cert 
(i.e. -trustcacerts).

This (and everything I've said before) is assuming that you're using the 
Coyote Connector.  I don't really remember how the (deprecated) 
Http11Connector works (and don't care enough to look it up :).

> # Create a file to hold CA's serial numbers.
> echo "02" > ca.srl
>
> # Create a keystore for web server.
> keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D, O=MyOrg, 
> L=New
> York, S=New York, C=US" -keyalg RSA -keypass changeit -storepass
> changeit -keysize 1024 -keystore server.keystore -storetype JKS
>
> # Create a certificate request for web server:
> keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore
> server.keystore -storepass changeit
>
> # Sign the certificate request:
> openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
> server.csr -out server.crt -days 365
>
> # Import the signed server certificate into the server keystore:
> keytool -import -alias tomcat-sv -keystore
> server.keystore -trustcacerts -file server.crt -storepass changeit
>

It's good practice to import the server CA as well, so that JSSE can send 
the entire chain, but at this point, I imagine you just want it to work ;-). 
It's also necessary if you are pointing your truststore to your keystore.

> I get a 'Failed to establish chain from reply' exception at his point.
>

Since you re-created your CA, you would need to re-import it into your 
browser.  However, I'm guessing that it's because of the lack of trust 
mentioned above.

>
>
> - Original Message - 
> From: "joelsherriff" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" 
> Sent: Saturday, March 26, 2005 11:24 AM
> Subject: Re: Help with SSL & Cert config
>
>
>> Ah.  Thanks for the help, truly, but I'm still not getting there.  I
> didn't
>> even know about the truststoreFile so I googled it and saw mention that
> the
>> easiest thing to do is to set the truststoreFile = the keystoreFile, 
>> since
>> that already has the CA cert in it.  So, I tried setting truststoreFile 
>> to
>> point to my keystoreFile in server.xml.  That didn't help.  Then I saw
> that
>> there might be issues with setting truststoreFile in the server.xml in
>> Tomcat 4.1 so I set it in CATALINA_OPTS like:
>>
>> -Djavax.net.ssl.trustStore="C:/Program Files/Apache Group/Tomcat
>> 4.1/conf/server.keystore"
>>
>> and that didn't help either.  Anything else I'm missing?
>>
>>
>> - Original Message - 
>> From: "Bill Barker" <[EMAIL PROTECTED]>
>> To: 
>> Sent: Friday, March 25, 2005 10:13 PM
>> Subject: Re: Help with SSL & Cert config
>>
>>
>> >
>> > "joelsherriff" <[EMAIL PROTECTED]> wrote in message
>> > news:[EMAIL PROTECTED]
>> > >I thought that's what this step:
>> > >
>> > > # Import the CA certificate into the server keystore:
>> > > keytool -import -alias my_ca_alias -keystore
>> > > server.keystore -trustcacerts -file ca.pem -keypass changeit
>> > >
>> > > was doing.  No?
>> > >
>> >
>> > No.  That's putting it into your keystoreFile.  The keystoreFile is to
>> > identify you.  The truststoreFile is to identify other people.
>> >
>> > > - Original Message - 
>> > > From: "Bill Barker&q

Re: Help with SSL & Cert config

2005-03-26 Thread joelsherriff
Well I have more info now.  I turned on debugging and saw that I'm getting a
'null cert chain' SSLHandshakeException.  So,
I started from scratch and went through each of my steps one by one and I've
apparently got one of them wrong.  Now when
I do these steps:

# Create a private key and certificate request for your own CA:
openssl req -new -subj "/C=US/ST=New York/L=New York/CN=akuma-c" -newkey
rsa:1024 -nodes -out ca.csr -keyout ca.key

# Create CA's self-signed certificate
openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out ca.pem

#Import the CA certificate into the JDK certificate authorities keystore:
keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
ca.pem -alias myalias -keypass changeit

# Create a file to hold CA's serial numbers.
echo "02" > ca.srl

# Create a keystore for web server.
keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D, O=MyOrg, L=New
York, S=New York, C=US" -keyalg RSA -keypass changeit -storepass
changeit -keysize 1024 -keystore server.keystore -storetype JKS

# Create a certificate request for web server:
keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore
server.keystore -storepass changeit

# Sign the certificate request:
openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
server.csr -out server.crt -days 365

# Import the signed server certificate into the server keystore:
keytool -import -alias tomcat-sv -keystore
server.keystore -trustcacerts -file server.crt -storepass changeit

I get a 'Failed to establish chain from reply' exception at his point.



- Original Message - 
From: "joelsherriff" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Saturday, March 26, 2005 11:24 AM
Subject: Re: Help with SSL & Cert config


> Ah.  Thanks for the help, truly, but I'm still not getting there.  I
didn't
> even know about the truststoreFile so I googled it and saw mention that
the
> easiest thing to do is to set the truststoreFile = the keystoreFile, since
> that already has the CA cert in it.  So, I tried setting truststoreFile to
> point to my keystoreFile in server.xml.  That didn't help.  Then I saw
that
> there might be issues with setting truststoreFile in the server.xml in
> Tomcat 4.1 so I set it in CATALINA_OPTS like:
>
> -Djavax.net.ssl.trustStore="C:/Program Files/Apache Group/Tomcat
> 4.1/conf/server.keystore"
>
> and that didn't help either.  Anything else I'm missing?
>
>
> - Original Message - 
> From: "Bill Barker" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, March 25, 2005 10:13 PM
> Subject: Re: Help with SSL & Cert config
>
>
> >
> > "joelsherriff" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > >I thought that's what this step:
> > >
> > > # Import the CA certificate into the server keystore:
> > > keytool -import -alias my_ca_alias -keystore
> > > server.keystore -trustcacerts -file ca.pem -keypass changeit
> > >
> > > was doing.  No?
> > >
> >
> > No.  That's putting it into your keystoreFile.  The keystoreFile is to
> > identify you.  The truststoreFile is to identify other people.
> >
> > > - Original Message - 
> > > From: "Bill Barker" <[EMAIL PROTECTED]>
> > > To: 
> > > Sent: Friday, March 25, 2005 8:51 PM
> > > Subject: Re: Help with SSL & Cert config
> > >
> > >
> > >> You need to put your CA cert into your Tomcat truststoreFile.
> Otherwise,
> > >> you client's cert won't be trusted.
> > >>
> > >> "joelsherriff" <[EMAIL PROTECTED]> wrote in message
> > >> news:[EMAIL PROTECTED]
> > >> I'm resending this message because a) for some reason I didn't see it
> on
> > > the
> > >> list after I sent it and b) I never got any responses (maybe because
of
> > >> _a_).  So, if my original post did actually make it to the list,
please
> > >> forgive the re-post.
> > >>
> > >> Hope someone can help.  I've searched through the archives and this
> seems
> > > to
> > >> be a common problem, but even detailed instructions
> > >> have left me stumped.  I'm trying to get client certificates to be
> > > required
> > >> by tomcat by setting clientAuth=true but I can't seem to figure out
how
> > >> to get the client certificate to be accepted once I do that.  Here's
> what
> > >> I've done to generate all the a

Re: Help with SSL & Cert config

2005-03-26 Thread joelsherriff
Ah.  Thanks for the help, truly, but I'm still not getting there.  I didn't
even know about the truststoreFile so I googled it and saw mention that the
easiest thing to do is to set the truststoreFile = the keystoreFile, since
that already has the CA cert in it.  So, I tried setting truststoreFile to
point to my keystoreFile in server.xml.  That didn't help.  Then I saw that
there might be issues with setting truststoreFile in the server.xml in
Tomcat 4.1 so I set it in CATALINA_OPTS like:

-Djavax.net.ssl.trustStore="C:/Program Files/Apache Group/Tomcat
4.1/conf/server.keystore"

and that didn't help either.  Anything else I'm missing?


- Original Message - 
From: "Bill Barker" <[EMAIL PROTECTED]>
To: 
Sent: Friday, March 25, 2005 10:13 PM
Subject: Re: Help with SSL & Cert config


>
> "joelsherriff" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >I thought that's what this step:
> >
> > # Import the CA certificate into the server keystore:
> > keytool -import -alias my_ca_alias -keystore
> > server.keystore -trustcacerts -file ca.pem -keypass changeit
> >
> > was doing.  No?
> >
>
> No.  That's putting it into your keystoreFile.  The keystoreFile is to
> identify you.  The truststoreFile is to identify other people.
>
> > - Original Message - 
> > From: "Bill Barker" <[EMAIL PROTECTED]>
> > To: 
> > Sent: Friday, March 25, 2005 8:51 PM
> > Subject: Re: Help with SSL & Cert config
> >
> >
> >> You need to put your CA cert into your Tomcat truststoreFile.
Otherwise,
> >> you client's cert won't be trusted.
> >>
> >> "joelsherriff" <[EMAIL PROTECTED]> wrote in message
> >> news:[EMAIL PROTECTED]
> >> I'm resending this message because a) for some reason I didn't see it
on
> > the
> >> list after I sent it and b) I never got any responses (maybe because of
> >> _a_).  So, if my original post did actually make it to the list, please
> >> forgive the re-post.
> >>
> >> Hope someone can help.  I've searched through the archives and this
seems
> > to
> >> be a common problem, but even detailed instructions
> >> have left me stumped.  I'm trying to get client certificates to be
> > required
> >> by tomcat by setting clientAuth=true but I can't seem to figure out how
> >> to get the client certificate to be accepted once I do that.  Here's
what
> >> I've done to generate all the appropriate files (parts coped from
> >> other posts to this list):
> >>
> >> Further elaboration of what we're trying to do:  We want to require
> >> client
> >> authentication from our customers.  So, IIUC, we'll have to send them a
> >> signed client cert (p12) to install in their browser and java
keystores.
> >> Again, IIUC, importing the CA certificate, that was used to sign the
> > client
> >> cert, into the server keystore is what tells the server to accept the
> > client
> >> certificate presented, because it will be signed by that CA (us).  Is
my
> >> understanding correct?  If so, these steps appear to be correct, unless
> > I've
> >> hosed something up along the way.
> >>
> >> # Create a private key and certificate request
> >> openssl req -new -subj "/C=US/ST=North
> >> Carolina/L=Raleigh/CN=akuma-c" -newkey rsa:1024 -nodes -out
> >> ca.csr -keyout
> >> ca.key
> >>
> >> # Create CA's self-signed certificate
> >> openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out
> > ca.pem
> >>
> >> # Copy ca.pem to ca.crt, edit and change "TRUSTED CERTIFICATE" to
> >> "CERTIFICATE"
> >> # import ca.crt into the Trusted Root Certificates Store in IE
> >>
> >> #Import the CA certificate into the JDK certificate authorities
keystore:
> >> keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
> >> ca.pem -alias my_ca_alias -keypass changeit -storepass changeit
> >>
> >> # Create a file to hold CA's serial numbers.
> >> echo "02" > ca.srl
> >>
> >> # Create a keystore for the web server.
> >> keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D,
> >> O=MyOrganization, L=Raleigh, S=North Carolina, C=US" -keyalg
RSA -keypass
> >> changeit -storepass changeit -keysize 1024 -keystore
> >> server.keystore -

Re: Help with SSL & Cert config

2005-03-25 Thread Bill Barker

"joelsherriff" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I thought that's what this step:
>
> # Import the CA certificate into the server keystore:
> keytool -import -alias my_ca_alias -keystore
> server.keystore -trustcacerts -file ca.pem -keypass changeit
>
> was doing.  No?
>

No.  That's putting it into your keystoreFile.  The keystoreFile is to 
identify you.  The truststoreFile is to identify other people.

> - Original Message - 
> From: "Bill Barker" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, March 25, 2005 8:51 PM
> Subject: Re: Help with SSL & Cert config
>
>
>> You need to put your CA cert into your Tomcat truststoreFile.  Otherwise,
>> you client's cert won't be trusted.
>>
>> "joelsherriff" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>> I'm resending this message because a) for some reason I didn't see it on
> the
>> list after I sent it and b) I never got any responses (maybe because of
>> _a_).  So, if my original post did actually make it to the list, please
>> forgive the re-post.
>>
>> Hope someone can help.  I've searched through the archives and this seems
> to
>> be a common problem, but even detailed instructions
>> have left me stumped.  I'm trying to get client certificates to be
> required
>> by tomcat by setting clientAuth=true but I can't seem to figure out how
>> to get the client certificate to be accepted once I do that.  Here's what
>> I've done to generate all the appropriate files (parts coped from
>> other posts to this list):
>>
>> Further elaboration of what we're trying to do:  We want to require 
>> client
>> authentication from our customers.  So, IIUC, we'll have to send them a
>> signed client cert (p12) to install in their browser and java keystores.
>> Again, IIUC, importing the CA certificate, that was used to sign the
> client
>> cert, into the server keystore is what tells the server to accept the
> client
>> certificate presented, because it will be signed by that CA (us).  Is my
>> understanding correct?  If so, these steps appear to be correct, unless
> I've
>> hosed something up along the way.
>>
>> # Create a private key and certificate request
>> openssl req -new -subj "/C=US/ST=North
>> Carolina/L=Raleigh/CN=akuma-c" -newkey rsa:1024 -nodes -out 
>> ca.csr -keyout
>> ca.key
>>
>> # Create CA's self-signed certificate
>> openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out
> ca.pem
>>
>> # Copy ca.pem to ca.crt, edit and change "TRUSTED CERTIFICATE" to
>> "CERTIFICATE"
>> # import ca.crt into the Trusted Root Certificates Store in IE
>>
>> #Import the CA certificate into the JDK certificate authorities keystore:
>> keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
>> ca.pem -alias my_ca_alias -keypass changeit -storepass changeit
>>
>> # Create a file to hold CA's serial numbers.
>> echo "02" > ca.srl
>>
>> # Create a keystore for the web server.
>> keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D,
>> O=MyOrganization, L=Raleigh, S=North Carolina, C=US" -keyalg RSA -keypass
>> changeit -storepass changeit -keysize 1024 -keystore
>> server.keystore -storetype JKS
>>
>> # Create a certificate request for the web server:
>> keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore
>> server.keystore -storepass changeit
>>
>> # Sign the certificate request:
>> openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
>> server.csr -out server.crt -days 365
>>
>> # Import the signed server certificate into the server keystore:
>> keytool -import -alias tomcat-sv -keystore
>> server.keystore -trustcacerts -file server.crt -storepass changeit
>>
>> # Import the CA certificate into the server keystore:
>> keytool -import -alias my_ca_alias -keystore
>> server.keystore -trustcacerts -file ca.pem -keypass changeit
>>
>> # Create a client certificate request:
>> openssl req -new -newkey rsa:512 -nodes -out client1.req -keyout
> client1.key
>>
>> # Sign the client certificate.
>> openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
>> client1.req -out client1.pem -days 365
>>
>> # Generate a PKCS12 file containing client key and client certificate.
>> openssl pkcs12 -export -clcerts -in client1.pem -inkey client1.key -out
>> client1.p12 -name "Client"
>>
>> # Import the PKCS12 file into the web browser under Personal Certificates
>>
>> # edit the server.xml file and set clientAuth=true and keystoreFile to
> point
>> to my server.keystore file.
>>
>> Once all this is done, neither IE nor my web app can talk to tomcat on 
>> the
>> ssl port (8443)
>>
>>
>>
>>
>> -
>> 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: Help with SSL & Cert config

2005-03-25 Thread joelsherriff
I thought that's what this step:

# Import the CA certificate into the server keystore:
keytool -import -alias my_ca_alias -keystore
server.keystore -trustcacerts -file ca.pem -keypass changeit

was doing.  No?

- Original Message - 
From: "Bill Barker" <[EMAIL PROTECTED]>
To: 
Sent: Friday, March 25, 2005 8:51 PM
Subject: Re: Help with SSL & Cert config


> You need to put your CA cert into your Tomcat truststoreFile.  Otherwise,
> you client's cert won't be trusted.
>
> "joelsherriff" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> I'm resending this message because a) for some reason I didn't see it on
the
> list after I sent it and b) I never got any responses (maybe because of
> _a_).  So, if my original post did actually make it to the list, please
> forgive the re-post.
>
> Hope someone can help.  I've searched through the archives and this seems
to
> be a common problem, but even detailed instructions
> have left me stumped.  I'm trying to get client certificates to be
required
> by tomcat by setting clientAuth=true but I can't seem to figure out how
> to get the client certificate to be accepted once I do that.  Here's what
> I've done to generate all the appropriate files (parts coped from
> other posts to this list):
>
> Further elaboration of what we're trying to do:  We want to require client
> authentication from our customers.  So, IIUC, we'll have to send them a
> signed client cert (p12) to install in their browser and java keystores.
> Again, IIUC, importing the CA certificate, that was used to sign the
client
> cert, into the server keystore is what tells the server to accept the
client
> certificate presented, because it will be signed by that CA (us).  Is my
> understanding correct?  If so, these steps appear to be correct, unless
I've
> hosed something up along the way.
>
> # Create a private key and certificate request
> openssl req -new -subj "/C=US/ST=North
> Carolina/L=Raleigh/CN=akuma-c" -newkey rsa:1024 -nodes -out ca.csr -keyout
> ca.key
>
> # Create CA's self-signed certificate
> openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out
ca.pem
>
> # Copy ca.pem to ca.crt, edit and change "TRUSTED CERTIFICATE" to
> "CERTIFICATE"
> # import ca.crt into the Trusted Root Certificates Store in IE
>
> #Import the CA certificate into the JDK certificate authorities keystore:
> keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file
> ca.pem -alias my_ca_alias -keypass changeit -storepass changeit
>
> # Create a file to hold CA's serial numbers.
> echo "02" > ca.srl
>
> # Create a keystore for the web server.
> keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D,
> O=MyOrganization, L=Raleigh, S=North Carolina, C=US" -keyalg RSA -keypass
> changeit -storepass changeit -keysize 1024 -keystore
> server.keystore -storetype JKS
>
> # Create a certificate request for the web server:
> keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore
> server.keystore -storepass changeit
>
> # Sign the certificate request:
> openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
> server.csr -out server.crt -days 365
>
> # Import the signed server certificate into the server keystore:
> keytool -import -alias tomcat-sv -keystore
> server.keystore -trustcacerts -file server.crt -storepass changeit
>
> # Import the CA certificate into the server keystore:
> keytool -import -alias my_ca_alias -keystore
> server.keystore -trustcacerts -file ca.pem -keypass changeit
>
> # Create a client certificate request:
> openssl req -new -newkey rsa:512 -nodes -out client1.req -keyout
client1.key
>
> # Sign the client certificate.
> openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in
> client1.req -out client1.pem -days 365
>
> # Generate a PKCS12 file containing client key and client certificate.
> openssl pkcs12 -export -clcerts -in client1.pem -inkey client1.key -out
> client1.p12 -name "Client"
>
> # Import the PKCS12 file into the web browser under Personal Certificates
>
> # edit the server.xml file and set clientAuth=true and keystoreFile to
point
> to my server.keystore file.
>
> Once all this is done, neither IE nor my web app can talk to tomcat on the
> ssl port (8443)
>
>
>
>
> -
> 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: Help with SSL & Cert config

2005-03-25 Thread Bill Barker
You need to put your CA cert into your Tomcat truststoreFile.  Otherwise, 
you client's cert won't be trusted.

"joelsherriff" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
I'm resending this message because a) for some reason I didn't see it on the 
list after I sent it and b) I never got any responses (maybe because of 
_a_).  So, if my original post did actually make it to the list, please 
forgive the re-post.

Hope someone can help.  I've searched through the archives and this seems to 
be a common problem, but even detailed instructions
have left me stumped.  I'm trying to get client certificates to be required 
by tomcat by setting clientAuth=true but I can't seem to figure out how
to get the client certificate to be accepted once I do that.  Here's what 
I've done to generate all the appropriate files (parts coped from
other posts to this list):

Further elaboration of what we're trying to do:  We want to require client 
authentication from our customers.  So, IIUC, we'll have to send them a 
signed client cert (p12) to install in their browser and java keystores. 
Again, IIUC, importing the CA certificate, that was used to sign the client 
cert, into the server keystore is what tells the server to accept the client 
certificate presented, because it will be signed by that CA (us).  Is my 
understanding correct?  If so, these steps appear to be correct, unless I've 
hosed something up along the way.

# Create a private key and certificate request
openssl req -new -subj "/C=US/ST=North 
Carolina/L=Raleigh/CN=akuma-c" -newkey rsa:1024 -nodes -out ca.csr -keyout 
ca.key

# Create CA's self-signed certificate
openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out ca.pem

# Copy ca.pem to ca.crt, edit and change "TRUSTED CERTIFICATE" to 
"CERTIFICATE"
# import ca.crt into the Trusted Root Certificates Store in IE

#Import the CA certificate into the JDK certificate authorities keystore:
keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file 
ca.pem -alias my_ca_alias -keypass changeit -storepass changeit

# Create a file to hold CA's serial numbers.
echo "02" > ca.srl

# Create a keystore for the web server.
keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D, 
O=MyOrganization, L=Raleigh, S=North Carolina, C=US" -keyalg RSA -keypass 
changeit -storepass changeit -keysize 1024 -keystore 
server.keystore -storetype JKS

# Create a certificate request for the web server:
keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore 
server.keystore -storepass changeit

# Sign the certificate request:
openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in 
server.csr -out server.crt -days 365

# Import the signed server certificate into the server keystore:
keytool -import -alias tomcat-sv -keystore 
server.keystore -trustcacerts -file server.crt -storepass changeit

# Import the CA certificate into the server keystore:
keytool -import -alias my_ca_alias -keystore 
server.keystore -trustcacerts -file ca.pem -keypass changeit

# Create a client certificate request:
openssl req -new -newkey rsa:512 -nodes -out client1.req -keyout client1.key

# Sign the client certificate.
openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in 
client1.req -out client1.pem -days 365

# Generate a PKCS12 file containing client key and client certificate.
openssl pkcs12 -export -clcerts -in client1.pem -inkey client1.key -out 
client1.p12 -name "Client"

# Import the PKCS12 file into the web browser under Personal Certificates

# edit the server.xml file and set clientAuth=true and keystoreFile to point 
to my server.keystore file.

Once all this is done, neither IE nor my web app can talk to tomcat on the 
ssl port (8443) 




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



RE: connection pooling confusion help needed

2005-03-25 Thread pandu yelamanchili
Hi
All the connection pool properties should be configured in server.xml. You 
dont have to initialize connections etc. in your init method. you just have 
to make sure you close your resultset and connection after you are done. 
Closing it will return it back to the pool.

Here is one link from tomcat. Not sure if you took a look at it already
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
Pandu
From: Krishnakant Mane <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" 
To: tomcat-user@jakarta.apache.org
Subject: connection pooling confusion help needed
Date: Fri, 25 Mar 2005 19:11:15 + (GMT)
hello all,
im going to put a web application in java servlets
with tomcat 5 on a production ready server for real
time use.
I am thinking of using connection pooling but I am a
bit confused.  I have initialised all my connections
in the servlet's init method and closed them in
distroy method.
so these connections are not closed untill the server
is turned off.  now how will the connection pooling
track these un closed connections?
and I will like some one to make me understand with an
example of how to implement connection pooling using
mysql jdbc.  I will be happy if some one gives a
complete example including how to define context and
where.  and how to link it to a web application and
how to call the connection from a pool.  I have some
rough idea but the tomcat docs really confused me.
so please help me understand this connection pooling
concept
thanks
Krishnakant.
Send instant messages to your online friends http://uk.messenger.yahoo.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]


connection pooling confusion help needed

2005-03-25 Thread Krishnakant Mane
hello all,
im going to put a web application in java servlets
with tomcat 5 on a production ready server for real
time use.
I am thinking of using connection pooling but I am a
bit confused.  I have initialised all my connections
in the servlet's init method and closed them in
distroy method.
so these connections are not closed untill the server
is turned off.  now how will the connection pooling
track these un closed connections?
and I will like some one to make me understand with an
example of how to implement connection pooling using
mysql jdbc.  I will be happy if some one gives a
complete example including how to define context and
where.  and how to link it to a web application and
how to call the connection from a pool.  I have some
rough idea but the tomcat docs really confused me.
so please help me understand this connection pooling
concept
thanks
Krishnakant.

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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



Help with SSL & Cert config

2005-03-25 Thread joelsherriff
I'm resending this message because a) for some reason I didn't see it on the 
list after I sent it and b) I never got any responses (maybe because of _a_).  
So, if my original post did actually make it to the list, please forgive the 
re-post.

Hope someone can help.  I've searched through the archives and this seems to be 
a common problem, but even detailed instructions
have left me stumped.  I'm trying to get client certificates to be required by 
tomcat by setting clientAuth=true but I can't seem to figure out how
to get the client certificate to be accepted once I do that.  Here's what I've 
done to generate all the appropriate files (parts coped from
other posts to this list):

Further elaboration of what we're trying to do:  We want to require client 
authentication from our customers.  So, IIUC, we'll have to send them a signed 
client cert (p12) to install in their browser and java keystores.  Again, IIUC, 
importing the CA certificate, that was used to sign the client cert, into the 
server keystore is what tells the server to accept the client certificate 
presented, because it will be signed by that CA (us).  Is my understanding 
correct?  If so, these steps appear to be correct, unless I've hosed something 
up along the way.

# Create a private key and certificate request
openssl req -new -subj "/C=US/ST=North Carolina/L=Raleigh/CN=akuma-c" -newkey 
rsa:1024 -nodes -out ca.csr -keyout ca.key

# Create CA's self-signed certificate
openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out ca.pem

# Copy ca.pem to ca.crt, edit and change "TRUSTED CERTIFICATE" to "CERTIFICATE"
# import ca.crt into the Trusted Root Certificates Store in IE

#Import the CA certificate into the JDK certificate authorities keystore:
keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file ca.pem 
-alias my_ca_alias -keypass changeit -storepass changeit

# Create a file to hold CA's serial numbers.
echo "02" > ca.srl

# Create a keystore for the web server.
keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D, O=MyOrganization, 
L=Raleigh, S=North Carolina, C=US" -keyalg RSA -keypass changeit -storepass 
changeit -keysize 1024 -keystore server.keystore -storetype JKS

# Create a certificate request for the web server:
keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore 
server.keystore -storepass changeit

# Sign the certificate request:
openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in server.csr -out 
server.crt -days 365

# Import the signed server certificate into the server keystore:
keytool -import -alias tomcat-sv -keystore server.keystore -trustcacerts -file 
server.crt -storepass changeit

# Import the CA certificate into the server keystore:
keytool -import -alias my_ca_alias -keystore server.keystore -trustcacerts 
-file ca.pem -keypass changeit

# Create a client certificate request:
openssl req -new -newkey rsa:512 -nodes -out client1.req -keyout client1.key

# Sign the client certificate.
openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in client1.req 
-out client1.pem -days 365

# Generate a PKCS12 file containing client key and client certificate.
openssl pkcs12 -export -clcerts -in client1.pem -inkey client1.key -out 
client1.p12 -name "Client"

# Import the PKCS12 file into the web browser under Personal Certificates

# edit the server.xml file and set clientAuth=true and keystoreFile to point to 
my server.keystore file.

Once all this is done, neither IE nor my web app can talk to tomcat on the ssl 
port (8443)

Re: Tomcat rookie needs help updating project

2005-03-25 Thread Steve Lianoglou
I thought Reloadable set to true will only work for JSPs? Will that
allow classes to be reloaded as well ?
What would trigger that?
Hmm .. I may be delerious, but I feel like when reloadable="true", the 
context gets reloaded whenever something 'changes' in the WEB-INF dir .. let's see ...
got this from the docs:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html
(Tomcat 4, but I'm a bit lazy to go to tommcat 5, and I can't imagine it 
changing too much)
reloadable:
Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and 
/WEB-INF/lib for changes, and automatically reload the web application if a 
change is detected. This feature is very useful during application development, 
but it requires significant runtime overhead and is not recommended for use on 
deployed production applications. You can use the Manager web application, 
however, to trigger reloads of deployed applications on demand.
I figured I had to find a way to programmatically make tomcat restart
the web app. No idea how yet, other than writing to web.xml to modify it
or looking into tomcat API .
Hmm .. nothing ingenious .. what if use some lo-tech style of a shell 
script that justs request the correct url to reload a particular webapp context 
...
The Eclipse sysdeo plugin has a way of telling a context to reload ... might be 
something to look into.
-steve
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat rookie needs help updating project

2005-03-25 Thread Jon Cline - Enthusiast, Inc.
Hey Neil,

I believe you can also send a url string to the manager application
which will cause the webapp to reload:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html

jc


On Fri, 25 Mar 2005 11:52:05 -0500, Neil Upfalow <[EMAIL PROTECTED]> wrote:
> I thought Reloadable set to true will only work for JSPs? Will that
> allow classes to be reloaded as well ?
> What would trigger that?
> I'm trying to produce an inhouse solution to keep a large number of
> hosted linux server's tomcat web apps on the same code base.
> I figured I had to find a way to programmatically make tomcat restart
> the web app. No idea how yet, other than writing to web.xml to modify it
> or looking into tomcat API .
> 
> Any ideas?
> 
> Sincerely,
> Neil Upfalow
> 
> 
> -Original Message-
> From: Steve Lianoglou [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 25, 2005 11:43 AM
> To: Tomcat Users List
> Subject: Re: Tomcat rookie needs help updating project
> 
> > However when I make a change to my project either by recompiling some
> > of my Java source code or by modifying some of JSP and/or HTML files,
> > how do I get Tomcat to "recognize" these changes ? If I run the
> > command "ant reload" from the DOS command line, when I rerun my
> > application I do not see my changes. What do I need to do to install
> > project changes ?
> 
> If you set reloadable="true" in your web-app context (see my previous
> post), tomcat should also recognize any changes to the WEB-INF folder
> and reload the webapp context automatically w/o taking down the whole
> server.
> 
> Or, if you don't set reloadable="true" .. just click "reload" for the
> webapp in the tomcat manager app.
> 
> hope that helps,
> 
> -steve
> 
> -
> 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]
> 
> 


-- 
|

Jon Cline
Chief Product Evangelist
Enthusiast, Inc
www.enthusiastinc.com
[EMAIL PROTECTED]
626.256.3505

|

*Need help?  Email [EMAIL PROTECTED]

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



Re: HELP: How the DBCP works ? (and the JMXProxy)

2005-03-25 Thread Lionel Farbos
On Wed, 23 Mar 2005 17:40:05 +0100
Lionel Farbos <[EMAIL PROTECTED]> wrote:

> Hi all (tomcat 5.5 developers),
> 
> In my context.xml, I use a DataSource like this :
> 
> So, I suppose the dataSource.getConnection() is taken from DataBase 
> Connection Pool...
> 
> 1- But How do this works ?
> 
> 2- If all my contexts have their own DataSource, each context have their own 
> Pool ?
> 
No response but I suppose there is one pool for each DataSource...

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



RE: Tomcat rookie needs help updating project

2005-03-25 Thread Neil Upfalow
I thought Reloadable set to true will only work for JSPs? Will that
allow classes to be reloaded as well ?
What would trigger that?
I'm trying to produce an inhouse solution to keep a large number of
hosted linux server's tomcat web apps on the same code base. 
I figured I had to find a way to programmatically make tomcat restart
the web app. No idea how yet, other than writing to web.xml to modify it
or looking into tomcat API .

Any ideas?

Sincerely,
Neil Upfalow
 

-Original Message-
From: Steve Lianoglou [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 25, 2005 11:43 AM
To: Tomcat Users List
Subject: Re: Tomcat rookie needs help updating project

> However when I make a change to my project either by recompiling some 
> of my Java source code or by modifying some of JSP and/or HTML files, 
> how do I get Tomcat to "recognize" these changes ? If I run the 
> command "ant reload" from the DOS command line, when I rerun my 
> application I do not see my changes. What do I need to do to install 
> project changes ?

If you set reloadable="true" in your web-app context (see my previous 
post), tomcat should also recognize any changes to the WEB-INF folder 
and reload the webapp context automatically w/o taking down the whole 
server.

Or, if you don't set reloadable="true" .. just click "reload" for the 
webapp in the tomcat manager app.

hope that helps,

-steve


-
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 rookie needs help updating project

2005-03-25 Thread Steve Lianoglou
However when I make a change to my project either by recompiling some 
of my Java source code or by modifying some of JSP and/or HTML files, 
how do I get Tomcat to "recognize" these changes ? If I run the 
command "ant reload" from the DOS command line, when I rerun my 
application I do not see my changes. What do I need to do to install 
project changes ?
If you set reloadable="true" in your web-app context (see my previous 
post), tomcat should also recognize any changes to the WEB-INF folder 
and reload the webapp context automatically w/o taking down the whole 
server.

Or, if you don't set reloadable="true" .. just click "reload" for the 
webapp in the tomcat manager app.

hope that helps,
-steve
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat rookie needs help updating project

2005-03-25 Thread t.n.a.
Barry Kimelman wrote:
My system is a PC run by Windows XP.
I am running version 5.5.8 of Tomcat
I am running version 1.6.2 of Ant
 
I can successfully compile and install a new project with no problems. 
I can then successfully run the project by visiting the appropriate 
URL in my browser.
 
However when I make a change to my project either by recompiling some 
of my Java source code or by modifying some of JSP and/or HTML files, 
how do I get Tomcat to "recognize" these changes ? If I run the 
command "ant reload" from the DOS command line, when I rerun my 
application I do not see my changes. What do I need to do to install 
project changes ?

Well, one obvious thing you could do is restart tomcat: it takes about 
10 s, but it works.
If you use eclipse with the sysdeo plugin as your IDE (which I highly 
recommend), you can relead the project without a tomcat restart using a 
command from a project pop-up menu.
If you don't use eclipse, I suggest you read up on the manager 
application that comes with tomcat as loading and unloading projects is 
it's responsibility.

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


Tomcat rookie needs help updating project

2005-03-25 Thread Barry Kimelman






My system is a PC run by Windows XP.
I am running version 5.5.8 of Tomcat
I am running version 1.6.2 of Ant
 
I can successfully compile and install a new project with no problems. I can then successfully run the project by visiting the appropriate URL in my browser.
 
However when I make a change to my project either by recompiling some of my Java source code or by modifying some of JSP and/or HTML files, how do I get Tomcat to "recognize" these changes ? If I run the command "ant reload" from the DOS command line, when I rerun my application I do not see my changes. What do I need to do to install project changes ?
 
 
*
 
Barry KimelmanToronto, Ontario, Canadaemail :  [EMAIL PROTECTED] , [EMAIL PROTECTED]









HELP: How the DBCP works ? (and the JMXProxy)

2005-03-23 Thread Lionel Farbos
Hi all (tomcat 5.5 developers),

In my context.xml, I use a DataSource like this :

So, I suppose the dataSource.getConnection() is taken from DataBase Connection 
Pool...

1- But How do this works ?

2- If all my contexts have their own DataSource, each context have their own 
Pool ?

3- How Do I Manage these Pools ? 
I'd want to test with the JMX Proxy but I don't succeed in the good URL for 
asking the only MBean I'm interested in...
I test :
http://localhost:8080/manager/jmxproxy/?get=%3Atype=RequestProcessor%3C
I have a section with the desired MBean : 
Name: 
Catalina:type=DataSource,path=/myContext,host=localhost,class=javax.sql.DataSource,name="myDB"
But I don't succeed with :
http://localhost:8080/manager/jmxproxy/?get=Catalina%3Atype%3DDataSource%2Cpath%3D/myContext%2Chost%3Dlocalhost%2Cclass%3Djavax.sql.DataSource%2Cname%3D%22myBD%22%3C&att=maxActive
...
or something like this...

I need help, please.

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



Re: Newbie help

2005-03-22 Thread Frank Høvin

I don't know anything about JWSDP, but have you read the setup and
configuration pages for the version of Tomcat you're using? e.g.,
  
That's the "how-to" you're looking for, I suspect...
Yah, I tried, but I found it much more confusing than I thought, so I went 
back to Tomcat 4.01 and installed a plugin for Eclipse. Thanks for 
replying, though .-) 

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


Re: Rookie needs help resolving "HTTP Status 500" error message

2005-03-22 Thread Mark Leone
And be advised that you have to recapitulate your package structure in 
the directory hierarchy under ..WEB-INF\classes. In other words, if you 
compile your bean inside package org.company.my.java, then you should 
place the class file for your bean in ..WEB-INF\classes\org\company\my\java

QM wrote:
On Sun, Mar 20, 2005 at 03:45:23PM -0500, Barry Kimelman wrote:
: An error occurred at line: 8 in the jsp file: /logon.jsp
: Generated servlet error:
: DatabaseBean cannot be resolved or is not a type
: [snip]
: 
: [more snip]
The error message indicates that the class "DatabaseBean" is not in a
package, such as
com.someproject.DatabaseBean
Packageless classes are discouraged, and will not load under Tomcat 5.x
and later (aka servlet spec 2.3 and later).
Put your DatabaseBean class in a package and this error should fade
away.
-QM
 

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


Re: Newbie help

2005-03-21 Thread Hassan Schroeder
[EMAIL PROTECTED] wrote:
Now, I've downloaded JWSDP and tomcat50-jwsdp, and nothing makes sense anymore.
What I want to do is the following:
- create a directory in the /webapps dir, and place my small servlets in that
  dir and run them.
I don't know anything about JWSDP, but have you read the setup and
configuration pages for the version of Tomcat you're using? e.g.,
  
That's the "how-to" you're looking for, I suspect...
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com
  dream.  code.

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


Newbie help

2005-03-21 Thread frank
Hi,

Please, can someone help me get started with this. I've used v4.x before,
and it was very simple to just create your own dir with the necessary
web.xml etc. and the deploy simple servlets.

Now, I've downloaded JWSDP and tomcat50-jwsdp, and nothing makes sense anymore.

What I want to do is the following:

- create a directory in the /webapps dir, and place my small servlets in that
  dir and run them.

Can someone give me a quick how-to for that? The JWSDP talks about "putting your
war-files in the /webapps dir", but says nothing more about it. Do I have to
develop heaps of other things just to be able to test-run a few simple
servlets?

Thanks,
Frank Høvin

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



Re: Rookie needs help resolving "HTTP Status 500" error message

2005-03-20 Thread QM
On Sun, Mar 20, 2005 at 03:45:23PM -0500, Barry Kimelman wrote:
: An error occurred at line: 8 in the jsp file: /logon.jsp
: Generated servlet error:
: DatabaseBean cannot be resolved or is not a type
: [snip]
: 
: [more snip]

The error message indicates that the class "DatabaseBean" is not in a
package, such as
com.someproject.DatabaseBean

Packageless classes are discouraged, and will not load under Tomcat 5.x
and later (aka servlet spec 2.3 and later).

Put your DatabaseBean class in a package and this error should fade
away.

-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]



Rookie needs help resolving "HTTP Status 500" error message

2005-03-20 Thread Barry Kimelman






 My system is a Windows XP PC running Tomcat 5.5.8
 
I have been able to compile and install my Tomcat project.
When I visit the URL corresponding to my Tomcat project I see the "starting" page I expected to see.
When I click on the "SUBMIT" button on the form on the main page, I receive the following error message from Tomcat :
 
 
HTTP Status 500 -
type Exception report
message 
description The server encountered an internal error () that prevented it from fulfilling this request.
exception org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 8 in the jsp file: /logon.jsp
Generated servlet error:
DatabaseBean cannot be resolved or is not a type

An error occurred at line: 8 in the jsp file: /logon.jsp
Generated servlet error:
DatabaseBean cannot be resolved or is not a type

An error occurred at line: 8 in the jsp file: /logon.jsp
Generated servlet error:
DatabaseBean cannot be resolved or is not a type
 ==
 
The contents of the named JSP file is as follows :
 
<%@ page language="java" contentType="text/html" %><%-- This JSP is to test my own personal Bean/class. --%>Logon
 
<%-- First call the method that generates the data --%><% foobar.user_logon();%>
 
<%-- Now call the method that retrieves the generated data --%><%= foobar.getHtmldata() %>
 


 
I checked the directory structure where my Tomcat project was deployed and I found that my class file DatabaseBean.class file was located under the WEB-INF\classes sub-directory as expected. So why am I receiving the error message from Tomcat ? Is there something I need to do to set the value for CLASSPATH ?
 
 
 
*
 
Barry KimelmanToronto, Ontario, Canadaemail :  [EMAIL PROTECTED] , [EMAIL PROTECTED]









Re: Tomcat rookie needs help building application

2005-03-20 Thread Dakota Jack
First of all, welcome to the wonderful, wacky world of Java web programming.  

Second, Tomcat is the server that "serves up" your application.  You
are so new it is hard to tell what you know and don't know.  Do you
know the basic structure a web application must have in Tomcat
including where web.xml is, whre the WEB-INF is, etc.?

Third, you seem to be focusing on compiling classes, right?  Tomcat
does not build or compile web applications for you.  Tomcat "serves
up" the applications that are already running.  Many times you have a
development Tomcat server on which you run your applications so that
you can easily test the applications.

Different people have different levels of experience doing different
things regarding compiling.  The best thing you can do to learn about
class compiling and loading is to learn all about CLASSPATH and
ClassLoaders in Java.  Then you can choose what to do, such as use Ant
for compiling your classes, etc.

Fourth, you might want to think about using a standard web framework
at the start to assist your building a web application.  A web
framework, like Struts, codes some things you would have to do for
yourself anyway.  You can take the time it would take you to write all
that framework code to pick out a good one that is pre-built for you. 
So, don't worry if it takes a little time.

Jack


On Sun, 20 Mar 2005 10:11:08 -0500 (Eastern Standard Time), Barry
Kimelman <[EMAIL PROTECTED]> wrote:
>  
>  
>  I need help building my 1st Tomcat application. 
>   
> My system is a Windows XP PC. My version of Tomcat is 5.5.8. 
> I have tomcat installed under the directoryC:\Tomcat5.5 
>   
> I have verified that the installation of Tomcat was successfull by visiting
> http://localhost:8080. 
> Once at the test page, I also ran some of the JSP examples to verify that
> everything was working correctly. 
>   
> My problem is that I can't build an application successfully. I have
> searched the Tomcat documentation and several mailing list archives, but I
> have not found any documentation that states, "This is how to build a Tomcat
> application". I have organized my source code as described/recommended in
> the Tomcat documentation. 
> I did have some success with Tomcat 5.0.16 under Linux Redhat9 a year ago,
> and as I recall, you compiled your application from the command line using
> the "Ant" utility. So I changed my current directory to the toplevel of my
> project and issued the command "ant compile". I received the following error
> message : 
>   
>  BUILD FAILED 
>  C:\barry\myproject\build.xml:146: taskdef class
> org.apache.cataline.ant.DeployTask cannot be found 
>   
> Line 146 of my build.xml file is as follows : 
>  classname="org.apache.catalina.ant.DeployTask"/>
>  
>   
> I searched the JAR files under my Tomcat installation and found that the JAR
> file located at 
> C:\Tomcat5.5\server\lib\catalina-ant.jar   conatins the "missing" class. 
>   
> According to the Tomcat documentation that I read, JAR files placed under
> $CATALINA_HOME/common/lib 
> are available both to web applications and internal Tomcat code. So I copied
> the JAR file under that directory and once again attempted to build my
> project/application. However, I received the same error message 
>   
> What do I need to do in order to build/compile my Tomcat5 project ? Is there
> a "How to build a Tomcat5 Project" document ? 
>   
> Please help a confused rookie. 
>   
> * 
>   
> Barry Kimelman
> Toronto, Ontario, Canada
> email :  [EMAIL PROTECTED] , [EMAIL PROTECTED] 
>  
>  


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: Tomcat rookie needs help building application

2005-03-20 Thread Hassan Schroeder
Barry Kimelman wrote:
So I changed my current directory to the 
toplevel of my project and issued the command "ant compile". I received 
the following error message :
 
 BUILD FAILED
 C:\barry\myproject\build.xml:146: taskdef class 
org.apache.cataline.ant.DeployTask cannot be found
 
Line 146 of my build.xml file is as follows :
  
 
I searched the JAR files under my Tomcat installation and found that the 
JAR file located at C:\Tomcat5.5\server\lib\catalina-ant.jar conatins the 
> "missing" class.
 
According to the Tomcat documentation that I read, JAR files placed 
under $CATALINA_HOME/common/lib are available both to web applications 
> and internal Tomcat code.
But you're neither of those :-) so it's *your* CLASSPATH that needs
to include "C:\Tomcat5.5\server\lib\catalina-ant.jar" when you run
ant from the command line.
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com
  dream.  code.

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


Tomcat rookie needs help building application

2005-03-20 Thread Barry Kimelman






 I need help building my 1st Tomcat application.
 
My system is a Windows XP PC. My version of Tomcat is 5.5.8.
I have tomcat installed under the directory    C:\Tomcat5.5
 
I have verified that the installation of Tomcat was successfull by visiting http://localhost:8080.
Once at the test page, I also ran some of the JSP examples to verify that everything was working correctly.
 
My problem is that I can't build an application successfully. I have searched the Tomcat documentation and several mailing list archives, but I have not found any documentation that states, "This is how to build a Tomcat application". I have organized my source code as described/recommended in the Tomcat documentation.
I did have some success with Tomcat 5.0.16 under Linux Redhat9 a year ago, and as I recall, you compiled your application from the command line using the "Ant" utility. So I changed my current directory to the toplevel of my project and issued the command "ant compile". I received the following error message :
 
 BUILD FAILED
 C:\barry\myproject\build.xml:146: taskdef class org.apache.cataline.ant.DeployTask cannot be found
 
Line 146 of my build.xml file is as follows :
    
 
I searched the JAR files under my Tomcat installation and found that the JAR file located at
C:\Tomcat5.5\server\lib\catalina-ant.jar   conatins the "missing" class.
 
According to the Tomcat documentation that I read, JAR files placed under $CATALINA_HOME/common/lib
are available both to web applications and internal Tomcat code. So I copied the JAR file under that directory and once again attempted to build my project/application. However, I received the same error message
 
What do I need to do in order to build/compile my Tomcat5 project ? Is there a "How to build a Tomcat5 Project" document ?
 
Please help a confused rookie.
 
*
 
Barry KimelmanToronto, Ontario, Canadaemail :  [EMAIL PROTECTED] , [EMAIL PROTECTED]









RE: Help configure ServletFilter

2005-03-16 Thread Ramu, Vinod
I would suggest 

For JSP's,use *.jsp.

And for Servlets. You could add a common starting name that maps to a
servlet path in the container. For instance, let's say all the URLs
starting with the path "servlets" map to some kind of servlet in the
container. Now add /servlet/* element to your
filter. This maps all the servlet paths starting with "servlet" to be
intercepted by your filter. 

All the Best,
Vinod

-Original Message-
From: Fredrik Liden [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 16, 2005 2:18 PM
To: Tomcat Users List
Subject: Help configure ServletFilter


Does anyone know how to configure a ServletFilter to only respond to
JSPs and Servlets? 

If I set it to everything using * it triggers for all the images as
well.

Thanks!

/Fredrik

-
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]



Help configure ServletFilter

2005-03-16 Thread Fredrik Liden
Does anyone know how to configure a ServletFilter to only respond to
JSPs and Servlets? 

If I set it to everything using * it triggers for all the images as
well.

Thanks!

/Fredrik

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



Re: Trouble with JDBC (I need a little help)

2005-03-16 Thread Maxime
Fenderbosch Eric, Wolfgang Hackl and Jon Wingfield. Hi and thank you!

It's looks like I have a lot of thing to learn (it's nice to learn everyday
hehe). For closing connection + ResultSet and Statement, I wanted to include
them later.
Anyway,  thank you very very much for these advices and answers. I read them
very carefully ! (Thank you for the explanation Jon, you were completly
right about the Connection)
It's looks like I have to completly rewrite de DBConnection Class, surely a
clean code (not a fuzzy like that old one) !
Thank you again, if you have some advices about that, I will gracefully take
them !

Cya later
Maxime



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



Re: Trouble with JDBC (I need a little help)

2005-03-16 Thread Jon Wingfield
It's a NullPointerException causing all your woes. In the Connect method 
of DBConnection you are assigning to a local variable of type Connection 
instead of the instance variable. The instance variable is always null, 
which causes issues in the QueryDataBase and TotalRows methods.

The code as it stands is rather flaky, I'm afraid.
Look into connection pooling (docs on the tomcat site and many posts 
related to it on this list) and defensive programming (checking for null 
values etc, etc). Also, Wolfgang's advice is good: always close 
ResultSets and Statements after you're done with them (and connections 
for that matter).

HTH,
Jon
Maxime wrote:
Hello Everybody;
I'am asking for help because I have a problem that it's making me crazy.
To do some query to the Database, I am using a Class  named DBConnection.
It's like around 1 week, I didn't do anything on the code (perhaps I did 
because it doesn't working now).
Well... , in order to find the problem I did some test function, but I still 
can't find it.
Here we go, it's not very long, it's just some basic code and 2 logs

This the JSP where my test start.
Test.jsp


DataBase Test!

DataBase Test Button
http://localhost:8080/Training/TEST2";>


DataBase Test Button2
http://localhost/Training/TEST3";>




We have 2 button to access on servlet Test2 and Test3
Here they go :

TEST3.java :
package Training;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*; 
import java.sql.DriverManager; 

public class TEST3 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException  {

response.setContentType("text/html");
PrintWriter out = response.getWriter();

// New Instance : DBConnection
DBConnection db = new DBConnection();   

String req ="Select * FROM User_Table";
try{

db.Connect();
out.println(" DRIVERS JDBC : OK!");
out.println(" Connexion TO DB : OK!");

ResultSet Result = db.QueryDataBase(req);

// This part was added to see if we can catch the total row 
int col = db.TotalRows(Result);
if (col == 0)
{
out.println("Query to DB is not ok!");
}
else{
out.println(col);
}

}
catch (ClassNotFoundException e) 
  { 
 out.println("PB with Drivers");
  } 

catch (Exception x) 
{ 
  out.println(x); 
} 

}
}

DBConnection.java
package Training;
import java.sql.*; 
import java.sql.DriverManager; 

public class DBConnection{

Connection connection;
Statement stmt;
ResultSet result;

public DBConnection(){
}
public void Connect() throws Exception, SQLException{ 

String url = "jdbc:mysql://localhost:3306/HeroDB"; 
String user = "Login"; 
String password = "Password";
   
try { 
 // Load JDBC Drivers
 Class.forName("com.mysql.jdbc.Driver"); 
 // make the connection with the database 
The problem's right here:
 Connection connection = DriverManager.getConnection(url,user,password);
   }
 catch(SQLException sqle){ 
  
   System.out.println(sqle.getMessage());
   
  
   }
   catch(Exception e){ 
  
   System.out.println("The Connection Failed !"+ e.getMessage()); 
   
   }


 }

public ResultSet QueryDataBase(String SQLFunc)throws SQLException, Exception{ 
try{
stmt = connection.createStatement(); 
result = stmt.executeQuery(SQLFunc); 
   } 
 catch(SQLException sqle){ 
  
   System.out.println("Problem with getting Result1!"+ sqle.getMessage());
   System.out.println("Problem with getting Result2!"+ sqle.getSQLState());
   System.out.println("Problem with getting Result3!"+ sqle.getErrorCode());
  
   }
 catch(Exception e){ 
  
   System.out.println("Problem with getting Result4!"+ e.getMessage());
   
   }
return result; 
}

public int TotalRows (ResultSet rs) throws SQLException, Exception
 {
int numRows = 0;
try{

rs.last();
numRows = rs.getRow();
rs.first();
}

catch(SQLException sqle)
  {
   System.out.println("Problem with getting Row1"+ sqle.getMessage());
System.out.println("Problem with getting Row2"+ sqle.getSQLState());
System.out.println("Problem with getting Row3"+ sqle.getErrorCode());
  }
  catch(Exception e){ 
System.out.println("Problem with getting getting Row4!"+ e.getMessage());
}
  
return numRows;
 }

}



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


Re: Trouble with JDBC (I need a little help)

2005-03-16 Thread Wolfgang Hackl
Maxime wrote:
I'am asking for help because I have a problem that it's making me crazy.
 

[Program code and logs snipped]

Thank you very much for the help, it will be very appreciated !
I am not familiar with MySQL therefore just a guess: I do not see a 
single close() statement. Close your ResultSets and Statements after 
usage (read some JDBC tutorials)! If this does not help with your 
current problem, this might be the next problem you run into anyway.

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


Trouble with JDBC (I need a little help)

2005-03-16 Thread Maxime
Hello Everybody;
I'am asking for help because I have a problem that it's making me crazy.
To do some query to the Database, I am using a Class  named DBConnection.

It's like around 1 week, I didn't do anything on the code (perhaps I did 
because it doesn't working now).
Well... , in order to find the problem I did some test function, but I still 
can't find it.
Here we go, it's not very long, it's just some basic code and 2 logs



This the JSP where my test start.

Test.jsp


DataBase Test!


DataBase Test Button
http://localhost:8080/Training/TEST2";>


DataBase Test Button2
http://localhost/Training/TEST3";>






We have 2 button to access on servlet Test2 and Test3

Here they go :

TEST2.java :

package Training;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*; 
import java.sql.DriverManager; 

public class TEST2 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException  {

response.setContentType("text/html");
PrintWriter out = response.getWriter();

Statement stmt;
ResultSet result; 

String url = "jdbc:mysql://localhost:3306/HeroDB"; 
String user = "Login"; 
String password = "Password";

try{
Class.forName("com.mysql.jdbc.Driver"); 
out.println(" DRIVERS JDBC : OK!");
Connection connection = DriverManager.getConnection(url,user,password);
out.println(" Databse Connexion : OK!");
 
String req ="Select * FROM User_Table";
stmt = connection.createStatement();
result = stmt.executeQuery(req); 
   
   // This part was added to see if we can catch the total row
   int numRows = 0;
   result.last();
   numRows = result.getRow();
   result.first();
   out.println(numRows);

  
  result.beforeFirst();
  while (result.next())
  {
  out.println(result.getString("Login"));
  
  }
}
catch (ClassNotFoundException e) 
  { 
 out.println("PB with Drivers");
  } 
catch(SQLException ex) {
 

out.println(" Error Message ");
 while (ex != null) {
  
out.println("Message: " + ex.getMessage ());
  
out.println("SQLState: "  + ex.getSQLState ());
  
out.println("ErrorCode: "  + ex.getErrorCode ());
  
ex = ex.getNextException();
  out.println("");
 }
}


}
}

This code works perfectly, all users are displayed + the total row of the 
resultset.
But now, here the interested part (where it give me some headache:


TEST3.java :

package Training;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*; 
import java.sql.DriverManager; 

public class TEST3 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException  {

response.setContentType("text/html");
PrintWriter out = response.getWriter();

// New Instance : DBConnection
DBConnection db = new DBConnection();   

String req ="Select * FROM User_Table";

try{

db.Connect();
out.println(" DRIVERS JDBC : OK!");
out.println(" Connexion TO DB : OK!");

ResultSet Result = db.QueryDataBase(req);

// This part was added to see if we can catch the total row 
int col = db.TotalRows(Result);
if (col == 0)
{
out.println("Query to DB is not ok!");
}
else{
out.println(col);
}

}
catch (ClassNotFoundException e) 
  { 
 out.println("PB with Drivers");
  } 

catch (Exception x) 
{ 
  out.println(x); 
} 

}
}



DBConnection.java

package Training;

import java.sql.*; 
import java.sql.DriverManager; 

public class DBConnection{

Connection connection;
Statement stmt;
ResultSet result;


public DBConnection(){
}

public void Connect() throws Exception, SQLException{ 

String url = "jdbc:mysql://localhost:3306/HeroDB"; 
String user = "Login"; 
String password = "Password";
   
try { 
 // Load JDBC Drivers
 Class.forName("com.mysql.jdbc.Driver"); 
 // make the connection with the database 
 Connection connection = DriverManager.getConnection(url,user,password);
   }
 catch(SQLException sqle){ 
  
   System.out.println(sqle.getMessage());
   
  
   }
   catch(Exception e){ 
  
   System.out.println("The Connection Failed !"+ e.getMessage()); 
   
   }


 }

public ResultSet QueryDataBase(String SQLFunc)throws SQLException, Exception{ 
try{
stmt = connection.createStatement(); 
result = stmt.executeQuery(SQLFunc); 
   } 
 catch(SQLException sqle){ 
  
   

RE: Installing tomcat (help)

2005-03-15 Thread Caldarale, Charles R
> From: Ben Souther [mailto:[EMAIL PROTECTED]
> Subject: Re: Installing tomcat (help)
> 
> the exe
> 
> On Tue, 2005-03-15 at 11:56, brian wrote:
> > One binary is an exe, one is tar.gz, one is a zip, another is
> > Deployer. Which one is the installation file for windows ?

Although the .exe is a true Windows installer, I much prefer using the .zip 
package, especially for the installation of a new level.  It provides the 
scripts to run from a command prompt, which I find to be much easier than 
running Tomcat as a service during the shakedown and tuning phase.  Once you're 
happy with your setup, you can use the service.bat script to create a service, 
if you wish.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Installing tomcat (help)

2005-03-15 Thread Ben Souther
the exe

On Tue, 2005-03-15 at 11:56, brian wrote:
> Below is the tomcat installation files for download and have
> pasted the contents of README packaging information.
> 
> One binary is an exe, one is tar.gz, one is a zip, another is
> Deployer. Which one is the installation file for windows ?
> 
> The .exe is the Tomcat Setup wizard. Is this the windows
> version ?
> 
> --
> 5.0.28 
>  Binary 
>   README (contains packaging information) 
>   5.0.28 exe 
>  [md5] [pgp] 
>   5.0.28 tar.gz 
>  [md5] [pgp] 
>   5.0.28 zip 
>  [md5] [pgp] 
>   5.0.28 Deployer tar.gz 
>  [md5] [pgp] 
>   5.0.28 Deployer zip 
>  [md5] [pgp] 
>   5.0.28 Embed tar.gz 
>  [md5] [pgp] 
>   5.0.28 Embed zip 
>  [md5] [pgp] 
> --
> Apache Tomcat 5.0.28
> 
> Useful references: 
> 
> Release notes, with important information about known issues 
> Changelog 
> Status 
> 
> NOTE: The tar files in this distribution use GNU tar
> extensions, and must be untarred with a GNU compatible
> version of tar. The version of tar on Solaris and Mac OS X
> will not work with these files.
> 
> Thank you for using Tomcat!. 
> -
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.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]



Installing tomcat (help)

2005-03-15 Thread brian
Below is the tomcat installation files for download and have
pasted the contents of README packaging information.

One binary is an exe, one is tar.gz, one is a zip, another is
Deployer. Which one is the installation file for windows ?

The .exe is the Tomcat Setup wizard. Is this the windows
version ?

--
5.0.28 
 Binary 
  README (contains packaging information) 
  5.0.28 exe 
 [md5] [pgp] 
  5.0.28 tar.gz 
 [md5] [pgp] 
  5.0.28 zip 
 [md5] [pgp] 
  5.0.28 Deployer tar.gz 
 [md5] [pgp] 
  5.0.28 Deployer zip 
 [md5] [pgp] 
  5.0.28 Embed tar.gz 
 [md5] [pgp] 
  5.0.28 Embed zip 
 [md5] [pgp] 
--
Apache Tomcat 5.0.28

Useful references: 

Release notes, with important information about known issues 
Changelog 
Status 

NOTE: The tar files in this distribution use GNU tar
extensions, and must be untarred with a GNU compatible
version of tar. The version of tar on Solaris and Mac OS X
will not work with these files.

Thank you for using Tomcat!. 
-


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Help getting started

2005-03-15 Thread Pete Stevens

How to install tomcat for linux,

http://www.mythic-beasts.com/support/topic_vds_java.html


How to make it act like a normal webserver with jsp & virtual hosting support,
rather than worrying about packaging .war files etc.

http://www.ex-parrot.com/~pete/tomcat-vhost.html


Hope this helps.

Pete

On Tue, 15 Mar 2005, Allistair Crossley wrote:

> Hi,
>
> Yes, and some would say you don't need the Apache web server, since Tomcat 
> can act as a web server too. Tomcat provides an implementation of the Servlet 
> and JSP aspects of the J2EE suite, so if you only need those you're ok.
>
> Allistair.
>
> > -Original Message-
> > From: brian [mailto:[EMAIL PROTECTED]
> > Sent: 15 March 2005 16:27
> > To: tomcat-user@jakarta.apache.org
> > Subject: Help getting started
> >
> >
> > To get a servelet engine one needs the following
> > apache web server
> > and tomcat servlet engine ??
> >
> > What about J2EE ? Does one need that as well ? Or the servlet
> > engine above (like tomcat) would contain the J2EE as well.
> >
> >
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> 
> ---
> QAS Ltd.
> Developers of QuickAddress Software
> http://www.qas.com";>www.qas.com
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> ---
> 
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

--
Pete Stevens
[EMAIL PROTECTED]
http://www.ex-parrot.com/~pete/

When I read about the evils of drinking, I gave up reading.
  -- Henny Youngman

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



RE: Help getting started

2005-03-15 Thread Allistair Crossley
Hi,

Yes, and some would say you don't need the Apache web server, since Tomcat can 
act as a web server too. Tomcat provides an implementation of the Servlet and 
JSP aspects of the J2EE suite, so if you only need those you're ok.

Allistair.

> -Original Message-
> From: brian [mailto:[EMAIL PROTECTED]
> Sent: 15 March 2005 16:27
> To: tomcat-user@jakarta.apache.org
> Subject: Help getting started
> 
> 
> To get a servelet engine one needs the following
> apache web server
> and tomcat servlet engine ??
> 
> What about J2EE ? Does one need that as well ? Or the servlet
> engine above (like tomcat) would contain the J2EE as well.
> 
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


 
---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---



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



RE: Help getting started

2005-03-15 Thread Peter Crowther
> From: brian [mailto:[EMAIL PROTECTED] 
> To get a servelet engine one needs the following
> apache web server

No.  Tomcat will work standalone.

> and tomcat servlet engine ??

Or another engine such as Jetty.  But that's heresy on this list ;-).

> What about J2EE ? Does one need that as well ? Or the servlet
> engine above (like tomcat) would contain the J2EE as well.

J2EE is a collection of different parts.  Tomcat provides
implementations of some, but not all, of the parts.  What do you want
"J2EE" for?  Which bits do you want?

- Peter

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



Help getting started

2005-03-15 Thread brian
To get a servelet engine one needs the following
apache web server
and tomcat servlet engine ??

What about J2EE ? Does one need that as well ? Or the servlet
engine above (like tomcat) would contain the J2EE as well.



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Help with SSL & Cert

2005-03-15 Thread joelsherriff
Hope someone can help.  I've searched through the archives and this seems to be 
a common problem, but even detailed instructions
have left me stumped.  I'm trying to get client certificates to be required by 
tomcat by setting clientAuth=true but I can't seem to figure out how
to get the client certificate to be accepted once I do that.  Here's what I've 
done to generate all the appropriate files (parts coped from
other posts to this list):

# Create a private key and certificate request
openssl req -new -subj "/C=US/ST=North Carolina/L=Raleigh/CN=akuma-c" -newkey 
rsa:1024 -nodes -out ca.csr -keyout ca.key

# Create CA's self-signed certificate
openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out ca.pem

# Copy ca.pem to ca.crt, edit and change "TRUSTED CERTIFICATE" to "CERTIFICATE"
# import ca.crt into the Trusted Root Certificates Store in IE

#Import the CA certificate into the JDK certificate authorities keystore:
keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file ca.pem 
-alias my_ca_alias -keypass changeit -storepass changeit

# Create a file to hold CA's serial numbers.
echo "02" > ca.srl

# Create a keystore for the web server.
keytool -genkey -alias tomcat-sv -dname "CN=akuma-c, OU=R&D, O=MyOrganization, 
L=Raleigh, S=North Carolina, C=US" -keyalg RSA -keypass changeit -storepass 
changeit -keysize 1024 -keystore server.keystore -storetype JKS

# Create a certificate request for the web server:
keytool -certreq -keyalg RSA -alias tomcat-sv -file server.csr -keystore 
server.keystore -storepass changeit

# Sign the certificate request:
openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in server.csr -out 
server.crt -days 365

# Import the signed server certificate into the server keystore:
keytool -import -alias tomcat-sv -keystore server.keystore -trustcacerts -file 
server.crt -storepass changeit

# Import the CA certificate into the server keystore:
keytool -import -alias my_ca_alias -keystore server.keystore -trustcacerts 
-file ca.pem -keypass changeit

# Create a client certificate request:
openssl req -new -newkey rsa:512 -nodes -out client1.req -keyout client1.key

# Sign the client certificate.
openssl x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in client1.req 
-out client1.pem -days 365

# Generate a PKCS12 file containing client key and client certificate.
openssl pkcs12 -export -clcerts -in client1.pem -inkey client1.key -out 
client1.p12 -name "Client"

# Import the PKCS12 file into the web browser under Personal Certificates

# edit the server.xml file and set clientAuth=true and keystoreFile to point to 
my server.keystore file.

Once all this is done, neither IE nor my web app can talk to tomcat on the ssl 
port (8443)

x509 Certificate Public key Problem - HELP

2005-03-10 Thread Sanjeev Srivastava
Hi all !

I am facing problem in displaying Public Key. When I
am pasring X509 certificate the Public Key is coming
as a very long String as as given in Format 1 below,
though it should come like as given in Format 2 below.


out.println(x509certificate.getPublicKey());

I am using Bouncy Castle API and after that only the
Public Key is coming like a long String. Please
advice. 


I tried to convert the Public key into byte array then
to String, but it is showing junk charaters. The
encoding for Publick key is ASN.1 DER but its is
giving error.

I need your advice .. Please HELP...! 

byte buf [] =
x509certificate.getPublicKey().getEncoded();
String s = new String(buf, "UTF-8");
s= new String(s.getBytes("ISO8859_1"), "UTF-8");
out.println(s);


Format 1

RSA Public Key modulus:
cd288334541b89f30faf379131ffaf3160c9a8e8b21068ed9fe79336f10a64bb47f504173f23474dc5271981260c54720d882dd91f9a129fbcb371d380193f47667b8c3528d2b90adf24da9cd65079817a5ad337f7c24ad829922664d1e4986c3a008af5349b65f8ede310fffdb84958dca0de82396b81b1161961b954b6e643
public exponent: 3 


Format 2

SunJSSE RSA public key: public exponent: 010001
modulus: c90a4f87 1cb7a888 b668a7a2 3b6ceb7b 6c1f2ad8
d548a4d3 34b5cdce 32535ed3 d122116a d8afc534 082b8877
fdc6f728 66d0b743 935f868a 80be4a94 e4d953ca 69bbf480
ff0ba33b bb7f88a4 05403841 7d74b823 3499f387 76e8a8ad
a7fd0d91 07cda676 23df07ca d8afaa75 cfc245e7 10bb201d
f6308f10 52b5fb79 66ab41f9


Thanks xue daoming for conversion but its not working
, I tried searching the charset and encoding but no
solution till now


Best Regards,
Sanjeev

--- xue daoming <[EMAIL PROTECTED]> wrote:
> I think you can do as just below:
> byte[] buf  =
> x509certificate.getPublicKey().getEncoded();
> String s = new String(buf);
> 
> 
> On Thu, 10 Mar 2005 02:35:03 + (GMT), Sanjeev
> Srivastava
> <[EMAIL PROTECTED]> wrote:
> > Hi All
> > 
> > Can anybody tell me how to convert this Byte [] to
> > String..
> > 
> > byte[] buf =
> > x509certificate.getPublicKey().getEncoded();
> > 
> > Please help
> > 
> > Thanks,
> > Sanjeev
> > 
> > Send instant messages to your online friends
> http://uk.messenger.yahoo.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]
> 
> 

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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



Re: Help - Byte [] to String

2005-03-09 Thread xue daoming
I think you can do as just below:
byte[] buf  = x509certificate.getPublicKey().getEncoded();
String s = new String(buf);


On Thu, 10 Mar 2005 02:35:03 + (GMT), Sanjeev Srivastava
<[EMAIL PROTECTED]> wrote:
> Hi All
> 
> Can anybody tell me how to convert this Byte [] to
> String..
> 
> byte[] buf =
> x509certificate.getPublicKey().getEncoded();
> 
> Please help
> 
> Thanks,
> Sanjeev
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.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]



<    1   2   3   4   5   6   7   8   9   10   >