Re: mod_jk2+tomcat+apache2 on OSX: WORKS! but NOT FINDINGworkers2.properties in DFAULT location

2003-03-29 Thread R Blake
hi

I've built 2.0.44 on Mac OS X with mod_jk2 and and running Tomcat 4.1.8
and 4.1.24. If the apache directory patch is set up correctly apache
should look for it conf directory, based on how you defined --prefix in
configure. It should look something like this:
./configure \
--prefix= /Library/Apache2 \
--with-apxs=/Library/Apache2/bin/apxs \
--with-java-home=/Library/Java/Home \
--with-java-platform=2 \
--enable-jni \
--enable-so \
--enable-proxy \
--enable-imap \
--enable-ssl \
--enable-modules=most \
--enable-mods-shared=all \
--enable-java=/System/Library/Frameworks/JavaVM.framework/Versions/
1.4.1
agreed  that's what's got me a bit confused.  prefix, and all other 
template settings are invoked in my configure with -enable-layout-=Darwin 
...

./configure \
--enable-layout=Darwin --with-port=80 --with-mpm=prefork \
--enable-mods-shared=all --enable-so \
--sysconfdir=/etc/apache2 \
--enable-dav --enable-dav-fs \
--enable-ssl --with-ssl \
--enable-suexec --with-suexec-caller=www \
--with-z \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-ftp \
--enable-proxy-http \
--enable-logio \
--enable-authn-dbm --enable-authz-dbm
which, if you look in my original pst, includes:

   prefix:/usr
   exec_prefix:   ${prefix}
   bindir:${exec_prefix}/bin
   sbindir:   ${exec_prefix}/sbin
   libdir:${exec_prefix}/lib
   libexecdir:${exec_prefix}/libexec+
   mandir:${prefix}/share/man
   datadir:   /Library/WebServer
   sysconfdir:/etc+

Then the workers2.properties file should be found in the
/Library/Apache2/conf directory and apache should find it.
So that's my point . its grapping the ${serverroot} from apache's 
prefix=/usr  but IGNORING where the sysconf files ACTUALLY are ... 
i.e., in /etc/apache2

does you jk2.properties file look like? See mine below:
mine is very simple:

handler.list=apr,channelSocket,request
shm.file=/usr/local/tomcat/work/jk2.shm
your comments have comfirmed i how it is behaving, but, again, it SHOULD 
find it in /etc/apache2, no?

thx,

blakers

## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
## WHEN YOU EDIT THE FILE.
## COMMENTS WILL BE _LOST_

## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.

serverRoot=/Library/Apache2
# Set the desired handler list
handler.list=apr,request,container,channelJni
#
# Override the default port for the socketChannel
# channelSocket.port=8019
# Default:
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config  is working
# shm.file=${jkHome}/work/jk2.shm
# In order to enable jni use any channelJni directive
channelJni.disabled = 0
# And one of the following directives:
# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
apr.jniModeSo=inprocess
Regards,

Tony



On Saturday, Mar 29, 2003, at 08:18 Europe/Berlin, R Blake wrote:

hi all,

i've gotten mod_jk2/2.0.3-dev, tomcat 4.1.24 LE, and Apache/2.1.0
built and playing nicely together on MacOSX 10.2.4.  html, jsp 
servlets all behaving exactly as they should!
just fyi, my Apache 'server-info reports:

   Apache/2.1.0-dev (Unix) mod_perl/1.99_08 Perl/v5.8.0 DAV/2
mod_jk2/2.0.3-dev PHP/4.3.2-RC
now, to my problem .

everything builds fine, and I've set up my config/properties files
correctly, but on apachectl start,  my /var/log/apache2_error.log is
showing:
   [error] config.update(): Can't find config file
/usr/conf/workers2.properties
in order to make this work, I have to kludge a bit by:

   mkdir /usr/conf
   ln -s /etc/apache2/workers2.properties
/usr/conf/workers2.properties
where /etc/apache2 is my httpd.conf directory  and where mod_jk
SHOULD be looking for workers2.properties
now, I know the REASON this is happening .  mod_jk2's code defines:

# define JK_WORKER_FILE_DEF  (${serverRoot}/conf/workers2.properties)
in several places, and an apxs build of mod_jk2 is grabbing prefix:
/usr for the ServerRoot, because I use the Darwin/MacOS
(config.layout) template when building apache2:
#   Darwin/Mac OS Layout u
Layout Darwin?
   prefix:/usr
   exec_prefix:   ${prefix}
   bindir:${exec_prefix}/bin
   sbindir:   ${exec_prefix}/sbin
   libdir:${exec_prefix}/lib
   libexecdir:${exec_prefix}/libexec+
   mandir:${prefix}/share/man
   datadir:   /Library/WebServer
   sysconfdir:/etc+
   installbuilddir: ${prefix}/share/httpd/build
   errordir:  ${prefix}/share/httpd/error
   iconsdir:  ${prefix}/share/httpd/icons
   htdocsdir: ${datadir}/Documents
   manualdir: /Library/WebServer/Documents/docs/apache2
   cgidir:${datadir}/CGI-Executables
   includedir:${prefix}/include+
   localstatedir: /var
   runtimedir:${localstatedir}/run
   logfiledir:${localstatedir}/log+
   proxycachedir: ${runtimedir}/proxy
/Layout
its seems to be MISSING/IGNORING the sysconfdir:/etc+ 

Re: Configuring Tomcat to use a JDBC Realm

2003-03-29 Thread Dean A. Hoover
Isn't mysql a client program? If so, I can connect with
the user/pw.
Tarun Ramakrishna Elankath wrote:

Seems like an access problem to me.
Dean, did you try connecting to the server from a mysql client with the
given username/password to check whether you are able to connect ?


On Sat, 2003-03-29 at 07:50, Dean A. Hoover wrote:
 

Can you be a little more specific? I'm not a mysql expert.
   



-
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: Living without a Context - deploying an application using manager app

2003-03-29 Thread johannes . fiala
Hi Jacob,

1.) 1.000 thanks - this was the answer I needed.
Do you know where this is to be found in the docs??? I spent quite some 
time with searching this forum and the internet, but didn't find any 
recommendation like that you just gave me.

2.) I see 
context.getAttribute(javax.servlet.context.tempdir)
returns the directory the application is living at.

Is it ok to access the file system using
=
String mydir = 
(String)context.getAttribute(javax.servlet.context.tempdir);
FileInputStream fin = new FileInputStream(mydir + 
/WEB-INF/myconfig.txt);
= ? 
or is it more preferable to use
=
Class myclass = this;
FileInputStream fin = 
(FileInputStream)myclass.getResourceAsStream(WEB-INF/myconfig.txt);
= ?

pls give me a hint which type of access is more portable?
Do you also know a howto how to create portable web-applications?

thx a lot
Johannes





Jacob Kjome [EMAIL PROTECTED] 
28.03.2003 20:27
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
Re: Living without a Context - deploying an application using  manager app







What do you mean Living without a Context?

Do you mean living without a Tomcat Context ... entry?

All you have to do is add META-INF/context.xml (the name context.xml is 
important so don't name it something else) to your .war file.  context.xml 

is the context configuration file for the context and contains a single 
Context ... element and any nested elements that the Context ... 
element supports.

A sample context.xml might look like...

Context path=/arbitraypath docBase=dbadmin.war/

Note that the path can be anything you want, but the docBase must be the 

name of the .war file.

I also saw your other message where you said

quote
additionaly, an application deployed using the manager app currently
returns null if you use servletcontext.getRealPath();
so it's context seems to be quite obfuscated...
/quote

This is to be expected.  When you deploy your app as a .war file and not a 

directory structure, you have no file system access.  If you are counting 
of having File IO access to within your webapp, you are creating a 
non-portable application.  The servlet spec does not guarantee any direct 
file system access to any resource on the server other than the directory 
path returned by context.getAttribute(javax.servlet.context.tempdir).

there you go.

Jake

At 07:46 PM 3/28/2003 +0100, you wrote:
hi there,

here are my findings after some experimentation with the ant deploy task
of the manager app.

*) a complete application can be easily built into a WAR file using ant
*) this WAR file can be easily deployed using ant deploy task
*) once deployed onto the server, the application is running with the
docbase located somewhere under the manager directory:
ant list
- produces:
/dbadmin:running:1:F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war

*) there the application is living
- without a context
- thus, also without any JNDI resources etc. defined in server.xml for a
context dbadmin with docbase dbadmin.

Would renaming the docbase to 
F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war resolve
the problem of not having any context?
What else could be done to get a context for the webapplication 
dbadmin?

thx
Johannes



Re: Living without a Context - deploying an application using manager app

2003-03-29 Thread johannes . fiala
p.s. I also have found that
ant deploy
will give me the context as desired (if stored in META-INF/context.xml as 
recommended by you)

however, ant install does not create the same result.
There the context.getInitParameter() and JNDI-configuration 
(ResourceLinks) both return null and are not inited correctly. 

Thus it seems that ant deploy will correctly initialize the Context, but 
ant install fails to do so.
Working this way, ant install seems to be quite useless to me, or does 
it have another sense to use it?

thx alot
Johannes






Jacob Kjome [EMAIL PROTECTED] 
28.03.2003 20:27
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
Re: Living without a Context - deploying an application using  manager app







What do you mean Living without a Context?

Do you mean living without a Tomcat Context ... entry?

All you have to do is add META-INF/context.xml (the name context.xml is 
important so don't name it something else) to your .war file.  context.xml 

is the context configuration file for the context and contains a single 
Context ... element and any nested elements that the Context ... 
element supports.

A sample context.xml might look like...

Context path=/arbitraypath docBase=dbadmin.war/

Note that the path can be anything you want, but the docBase must be the 

name of the .war file.

I also saw your other message where you said

quote
additionaly, an application deployed using the manager app currently
returns null if you use servletcontext.getRealPath();
so it's context seems to be quite obfuscated...
/quote

This is to be expected.  When you deploy your app as a .war file and not a 

directory structure, you have no file system access.  If you are counting 
of having File IO access to within your webapp, you are creating a 
non-portable application.  The servlet spec does not guarantee any direct 
file system access to any resource on the server other than the directory 
path returned by context.getAttribute(javax.servlet.context.tempdir).

there you go.

Jake

At 07:46 PM 3/28/2003 +0100, you wrote:
hi there,

here are my findings after some experimentation with the ant deploy task
of the manager app.

*) a complete application can be easily built into a WAR file using ant
*) this WAR file can be easily deployed using ant deploy task
*) once deployed onto the server, the application is running with the
docbase located somewhere under the manager directory:
ant list
- produces:
/dbadmin:running:1:F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war

*) there the application is living
- without a context
- thus, also without any JNDI resources etc. defined in server.xml for a
context dbadmin with docbase dbadmin.

Would renaming the docbase to 
F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war resolve
the problem of not having any context?
What else could be done to get a context for the webapplication 
dbadmin?

thx
Johannes



servlet problems with web app outside Tomcat directory

2003-03-29 Thread Peter Reynolds
Hello Mike,

http://www.mail-archive.com/[EMAIL PROTECTED]/msg90076.html

Did you ever manage to solve this problem? I think I have the same one 
and I couldn't see any replys to your message on the list.

Thanks,

Peter

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


RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread Jeff Jensen
I do not have an answer for your specific issue, but I found minor deploy
issues with install, so I only use deploy and undeploy tasks and do not have
any more issues.  Have you tried using deploy - did it have the same
problems?


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 11:52 AM
 To: Tomcat Users List
 Subject: Trouble with ant install command and ResourceLink


 hi there,

 In my /webapps/myapp.xml I'm using a ResourceLink:
   ResourceLink name=jdbc/mydb global=MyDatabase/

 I'm using the manager app via ant to test my application.
 After calling
 ant remove
 ant install

 it tells me the context has been installed OK.
 However, it seems as if the ResourceLink has not been inited during
 install, so it seems Tomcat doesn't read the /webapps/myapp.xml file.

 Sidenote: this problem is somewhat related to my
 initparameter problem
 outlined earlier today, but cannot be overcome as easily.

 has anybody overcome this issue?
 is else using the ant manager task together with JNDI resourcelinks
 successfully?

 thx
 Johannes


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



RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread johannes . fiala
Hi Jeff,

no, using the ant deploy task it worked smoothly.
I was just wondering what the install task is all about (if it's not 
working)

thx 
Johannes




Jeff Jensen [EMAIL PROTECTED] 
29.03.2003 15:02
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
'Tomcat Users List' [EMAIL PROTECTED]
cc

Subject
RE: Trouble with ant install command and ResourceLink






I do not have an answer for your specific issue, but I found minor deploy
issues with install, so I only use deploy and undeploy tasks and do not 
have
any more issues.  Have you tried using deploy - did it have the same
problems?


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 11:52 AM
 To: Tomcat Users List
 Subject: Trouble with ant install command and ResourceLink


 hi there,

 In my /webapps/myapp.xml I'm using a ResourceLink:
   ResourceLink name=jdbc/mydb global=MyDatabase/

 I'm using the manager app via ant to test my application.
 After calling
 ant remove
 ant install

 it tells me the context has been installed OK.
 However, it seems as if the ResourceLink has not been inited during
 install, so it seems Tomcat doesn't read the /webapps/myapp.xml file.

 Sidenote: this problem is somewhat related to my
 initparameter problem
 outlined earlier today, but cannot be overcome as easily.

 has anybody overcome this issue?
 is else using the ant manager task together with JNDI resourcelinks
 successfully?

 thx
 Johannes


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




Where to store files in a portable app?

2003-03-29 Thread johannes . fiala
HI there,

In my app I need to store files after a transaction is complete.
I want to keep my application portable, so where should I store such files 
to??

Should I use a /output/.. directory in the root area or where else could 
be a smart location?

Any ideas on this topic??

thx alot
Johannes

RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread Jeff Jensen
Yes, me too.  Based on what the install process does compared to deploy, I
have not yet determined an applicable time to use install vs deploy!  I
haven't looked back since started using deploy... :-)


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Saturday, March 29, 2003 8:23 AM
 To: Tomcat Users List
 Subject: RE: Trouble with ant install command and ResourceLink


 Hi Jeff,

 no, using the ant deploy task it worked smoothly.
 I was just wondering what the install task is all about
 (if it's not
 working)

 thx
 Johannes




 Jeff Jensen [EMAIL PROTECTED]
 29.03.2003 15:02
 Please respond to
 Tomcat Users List [EMAIL PROTECTED]


 To
 'Tomcat Users List' [EMAIL PROTECTED]
 cc

 Subject
 RE: Trouble with ant install command and ResourceLink






 I do not have an answer for your specific issue, but I found
 minor deploy
 issues with install, so I only use deploy and undeploy tasks
 and do not
 have
 any more issues.  Have you tried using deploy - did it have the same
 problems?


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 28, 2003 11:52 AM
  To: Tomcat Users List
  Subject: Trouble with ant install command and ResourceLink
 
 
  hi there,
 
  In my /webapps/myapp.xml I'm using a ResourceLink:
ResourceLink name=jdbc/mydb global=MyDatabase/
 
  I'm using the manager app via ant to test my application.
  After calling
  ant remove
  ant install
 
  it tells me the context has been installed OK.
  However, it seems as if the ResourceLink has not been inited during
  install, so it seems Tomcat doesn't read the
 /webapps/myapp.xml file.
 
  Sidenote: this problem is somewhat related to my
  initparameter problem
  outlined earlier today, but cannot be overcome as easily.
 
  has anybody overcome this issue?
  is else using the ant manager task together with JNDI resourcelinks
  successfully?
 
  thx
  Johannes


 -
 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: servlet problems with web app outside Tomcat directory

2003-03-29 Thread Boon Seong
since you have a package name for ur servlet , i think u need do a servlet
mapping
on web.xml file

- Original Message -
From: Peter Reynolds [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 3:40 PM
Subject: servlet problems with web app outside Tomcat directory


 Hello Mike,

 http://www.mail-archive.com/[EMAIL PROTECTED]/msg90076.html

 Did you ever manage to solve this problem? I think I have the same one
 and I couldn't see any replys to your message on the list.

 Thanks,

 Peter


 -
 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: Where to store files in a portable app?

2003-03-29 Thread Kaarle Kaila
At 15:35 29.3.2003 +0100, you wrote:
HI there,

In my app I need to store files after a transaction is complete.
I want to keep my application portable, so where should I store such files
to??
I would put the directory address for the files in a properties file 
(ResourceBundle)
Then you can really put them anywhere you like.

regards
Kaarle

Should I use a /output/.. directory in the root area or where else could
be a smart location?
Any ideas on this topic??

thx alot
Johannes
-
Kaarle Kaila
http://www.iki.fi/kaila
mailto:[EMAIL PROTECTED]
tel: +358 50 3725844 

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


RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread johannes . fiala
hi jeff,

ok. so I will stay with deploy as well.

Currently I do the following to redeploy:
ant remove
ant deploy

However, there is a small time where users will still get a 404 error (the 
small delay where the PUT command is issued by the deploy task). Do you 
know a way how to get around this issue to have 100% uptime of an 
application?

thx alot
Johannes





Jeff Jensen [EMAIL PROTECTED] 
29.03.2003 15:34
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
'Tomcat Users List' [EMAIL PROTECTED]
cc

Subject
RE: Trouble with ant install command and ResourceLink






Yes, me too.  Based on what the install process does compared to deploy, I
have not yet determined an applicable time to use install vs deploy!  I
haven't looked back since started using deploy... :-)


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Saturday, March 29, 2003 8:23 AM
 To: Tomcat Users List
 Subject: RE: Trouble with ant install command and ResourceLink


 Hi Jeff,

 no, using the ant deploy task it worked smoothly.
 I was just wondering what the install task is all about
 (if it's not
 working)

 thx
 Johannes




 Jeff Jensen [EMAIL PROTECTED]
 29.03.2003 15:02
 Please respond to
 Tomcat Users List [EMAIL PROTECTED]


 To
 'Tomcat Users List' [EMAIL PROTECTED]
 cc

 Subject
 RE: Trouble with ant install command and ResourceLink






 I do not have an answer for your specific issue, but I found
 minor deploy
 issues with install, so I only use deploy and undeploy tasks
 and do not
 have
 any more issues.  Have you tried using deploy - did it have the same
 problems?


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 28, 2003 11:52 AM
  To: Tomcat Users List
  Subject: Trouble with ant install command and ResourceLink
 
 
  hi there,
 
  In my /webapps/myapp.xml I'm using a ResourceLink:
ResourceLink name=jdbc/mydb global=MyDatabase/
 
  I'm using the manager app via ant to test my application.
  After calling
  ant remove
  ant install
 
  it tells me the context has been installed OK.
  However, it seems as if the ResourceLink has not been inited during
  install, so it seems Tomcat doesn't read the
 /webapps/myapp.xml file.
 
  Sidenote: this problem is somewhat related to my
  initparameter problem
  outlined earlier today, but cannot be overcome as easily.
 
  has anybody overcome this issue?
  is else using the ant manager task together with JNDI resourcelinks
  successfully?
 
  thx
  Johannes


 -
 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: Where to store files in a portable app?

2003-03-29 Thread johannes . fiala
Hi Kaarle,

Thx for the input.
Unfortunately the development system is Windows and production system is 
Unix, so absolute paths will never be the same.

Do you have any idea for how to manage properties files which will be 
different for windows than unix?
Should I create a separate web_local and web_remote directory and make a 
simple ant copy task to distinguish production/development?
Or is there a more elegant approach to this?

thx alot
Johannes




Kaarle Kaila [EMAIL PROTECTED] 
29.03.2003 15:41
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
Re: Where to store files in a portable app?






At 15:35 29.3.2003 +0100, you wrote:
HI there,

In my app I need to store files after a transaction is complete.
I want to keep my application portable, so where should I store such 
files
to??

I would put the directory address for the files in a properties file 
(ResourceBundle)
Then you can really put them anywhere you like.

regards
Kaarle


Should I use a /output/.. directory in the root area or where else could
be a smart location?

Any ideas on this topic??

thx alot
Johannes

-
Kaarle Kaila
http://www.iki.fi/kaila
mailto:[EMAIL PROTECTED]
tel: +358 50 3725844 


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




Re: Where to store files in a portable app?

2003-03-29 Thread Kaarle Kaila
At 15:58 29.3.2003 +0100, you wrote:
Hi Kaarle,

Thx for the input.
Unfortunately the development system is Windows and production system is
Unix, so absolute paths will never be the same.
I would think that you need different settings for production and development.
When you have the settings in a properties file (or some xml-file if you like)
then you can anyway have the java and jsp-files independent of the environment.
Perhaps you have everything packed in a war-file for production.
In development you could keep the files unpacked and thus it would be easy
to replace the properties file in development.
Kaarle

Do you have any idea for how to manage properties files which will be
different for windows than unix?
Should I create a separate web_local and web_remote directory and make a
simple ant copy task to distinguish production/development?
Or is there a more elegant approach to this?
thx alot
Johannes


Kaarle Kaila [EMAIL PROTECTED]
29.03.2003 15:41
Please respond to
Tomcat Users List [EMAIL PROTECTED]
To
Tomcat Users List [EMAIL PROTECTED]
cc
Subject
Re: Where to store files in a portable app?




At 15:35 29.3.2003 +0100, you wrote:
HI there,

In my app I need to store files after a transaction is complete.
I want to keep my application portable, so where should I store such
files
to??
I would put the directory address for the files in a properties file
(ResourceBundle)
Then you can really put them anywhere you like.
regards
Kaarle
Should I use a /output/.. directory in the root area or where else could
be a smart location?

Any ideas on this topic??

thx alot
Johannes
-
Kaarle Kaila
http://www.iki.fi/kaila
mailto:[EMAIL PROTECTED]
tel: +358 50 3725844
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
Kaarle Kaila
http://www.iki.fi/kaila
mailto:[EMAIL PROTECTED]
tel: +358 50 3725844 

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


RE: Where to store files in a portable app?

2003-03-29 Thread Jeff Jensen
Have property files that are loaded per OS type/deployment environment.
e.g. build.dev.properties  build.prod.properties or a set of
build.${os.name}.properties files (but then you have to do the deploy
process on the same OS as the deploy target).

So you can have a ${deploy.persist.dir} property defined in each one, and
dependent on where you are deploying to.

If necessary, you can have a property defined in one file (that is loaded
first) and then use that in another property file.  e.g.:
${deploy.persist.base.dir} defined in build.dev.properties ( .prod.) and
then another like
build.persist.dir=${build.persist.base.dir}/subdir/subdir in
build.properties.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Saturday, March 29, 2003 8:59 AM
 To: Tomcat Users List
 Subject: Re: Where to store files in a portable app?


 Hi Kaarle,

 Thx for the input.
 Unfortunately the development system is Windows and
 production system is
 Unix, so absolute paths will never be the same.

 Do you have any idea for how to manage properties files which will be
 different for windows than unix?
 Should I create a separate web_local and web_remote directory
 and make a
 simple ant copy task to distinguish production/development?
 Or is there a more elegant approach to this?

 thx alot
 Johannes




 Kaarle Kaila [EMAIL PROTECTED]
 29.03.2003 15:41
 Please respond to
 Tomcat Users List [EMAIL PROTECTED]


 To
 Tomcat Users List [EMAIL PROTECTED]
 cc

 Subject
 Re: Where to store files in a portable app?






 At 15:35 29.3.2003 +0100, you wrote:
 HI there,
 
 In my app I need to store files after a transaction is complete.
 I want to keep my application portable, so where should I store such
 files
 to??

 I would put the directory address for the files in a properties file
 (ResourceBundle)
 Then you can really put them anywhere you like.

 regards
 Kaarle


 Should I use a /output/.. directory in the root area or
 where else could
 be a smart location?
 
 Any ideas on this topic??
 
 thx alot
 Johannes

 -
 Kaarle Kaila
 http://www.iki.fi/kaila
 mailto:[EMAIL PROTECTED]
 tel: +358 50 3725844


 -
 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: Living without a Context - deploying an application using manager app

2003-03-29 Thread Jacob Kjome
At 11:38 AM 3/29/2003 +0100, you wrote:
Hi Jacob,

1.) 1.000 thanks - this was the answer I needed.
Do you know where this is to be found in the docs??? I spent quite some
time with searching this forum and the internet, but didn't find any
recommendation like that you just gave me.
Not positive where it is in the docs, but you might check under the Host, 
Context, or deployment documentation.  I believe it is there, I just don't 
remember where.

2.) I see
context.getAttribute(javax.servlet.context.tempdir)
returns the directory the application is living at.
No, you misunderstand.  the tempdir is *not* the directory that the 
application is living at.  It works out to something like...

CATALINA_HOME/work/Standalone/localhost/myapp
CATALINA_HOME/work/Standalone/[your virtual host]/[your application context 
name]

this is very specifically *not* where WEB-INF directory is.  If you see one 
there, it is only because Tomcat is caching information.  It is not the 
context's home.

Is it ok to access the file system using
=
String mydir =
(String)context.getAttribute(javax.servlet.context.tempdir);
FileInputStream fin = new FileInputStream(mydir +
/WEB-INF/myconfig.txt);
= ?
or is it more preferable to use
=
Class myclass = this;
FileInputStream fin =
(FileInputStream)myclass.getResourceAsStream(WEB-INF/myconfig.txt);
= ?
pls give me a hint which type of access is more portable?
Do you also know a howto how to create portable web-applications?
Well, the first case is completely incorrect.  If your config file happens 
to be there because Tomcat is doing some sort of caching or something in 
the app's tempdir, consider it a happy accident.  The second case won't 
work because you are using the classloader to find the resource and 
WEB-INF is not a directory that is in the classpath (although 
WEB-INF/classes is and so are jars within WEB-INF/lib).  Here is how you 
would do it...

InputStream is = 
getServletContext().getResourceAsStream(/WEB-INF/myconfig.txt);

using the ServletContext, you can find resources anywhere inside your 
webapp whether the app is being deployed from a directory or directly from 
a .war file.

Jake

thx a lot
Johannes




Jacob Kjome [EMAIL PROTECTED]
28.03.2003 20:27
Please respond to
Tomcat Users List [EMAIL PROTECTED]
To
Tomcat Users List [EMAIL PROTECTED]
cc
Subject
Re: Living without a Context - deploying an application using  manager app






What do you mean Living without a Context?

Do you mean living without a Tomcat Context ... entry?

All you have to do is add META-INF/context.xml (the name context.xml is
important so don't name it something else) to your .war file.  context.xml
is the context configuration file for the context and contains a single
Context ... element and any nested elements that the Context ...
element supports.
A sample context.xml might look like...

Context path=/arbitraypath docBase=dbadmin.war/

Note that the path can be anything you want, but the docBase must be the

name of the .war file.

I also saw your other message where you said

quote
additionaly, an application deployed using the manager app currently
returns null if you use servletcontext.getRealPath();
so it's context seems to be quite obfuscated...
/quote
This is to be expected.  When you deploy your app as a .war file and not a

directory structure, you have no file system access.  If you are counting
of having File IO access to within your webapp, you are creating a
non-portable application.  The servlet spec does not guarantee any direct
file system access to any resource on the server other than the directory
path returned by context.getAttribute(javax.servlet.context.tempdir).
there you go.

Jake

At 07:46 PM 3/28/2003 +0100, you wrote:
hi there,

here are my findings after some experimentation with the ant deploy task
of the manager app.

*) a complete application can be easily built into a WAR file using ant
*) this WAR file can be easily deployed using ant deploy task
*) once deployed onto the server, the application is running with the
docbase located somewhere under the manager directory:
ant list
- produces:
/dbadmin:running:1:F:\tomcat-4.1.18\work\Standalone\localhost\manager\db 
admin.war

*) there the application is living
- without a context
- thus, also without any JNDI resources etc. defined in server.xml for a
context dbadmin with docbase dbadmin.

Would renaming the docbase to 
F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war resolve
the problem of not having any context?
What else could be done to get a context for the webapplication
dbadmin?

thx
Johannes


Re: Living without a Context - deploying an application using manager app

2003-03-29 Thread Jacob Kjome
At 11:41 AM 3/29/2003 +0100, you wrote:
p.s. I also have found that
ant deploy
will give me the context as desired (if stored in META-INF/context.xml as
recommended by you)
Yes, ant's deploy task uses HTTP PUT which isn't supported by normal 
browsers so deploy actually can't be done any other way than with the ant 
manager deploy task (or another custom implementation that enables the use 
of HTTP PUT).  The concept of the META-INF/context.xml was specifically 
made for this task.

however, ant install does not create the same result.
There the context.getInitParameter() and JNDI-configuration
(ResourceLinks) both return null and are not inited correctly.
the install task is meant to deploy a directory in any given location, 
not a .war file.  You can provide it a context configuration file (doesn't 
have to be named context.xml is this case, any arbitrary name is 
fine).  Note that getServletContext().getRealPath(/) will return an 
actual directory path instead of null in this case because the app is being 
deployed from a directory.  And be sure to note that the install task is 
not persistent across Tomcat restarts where the deploy task is.  This is 
because the install task installs your app into memory and store any 
information permanently about how to restart the app upon Tomcat 
restart.  This makes it very convenient for development.  However, the 
deploy task physically modifies your server.xml to store the information 
you put in your META-INF/context.xml which allows Tomcat to restart the app 
upon server restart.  This makes it better for production.

Thus it seems that ant deploy will correctly initialize the Context, but
ant install fails to do so.
It does if it is used correctly.

Working this way, ant install seems to be quite useless to me, or does
it have another sense to use it?
thx alot
Johannes

Jake





Jacob Kjome [EMAIL PROTECTED]
28.03.2003 20:27
Please respond to
Tomcat Users List [EMAIL PROTECTED]
To
Tomcat Users List [EMAIL PROTECTED]
cc
Subject
Re: Living without a Context - deploying an application using  manager app






What do you mean Living without a Context?

Do you mean living without a Tomcat Context ... entry?

All you have to do is add META-INF/context.xml (the name context.xml is
important so don't name it something else) to your .war file.  context.xml
is the context configuration file for the context and contains a single
Context ... element and any nested elements that the Context ...
element supports.
A sample context.xml might look like...

Context path=/arbitraypath docBase=dbadmin.war/

Note that the path can be anything you want, but the docBase must be the

name of the .war file.

I also saw your other message where you said

quote
additionaly, an application deployed using the manager app currently
returns null if you use servletcontext.getRealPath();
so it's context seems to be quite obfuscated...
/quote
This is to be expected.  When you deploy your app as a .war file and not a

directory structure, you have no file system access.  If you are counting
of having File IO access to within your webapp, you are creating a
non-portable application.  The servlet spec does not guarantee any direct
file system access to any resource on the server other than the directory
path returned by context.getAttribute(javax.servlet.context.tempdir).
there you go.

Jake

At 07:46 PM 3/28/2003 +0100, you wrote:
hi there,

here are my findings after some experimentation with the ant deploy task
of the manager app.

*) a complete application can be easily built into a WAR file using ant
*) this WAR file can be easily deployed using ant deploy task
*) once deployed onto the server, the application is running with the
docbase located somewhere under the manager directory:
ant list
- produces:
/dbadmin:running:1:F:\tomcat-4.1.18\work\Standalone\localhost\manager\db 
admin.war

*) there the application is living
- without a context
- thus, also without any JNDI resources etc. defined in server.xml for a
context dbadmin with docbase dbadmin.

Would renaming the docbase to 
F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war resolve
the problem of not having any context?
What else could be done to get a context for the webapplication
dbadmin?

thx
Johannes


RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread Jacob Kjome
If you use the deploy task to deploy the app, you should use the 
undeploy task to undeploy the app. The remove task is mated with the 
install task.  Mixing these will give you unexpected results.

Jake

At 03:56 PM 3/29/2003 +0100, you wrote:
hi jeff,

ok. so I will stay with deploy as well.

Currently I do the following to redeploy:
ant remove
ant deploy
However, there is a small time where users will still get a 404 error (the
small delay where the PUT command is issued by the deploy task). Do you
know a way how to get around this issue to have 100% uptime of an
application?
thx alot
Johannes




Jeff Jensen [EMAIL PROTECTED]
29.03.2003 15:34
Please respond to
Tomcat Users List [EMAIL PROTECTED]
To
'Tomcat Users List' [EMAIL PROTECTED]
cc
Subject
RE: Trouble with ant install command and ResourceLink




Yes, me too.  Based on what the install process does compared to deploy, I
have not yet determined an applicable time to use install vs deploy!  I
haven't looked back since started using deploy... :-)
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Saturday, March 29, 2003 8:23 AM
 To: Tomcat Users List
 Subject: RE: Trouble with ant install command and ResourceLink


 Hi Jeff,

 no, using the ant deploy task it worked smoothly.
 I was just wondering what the install task is all about
 (if it's not
 working)

 thx
 Johannes




 Jeff Jensen [EMAIL PROTECTED]
 29.03.2003 15:02
 Please respond to
 Tomcat Users List [EMAIL PROTECTED]


 To
 'Tomcat Users List' [EMAIL PROTECTED]
 cc

 Subject
 RE: Trouble with ant install command and ResourceLink






 I do not have an answer for your specific issue, but I found
 minor deploy
 issues with install, so I only use deploy and undeploy tasks
 and do not
 have
 any more issues.  Have you tried using deploy - did it have the same
 problems?


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 28, 2003 11:52 AM
  To: Tomcat Users List
  Subject: Trouble with ant install command and ResourceLink
 
 
  hi there,
 
  In my /webapps/myapp.xml I'm using a ResourceLink:
ResourceLink name=jdbc/mydb global=MyDatabase/
 
  I'm using the manager app via ant to test my application.
  After calling
  ant remove
  ant install
 
  it tells me the context has been installed OK.
  However, it seems as if the ResourceLink has not been inited during
  install, so it seems Tomcat doesn't read the
 /webapps/myapp.xml file.
 
  Sidenote: this problem is somewhat related to my
  initparameter problem
  outlined earlier today, but cannot be overcome as easily.
 
  has anybody overcome this issue?
  is else using the ant manager task together with JNDI resourcelinks
  successfully?
 
  thx
  Johannes


 -
 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: servlet problems with web app outside Tomcat directory

2003-03-29 Thread Jacob Kjome
You really need to read the release notes.  In recent Tomcat versions, the 
invoker servlet mapping is commented out in 
CATALINA_HOME/web.xml.  Uncomment that and your problem will be 
solved.  Note that it was disabled because of security issues so I would 
not recommend enabling the invoker servlet on a production box.  You should 
use custom servlet mappings anyway.

Jake

At 01:40 PM 3/29/2003 +, you wrote:
Hello Mike,

http://www.mail-archive.com/[EMAIL PROTECTED]/msg90076.html

Did you ever manage to solve this problem? I think I have the same one and 
I couldn't see any replys to your message on the list.

Thanks,

Peter

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


Re: Where to store files in a portable app?

2003-03-29 Thread Jacob Kjome
There are a couple ways to proceed with this, but both are related.

1.  Add an env-entry to your web.xml with a default location for file 
storage.  You then override this in the Tomcat configuration via the 
Environment element.   For instance...

web.xml...

env-entry
descriptionFile storage for this webapp/description
env-entry-namefileStore/env-entry-name

env-entry-value/change/this/path/in/proprietary/server/deployment/config/env-entry-value
env-entry-typejava.lang.String/env-entry-type
/env-entry
server.xml or context configuration file...

 Context ...
...
Environment name=fileStore type=java.lang.String
value=C:\my\filestore\path override=true/
...
  /Context
and access it from your application like this:

  InitialContext ic = new InitialContext();
  String appFileStore = (String) ic.lookup(java:comp/env/fileStore);
2.  Add a context-param to your web.xml with a default location for file 
storage.  You then override this in the Tomcat configuration via the 
Parameter element.  For instance...

web.xml...

context-param
param-namefileStore/param-name

param-value/change/this/path/in/proprietary/server/deployment/config/param-value
/context-param
server.xml or context configuration file...

 Context ...
...
Parameter name=fileStore
value=C:\my\filestore\path override=true/
...
  /Context
and access it from your application like this:

   String appFileStore = getServletContext().getInitParameter(fileStore);

In your deployment instructions, you would specify that the deployer modify 
the path to something valid on the local machine.  This makes it so that 
you can send your app as a .war file and no one has to modify anything 
inside that .war file.  Everything is set to go on your end and you simply 
require a small step to be completed before deployment.

Jake

At 03:58 PM 3/29/2003 +0100, you wrote:
Hi Kaarle,

Thx for the input.
Unfortunately the development system is Windows and production system is
Unix, so absolute paths will never be the same.
Do you have any idea for how to manage properties files which will be
different for windows than unix?
Should I create a separate web_local and web_remote directory and make a
simple ant copy task to distinguish production/development?
Or is there a more elegant approach to this?
thx alot
Johannes


Kaarle Kaila [EMAIL PROTECTED]
29.03.2003 15:41
Please respond to
Tomcat Users List [EMAIL PROTECTED]
To
Tomcat Users List [EMAIL PROTECTED]
cc
Subject
Re: Where to store files in a portable app?




At 15:35 29.3.2003 +0100, you wrote:
HI there,

In my app I need to store files after a transaction is complete.
I want to keep my application portable, so where should I store such
files
to??
I would put the directory address for the files in a properties file
(ResourceBundle)
Then you can really put them anywhere you like.
regards
Kaarle
Should I use a /output/.. directory in the root area or where else could
be a smart location?

Any ideas on this topic??

thx alot
Johannes
-
Kaarle Kaila
http://www.iki.fi/kaila
mailto:[EMAIL PROTECTED]
tel: +358 50 3725844
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


SOLVED: Re: Living without a Context - deploying an application using manager app

2003-03-29 Thread johannes . fiala
Hi Jacob,

Thank you for your detailed description.
I'm now using the ant deploy/ant undeploy task successfully and it works 
as expected. 
I replaced all file-system access with .getClass().getResourceAsStream() 
and it works smoothly now.

Also, the ant install command works correctly with the same configuration 
(with META-INF/context.xml), which is quite cool because I'm able to use 
the same file structure for development and production.

Given my current ant/tomcat configuration I think a multi-release 
environment is definitely possible and easy to handle if one has the right 
tools and scripts available (e.g. I'm recently migrated from apache soap 
to axis with multiple releases). 

I'd like to contribute my current configuration experiences and update the 
docs for the other users - how can I do this?

thx
Johannes

Re: Where to store files in a portable app?

2003-03-29 Thread johannes . fiala
Hi Jacob,

I think the decision about where the locally stored data should go should 
be done at build time.
I'd suggest to use two directories within the ant tree structure:

/web/// stores the static data independent of location
/web-production/ // stores the config data which should be used in 
production
/web-preproduction/ // stores the config data which should be used in 
pre-production mode (testenvironment)
/web-development // stores the config data which should be used in 
development

context.xml could store the entry path of the locallay stored data
/web-development/META-INF/context.xml   // stores entry point and urls for 
development
/web-preproduction/META-INF/context.xml   // stores entry point and urls 
for pre-production
/web-production/META-INF/context.xml   // stores entry point and urls for 
production

when I build I could say
ant -Dtarget=production
ant -Dtarget=preproduction
ant -Dtarget=development

and have the ant task copy the proper configuration files.
This way I could easily test in preproduction and then deploy the same 
webapp, with only minor context configuration changes (and thus minimized 
error probability).

What do you think about this approach?

Johannes

Need help with org.apache.jasper.JasperException: Unable to compile class for JSP

2003-03-29 Thread Andre Carrier
Hi,

I did a fresh install of tomcat on a win2000 server. I installed the latest JDK 
(1.4.1) first. I installed tomcat (4.1.24) after. Whenever I access the default 
index.jsp page I get this error. The JSPs of the application that I am building give 
the same error. Whith a previous build of tomcat 4.1.x (I dont remember which exactly) 
on another server I have no problems with exactly the same application. Can anyone 
suggest how to fix this? Must I use a previous version of tomcat? Is this a known 
issue? 

Here is the detailed error message:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.


at 
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
at 
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)


The best to all!
Andre





RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread johannes . fiala
Hi Jacob,

It seems as if I was wrong with ant install test.
I now undeployed and installed, but the Context information got lost.

Where do I have to put the context.xml in the /build/ directory? 
Would /build/myapp.xml ok? Would the install task accept any *.xml in 
/build/ as context configuration info?

I tried:
/build/context.xml
and 
ant install, but it didn't work.

Any suggestions??

thx
Johannes

Internal server error only on first run tomcat 4.x + apache 2.0x + modjk2 + winxp

2003-03-29 Thread Henry Tang
Hi, I am getting this error below only on the first service for apache.
After this error, all other pages served will be fine.  Error is produced
after the server hangs for a while around 2 minutes.  Anyone experiencing
the same problem?

thanks
henry

Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.
More information about this error may be available in the server error log.



Apache/2.0.44 (Win32) mod_jk2/2.0.0 Server at localhost Port 80


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



RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread johannes . fiala
p.s. if I do 

ant undeploy
ant install - context info gets lost
ant remove
ant deploy - context info is here again!
== so with deploy the context is ok, with install not.

*) I put /build/context.xml and /build/myapp.xml into the build-directory, 
but it still doesn't get the context inited.

*) wouldn't it make sense to read the context.xml for ant install out of 
the same directory as ant deploy?
(e.g. /build/META-INF/context.xml)

thx
Johannes

Re: Classloader Mysteries

2003-03-29 Thread Theodore Chen
A couple of questions:  How are you deploying the web app?  Is the
daemon thread aware of the Servlet lifecycle?

I have observed that when deploying via the Tomcat manager, there are
cases where the web app is stopped and restarted erroneously. 
Basically, it starts after a deploy, then within a few seconds it stops
and then restarts.  If this is happening and your daemon thread is not
Servlet lifecycle aware and does not stop when the ServletContext is
destroyed, then that daemon is what is pinning your web application and
therefore WebappClassLoader.


On Sat, 2003-03-29 at 00:48, Micael wrote:
 I have created a daemon which I want to startup when Tomcat is started 
 up.  If I configure the daemon to be started with a servlet in web.xml or 
 by using a PlugIn interface and struts-config.xml, I get two daemons 
 running.  How I don't know.  If I don't start the daemon at startup but by 
 tweaking a servlet after startup, where the servlet calls the daemon, then 
 I don't get two daemons.  Does anyone have any idea how this is 
 happening?  I am getting two classloaders of the same type, i.e. same type 
 but different hashcodes.  Anyone know what is going on.  I am running 
 Struts 1.1 and Tomcat 1.1.18.  I have asked this question in a few ways 
 with no responses.  I can find nothing relevant in the archives.  They are 
 both coming from the WebappClassLoader which has as a parent 
 [EMAIL PROTECTED]
 
 Hopefully someone has some assistance, because I am somewhat at a 
 loss.  This must have something to do with the launcher, but I don't know 
 what.  I have tried to get some information for a week out of this 
 list.  Not sure if no one is doing PlugIns, or why there is so little 
 interest in this.
 
 The hashcodes I get for the classloaders are as follows:
 
 
 LOOP: ClassLoader.hashCode(): 728272 Class.hashCode(): 15612583   Check 
 No.: 657) Fri Mar 28 22:47:17 PST 2003 END
 
 
 LOOP: ClassLoader.hashCode(): 20632381 Class.hashCode(): 10973446  Check 
 No.: 659) Fri Mar 28 22:47:19 PST 2003 END
 
 The details on the classloaders are:
 
 LOOP: ClassLoader.toString(): WebappClassLoader
available:
  Extension[org.apache.commons.beanutils, implementationVendor=Apache 
 Software Foundation, implementationVersion=1.4-dev, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.collections, implementationVendor=Apache 
 Software Foundation, implementationVersion=2.0, specificationVendor=Apache 
 Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.dbcp, implementationVendor=Apache 
 Software Foundation, implementationVersion=1.0-dev, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.digester, implementationVendor=Apache 
 Software Foundation, implementationVersion=1.3-dev, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[commons-lang, implementationVendor=Apache Software 
 Foundation, implementationVersion=1.0-dev, specificationVendor=Apache 
 Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.logging, implementationVendor=Apache 
 Software Foundation, implementationVersion=1.0.1-dev, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.pool, implementationVendor=Apache 
 Software Foundation, implementationVersion=1.0, specificationVendor=Apache 
 Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.resources, implementationVendor=Apache 
 Software Foundation, implementationVersion=0.1-dev, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.services, implementationVendor=Apache 
 Software Foundation, implementationVersion=1.0-dev, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[Struts Framework, implementationVendor=Apache Software 
 Foundation, implementationVendorId=org.apache, implementationVersion=1.0, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[Components Framework, implementationVendor=Apache Software 
 Foundation, implementationVendorId=org.apache, implementationVersion=0.7, 
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
delegate: false
repositories:
  /WEB-INF/classes/
required:
 -- Parent Classloader:
 StandardClassLoader
available:
delegate: true
repositories:
required:
 -- Parent Classloader:
 StandardClassLoader
available:
  Extension[org.apache.tools.ant, implementationVendor=Apache Software 
 Foundation, implementationVersion=1.5.1, specificationVendor=Apache 
 Software Foundation, specificationVersion=1.5.1]
  Extension[org.apache.commons.collections, implementationVendor=Apache 
 Software Foundation, implementationVersion=1.1-dev, 
 

ant deploy - server.xml changes

2003-03-29 Thread johannes . fiala
Hi there,

1.) My server.xml looks a bit unstructured after doing an ant deploy with 
the manager app.
== Is it possible to tell the ant deploy task not to change server.xml 
itself, but only the /webapps/myapp.xml file belonging to the context 
(myapp)?

2.) Is it possible to turn the automatic renaming of old versions of 
server.xml off?
Every time I redeploy, an additional file shows up:
/conf/server.xml.2003-03-28.19-41-35

thx
Johannes

Listing all JNDI resources available

2003-03-29 Thread johannes . fiala
Hi there,

Is it somehow possible to look up all JNDI configuration values available 
in a servlet/context?
This would be quite fine for debugging purposes, and it seems there is no 
function available for this, only for looking up a specific value.

thx 
Johannes

Different behaviour of JSPC using ant/using tomcat itself

2003-03-29 Thread johannes . fiala
hi there,

I noticed an interesting difference between using ant jspc and having the 
jsp-file compiled by jasper during runtime.

*) during runtime the file is processed ok
*) using jspc it is encoded in UTF-8, which means that the german umlaute 
(ä,ö,ü) are displayed wrong, because the browser renders it as ISO-8859-1 
(which would be ok).

So it seems there is some character encoding conversion taking place using 
ant jspc.

== 
*) why is this happening?
*) how can I get rid of this?

thx alot
Johannes

Re: Listing all JNDI resources available

2003-03-29 Thread jerome moliere
[EMAIL PROTECTED] wrote:

Hi there,

Is it somehow possible to look up all JNDI configuration values available 
in a servlet/context?
This would be quite fine for debugging purposes, and it seems there is no 
function available for this, only for looking up a specific value.

 

depending from your server config  the corresponding xsource of data 
used as the naming server, this solution could be very expansive
What about listing all resources available in your company LDAP server ?
I think that every other solution should be  preferred to this one...

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


Switching between releases during runtime

2003-03-29 Thread johannes . fiala
hi there,

Is it possible to have a virtual context, which just points to another 
context?
e.g.
myapp = current version, should point to myapp-1.0
myapp-1.0
myapp-1.1

Is it possible to change the context myapp is pointing to during 
runtime?
This would make switching between releases much easier rather than having 
to redeploy for each release switch.

What do you think about this idea?

thx
Johannes

Re: Listing all JNDI resources available

2003-03-29 Thread johannes . fiala
Hi Jerome,

I thought about the jdbc and env-entity entries in server.xml and web.xml.
I think it could be quite handy to have a servlet which lists all 
resources available (without having to know the name of each JNDI 
resource).

Of course digging in LDAP directories would make no sense, but I think a 
configuration listing would be quite handy for debugging and info 
purposes.

What do you mean?
Johannes





jerome moliere [EMAIL PROTECTED] 
29.03.2003 18:36
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
Re: Listing all JNDI resources available






[EMAIL PROTECTED] wrote:

Hi there,

Is it somehow possible to look up all JNDI configuration values available 

in a servlet/context?
This would be quite fine for debugging purposes, and it seems there is no 

function available for this, only for looking up a specific value.

 

depending from your server config  the corresponding xsource of data 
used as the naming server, this solution could be very expansive
What about listing all resources available in your company LDAP server ?
I think that every other solution should be  preferred to this one...

HTH
Jerome


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




Re: Classloader Mysteries

2003-03-29 Thread Micael


At 09:55 AM 3/29/03 -0700, you wrote:
A couple of questions:  How are you deploying the web app?
The web app is deployed as ROOT.  The server.xml is:

  Context path=
   docBase=my_app
   debug=0/
The daemon thread is created and destroyed in the struts PlugIn 
interface.  I have given the relevant code below.  My application shows 
that the application is created both as root /_ and as /my_app.  Could that 
be the cause?  If so, what is the solution?  I want the web app to come up 
when the url is called and don't want to have to call 
www.url.com/my_app.  Thanks.  This seems like it may be the source of the 
difficulty.  See below.

Is the
daemon thread aware of the Servlet lifecycle?
I have observed that when deploying via the Tomcat manager, there are
cases where the web app is stopped and restarted erroneously.
Basically, it starts after a deploy, then within a few seconds it stops
and then restarts.  If this is happening and your daemon thread is not
Servlet lifecycle aware and does not stop when the ServletContext is
destroyed, then that daemon is what is pinning your web application and
therefore WebappClassLoader.


No code calls the daemon.  The only mention of the PlugIn on the entire 
computer is in the struts-config, which says:

plug-in className=com.michaelmcgrady.util.message.IpDaemon/

I originally had code that would create the daemon by calling a servlet 
from a browser.  That created only one object.  No problems!  To make life 
easy (or possible) for the person purchasing the software, I wanted to 
auto-generate the daemon, and have tried the web.xml generation through a 
servlet and the struts-config.xml generation through the PlugIn 
interface.   I do not have initialization other than through the PlugIn 
init method.  My initialization is:

public void init(ActionServlet servlet, ApplicationConfig config) 
throws ServletException {
this.servlet = servlet;
thread = new Thread(this);
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
}

My destroy method, through the PlugIn, is:

public void destroy() {
Thread moribund = thread;
thread = null;
moribund.interrupt();
}
The debug (on the first object being created) gives the following read-out:

ClassLoader Hash (20632381) Class Hash (30102190) -- In constructor: Sat 
Mar 29 09:31:07 PST 2003
Start of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:07 PST 2003
End of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:07 PST 2003

ClassLoader Hash (274614) Class Hash (7084674) -- In constructor: Sat Mar 
29 09:31:34 PST 2003
Start of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:34 PST 2003
End of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:34 PST 2003

The Thread object is static in this class.  What do you think?

Micael



On Sat, 2003-03-29 at 00:48, Micael wrote:
 I have created a daemon which I want to startup when Tomcat is started
 up.  If I configure the daemon to be started with a servlet in web.xml or
 by using a PlugIn interface and struts-config.xml, I get two daemons
 running.  How I don't know.  If I don't start the daemon at startup but by
 tweaking a servlet after startup, where the servlet calls the daemon, then
 I don't get two daemons.  Does anyone have any idea how this is
 happening?  I am getting two classloaders of the same type, i.e. same type
 but different hashcodes.  Anyone know what is going on.  I am running
 Struts 1.1 and Tomcat 1.1.18.  I have asked this question in a few ways
 with no responses.  I can find nothing relevant in the archives.  They are
 both coming from the WebappClassLoader which has as a parent
 [EMAIL PROTECTED]

 Hopefully someone has some assistance, because I am somewhat at a
 loss.  This must have something to do with the launcher, but I don't know
 what.  I have tried to get some information for a week out of this
 list.  Not sure if no one is doing PlugIns, or why there is so little
 interest in this.

 The hashcodes I get for the classloaders are as follows:


 LOOP: ClassLoader.hashCode(): 728272 Class.hashCode(): 15612583   Check
 No.: 657) Fri Mar 28 22:47:17 PST 2003 END


 LOOP: ClassLoader.hashCode(): 20632381 Class.hashCode(): 10973446  Check
 No.: 659) Fri Mar 28 22:47:19 PST 2003 END

 The details on the classloaders are:

 LOOP: ClassLoader.toString(): WebappClassLoader
available:
  Extension[org.apache.commons.beanutils, implementationVendor=Apache
 Software Foundation, implementationVersion=1.4-dev,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.collections, implementationVendor=Apache
 Software Foundation, implementationVersion=2.0, specificationVendor=Apache
 Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.dbcp, implementationVendor=Apache
 Software Foundation, implementationVersion=1.0-dev,
 

Re: Listing all JNDI resources available

2003-03-29 Thread Craig R. McClanahan


On Sat, 29 Mar 2003 [EMAIL PROTECTED] wrote:

 Date: Sat, 29 Mar 2003 18:03:21 +0100
 From: [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Subject: Listing all JNDI resources available

 Hi there,

 Is it somehow possible to look up all JNDI configuration values available
 in a servlet/context?

You need to look at the JNDI Javadocs (package javax.naming):

  InitialContext ic = new InitialContext();
  Context resources = ic.lookup(java:comp/env);
  NamingEnumeration ne = resources.listBindings();
  while (ne.hasMore()) {
Binding b = ne.next();
String resourceName = b.getName();
Object resourceObject = b.getObject();
... do whatever you need ...
  }


 This would be quite fine for debugging purposes, and it seems there is no
 function available for this, only for looking up a specific value.

 thx
 Johannes

Craig


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



Re: Listing all JNDI resources available

2003-03-29 Thread Phil Steitz
[EMAIL PROTECTED] wrote:
Hi there,

Is it somehow possible to look up all JNDI configuration values available 
in a servlet/context?
This would be quite fine for debugging purposes, and it seems there is no 
function available for this, only for looking up a specific value.

thx 
Johannes
Johannes,

You can use JNDI APIs to do this.
Check out the Naming example that ships with Tomcat 4.  HTML source is 
in /examples/servlets/jndi.html.

-Phil

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


RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread Jacob Kjome
You need to look at the attributes provided for the install task...

target name=catalina-install depends=compile,manager.init
description=Install application to servlet container 
catalina-install
url=${manager.url}
username=${manager.username}
password=${manager.password}
config=${app.ccf}
path=${app.path} /
/target
Notice the config attribute.  At build time, that resolves to a file:/// 
URL pointing to where the context configuration file is.

Now look at the deploy task...

target name=catalina-deploy depends=war,manager.init
description=Deploy web-app war 
echo message=${app.war}/
catalina-deploy
url=${manager.url}
username=${manager.username}
password=${manager.password}
path=${app.path}
war=${app.war} /
/target
There is no config attribute.  You might argue that there should be 
one.  File a bug on that if you think so.  However, the fact is, there 
isn't one now and the current mechanism here is the META-INF/context.xml 
file that Tomcat looks for.

Jake

At 05:55 PM 3/29/2003 +0100, you wrote:
p.s. if I do

ant undeploy
ant install - context info gets lost
ant remove
ant deploy - context info is here again!
== so with deploy the context is ok, with install not.
*) I put /build/context.xml and /build/myapp.xml into the build-directory,
but it still doesn't get the context inited.
*) wouldn't it make sense to read the context.xml for ant install out of
the same directory as ant deploy?
(e.g. /build/META-INF/context.xml)
thx
Johannes


Re: Where to store files in a portable app?

2003-03-29 Thread Jacob Kjome
Ok, that's fine, but now instead of releasing a simple .war file for 
someone to drop into a servlet container, you are making them run an ant 
build in order to deploy your app.  Not my idea of portability, but you can 
do what works for you.

For development purposes, you can easily do a filter copy of the 
context.xml file so you provide build time paths and put those in 
Property or Environment entries in the context.xml during the filter 
copy.  This combines the best of all worlds.  You have a simple development 
environment to work with and you can easily deploy a .war file to a server 
without requiring the ant build.

Jake

At 05:30 PM 3/29/2003 +0100, you wrote:
Hi Jacob,

I think the decision about where the locally stored data should go should
be done at build time.
I'd suggest to use two directories within the ant tree structure:
/web/// stores the static data independent of location
/web-production/ // stores the config data which should be used in
production
/web-preproduction/ // stores the config data which should be used in
pre-production mode (testenvironment)
/web-development // stores the config data which should be used in
development
context.xml could store the entry path of the locallay stored data
/web-development/META-INF/context.xml   // stores entry point and urls for
development
/web-preproduction/META-INF/context.xml   // stores entry point and urls
for pre-production
/web-production/META-INF/context.xml   // stores entry point and urls for
production
when I build I could say
ant -Dtarget=production
ant -Dtarget=preproduction
ant -Dtarget=development
and have the ant task copy the proper configuration files.
This way I could easily test in preproduction and then deploy the same
webapp, with only minor context configuration changes (and thus minimized
error probability).
What do you think about this approach?

Johannes


MYSTERY SOLVED: Re: Classloader Mysteries

2003-03-29 Thread Micael
An extra version of the app was being created under root in 
web.xml.  Thanks for all who assisted.

At 09:55 AM 3/29/03 -0700, you wrote:
A couple of questions:  How are you deploying the web app?  Is the
daemon thread aware of the Servlet lifecycle?
I have observed that when deploying via the Tomcat manager, there are
cases where the web app is stopped and restarted erroneously.
Basically, it starts after a deploy, then within a few seconds it stops
and then restarts.  If this is happening and your daemon thread is not
Servlet lifecycle aware and does not stop when the ServletContext is
destroyed, then that daemon is what is pinning your web application and
therefore WebappClassLoader.
On Sat, 2003-03-29 at 00:48, Micael wrote:
 I have created a daemon which I want to startup when Tomcat is started
 up.  If I configure the daemon to be started with a servlet in web.xml or
 by using a PlugIn interface and struts-config.xml, I get two daemons
 running.  How I don't know.  If I don't start the daemon at startup but by
 tweaking a servlet after startup, where the servlet calls the daemon, then
 I don't get two daemons.  Does anyone have any idea how this is
 happening?  I am getting two classloaders of the same type, i.e. same type
 but different hashcodes.  Anyone know what is going on.  I am running
 Struts 1.1 and Tomcat 1.1.18.  I have asked this question in a few ways
 with no responses.  I can find nothing relevant in the archives.  They are
 both coming from the WebappClassLoader which has as a parent
 [EMAIL PROTECTED]

 Hopefully someone has some assistance, because I am somewhat at a
 loss.  This must have something to do with the launcher, but I don't know
 what.  I have tried to get some information for a week out of this
 list.  Not sure if no one is doing PlugIns, or why there is so little
 interest in this.

 The hashcodes I get for the classloaders are as follows:


 LOOP: ClassLoader.hashCode(): 728272 Class.hashCode(): 15612583   Check
 No.: 657) Fri Mar 28 22:47:17 PST 2003 END


 LOOP: ClassLoader.hashCode(): 20632381 Class.hashCode(): 10973446  Check
 No.: 659) Fri Mar 28 22:47:19 PST 2003 END

 The details on the classloaders are:

 LOOP: ClassLoader.toString(): WebappClassLoader
available:
  Extension[org.apache.commons.beanutils, implementationVendor=Apache
 Software Foundation, implementationVersion=1.4-dev,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.collections, implementationVendor=Apache
 Software Foundation, implementationVersion=2.0, specificationVendor=Apache
 Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.dbcp, implementationVendor=Apache
 Software Foundation, implementationVersion=1.0-dev,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.digester, implementationVendor=Apache
 Software Foundation, implementationVersion=1.3-dev,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[commons-lang, implementationVendor=Apache Software
 Foundation, implementationVersion=1.0-dev, specificationVendor=Apache
 Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.logging, implementationVendor=Apache
 Software Foundation, implementationVersion=1.0.1-dev,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.pool, implementationVendor=Apache
 Software Foundation, implementationVersion=1.0, specificationVendor=Apache
 Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.resources, implementationVendor=Apache
 Software Foundation, implementationVersion=0.1-dev,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[org.apache.commons.services, implementationVendor=Apache
 Software Foundation, implementationVersion=1.0-dev,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[Struts Framework, implementationVendor=Apache Software
 Foundation, implementationVendorId=org.apache, implementationVersion=1.0,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
  Extension[Components Framework, implementationVendor=Apache Software
 Foundation, implementationVendorId=org.apache, implementationVersion=0.7,
 specificationVendor=Apache Software Foundation, specificationVersion=1.0]
delegate: false
repositories:
  /WEB-INF/classes/
required:
 -- Parent Classloader:
 StandardClassLoader
available:
delegate: true
repositories:
required:
 -- Parent Classloader:
 StandardClassLoader
available:
  Extension[org.apache.tools.ant, implementationVendor=Apache Software
 Foundation, implementationVersion=1.5.1, specificationVendor=Apache
 Software Foundation, specificationVersion=1.5.1]
  Extension[org.apache.commons.collections, 

Memory leak for webapp Manager deploy/undeploy

2003-03-29 Thread Theodore Chen
I believe I'm seeing a memory leak as a result of a Manager
deploy/undeploy.  I have a very simple test case:  a Servlet that has a
static field that refers to an object (Foo) that allocates a large chunk
of memory.  I've instrumented both the Servlet (init(), destroy(), and
finalize()) and Foo (ctor and finalize()).  The Servlet has been
configured to load on startup.

On a deploy, I see:

Foo.ctor (during class initialization of the Servlet)
Servlet.init():

On an undeploy, I see:

Servlet.destroy()
Servlet.finalize()

I never see Foo.finalize().  If I continue to deploy/undeploy
repeatedly, eventually the VM reports an OutOfMemoryError when I try to
deploy.  Running the VM with -verbose:gc and encouraging GC whenever
possible, I see that after each undeploy, memory usage goes up roughly
by what I've allocated in Foo.

Any ideas?


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



RE: Virtual hosting mod_jk2

2003-03-29 Thread Quinton McCombs
None at all.  I think that I encountered a bug or two in mod_jk2.  This
is when you have two virtual hosts mapping the same path to the worker.
Only the last map is kept.

I ended up switching to mod_jk.  I got everything working under that
connector.  I can go into the details of how that is working if you are
interested.

 -Original Message-
 From: Richard Anderson [mailto:[EMAIL PROTECTED] 
 Sent: Friday, March 28, 2003 5:56 PM
 To: Tomcat Users List
 Subject: Re: Virtual hosting  mod_jk2
 
 
 Did you have any luck getting this configured?
 
 I'm having difficulties doing the same thing.
 
 --Rick
 
 On Thursday, March 27, 2003, at 03:51 PM, Quinton McCombs wrote:
 
  I am having a difficult time figuring out how to properly configure 
  Apache 2.0.44 and Tomcat 4.1.12 with virtual hosting.  I am using 
  mod_jk2 as my connector.
 
  I have all of this working with Apache 1.3, Tomcat 4.1, and 
  mod_webapp
 
  In my testing environment, I have a servlet based 
 application that is 
  available over https and http.
 
  On the tomcat side, I have defined the default host and one virtual 
  host.  The virtual host (test.nequalsone.com) has a non-default 
  appBase. The intent here is to only allow access to the application 
  through test.nequalsone.com although the server can be accessed by 
  serveral names.
 
  On the Apache side, I am using name based virtual hosting.  
 I have one 
  host defined to use SSL which should forward requests for my 
  application to Tomcat.  I have another virtual host 
  (test.nequalsone.com) that is defined to also forward requests to 
  tomcat.  I am using JKUriSet to define the mapping to Tomcat.
 
  This seemed to work fine at first but then I noticed that the 
  application did not work properly on the SSL version.  My 
 application 
  did not detect that it was being accessed over SSL so it was 
  generating links using http:// instead of https://.  
 Everything else 
  appeared to work...
 
  I decided to try creating a second AJP13 connector on tomcat.  The 
  second connection has scheme=https and secure=true.  Both 
  connectors are on different ports.  Is this the correct way 
 to solve 
  this problem so far?
 
  Next, I created a new channel in workers2.properties.  I 
 then modified 
  the JKSetUri directive for the SSL virtual host to use the new 
  channel. This is where things started to go wrong
 
  Checking the jkstatus page showed that the last JKSetUri directive 
  over wrote the previous one.  Under the uri runtime info section, I 
  had the
  following:
  Id=0, name=/neo/servlet, host=*, uri=/neo/servlet,
  group=ajp13:localhost:8010, context=/
 
  The location that I mapped for both virtual hosts was 
 /neo/servlet.  
  It seems that it should have created two uri mappings with 
 different 
  hosts.
 
  After running into this problem, I tried setting the mapping in 
  workers2.properties.  I was unable to get that working properly. 
  Consider the following section from the virtual host in apache.
 
  VirtualHost *
  ServerName test.nequalsone.com
  DocumentRoot /usr/local/www/test
  Alias /neo /opt/jakarta/test_webapps/neo
  Location /neo/servlet
JKUriSet group ajp13:localhost:8009
  /Location
  /VirtualHost
 
  I tried all of the following entries in workers2.properties: 
  [uri:test.nequalsone.com/neo/servlet]
  Group=agp13:localhost:8009
 
  [uri:test.nequalsone.com/neo/servlet/]
  Group=agp13:localhost:8009
 
  [uri:test.nequalsone.com/neo/servlet/*]
  Group=agp13:localhost:8009
 
  [uri:/neo/servlet]
  Group=agp13:localhost:8009
 
  [uri:/neo/servlet/]
  Group=agp13:localhost:8009
 
  [uri:/neo/servlet/*]
  Group=agp13:localhost:8009
 
  None of them worked.  The log file for the mod_jk2 module reported 
  that the file /opt/jakarta/test_webapps/neo/servlet did not exist.
 
  What am I doing wrong here?
  
  Quinton McCombs
  NequalsOne - HealthCare marketing tools 
 mailto:[EMAIL PROTECTED]
  http://www.NequalsOne.com
 
 
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


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



RE: mod_jk2 logic check

2003-03-29 Thread Quinton McCombs


 -Original Message-
 From: Richard Anderson [mailto:[EMAIL PROTECTED] 
 Sent: Friday, March 28, 2003 6:11 PM
 To: Tomcat List
 Subject: mod_jk2 logic check
 
 
 
 I have apache 2.0.43 and tomcat 4.1.24. I've set up mod_jk2.
 
 Here is my understanding of how things should work. I need this logic 
 double check.
 
 My webapp is locate in webapps/ccpd
 
 I restart tomcat and/or tomcat automaticly finds the webapp 
 ccpd and 
 maps a default contect to it.
 
 context=/ccpd
 
 In the apache2 httpd2.conf file the following is inserted:
 
 ###Load mod_jk2 and relate file
 LoadModule jk2_module modules/mod_jk2.so
 Include /etc/httpd2/conf/jk2.properties

No.  You do not include the jk2.properties file into your httpd.conf
file.  As long as your jk2.properties file is found under
${serverRoot}/conf, it will read it.  You can manually set the location
of the config file and a few other directives using the JkSet directive.
 
 I also set the virtual host up so apache recognizes it.
 
 
  From there I configure the workers2.properties file:
 
 [uri:ccpd.foo.edu/*]
 info=ccpd
 context=/ccpd
 
 
  From what I understand now that i have set these all in place. 
 Everything now should work just fine. Anything that runs off of 
 ccpd.foo.edu will not map directly to my tomcat4 context.

I could not figure out what context and servlet path were meant to be
used for.  It did not seem to matter what combinations I tried, I could
not seem to map servlet requests to a virtual host in jk2.properties.  I
was able to use the JkUriSet directive in httpd.conf to perform the
mapping.  You might run into a problem here if you have multiple virtual
hosts mapping the same path...

In your virtual host configuration, you do something like this:
Location /ccpd
   JkUriSet worker ajp13:localhost:8009
/Location

 
 Is this correct? Maybe the problem is elsewhere. What's the 
 best way to 
 diagnose this?
 
 Thanks you for help.
 
 --Rick
 
 
 
 -
 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: Memory leak for webapp Manager deploy/undeploy

2003-03-29 Thread Jacob Kjome
This is interesting.  Can you post a bug on this to 
http://nagoya.apache.org/bugzilla/ and then report back here as to what the 
link to that bug is?Also, it would be ideal if you could post your 
testcase (Foo.java) to that bug so people can easily reproduce the issue.

later,

Jake

At 12:48 PM 3/29/2003 -0700, you wrote:
I believe I'm seeing a memory leak as a result of a Manager
deploy/undeploy.  I have a very simple test case:  a Servlet that has a
static field that refers to an object (Foo) that allocates a large chunk
of memory.  I've instrumented both the Servlet (init(), destroy(), and
finalize()) and Foo (ctor and finalize()).  The Servlet has been
configured to load on startup.
On a deploy, I see:

Foo.ctor (during class initialization of the Servlet)
Servlet.init():
On an undeploy, I see:

Servlet.destroy()
Servlet.finalize()
I never see Foo.finalize().  If I continue to deploy/undeploy
repeatedly, eventually the VM reports an OutOfMemoryError when I try to
deploy.  Running the VM with -verbose:gc and encouraging GC whenever
possible, I see that after each undeploy, memory usage goes up roughly
by what I've allocated in Foo.
Any ideas?

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


Bug in CoyoteConnector when using JkCoyoteHandler

2003-03-29 Thread Quinton McCombs

I am running into a strange problem on Tomcat 4.1.18.

I setup a CoyoteConnector on port 8009 using the JkCoyoteHandler
protocol handler to handle AJP13 requests.  This worked perfectly.  

I then needed to add a second AJP13 connector to process secure requests
(though an ssl apache virtual host).  I created a second CoyoteConnector
using the JkCoyoteHandler listening on port 8443.  I should be able to
have multiple connectors as long as they are on different ports, right?

After I restarted the sever, I saw an error message when the second AJP
connector tried to initialize.  It reported that port 8009 was already
bound.  It then promptly bound the second connector to port 8010.  This
truly confused me.  I double checked my configureation and everything
seemed to be correct.  I also did a netstat -l to see what ports were
actually in use.  Ports 8009 and 8010 had listeners.

I removed the second connector.  I then changed the original connector
to listen on port 8019.  I now had only one CoyoteConnector for AJP13
connections configured.  The only port is 8019.

After I restarted the server, the connector bound itself to 8009.
netstat -l confirmed that this was not a bogus log message.

From the way this looks, a coyote connector using the JkCoyoteHandler
will always attempt to use port 8009 reguadless of the port attribute of
the connector.  If the port is not available, it increment the port
number by one and try again.  This appears to be a bug.


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



RE: mod_jk2+tomcat+apache2 on OSX: WORKS! but NOT FINDING workers2.properties in DFAULT location

2003-03-29 Thread Quinton McCombs
JkSet config.file /etc/apache2/worker2.properties

The above directive can be placed anywhere inside your httpd.conf file.
It will set the location of your config file for jk2.

 -Original Message-
 From: R Blake [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, March 29, 2003 2:07 AM
 To: Tomcat Users List
 Cc: Anthony Marlowe
 Subject: Re: mod_jk2+tomcat+apache2 on OSX: WORKS! but NOT 
 FINDING workers2.properties in DFAULT location 
 
 
 hi
 
  I've built 2.0.44 on Mac OS X with mod_jk2 and and running Tomcat 
  4.1.8 and 4.1.24. If the apache directory patch is set up correctly 
  apache should look for it conf directory, based on how you defined 
  --prefix in configure. It should look something like this:
 
  ./configure \
  --prefix= /Library/Apache2 \ 
 --with-apxs=/Library/Apache2/bin/apxs 
  \ --with-java-home=/Library/Java/Home \
  --with-java-platform=2 \
  --enable-jni \
  --enable-so \
  --enable-proxy \
  --enable-imap \
  --enable-ssl \
  --enable-modules=most \
  --enable-mods-shared=all \
  --enable-java=/System/Library/Frameworks/JavaVM.framework/Versions/
  1.4.1
 
 agreed  that's what's got me a bit confused.  prefix, and 
 all other 
 template settings are invoked in my configure with 
 -enable-layout-=Darwin 
 ...
 
 ./configure \
 --enable-layout=Darwin --with-port=80 --with-mpm=prefork \ 
 --enable-mods-shared=all --enable-so \ 
 --sysconfdir=/etc/apache2 \ --enable-dav --enable-dav-fs \ 
 --enable-ssl --with-ssl \ --enable-suexec 
 --with-suexec-caller=www \ --with-z \ --enable-proxy \ 
 --enable-proxy-connect \ --enable-proxy-ftp \ 
--enable-proxy-http \ --enable-logio \ --enable- authn-dbm
--enable-authz-dbm
 
 which, if you look in my original pst, includes:
 
 prefix:/usr
 exec_prefix:   ${prefix}
 bindir:${exec_prefix}/bin
 sbindir:   ${exec_prefix}/sbin
 libdir:${exec_prefix}/lib
 libexecdir:${exec_prefix}/libexec+
 mandir:${prefix}/share/man
 datadir:   /Library/WebServer
 sysconfdir:/etc+
 
  Then the workers2.properties file should be found in the 
  /Library/Apache2/conf directory and apache should find it.
 
 So that's my point . its grapping the ${serverroot} from apache's 
 prefix=/usr  but IGNORING where the sysconf files 
 ACTUALLY are ... 
 i.e., in /etc/apache2
 
  does you jk2.properties file look like? See mine below:
 
 mine is very simple:
 
 handler.list=apr,channelSocket,request
 shm.file=/usr/local/tomcat/work/jk2.shm
 
 your comments have comfirmed i how it is behaving, but, 
 again, it SHOULD 
 find it in /etc/apache2, no?
 
 thx,
 
 blakers
 
 ## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT 
 IS STOPED ## 
 WHEN YOU EDIT THE FILE.
 
 ## COMMENTS WILL BE _LOST_
 
 ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
 
  serverRoot=/Library/Apache2
 # Set the desired handler list  
 handler.list=apr,request,container,channelJni
 #
 # Override the default port for the socketChannel
 # channelSocket.port=8019
 # Default:
 # channelUnix.file=${jkHome}/work/jk2.socket
 # Just to check if the the config  is working
 # shm.file=${jkHome}/work/jk2.shm
 
 # In order to enable jni use any channelJni directive  
 channelJni.disabled = 0 # And one of the following directives:
 
 # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
 
 # If set to inprocess the mod_jk2 will Register natives 
 itself # This 
 will enable the starting of the Tomcat from mod_jk2  
 apr.jniModeSo=inprocess
 
  Regards,
 
  Tony
 
 
 
  On Saturday, Mar 29, 2003, at 08:18 Europe/Berlin, R Blake wrote:
 
  hi all,
 
  i've gotten mod_jk2/2.0.3-dev, tomcat 4.1.24 LE, and Apache/2.1.0 
  built and playing nicely together on MacOSX 10.2.4.  html, jsp  
  servlets all behaving exactly as they should!
 
  just fyi, my Apache 'server-info reports:
 
 Apache/2.1.0-dev (Unix) mod_perl/1.99_08 Perl/v5.8.0 DAV/2 
  mod_jk2/2.0.3-dev PHP/4.3.2-RC
 
  now, to my problem .
 
  everything builds fine, and I've set up my config/properties files 
  correctly, but on apachectl start,  my 
 /var/log/apache2_error.log 
  is
  showing:
 
 [error] config.update(): Can't find config file 
  /usr/conf/workers2.properties
 
 
  in order to make this work, I have to kludge a bit by:
 
 mkdir /usr/conf
 ln -s /etc/apache2/workers2.properties 
  /usr/conf/workers2.properties
 
  where /etc/apache2 is my httpd.conf directory  and 
 where mod_jk 
  SHOULD be looking for workers2.properties
 
  now, I know the REASON this is happening .  mod_jk2's code 
  defines:
 
  # define JK_WORKER_FILE_DEF  
  (${serverRoot}/conf/workers2.properties)
  in several places, and an apxs build of mod_jk2 is 
 grabbing prefix:
  /usr for the ServerRoot, because I use the Darwin/MacOS
  (config.layout) template when building apache2:
 
  #   Darwin/Mac OS Layout u
  Layout Darwin?
 prefix:/usr
 exec_prefix:   ${prefix}
 bindir:${exec_prefix}/bin
 sbindir:   

RE: Where to store files in a portable app?

2003-03-29 Thread Quinton McCombs
You could have ant replace the value of the directory name in your
properties file during the build.  As part of your build process, ant
would have to copy the properties file from its source directory into
the target directory where it will be used for the build.  See the ant
docs for filter and copy for more details.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, March 29, 2003 8:59 AM
 To: Tomcat Users List
 Subject: Re: Where to store files in a portable app?
 
 
 Hi Kaarle,
 
 Thx for the input.
 Unfortunately the development system is Windows and 
 production system is 
 Unix, so absolute paths will never be the same.
 
 Do you have any idea for how to manage properties files which will be 
 different for windows than unix?
 Should I create a separate web_local and web_remote directory 
 and make a 
 simple ant copy task to distinguish production/development?
 Or is there a more elegant approach to this?
 
 thx alot
 Johannes
 
 
 
 
 Kaarle Kaila [EMAIL PROTECTED] 
 29.03.2003 15:41
 Please respond to
 Tomcat Users List [EMAIL PROTECTED]
 
 
 To
 Tomcat Users List [EMAIL PROTECTED]
 cc
 
 Subject
 Re: Where to store files in a portable app?
 
 
 
 
 
 
 At 15:35 29.3.2003 +0100, you wrote:
 HI there,
 
 In my app I need to store files after a transaction is 
 complete. I want 
 to keep my application portable, so where should I store such
 files
 to??
 
 I would put the directory address for the files in a properties file 
 (ResourceBundle)
 Then you can really put them anywhere you like.
 
 regards
 Kaarle
 
 
 Should I use a /output/.. directory in the root area or where else 
 could be a smart location?
 
 Any ideas on this topic??
 
 thx alot
 Johannes
 
 -
 Kaarle Kaila
 http://www.iki.fi/kaila
 mailto:[EMAIL PROTECTED]
 tel: +358 50 3725844 
 
 
 -
 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: mod_jk2+tomcat+apache2 on OSX: WORKS! but NOT FINDINGworkers2.properties in DFAULT location

2003-03-29 Thread R Blake
BINGO!

i suppose that should've been obvious  but thanks!

blakers

-- On Saturday, March 29, 2003 3:34 PM -0600  Quinton McCombs 
[EMAIL PROTECTED] wrote:


JkSet config.file /etc/apache2/worker2.properties

The above directive can be placed anywhere inside your httpd.conf file.
It will set the location of your config file for jk2.
-Original Message-
From: R Blake [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 2:07 AM
To: Tomcat Users List
Cc: Anthony Marlowe
Subject: Re: mod_jk2+tomcat+apache2 on OSX: WORKS! but NOT
FINDING workers2.properties in DFAULT location
hi

 I've built 2.0.44 on Mac OS X with mod_jk2 and and running Tomcat
 4.1.8 and 4.1.24. If the apache directory patch is set up correctly
 apache should look for it conf directory, based on how you defined
 --prefix in configure. It should look something like this:

 ./configure \
 --prefix= /Library/Apache2 \
--with-apxs=/Library/Apache2/bin/apxs
 \ --with-java-home=/Library/Java/Home \
 --with-java-platform=2 \
 --enable-jni \
 --enable-so \
 --enable-proxy \
 --enable-imap \
 --enable-ssl \
 --enable-modules=most \
 --enable-mods-shared=all \
 --enable-java=/System/Library/Frameworks/JavaVM.framework/Versions/
 1.4.1
agreed  that's what's got me a bit confused.  prefix, and
all other
template settings are invoked in my configure with
-enable-layout-=Darwin
...
./configure \
--enable-layout=Darwin --with-port=80 --with-mpm=prefork \
--enable-mods-shared=all --enable-so \
--sysconfdir=/etc/apache2 \ --enable-dav --enable-dav-fs \
--enable-ssl --with-ssl \ --enable-suexec
--with-suexec-caller=www \ --with-z \ --enable-proxy \
--enable-proxy-connect \ --enable-proxy-ftp \
--enable-proxy-http \ --enable-logio \ --enable- authn-dbm
--enable-authz-dbm
which, if you look in my original pst, includes:

prefix:/usr
exec_prefix:   ${prefix}
bindir:${exec_prefix}/bin
sbindir:   ${exec_prefix}/sbin
libdir:${exec_prefix}/lib
libexecdir:${exec_prefix}/libexec+
mandir:${prefix}/share/man
datadir:   /Library/WebServer
sysconfdir:/etc+
 Then the workers2.properties file should be found in the
 /Library/Apache2/conf directory and apache should find it.
So that's my point . its grapping the ${serverroot} from apache's
prefix=/usr  but IGNORING where the sysconf files
ACTUALLY are ...
i.e., in /etc/apache2
 does you jk2.properties file look like? See mine below:

mine is very simple:

handler.list=apr,channelSocket,request
shm.file=/usr/local/tomcat/work/jk2.shm
your comments have comfirmed i how it is behaving, but,
again, it SHOULD
find it in /etc/apache2, no?
thx,

blakers

## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT
IS STOPED ##
 WHEN YOU EDIT THE FILE.

## COMMENTS WILL BE _LOST_

## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.

 serverRoot=/Library/Apache2
# Set the desired handler list
 handler.list=apr,request,container,channelJni
#
# Override the default port for the socketChannel
# channelSocket.port=8019
# Default:
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config  is working
# shm.file=${jkHome}/work/jk2.shm

# In order to enable jni use any channelJni directive
 channelJni.disabled = 0 # And one of the following directives:

# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

# If set to inprocess the mod_jk2 will Register natives
itself # This
 will enable the starting of the Tomcat from mod_jk2
 apr.jniModeSo=inprocess

 Regards,

 Tony



 On Saturday, Mar 29, 2003, at 08:18 Europe/Berlin, R Blake wrote:

 hi all,

 i've gotten mod_jk2/2.0.3-dev, tomcat 4.1.24 LE, and Apache/2.1.0
 built and playing nicely together on MacOSX 10.2.4.  html, jsp 
 servlets all behaving exactly as they should!

 just fyi, my Apache 'server-info reports:

Apache/2.1.0-dev (Unix) mod_perl/1.99_08 Perl/v5.8.0 DAV/2
 mod_jk2/2.0.3-dev PHP/4.3.2-RC

 now, to my problem .

 everything builds fine, and I've set up my config/properties files
 correctly, but on apachectl start,  my
/var/log/apache2_error.log
 is
 showing:

[error] config.update(): Can't find config file
 /usr/conf/workers2.properties


 in order to make this work, I have to kludge a bit by:

mkdir /usr/conf
ln -s /etc/apache2/workers2.properties
 /usr/conf/workers2.properties

 where /etc/apache2 is my httpd.conf directory  and
where mod_jk
 SHOULD be looking for workers2.properties

 now, I know the REASON this is happening .  mod_jk2's code
 defines:

 # define JK_WORKER_FILE_DEF
 (${serverRoot}/conf/workers2.properties)
 in several places, and an apxs build of mod_jk2 is
grabbing prefix:
 /usr for the ServerRoot, because I use the Darwin/MacOS
 (config.layout) template when building apache2:

 #   Darwin/Mac OS Layout u
 Layout Darwin?
prefix:/usr
exec_prefix:   ${prefix}
bindir:${exec_prefix}/bin
sbindir:   ${exec_prefix}/sbin
libdir:${exec_prefix}/lib
  

Question about getting client certificate in servlet

2003-03-29 Thread Mark Liu

I am using Tomcat 4.1.18 in SSL mode under Win2K.  And my Web server requires client 
authentication.

As we know, if we visit a web server which requires client authentication, say, 
https://www.myweb.com , the browser brings up a dialog box which presents a list of 
valid certificates for you to choose from.

Then we select one of them and hit ok, and the certificate is sent to the web server.

But no servlet is invoked by this action, so how can the web server get the client 
certificate information?

Suppose I want to intercept the client certificates in a servlet called 
CertInterceptor which contains the following code:

[CODE]

X509Certificate[] certs = (X509Certificate[])
httpRequest.getAttribute(javax.servlet.request.X509Certificate);

if (certs == null) {
//Processed a request that did not contain a client certificate.
}

//Attempt to extract principal name from Subject:
String clientDN = certs[0].getSubjectDN().getName();
...

[/CODE]

Usually, we invoke this servlet by way of a submit button *on the web page*.  But in 
this case, we want to invoke it by hitting an OK button in a dialog box that IE 
brings up.

Is this possible?  And if this is not the right way to intercept the client 
certificates submitted that way, how do we catch the client certificates?

Click here to get a better view of my question.
http://www.geocities.com/markliu1989/

Thanks!



-
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

URGENT: java.lang.OutOfMemoryError

2003-03-29 Thread Galbayar Dorjgotov
I'm running Tomcat 4.1.18 on Linux 7.3+jdk 1.4 and installed few webapps.
I think one application leaks memory but i can't detect what one leaks
memory?

Tomcat reports(catalina.out)
Mar 29, 2003 11:34:25 PM org.apache.tomcat.util.log.CommonLogHandler log
SEVERE: Exception in acceptSocket
java.lang.OutOfMemoryError
java.lang.OutOfMemoryError


How do i detect which application leaks memory?



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



Re: URGENT: java.lang.OutOfMemoryError

2003-03-29 Thread Andre Carrier
Hi,

I don't have a precise answer, but you can look in the jakarta projects
list. There might be a utility that evaluates performance of a java program.
There might be a utility that monitors memory usage. I am sure a tool exists
out there to do this kind of thing. Sorry I can't help more.

See ya
Andre

- Original Message -
From: Galbayar Dorjgotov [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 20:26
Subject: URGENT: java.lang.OutOfMemoryError


 I'm running Tomcat 4.1.18 on Linux 7.3+jdk 1.4 and installed few webapps.
 I think one application leaks memory but i can't detect what one leaks
 memory?

 Tomcat reports(catalina.out)
 Mar 29, 2003 11:34:25 PM org.apache.tomcat.util.log.CommonLogHandler log
 SEVERE: Exception in acceptSocket
 java.lang.OutOfMemoryError
 java.lang.OutOfMemoryError


 How do i detect which application leaks memory?



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



Porting a functioning Web App to Tomcat 3.2.4

2003-03-29 Thread Taylor, Robert
I have a Web App that I have successfully deployed to a JRun server, but when I try to 
port it over to Tomcat 3.2.4 I get the error that it cannot find my Servlet class. I 
hard coded the path to that class in my refering HTML page and it found the class 
properly, however I have several servlets accessed in that first servlet, and now it 
is choking on the second servlet call.
 
I have what I believe is a proper web.xml file, and in fact it was working properly on 
JRun, which could find all the abstracted servlets properly, but it apears that Tomcat 
is not reading the Web.xml file.
 
Can anyone please help me?
 
Rob

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



RE: URGENT: java.lang.OutOfMemoryError

2003-03-29 Thread Filip Hanik
Borland OptimizeIT or Sitraka's JProbe work pretty well

Filip

 -Original Message-
 From: Andre Carrier [mailto:[EMAIL PROTECTED]
 Sent: Saturday, March 29, 2003 4:37 PM
 To: Tomcat Users List
 Subject: Re: URGENT: java.lang.OutOfMemoryError


 Hi,

 I don't have a precise answer, but you can look in the jakarta projects
 list. There might be a utility that evaluates performance of a
 java program.
 There might be a utility that monitors memory usage. I am sure a
 tool exists
 out there to do this kind of thing. Sorry I can't help more.

 See ya
 Andre

 - Original Message -
 From: Galbayar Dorjgotov [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Saturday, March 29, 2003 20:26
 Subject: URGENT: java.lang.OutOfMemoryError


  I'm running Tomcat 4.1.18 on Linux 7.3+jdk 1.4 and installed
 few webapps.
  I think one application leaks memory but i can't detect what one leaks
  memory?
 
  Tomcat reports(catalina.out)
  Mar 29, 2003 11:34:25 PM org.apache.tomcat.util.log.CommonLogHandler log
  SEVERE: Exception in acceptSocket
  java.lang.OutOfMemoryError
  java.lang.OutOfMemoryError
 
 
  How do i detect which application leaks memory?
 
 
 
  -
  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]



help? JNI config FAILS for inprocess Tomcat at vm: initializationon OSX

2003-03-29 Thread R Blake
hi,

i've got tomcat 4.1.24 LE + apache2 2.1.0 cvs + mod_jk2 all behaving nicely 
for 'out of process' Tomcat.

however, when I try to launch tomcat 'in process', it fails, and the 
catalina.out log shows:

INFO: Starting Coyote HTTP/1.1 on port 8080
[Sat Mar 29 18:07:59 2003] ( info ) [jk_config_file.c (320)]  cfg.update() 
Updating config /etc/apache2/workers2.properties 0 1048989584
[Sat Mar 29 18:07:59 2003] ( info ) [jk_config_file.c (331)] 
config.setConfig():  Reading properties /etc/apache2/workers2.properties 27
[Sat Mar 29 18:07:59 2003] ( info ) [jk_logger_file.c (224)]  Level DEBUG 0
[Sat Mar 29 18:07:59 2003] ( info ) [jk_logger_file.c (184)]  Initializing 
log file stderr
[Sat Mar 29 18:07:59 2003] ( info ) [jk_vm_default.c (463)] 
jni.guessJvmDll() failed /Library/Java/Home/jre/bin/classic/libjvm.so
[Sat Mar 29 18:07:59 2003] ( info ) [jk_vm_default.c (463)] 
jni.guessJvmDll() failed /Library/Java/Home/jre/bin/client/jvm.so
[Sat Mar 29 18:07:59 2003] ( info ) [jk_vm_default.c (463)] 
jni.guessJvmDll() failed /Library/Java/Home/jre/lib/i386/classic/libjvm.so
[Sat Mar 29 18:07:59 2003] ( info ) [jk_vm_default.c (463)] 
jni.guessJvmDll() failed /Library/Java/Home/jre/lib/i386/client/libjvm.so
[Sat Mar 29 18:07:59 2003] ( info ) [jk_vm_default.c (463)] 
jni.guessJvmDll() failed /Library/Java/Home/jre/bin/classic/jvm.so
[Sat Mar 29 18:07:59 2003] ( info ) [jk_vm_default.c (468)] 
jni.guessJvmDll() failed
[Sat Mar 29 18:07:59 2003] (error ) [jk_vm_default.c (496)]  vm.init(): no 
jvm_dll_path, will use LD_LIBRARY_PATH libjvm.so
[Sat Mar 29 18:07:59 2003] (error ) [jk_vm_default.c (246)]  Can't load 
native library libjvm.so : cannot create object file image or add lib
[Sat Mar 29 18:07:59 2003] (emerg ) [jk_vm_default.c (507)]  jni.loadJvm() 
Error - can't load jvm dll
[Sat Mar 29 18:07:59 2003] (error ) [jk_workerEnv.c (229)] 
workerEnv.initChannel() init failed for channel.jni:jni
[Sat Mar 29 18:07:59 2003] ( info ) [jk_worker_jni.c (239)] 
workerJni.Init() Skipping initialization for the -1 13086
[Sat Mar 29 18:07:59 2003] (error ) [jk_workerEnv.c (193)] 
workerEnv.initWorkers() init failed for worker.jni:onStartup
[Sat Mar 29 18:07:59 2003] ( info ) [jk_worker_jni.c (239)] 
workerJni.Init() Skipping initialization for the -1 13086
[Sat Mar 29 18:07:59 2003] (error ) [jk_workerEnv.c (193)] 
workerEnv.initWorkers() init failed for worker.jni:onShutdown

now, i'm not terribly surprised by this . cuz OSX's jvm can be found at:

/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Libraries/libjvm
.dylib
i've tried a clean build with LDFLAGS set to:

   setenv LDFLAGS -ldl -F/System/Library/PrivateFrameworks -framework 
JavaVM

but no dice . same error

a quick peek in jk_vm_default.c shows that the jni.guessJvmDll checks are 
only for .so libs

noting the will use LD_LIBRARY_PATH libjvm.so , and i naivelely added 
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Libraries/ to my 
LD_LIBRARY_PATH and tried again -- even with a symbolic link from 
libjvm.dylib to libjvm.so, its still failing with the same errors.

clearly, i'm missing something .

any help/ideas?

for reference, here are my jk2.properties  workers2.properties:

=
#
# /etc/local/tomcat/conf/jk2.properties
#
#Minimum JNI configuration is the simplest one to make the Tomcat working
#from inside the web server as inprocess. The only comunication channel used
#is JNI. The JK2 will register all the native calls by itself, so there is
#no need to specify the native library on Java side.
#handler.list=apr,channelSocket,channelJni,request
handler.list=apr,request,container,channelJni
shm.file=/usr/local/tomcat/work/jk2.shm
tomcatAuthentication=true
channelSocket.port=8009
# Tomcat: in process; native libs will be reg'd by JK2
# If not then it has to be the absolute path of the jkjni dynamic library.
apr.jniModeSo=inprocess
# jkjni dynamic library: either in java.library.path, or absolute path
apr.NativeSo=/usr/libexec/apache2/jkjni.so
# Tomcat: out of process
# jtc=/usr/local/tomcat-connectors
# apr.NativeSo=${jtc}/jk/build/jk2/apache2/jkjni.so
# Or you can use the mod_jk2 directly
# apr.jniModeSo=/usr/libexec/apache2/mod_jk2.so
=






=
#
## /etc/apache2/workers2.properties -
#

# Global Settings

[logger]
level=DEBUG
[config:]
file=/etc/apache2/conf/workers2.properties
debug=0
debugEnv=0
[uriMap:]
info=Maps the requests. Options: debug
debug=0
[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, 

it's always the simplest things (redeploy)

2003-03-29 Thread Dan Allen
I can't for the life of me understand why this has to be so
difficult.  It seems a major flaw of tomcat not to be able to simply
redeploy and activate an application from a war file.  I have read many
posts on the subject from the archives of this list and no one seems
to have a definitive solution.  The solution just seems to be just
use resin for development, it actually works right, then just deploy
on tomcat.  Since I have invested a great deal of time in tomcat, I
wish not to give up this easily.

In short, what does it take to drop a war into the webapps
directory, overwriting a previous war and get tomcat to recognize
the timestamp is newer and reissue the files so that you can see the
changes when you visit the application in the browser?  I am tempted
just to do my development directly inside the web container to avoid
this issue all together, but that just doesn't seem to be the right
way to go about things.

Since this question comes up so often, maybe we can work out a full
answer in this thread so that it doesn't have to be asked again.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Microsoft's Law of Software Engineering: 
Don't worry if it doesn't work right. 
If everything did, we'd be out of a job.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Can't disable cookies when web-app running on localhost

2003-03-29 Thread gardener
Hi,

I am unable to disable cookies when my web-app is running on the same computer that 
the browser (IE6) is running on.  When I run the web-app on a remote host, I can 
disable cookie support by setting privacy at the highest level.  However the high 
privacy setting has no affect when the web-app is running on my computer (the same 
computer that the browser is running on).  Cookies continue to be accepted by the 
browser, even though they're supposedly disabled.

Both my computer and the remote host are using the same version of Tomcat (version 
4.1.18).  My computer operating system is Windows XP Professional.

Any information on this phenomenon would be greatly appreciated.  Thanks in advance.

Mark Steere

Re: Bug in CoyoteConnector when using JkCoyoteHandler

2003-03-29 Thread Bill Barker
There is a bug in 4.1.18 where it will always behave as you are seeing.  It
should be fixed in 4.1.24.  Even with 4.1.18, you should be able to override
the port setting in the jk2.properties file.

Quinton McCombs [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 I am running into a strange problem on Tomcat 4.1.18.

 I setup a CoyoteConnector on port 8009 using the JkCoyoteHandler
 protocol handler to handle AJP13 requests.  This worked perfectly.

 I then needed to add a second AJP13 connector to process secure requests
 (though an ssl apache virtual host).  I created a second CoyoteConnector
 using the JkCoyoteHandler listening on port 8443.  I should be able to
 have multiple connectors as long as they are on different ports, right?

 After I restarted the sever, I saw an error message when the second AJP
 connector tried to initialize.  It reported that port 8009 was already
 bound.  It then promptly bound the second connector to port 8010.  This
 truly confused me.  I double checked my configureation and everything
 seemed to be correct.  I also did a netstat -l to see what ports were
 actually in use.  Ports 8009 and 8010 had listeners.

 I removed the second connector.  I then changed the original connector
 to listen on port 8019.  I now had only one CoyoteConnector for AJP13
 connections configured.  The only port is 8019.

 After I restarted the server, the connector bound itself to 8009.
 netstat -l confirmed that this was not a bogus log message.

 From the way this looks, a coyote connector using the JkCoyoteHandler
 will always attempt to use port 8009 reguadless of the port attribute of
 the connector.  If the port is not available, it increment the port
 number by one and try again.  This appears to be a bug.




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



Re: Can't disable cookies when web-app running on localhost

2003-03-29 Thread Bill Barker
You'll have to complain to Bill Gates about this one ;-).  The MSIE-6
Privacy settings are for the Internet Zone only.  They are ignored for the
Local Intranet Zone (which includes localhost).

gardener [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,

I am unable to disable cookies when my web-app is running on the same
computer that the browser (IE6) is running on.  When I run the web-app on a
remote host, I can disable cookie support by setting privacy at the highest
level.  However the high privacy setting has no affect when the web-app is
running on my computer (the same computer that the browser is running on).
Cookies continue to be accepted by the browser, even though they're
supposedly disabled.

Both my computer and the remote host are using the same version of Tomcat
(version 4.1.18).  My computer operating system is Windows XP Professional.

Any information on this phenomenon would be greatly appreciated.  Thanks in
advance.

Mark Steere




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