Re: Getting other Sessions

2005-02-23 Thread Michael Greer
List servers = MBeanServerFactory.findMBeanServer(null);
MBeanServer server = (MBeanServer)servers.get(0);
	ObjectName objName = new 
ObjectName(Catalina:type=Manager,path=/contextPath,host=localhost);
	
	String sessionIds = 
(String)server.invoke(objName,listSessionIds,null, null);

You can get the rest by each sessionId. Take a look at the MBean docs 
on how to make jmx calls. There is a jmxproxy in 5.5 manager app which 
shows all of the mbeans by default, and lets you test your queries. 
Complex, but not hard.

-Michael Greer  
On Feb 22, 2005, at 11:17 PM, Joseph Shraibman wrote:
I want to make an admin page in my application.  I needs to be able to 
get access to all the current Session objects to access their 
attributes.  Is this possible?

-
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: can I develop dan deploy myapps as regular user at linux?

2005-02-22 Thread Michael Greer
Why not chown the whole tomcat directory to yourself (or your group)? 
Then you can just pop in your apps. Tomcat doesn't need to (and should 
not) run as root. No need to restart either.
-Michael Greer

On Feb 22, 2005, at 8:47 AM, Mohd. Jeffry wrote:
Hi, I'm pretty new with tomcat, 1 month to be exect. So what are the
standart operating procedure to develop and deploy at linux
environtment? For the time being this is what I do and it's kinda
troublesome.
1. compile my app at /home/devel/myapps
2. su as root and move it to /usr/local/tomcat/webapps/myapps
3. and chown myapps for tomcat:tomcat.
4. and restart tomcat
If possible I don't want to use any IDE tools for time being because I
want to focus on servlet/jsp and not on IDE.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Re: Tomcat 5.5 working, BUT not outside of webapps/

2005-02-22 Thread Michael Greer
Maybe take a look at the current $CATALINA_HOME/Catalina/localhost/  
context files. Delete the old ones for your webapp and examples, so it  
will reload from server.xml

On Feb 22, 2005, at 11:39 AM, Matt wrote:
Well, I've tried all sorts of configurations, so I was hoping to get a
clean example from someone who had it working.  I changed the stock  
Tomcat
5.5 server.xml file to add the following (within the pre-existing, as  
well
as the only, HOST tag for localhost, and I have tried with/without a  
slash
for path, and with forward or backward slashes in docbase):
CONTEXT path= docbase=C:/Inetpub/wwwroot/MYwebapps debug=0
reloadable=true /
...and I have edited the stock Tomcat 5.5 uriworkermap.properties file  
to
add the directory relative to the additional docbase (I've also tried
without the .jsp specificity at the end of the line to handle  
everything):
/MYjsp-examples/*.jsp
(the jk_1.2.8.exe installer puts it all in its own folders in
$CATALINA_HOME's parent, not within $CATALINA_HOME/bin, and also sets  
the
registry properly - anything else this nice installer does for me?  It
doesn't appear to set environment variables $CATALINA_HOME or  
JAVA_HOME -
do I need to do this manually?  The webapps examples work fine without
these variables set though, so is this a deprecated step?)

So, if I have copied the webapps folder (and everything in it) to the
C:\Inetpub\wwwroot folder and renamed it MYwebapps, and renamed
jsp-examples therein to be MYjsp-examples (and fixed the .html to  
point to
the right path), I would have thought that I could run examples from  
the
new directory as well.  I don't see any path info. (non-relative)
elsewhere that would cause problems and need to be changed?  However,  
if
uriworkermap.properties is edited properly, I get a Tomcat 404 error
starting with the docbase, when clicking any example (.jsp link; the  
.html
ones still work fine, since they're not handed-off to Tomcat) from the
main page:
http://localhost/MYwebapps/MYjsp-examples/index.html
...the same files still work fine if I go back to the original  
location:
http://localhost/jsp-examples

I've even tried making new HOST tags as well, but Tomcat won't start if
you try to define two HOST tags for the same system whether I use a
machine name, IP or whatever.
Perhaps I misread the docs somewhere, or there's more to it than the  
above
two steps, I'd love to know!

Thanks,
-Matt
On Tue, 22 Feb 2005, Michael Greer wrote:
Why don't you show us your config file. This behavior work fine for me
with 5.5.7, with Apache  mod_jk.
On Feb 22, 2005, at 1:20 AM, Matt wrote:
Is this simply not possible?  I have tried extrapolating form the  
docs
(which seems to work fine under webapps/ or $CATALINA_HOME) but
anything
outside of it fails as badly as the other works perfectly, even if I
try
to swap-out webapps/ for an otuside docbase using the HOST tag
already
present.

There's got to be a file or simple edit that I'm missing for this?
Anyone?
Thanks,
-Matt
On Sun, 20 Feb 2005, Matt wrote:
OK, the docs out there are good, but they either concern old  
versions
of
IIS and/or Tomcat -OR- they concern the JK2 module (including this
list's
archives I have searched).
If JK2 is NO LONGER SUPPORTED, why in the heck would I care to use  
it?
So, I am using the very nice jk_1.2.8.exe installer.  With that,  
most
of
the steps found in the various, partially-helpful docs are already
done!
;^)

That said:
I am using Win2K + IIS5, and also Win2K3 + IIS6, and in either case,
also
Tomcat 5.5:
I can go to http://localhost and get my IIS index page.
I can go to http://localhost:8080 and get my Tomcat index page.
I can go to http://localhost/jsp-examples/index.html and run all the
wonderful examples.
HOWEVER, if I simply want to -ALSO- hand-off jsp pages to Tomcat  
that
are
in C:\Inetpub\wwwroot (and below) everything goes to hell.

I have tried adding CONTEXT tags to server.xml until I turn blue in
the
face, and when I do so I get either 404 not found errors from Tomcat
(can't find the subdirectory b/c I assume it is looking for it in
webapps/, but then again it can't find it even if I copy the whole
thing
into webapps/) or The specified module could not be found message
on the
page (IIS result of a uriworkermap.properties issue).
I have even tried editing the existing HOST tag to change webapps
to C:/Inetpub/wwwroot and all sorts of folders below wwwroot.  In
those
cases, if I manage to edit the uriworkermap.properties file
correctly, all
I get is a blank page for any .jsp, while IIS still handles the  
other
stuff just fine.

So, instead of these outdated docs everyone keeps pointing to, does
anyone
have any simple instructions to get Tomcat to properly use a folder
OUTSIDE of webapps, and ALONG WITH webapps to work (especially
assuming
you've already got the basics working just fine as I do)?
I'd like to start by getting a copy of jsp-examples working in
wwwroot/ if
possible (which is also how I was testing in the situation above

Re: Class GtorActionServlet is not a Servlet

2005-02-21 Thread Michael Greer
Could you post the class itself? Perhaps it does _not_ implement 
servlet (most likely scenario).

On Feb 21, 2005, at 9:41 AM, Adrian Wilford wrote:
Hi,
I am having a problem with Tomcat - I am running JBOSS 4.0.1 using 
Tomcat as
the web container, and I am getting this odd Exception thrown, it says 
that
my class (which definitely extends Servlet) is not a Servlet ?!?!?

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


Re: Class GtorActionServlet is not a Servlet

2005-02-21 Thread Michael Greer
I would manually declare that class to be implementing the Servlet 
interface. Can't hurt (can it?) if it already does so by its ancestry. 
At least it is quick to add and test.

On Feb 21, 2005, at 10:28 AM, Adrian Wilford wrote:
HTTPServlet

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


Re: Tomcat: who is knocking on my door?

2005-02-21 Thread Michael Greer
Front it with apache and restrict access by user agent.
-Michael Greer
On Feb 21, 2005, at 5:55 PM, Dola Woolfe wrote:
First, I'm sure this is documented so can anyone point
me to the documentation on how to determine the client
application.
Second, does Tomcat itself do anything different
depending on who's making the request. I sometimes
notice that IE's requests are fielded faster than
wget's requests.
Finally, is there a blanket way to prevent wget
requests?
Many thanks in advacne!
Dola
__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Re: log4j.properties not found in tomcat

2005-02-21 Thread Michael Greer
Where do you put  log4j.properties currently?
-Michael Greer
On Feb 21, 2005, at 5:02 PM, Brian McGovern wrote:
I have a wierd problem.  Tomcat on W2k barks FileNotFound Exceptions 
for the log4j.properties file when i execute a servlet that 
instantiates log4j.  Strangely enough the actual file that i create 
and log to with log4j.properties file logs out just fine even though 
stdout.log said that it couldn't find my log4j.properties file.

Only time i don't get an error is when i put log4j.properites in my 
winnt/system32 directory.  But this doesnt make sense to me.  I supply 
-Dlog4j.configuration=log4j.properties to Java at startup and still 
get the same error.  I also tried the FULL path to my log4j.properties 
in the -D option.

Instantiated like this across my app.
private static final Logger zLogger = 
Logger.getLogger(MyClassName.class);

Can anyone tell me where I went wrong.
thanks

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


Re: volunteering to enhance docs for mod_jk local_worker_only (server quiescence)

2005-02-21 Thread Michael Greer
Mladen,
Built new jk from CVS. How to I access the lovely status page? 
/jkstatus as in jk2? Do have to enable it? Docs do not seem to be 
updated yet.
Looking forward to playing with it!
thanks,

-Michael Greer
On Feb 19, 2005, at 2:44 PM, Mladen Turk wrote:
Michael Greer wrote:
Mladen ,
That sounds like the right solution! I think I remember the status 
page from jk2, and it is a good idea.
Yes, we are trying to backport all goodies from jk2 now that is
deprecated and no longer maintained.
Not only that. It will have options to fully edit properties, as well
to add or disable uri mappings, to reflect the dynamic deployment in
tomcat. You can try new features either from cvs, or wait for a
public beta release, before releasing stable version.
Regards,
Mladen.
-
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: volunteering to enhance docs for mod_jk local_worker_only (server quiescence)

2005-02-21 Thread Michael Greer
Ah, I extrapolated from the jk2 docs:
workers.properties:
worker.status.type=status
httpd.conf:
JkMount /jkstatus/* status
Nice!
-Michael Greer
On Feb 22, 2005, at 1:01 AM, Michael Greer wrote:
Mladen,
Built new jk from CVS. How to I access the lovely status page? 
/jkstatus as in jk2? Do have to enable it? Docs do not seem to be 
updated yet.
Looking forward to playing with it!
thanks,

-Michael Greer
On Feb 19, 2005, at 2:44 PM, Mladen Turk wrote:
Michael Greer wrote:
Mladen ,
That sounds like the right solution! I think I remember the status 
page from jk2, and it is a good idea.
Yes, we are trying to backport all goodies from jk2 now that is
deprecated and no longer maintained.
Not only that. It will have options to fully edit properties, as well
to add or disable uri mappings, to reflect the dynamic deployment in
tomcat. You can try new features either from cvs, or wait for a
public beta release, before releasing stable version.
Regards,
Mladen.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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

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


Re: Tomcat 5.5 working, BUT not outside of webapps/

2005-02-21 Thread Michael Greer
Why don't you show us your config file. This behavior work fine for me  
with 5.5.7, with Apache  mod_jk.

On Feb 22, 2005, at 1:20 AM, Matt wrote:
Is this simply not possible?  I have tried extrapolating form the docs
(which seems to work fine under webapps/ or $CATALINA_HOME) but  
anything
outside of it fails as badly as the other works perfectly, even if I  
try
to swap-out webapps/ for an otuside docbase using the HOST tag  
already
present.

There's got to be a file or simple edit that I'm missing for this?
Anyone?
Thanks,
-Matt
On Sun, 20 Feb 2005, Matt wrote:
OK, the docs out there are good, but they either concern old versions  
of
IIS and/or Tomcat -OR- they concern the JK2 module (including this  
list's
archives I have searched).
If JK2 is NO LONGER SUPPORTED, why in the heck would I care to use it?
So, I am using the very nice jk_1.2.8.exe installer.  With that, most  
of
the steps found in the various, partially-helpful docs are already  
done!
;^)

That said:
I am using Win2K + IIS5, and also Win2K3 + IIS6, and in either case,  
also
Tomcat 5.5:
I can go to http://localhost and get my IIS index page.
I can go to http://localhost:8080 and get my Tomcat index page.
I can go to http://localhost/jsp-examples/index.html and run all the
wonderful examples.
HOWEVER, if I simply want to -ALSO- hand-off jsp pages to Tomcat that  
are
in C:\Inetpub\wwwroot (and below) everything goes to hell.

I have tried adding CONTEXT tags to server.xml until I turn blue in  
the
face, and when I do so I get either 404 not found errors from Tomcat
(can't find the subdirectory b/c I assume it is looking for it in
webapps/, but then again it can't find it even if I copy the whole  
thing
into webapps/) or The specified module could not be found message  
on the
page (IIS result of a uriworkermap.properties issue).
I have even tried editing the existing HOST tag to change webapps
to C:/Inetpub/wwwroot and all sorts of folders below wwwroot.  In  
those
cases, if I manage to edit the uriworkermap.properties file  
correctly, all
I get is a blank page for any .jsp, while IIS still handles the other
stuff just fine.

So, instead of these outdated docs everyone keeps pointing to, does  
anyone
have any simple instructions to get Tomcat to properly use a folder
OUTSIDE of webapps, and ALONG WITH webapps to work (especially  
assuming
you've already got the basics working just fine as I do)?
I'd like to start by getting a copy of jsp-examples working in  
wwwroot/ if
possible (which is also how I was testing in the situation above, if  
that
means anything), rather than also confusing the situation by learning
how to create apps myself at the same time.  Perhaps that has caused  
my
problem - maybe the issue lies in a web.xml file somewhere for the
jsp-examples (I;ve even copied all of webapps to wwwroot to try and  
get
that to work, but no luck).

Thanks,
Matthew Kozak
Rutgers University-Camden
[EMAIL PROTECTED]
** 

 They that can give up essential liberty to obtain a little temporary
	safety deserve neither liberty nor safety.  -Ben Franklin
** 



Matthew Kozak
Rutgers University-Camden
[EMAIL PROTECTED]
*** 
***
 They that can give up essential liberty to obtain a little temporary
	safety deserve neither liberty nor safety.  -Ben Franklin
*** 
***

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


volunteering to enhance docs for mod_jk local_worker_only (server quiescence)

2005-02-19 Thread Michael Greer
I have been looking around the web to figure out how to implement 
server quiescence (starving sessions from server in balanced set to 
take it down for maintenance). The documentation on the jakarta site 
confused me, and it looks like I am not alone. More people have 
questions than answers.

I think the trouble it that the docs start with the properties, and 
then describe their complex interactions and possible outcomes. It 
might be helpful to write a HOWTO starting from the use case instead: 
HOWTO Quiesce Load-balanced Tomcat Server.

Should I take the trouble? Does this belong instead on the Apache wiki? 
I will need some help to get it right, so I wrote here to see if I 
could post drafts and get corrections from the community.

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


Re: volunteering to enhance docs for mod_jk local_worker_only (server quiescence)

2005-02-19 Thread Michael Greer
Mladen ,
That sounds like the right solution! I think I remember the status page 
from jk2, and it is a good idea.
-Michael Greer

On Feb 19, 2005, at 2:29 PM, Mladen Turk wrote:
Michael Greer wrote:
Should I take the trouble?
local_worker and local_worker_only flags will be deprecated.
(already are with the current 1.2.9-dev)
There has been more powerful mechanism implemented, that is
IMO more clearer and acts like it should.
1.2.9 has shared memory and status page that can be used to
dynamically change worker properties at runtime, without
the need for graceful restarts, or something like.
New directives like 'redirect' (for preferred failover),
'disabled' and 'sticky_session_force' has been added.
The documentation will be updated accordingly.
Release plan is for the first half of march.
Like you said the entire concept of local_worker and
local_worker_only was too fuzzy and understandable to
a wider audience.
Regards,
Mladen.
-
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]