Re: runtime.exec cmd.exe /C net use

2013-03-26 Thread Patrick Flaherty


On Mar 26, 2013, at 4:07 PM, André Warnier wrote:


Patrick Flaherty wrote:

On Mar 25, 2013, at 1:15 PM, Howard W. Smith, Jr. wrote:

On Mon, Mar 25, 2013 at 11:14 AM, Patrick Flaherty
pflah...@rampageinc.comwrote:

Update: If I'm login interactively (meaning machine boots and I  
login and
get my desktop) and that interactive account matches the service  
login

account
then net use from within the service does return all mapped  
drives.




I expected as much. It seems as though you cannot get away from the
requirement of having to login 'first'...to get everything working  
as

designed/expected in your app.

Excuse me, if I missed the business requirement specification  
(earlier in
this conversation), but is the requirement only to get a list of  
mapped
drives for 'your' user login or any enduser that logs into the  
production

server/client/PC/machine?

can you add the list of network drives to a database table, and  
maintain
the database table and retrieve the list from that database table  
via the

tomcat-app-running-as-service?

if you only need a list of mapped network drives for your user  
login, can
you just maintain a 'file' that has this list on the target/ 
production
server, and whenever it changes, can you update the file, and make  
the
topcat-app-running-as-service to always read the file instead of  
having to

call 'net use'?

IMHO and FWIW, i would never go with the approach of relying on a  
windows
'command line' to do this/that for me. yes, in my app, i allow  
endusers to
update files/documents, and the app saves the files/documents to a  
certain
folder on the server, and my app will list those files on a web  
page, and
they can view/download those files from/via the web app... all  
that is done
via java instead of doing a 'cmd.exe dir'. i'm new to java, always  
wanted

to be java developer, and loving what i can do with java. i'm almost
getting to the point, where my days of a 'windows user' are  
done... one

day, i hope to migrate to linux for target server instead of windows
server. :)
This is what I see. If my service logs in as service-user and I  
login normally to my desktop as dt-user.
I call net use from my service and get an empty list. Now I  
logout as dt-userand login as service-user and I mapped
4 drives and only 2 of the drives are mapped persisted (i.e.  
reconnect at logon). I logout as service-user and
now I have my app call net use programatically and it returns the  
2 drives that were mapped with persistence.
Conclusion: Whatever drives are mapped persisted when logged in as  
the user the service logs in as, then your
app can call net use and get those drives returned from net use  
even if your logged in as dt-user OR nobody

is logged in at all 
Maybe someone can confirm my finding, but this is what I see.


Hi Patrick.
Basically, what Jeffrey and I are trying to tell you :
- we are not saying that your observations above are incorrect, in  
the context in which you are making them
- but it seems to us that the way you are going about this, is not  
the right way to make your application portable to other systems or  
Windows versions, because it seems to rely on things that may be  
particular to one or the other Windows version or circumstance.

In other words, it makes your application fragile.

The point is : when you login interactively to a Windows computer as  
user-1, or when you run a Service which logs-in to that computer  
as the same user-1, the environment in each case is *different* in  
many ways.  It may be that under one or more particular versions of  
Windows, when comparing certain particular aspects (like prior drive  
mappings), you cannot see a difference.  But differences there are,  
and they may show up on another version of Windows that you have not  
tried yet, or maybe with the same version somewhere else which has  
other network policies or security policies than the ones you  
are testing under right now.


If you totally control your environment, notice that something is  
working and are happy with that because you are never going to use  
this anywhere else, then that's fine, keep doing it and don't spend  
more time figuring out what may be or not portable somewhere else.


But if you want to make something portable, then you have to take  
into account that, for example, the host on which your app may be  
running one day, will not allow you to login interactively ahead of  
time to make drive mappings for the service's user-id.
For example, because the sysadmins have decided that anything that  
runs as a service needs a special service account (which,  
contrarily to all the others has a password that never runs out  
e.g.); but on the other hand, according to their organisation's  
rules, a service account can *not* be used to login interactively  
anywhere. And since this rule already applies to the 10,000  
workstations and servers of that organisation, they are not going to  
change it just

Re: runtime.exec cmd.exe /C net use

2013-03-25 Thread Patrick Flaherty


On Mar 25, 2013, at 6:03 AM, André Warnier wrote:


Howard W. Smith, Jr. wrote:

On Sun, Mar 24, 2013 at 7:14 PM, Howard W. Smith, Jr. 
smithh032...@gmail.com wrote:



Hi Jeffrey,

Yes, I now get it. Thanks for the lesson on Windows Networking (I  
thought

I knew well) and thanks to Andre as well.
You also said that if all I wanted to do was make a list of mapping
appear in an html page (without actually using them
in your application), you can just fake it as previously  
discussed. I

think I missed that part.

Thanks
Pat



Glad you understand now. I was about to provide a response similar  
to
Andre's previous response. This all reminds me of a similar  
situation

within my TomEE/Tomcat7 web app.

On my development server (Windows 2008 server 64-bit), I am 'always'
logged in and coding/etc, which means I always test the web app via
NetBeans (which provide the infamous 'console' that is mentioned  
throughout
this thread). I developed this piece of code that uses  
JODConverter to call
OpenOffice.org at/via port 2002, and this allows my web app to  
convert
files to PDF after enduser uploads certain documents (Word docs,  
excel,
etc...). So, that all works on my development server. Why? because  
I am
logged in everytime while testing and the app is 'never' running  
as a

Windows 'service' on my development server.

So, i deploy my web app to target/production server (Windows 2003  
Server
and/or Windows Server 2008). For many months now, I have wondered  
'why' the
code will not work on the 'production' server but it runs/works  
'everytime'
on my development server. Finally, recently (after many months of  
research
and/or multiple attempts of trying to debug/resolve the problem),  
I either
read somewhere or finally realized that the code will 'not' work  
because my
web app is running as a service, and for whatever reason (of  
course a
'Windows' reason), the code will 'not' work while running as a  
service.


So, I am left to coding another implementation to convert files  
after
upload, use another library, and ditch the JODConverter/ 
OpenOffice.org

approach.


Forgot to mention... since OpenOffice.org can be installed in the  
Startup
folder, i was assuming that it would run as a service on production  
server,
and/but I forgot that Startup folder just automatically starts the  
app
immediately when/after you login. OpenOffice.org is 'not' running  
as a

service, and since my web app is running as a service (in a different
'environment'), my web app was unable to access OpenOffice.org,  
because
clearly/definitely/evidently, it was not/never running as a  
'service'..

which means it was never available to my web app. :(


And, to get back more OT, that may be the fundamental difference  
with my succesful usage of the same : in my case, it is my service  
program which launches the background OpenOffice instance, which  
most probably means that it too is running in the same service  
context a the main service program.

(Which brings us back to the same context as this thread).
Update: If I'm login interactively (meaning machine boots and I login  
and get my desktop) and that interactive account matches the service  
login account
then net use from within the service does return all mapped drives.  
I'm not sure if that is by design or is something I can hang my hat on  
but it is the case

with Windows 7 SP1.

Thanks again
Pat







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: runtime.exec cmd.exe /C net use

2013-03-25 Thread Patrick Flaherty


On Mar 25, 2013, at 11:59 AM, Harris, Jeffrey E. wrote:





-Original Message-
Update: If I'm login interactively (meaning machine boots and I login
and get my desktop) and that interactive account matches the service
login account then net use from within the service does return all
mapped drives.
I'm not sure if that is by design or is something I can hang my hat  
on

but it is the case with Windows 7 SP1.

Thanks again
Pat





Interesting.  It is possible that if you are already logged in, and  
start
the service, it does not need to log in separately as the service.   
Does this work

whether you start the service before or after you log in interactively
with the same account?


I just tested this and the order does not matter. Works for both  
sequences.


In any case, I am not sure you can rely on that because it does  
require an interactive
login, and if your system reboots in the middle of the night  
(whether because of an
unplanned event or installation of Microsoft updates, depending on  
your server is
configured), you will not be there to log in interactively so the  
net share list
is available, and you probably do not want to set automatic login  
for the account.
We only use it to populate a UI where you select a path that gets  
stored in a DB. Path is used as destination for scheduled backups.

So for us it will not present a problem.



Jeffrey Harris

This e-mail and any attachments are intended only for the use of the  
addressee(s) named herein and may contain proprietary information.  
If you are not the intended recipient of this e-mail or believe that  
you received this email in error, please take immediate action to  
notify the sender of the apparent error by reply e-mail; permanently  
delete the e-mail and any attachments from your computer; and do not  
disseminate, distribute, use, or copy this message and any  
attachments.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: runtime.exec cmd.exe /C net use

2013-03-25 Thread Patrick Flaherty


On Mar 25, 2013, at 1:15 PM, Howard W. Smith, Jr. wrote:


On Mon, Mar 25, 2013 at 11:14 AM, Patrick Flaherty
pflah...@rampageinc.comwrote:

Update: If I'm login interactively (meaning machine boots and I  
login and
get my desktop) and that interactive account matches the service  
login

account
then net use from within the service does return all mapped drives.



I expected as much. It seems as though you cannot get away from the
requirement of having to login 'first'...to get everything working as
designed/expected in your app.

Excuse me, if I missed the business requirement specification  
(earlier in
this conversation), but is the requirement only to get a list of  
mapped
drives for 'your' user login or any enduser that logs into the  
production

server/client/PC/machine?

can you add the list of network drives to a database table, and  
maintain
the database table and retrieve the list from that database table  
via the

tomcat-app-running-as-service?

if you only need a list of mapped network drives for your user  
login, can

you just maintain a 'file' that has this list on the target/production
server, and whenever it changes, can you update the file, and make the
topcat-app-running-as-service to always read the file instead of  
having to

call 'net use'?

IMHO and FWIW, i would never go with the approach of relying on a  
windows
'command line' to do this/that for me. yes, in my app, i allow  
endusers to
update files/documents, and the app saves the files/documents to a  
certain
folder on the server, and my app will list those files on a web  
page, and
they can view/download those files from/via the web app... all that  
is done
via java instead of doing a 'cmd.exe dir'. i'm new to java, always  
wanted

to be java developer, and loving what i can do with java. i'm almost
getting to the point, where my days of a 'windows user' are done...  
one

day, i hope to migrate to linux for target server instead of windows
server. :)


This is what I see. If my service logs in as service-user and I  
login normally to my desktop as dt-user.
I call net use from my service and get an empty list. Now I logout  
as dt-userand login as service-user and I mapped
4 drives and only 2 of the drives are mapped persisted (i.e. reconnect  
at logon). I logout as service-user and
now I have my app call net use programatically and it returns the 2  
drives that were mapped with persistence.
Conclusion: Whatever drives are mapped persisted when logged in as the  
user the service logs in as, then your
app can call net use and get those drives returned from net use  
even if your logged in as dt-user OR nobody

is logged in at all 

Maybe someone can confirm my finding, but this is what I see.

Thanks again
Pat






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: runtime.exec cmd.exe /C net use

2013-03-25 Thread Patrick Flaherty


On Mar 25, 2013, at 7:13 PM, Harris, Jeffrey E. wrote:





-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Monday, March 25, 2013 6:58 PM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 25, 2013, at 1:15 PM, Howard W. Smith, Jr. wrote:


On Mon, Mar 25, 2013 at 11:14 AM, Patrick Flaherty
pflah...@rampageinc.comwrote:


Update: If I'm login interactively (meaning machine boots and I

login
and get my desktop) and that interactive account matches the  
service
login account then net use from within the service does return  
all

mapped drives.



I expected as much. It seems as though you cannot get away from the
requirement of having to login 'first'...to get everything working  
as

designed/expected in your app.

Excuse me, if I missed the business requirement specification

(earlier

in this conversation), but is the requirement only to get a list of
mapped drives for 'your' user login or any enduser that logs into  
the

production server/client/PC/machine?

can you add the list of network drives to a database table, and
maintain the database table and retrieve the list from that database
table via the tomcat-app-running-as-service?

if you only need a list of mapped network drives for your user  
login,

can you just maintain a 'file' that has this list on the
target/production server, and whenever it changes, can you update  
the

file, and make the topcat-app-running-as-service to always read the
file instead of having to call 'net use'?

IMHO and FWIW, i would never go with the approach of relying on a
windows 'command line' to do this/that for me. yes, in my app, i

allow

endusers to update files/documents, and the app saves the
files/documents to a certain folder on the server, and my app will
list those files on a web page, and they can view/download those

files

from/via the web app... all that is done via java instead of doing a
'cmd.exe dir'. i'm new to java, always wanted to be java developer,
and loving what i can do with java. i'm almost getting to the point,
where my days of a 'windows user' are done...
one
day, i hope to migrate to linux for target server instead of windows
server. :)


This is what I see. If my service logs in as service-user and I  
login

normally to my desktop as dt-user.
I call net use from my service and get an empty list. Now I  
logout as

dt-userand login as service-user and I mapped
4 drives and only 2 of the drives are mapped persisted (i.e.  
reconnect

at logon). I logout as service-user and now I have my app call net
use programatically and it returns the 2 drives that were mapped  
with

persistence.
Conclusion: Whatever drives are mapped persisted when logged in as  
the

user the service logs in as, then your app can call net use and get
those drives returned from net use
even if your logged in as dt-user OR nobody is logged in at  
all 


Maybe someone can confirm my finding, but this is what I see.

Thanks again
Pat



You are on a Windows 7 system, which supports one user logged in at  
a time.
I would be interested in seeing how this behaves on a Windows Server  
2008 R2 system,
configured for multiple users to be logged on at the same time (the  
default for remote
administration mode is one user at a time).  I do believe this is an  
artifact of the
Windows 7 architecture (one user at a time) because Windows Server  
2008 R2 has different
security zones (rings) in its kernel implementation for access by  
different components
(services, drivers, and users) which affect the presentation to the  
user.


Also, persistent mappings are user specific.  So if usera has two  
persistent drive mappings and
userb has three different persistent mappings, usera will see his  
two when he is logged on and
userb will see his three when he is logged on.  Do you have the same  
persistent mappings for dt-user
and service-user?  You have also stated that you see no mapped  
drives when you run the service, so
it seems as though starting the service first (and never having  
anyone logged in or dt-user) is an exception.
Therefore, by extension of what you said above, you only receive the  
mapped drives if
1) the service starts first and then the service account logs in  
interactively, or
2) the service starts after logging in with the service account.   
Did you try both of these?
But once the service sees the mappings, it retains it until:  the  
service restarts?  Does
it matter whether the service restarts with someone logged on (i.e.,  
the service account) or no one

logged in?

I do not think that you have explored all of the conditions required  
for the service to maintain
its mappings, and that may be fine for your application, but then  
again, it may not be.  That is

for you to decide.

Jeffrey Harris


After the the drives are mapped persisted by the service-user, I  
reboot the computer and have nobody login interactively
and my app sees all drives that were mapped

Re: runtime.exec cmd.exe /C net use

2013-03-24 Thread Patrick Flaherty


On Mar 23, 2013, at 10:00 PM, David Kerber wrote:


On 3/23/2013 8:13 PM, Harris, Jeffrey E. wrote:




-Original Message-
From: André Warnier [mailto:a...@ice-sa.com]
Sent: Saturday, March 23, 2013 8:10 PM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use

Harris, Jeffrey E. wrote:



-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Saturday, March 23, 2013 5:22 PM
To: Tomcat Users List
Subject: runtime.exec cmd.exe /C net use

Hi,

I'm trying to run the following command ( runtime.exec cmd.exe /C
net use ) from my tomcat app and it's returning :

net use
New connections will be remembered.

There are no entries in the list.

This only happen when I run as a Windows service. If I run the

tomcat

batch file to start tomcat then net use returns all my mapped
network drives. The service login is an account that has access to
the network shares as my app uses those shares, but the service

login

should not preclude the command from executing properly. If I
substitute dir for net use
that works and I get a directory listing. The combo of net use
command using cmd.exe and running as a service seems to be the
conflict.

Any input much appreciated.

Thanks
Pat


I would add that it is kind of doubtful that this has anything  
directly
to do with Tomcat, or even Java.  Maybe that question would belong  
more

to some Windows forum.




-


I absolutely agree.  I would expect to see the same behavior with  
Apache HTTPD, IIS, or
any other service that accesses mapped drives.  It is a question of  
how service accounts behave
in the windows architecture, rather than something specific with  
Tomcat.


Jeffrey Harris


It will depend on what user your TC service is running under.If  
it's running as the LocalSystem user,  it will not have access to  
any network drives, or many other network resources.  It can hit  
some, such as databases.


If you want your TC to be able to see networked drives, you need to  
run it under the logged-on user's ID.  Keep in mind, though, that if  
the user logs off, the drives will be disconnected.  Your best bet  
in that case it to not connect by drive letter, but rather by the  
UNC name (what you used to map it when you were logged on).  That  
will work if the user TC is running has has the appropriate  
permissions to the network resource.


D


Hi,

Thanks for all the input. I know about service logins being only able  
to use UNC paths (not drive letters) to access network shares. I know  
the service login  password have to
have a matching account on the server with the shares in order for the  
tomcat app to use (access) those shares. We do all of this. Out tomcat  
app depends on
network shares to function and it always has worked as long as the  
service login account matches an account on the server with the shares.


What I'm trying to do in an html interface is make a pulldown menu  
list of my mapped drives as a location for our database backup. It's a  
preference setup to
where an automated scheduled backup will write the backups. I'm using  
net use to produce what you would expect for output (all the mapped  
network drives)
and parsing the output to produce the pulldown menu item containing  
the unc portion gleaned from the net use output. I need the unc  
portion as this is what
a tomcat app needs. No matter what I do outside the app I cannot  
produce the effectively empty list that the app is producing. I'm  
logged into Windows as the same
account as the service and I open a command prompt and see all my  
mapped drives via net use. I have tried UAC on and off and it  
changes nothing. I added a simple
dir to the app and I can get that output but not the net use  
output. I do know it has to do with the service as I said because when  
tomcat is started via the startup.bat

it works great.

Maybe it is a Windows question but thought someone may have had some  
similar experience.


Thanks for eveyone's thoughts.

-Pat











-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: runtime.exec cmd.exe /C net use

2013-03-24 Thread Patrick Flaherty


On Mar 24, 2013, at 10:24 AM, Harris, Jeffrey E. wrote:





-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 10:20 AM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 23, 2013, at 10:00 PM, David Kerber wrote:


On 3/23/2013 8:13 PM, Harris, Jeffrey E. wrote:


Hi,

Thanks for all the input. I know about service logins being only able
to use UNC paths (not drive letters) to access network shares. I know
the service login  password have to have a matching account on the
server with the shares in order for the tomcat app to use (access)
those shares. We do all of this. Out tomcat app depends on network
shares to function and it always has worked as long as the service
login account matches an account on the server with the shares.

What I'm trying to do in an html interface is make a pulldown menu  
list

of my mapped drives as a location for our database backup. It's a
preference setup to where an automated scheduled backup will write  
the

backups. I'm using net use to produce what you would expect for
output (all the mapped network drives) and parsing the output to
produce the pulldown menu item containing the unc portion gleaned  
from

the net use output. I need the unc portion as this is what a tomcat
app needs. No matter what I do outside the app I cannot produce the
effectively empty list that the app is producing. I'm logged into
Windows as the same account as the service and I open a command  
prompt
and see all my mapped drives via net use. I have tried UAC on and  
off
and it changes nothing. I added a simple dir to the app and I can  
get

that output but not the net use
output. I do know it has to do with the service as I said because  
when

tomcat is started via the startup.bat it works great.

Maybe it is a Windows question but thought someone may have had some
similar experience.

Thanks for eveyone's thoughts.

-Pat



You still have not answered how the mapping are being made in the  
first place.  Is the
service account dynamically setting the mapping using net use, or  
through the Windows

API?  Are you relying on static mappings in the user account profile?


Hi Jeffrey,

The drive mapping are happening through the Windows Explorer  
interface. The file server is browsed
and the shares on the file server are mapped by right-clicking the  
share, mapping it to a drive letter
and I check the checkbox Reconnect at logon. Then I start my app.  
(I'm not using any user profiles.)


-Pat



Jeffrey Harris

This e-mail and any attachments are intended only for the use of the  
addressee(s) named herein and may contain proprietary information.  
If you are not the intended recipient of this e-mail or believe that  
you received this email in error, please take immediate action to  
notify the sender of the apparent error by reply e-mail; permanently  
delete the e-mail and any attachments from your computer; and do not  
disseminate, distribute, use, or copy this message and any  
attachments.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: runtime.exec cmd.exe /C net use

2013-03-24 Thread Patrick Flaherty


On Mar 24, 2013, at 2:56 PM, André Warnier wrote:


Harris, Jeffrey E. wrote:

-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 12:18 PM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 24, 2013, at 10:24 AM, Harris, Jeffrey E. wrote:




-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 10:20 AM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 23, 2013, at 10:00 PM, David Kerber wrote:


On 3/23/2013 8:13 PM, Harris, Jeffrey E. wrote:

Hi,

Thanks for all the input. I know about service logins being only

able

to use UNC paths (not drive letters) to access network shares. I

know
the service login  password have to have a matching account on  
the

server with the shares in order for the tomcat app to use (access)
those shares. We do all of this. Out tomcat app depends on network
shares to function and it always has worked as long as the service
login account matches an account on the server with the shares.

What I'm trying to do in an html interface is make a pulldown menu
list of my mapped drives as a location for our database backup.  
It's
a preference setup to where an automated scheduled backup will  
write

the backups. I'm using net use to produce what you would expect

for

output (all the mapped network drives) and parsing the output to
produce the pulldown menu item containing the unc portion gleaned
from the net use output. I need the unc portion as this is  
what a

tomcat app needs. No matter what I do outside the app I cannot
produce the effectively empty list that the app is producing. I'm
logged into Windows as the same account as the service and I  
open a

command prompt and see all my mapped drives via net use. I have
tried UAC on and off and it changes nothing. I added a simple  
dir

to the app and I can get that output but not the net use
output. I do know it has to do with the service as I said because
when tomcat is started via the startup.bat it works great.

Maybe it is a Windows question but thought someone may have had  
some

similar experience.

Thanks for eveyone's thoughts.

-Pat


You still have not answered how the mapping are being made in the
first place.  Is the service account dynamically setting the  
mapping
using net use, or through the Windows API?  Are you relying on  
static

mappings in the user account profile?

Hi Jeffrey,

The drive mapping are happening through the Windows Explorer  
interface.
The file server is browsed and the shares on the file server are  
mapped
by right-clicking the share, mapping it to a drive letter and I  
check

the checkbox Reconnect at logon. Then I start my app.
(I'm not using any user profiles.)

-Pat


Jeffrey Harris


Pat,
I do not think that will work for a service account.  The drive  
mappings are stored in the user profile,
and since I do not think service accounts access user profiles, the  
service account will not remap
the drives when using the account to start a service (it will when  
you actually log in interactively with
the account).  You can try setting some custom environment  
variables in the user profile (not the system profile)
and see if they are accessible by the service account using the set  
command as a test to see if mapping

might be accessible.
What you probably need to do is actually set the drive mappings  
using the Windows API dynamically when Tomcat starts,
or use UNCs.  I know you want to display the drive mappings, but  
you could fake the display by doing a net use myfilemappings.txt  
from the command line (when logged into the account), and just  
calling the file to display the mappings.  Obviously, if the  
mappings change, you would have to redo the file.
I think those are your only options.  You might want to do a Google  
search and see if there is a way for

service accounts to use remembered mapped drives.


I routinely use net use \\hostname\share from inside programs  
running as Windows Services (not in Java, though, but it should not  
matter). Drive letters don't work.

The exact form I use is :
net use \\hostname\sharename password /USER:userid
And then later I can open/read/write/close files as \\hostname 
\sharename\filepath.


It works, but I have noticed one quirk in my programs : after  
doing the net use, the very first access to the share doesn't work  
and returns an error. The second access and all subsequent ones work  
though.  I have no idea why this is, but I have just adapted my  
programs to work around this issue (by doing a first dummy access  
and ignoring the result), and never had any problem since. (**)


To be able to do this, the Service *cannot* run as the LocalSystem  
or LocalService user. By design in Windows, these special users do  
not have access to any Windows network functions or resources.   
Any normal user (*) will do, depending on the environment

Re: runtime.exec cmd.exe /C net use

2013-03-24 Thread Patrick Flaherty


On Mar 24, 2013, at 3:46 PM, Harris, Jeffrey E. wrote:





-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 3:37 PM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 24, 2013, at 2:56 PM, André Warnier wrote:


Harris, Jeffrey E. wrote:

-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 12:18 PM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 24, 2013, at 10:24 AM, Harris, Jeffrey E. wrote:




-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 10:20 AM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 23, 2013, at 10:00 PM, David Kerber wrote:


(**) Maybe this is a hint to the OP : what happens if you ignore the
result of the first command call, and try the same command a second
time ?
And I agree : there a bit of hocus-pocus here, but then many things
are, in a Windows environment.


You are not hearing me. The drives are mapped and set to reconnect at
logon. Therefore if I reboot my machine the network drive mapping are
in place after logging in. I *do not* try and map a drive from within
my app. My app has full access to the network shares as soon as my  
app
is up. No problem with network shares and my app ! My app needs to  
read

and write to those network share to function and has no problems.



I think we have a failure to communicate here.

Mappings set to reconnect are NOT the same as having access to a  
share.
If you have access to the share, it is does not depending on a  
mapping.  The

mapping only assigns a particular drive letter to a UNC.

Within your application, do you actually access the mappings by  
letter, or by

UNC?


The problem is after I'm up and running, I try to run cmd.exe /C net
use from within the app it does not return any mapped drives. it
returns:
net use
New connections will be remembered.

There are no entries in the list.



We understand that.  What we are trying to tell you if you want  
those mappings
to appear (regardless of whether they are already mapped or not), we  
think you
need to dynamically map them within your application.  Otherwise, we  
think you

will continue to experience the situation you describe above.


Again, the return above happen only when running as a service  but
works fine when tomcat starts from startup.bat in a console. Works  
fine

means it returns drive letter, unc equivalent etc ... basically what
you normally see when you have mapped network drives and run net  
use

from cmd.exe.

It make no sense I know but I'm at a loss.


I think it makes sense (pending further information on how you  
actually access the
shares from within your application) because the application is not  
actually using

a mapped drive, but using its access rights from a UNC.


Hi Jeffrey,

I think I'm getting what you might be saying. Because net use  
returns a drive letter in its return
then the service cannot deal with it? To answer your question about  
how we access shares from
within our app, we *have to* use UNC paths that already have the  
proper credentials provided by
a common username  password that the service uses to login (local  
account with same username
and password as an account already on the file server) So when the app  
accesses the UNC path
for the first time it tries to use it's service login credentials  
which we require to exist on the file
server with the shares. Therefore when we do our first network access  
the service login account
is used to authenticate with the file server and because we create an  
account on the file server
with the same username and password we get clean access to the shares.  
I never liked having this
rule (service login name and password must exist on the file server  
matching exactly) but it has
work for us for years. But getting back to net use, because drive  
letters are not usable by code
running in the service, we don't get anything back from net use  
because part of its return is
a drive letter? I hope I'm making sense, but is that the gist of what  
you are saying? If it is then

it starts to make a lot more sense now.

Thanks for hanging in there with me.
Pat






Thanks again
Pat




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




This e-mail and any attachments are intended only for the use of the  
addressee(s) named herein and may contain proprietary information.  
If you are not the intended recipient of this e-mail or believe that  
you received this email in error, please take immediate action to  
notify the sender of the apparent error by reply e-mail; permanently  
delete the e-mail and any attachments from your computer; and do not  
disseminate, distribute, use

Re: runtime.exec cmd.exe /C net use

2013-03-24 Thread Patrick Flaherty


On Mar 24, 2013, at 4:01 PM, André Warnier wrote:


Patrick Flaherty wrote:

On Mar 24, 2013, at 2:56 PM, André Warnier wrote:

Harris, Jeffrey E. wrote:

-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 12:18 PM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 24, 2013, at 10:24 AM, Harris, Jeffrey E. wrote:




-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 10:20 AM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use


On Mar 23, 2013, at 10:00 PM, David Kerber wrote:


On 3/23/2013 8:13 PM, Harris, Jeffrey E. wrote:

Hi,

Thanks for all the input. I know about service logins being only

able

to use UNC paths (not drive letters) to access network shares. I

know
the service login  password have to have a matching account  
on the
server with the shares in order for the tomcat app to use  
(access)
those shares. We do all of this. Out tomcat app depends on  
network
shares to function and it always has worked as long as the  
service

login account matches an account on the server with the shares.

What I'm trying to do in an html interface is make a pulldown  
menu
list of my mapped drives as a location for our database  
backup. It's
a preference setup to where an automated scheduled backup will  
write
the backups. I'm using net use to produce what you would  
expect

for

output (all the mapped network drives) and parsing the output to
produce the pulldown menu item containing the unc portion  
gleaned
from the net use output. I need the unc portion as this is  
what a

tomcat app needs. No matter what I do outside the app I cannot
produce the effectively empty list that the app is producing.  
I'm
logged into Windows as the same account as the service and I  
open a
command prompt and see all my mapped drives via net use. I  
have
tried UAC on and off and it changes nothing. I added a simple  
dir

to the app and I can get that output but not the net use
output. I do know it has to do with the service as I said  
because

when tomcat is started via the startup.bat it works great.

Maybe it is a Windows question but thought someone may have  
had some

similar experience.

Thanks for eveyone's thoughts.

-Pat


You still have not answered how the mapping are being made in the
first place.  Is the service account dynamically setting the  
mapping
using net use, or through the Windows API?  Are you relying on  
static

mappings in the user account profile?

Hi Jeffrey,

The drive mapping are happening through the Windows Explorer  
interface.
The file server is browsed and the shares on the file server are  
mapped
by right-clicking the share, mapping it to a drive letter and I  
check

the checkbox Reconnect at logon. Then I start my app.
(I'm not using any user profiles.)

-Pat


Jeffrey Harris


Pat,
I do not think that will work for a service account.  The drive  
mappings are stored in the user profile,
and since I do not think service accounts access user profiles,  
the service account will not remap
the drives when using the account to start a service (it will  
when you actually log in interactively with
the account).  You can try setting some custom environment  
variables in the user profile (not the system profile)
and see if they are accessible by the service account using the  
set command as a test to see if mapping

might be accessible.
What you probably need to do is actually set the drive mappings  
using the Windows API dynamically when Tomcat starts,
or use UNCs.  I know you want to display the drive mappings, but  
you could fake the display by doing a net use myfilemappings.txt  
from the command line (when logged into the account), and just  
calling the file to display the mappings.  Obviously, if the  
mappings change, you would have to redo the file.
I think those are your only options.  You might want to do a  
Google search and see if there is a way for

service accounts to use remembered mapped drives.


I routinely use net use \\hostname\share from inside programs  
running as Windows Services (not in Java, though, but it should  
not matter). Drive letters don't work.

The exact form I use is :
net use \\hostname\sharename password /USER:userid
And then later I can open/read/write/close files as \\hostname 
\sharename\filepath.


It works, but I have noticed one quirk in my programs : after  
doing the net use, the very first access to the share doesn't  
work and returns an error. The second access and all subsequent  
ones work though.  I have no idea why this is, but I have just  
adapted my programs to work around this issue (by doing a first  
dummy access and ignoring the result), and never had any problem  
since. (**)


To be able to do this, the Service *cannot* run as the LocalSystem  
or LocalService user. By design in Windows, these special users do  
not have access to any Windows network

Re: runtime.exec cmd.exe /C net use

2013-03-24 Thread Patrick Flaherty


On Mar 24, 2013, at 4:29 PM, Harris, Jeffrey E. wrote:





-Original Message-
From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Sent: Sunday, March 24, 2013 4:15 PM
To: Tomcat Users List
Subject: Re: runtime.exec cmd.exe /C net use



Within your application, do you actually access the mappings by
letter, or by UNC?


The problem is after I'm up and running, I try to run cmd.exe /C

net

use from within the app it does not return any mapped drives. it
returns:
net use
New connections will be remembered.

There are no entries in the list.



We understand that.  What we are trying to tell you if you want  
those

mappings to appear (regardless of whether they are already mapped or
not), we think you need to dynamically map them within your
application.  Otherwise, we think you will continue to experience  
the

situation you describe above.


Again, the return above happen only when running as a service  but
works fine when tomcat starts from startup.bat in a console. Works
fine means it returns drive letter, unc equivalent etc ...  
basically

what you normally see when you have mapped network drives and run
net use
from cmd.exe.

It make no sense I know but I'm at a loss.


I think it makes sense (pending further information on how you
actually access the shares from within your application) because the
application is not actually using a mapped drive, but using its

access

rights from a UNC.


Hi Jeffrey,

I think I'm getting what you might be saying. Because net use
returns a drive letter in its return
then the service cannot deal with it? To answer your question about  
how

we access shares from within our app, we *have to* use UNC paths that
already have the proper credentials provided by a common username 
password that the service uses to login (local account with same
username and password as an account already on the file server) So  
when

the app accesses the UNC path for the first time it tries to use it's
service login credentials which we require to exist on the file  
server

with the shares. Therefore when we do our first network access the
service login account is used to authenticate with the file server  
and
because we create an account on the file server with the same  
username

and password we get clean access to the shares.
I never liked having this
rule (service login name and password must exist on the file server
matching exactly) but it has work for us for years. But getting  
back to

net use, because drive letters are not usable by code running in the
service, we don't get anything back from net use
because part of its return is
a drive letter? I hope I'm making sense, but is that the gist of what
you are saying? If it is then it starts to make a lot more sense now.

Thanks for hanging in there with me.
Pat


Mappings are strictly a convention for using UNCs with drive letters  
(a fall back
to the days of Windows 3.1 and 95/98 which did not understand UNCs,  
and neither
did applications).  Based on your description, you are using  
passthrough authentication because you
are operating in a workgroup environment (if you were in a domain  
environment,
you would simply assign a domain account, and give that account the  
right
permissions to the share).  Your description above about  
authentication is
exactly right - matching accounts and passwords means transparent  
access to the

share.

Andre discussed this point in his last post - a service account  
logging in interactively
has a different environment than a service account logging in as a  
service.  Windows is
basically ignoring any drive mappings that you specify because they  
were specified outside
of the service session.  You are gaining access because of the UNCs  
and the passthrough

authentication.

If you want to use drive mappings, you need to map them WITHIN your  
application (or service
session) to appear.  See the link in Serge's post for some ideas how  
to do this.  I think
the best method is to actually map the drives yourself within your  
application, if you can;
otherwise, set up a service that does the drive mappings, and then  
calls your Tomcat service.


If all you want to do is make the list of mappings appear in an HTML  
page (without actually using
them in your application), you can just fake the list as I discussed  
previously.


The key point is because the mappings are not set within the service  
session itself, you are NOT
using the mappings, only the UNCs, and they will not appear using  
the net use command within

the service.

Jeffrey Harris


Hi Jeffrey,

Yes, I now get it. Thanks for the lesson on Windows Networking (I  
thought I knew well) and thanks to Andre as well.
You also said that if all I wanted to do was make a list of mapping  
appear in an html page (without actually using them
in your application), you can just fake it as previously discussed. I  
think I missed that part.


Thanks
Pat




This e-mail and any attachments are intended only

runtime.exec cmd.exe /C net use

2013-03-23 Thread Patrick Flaherty

Hi,

I'm trying to run the following command ( runtime.exec cmd.exe /C net  
use ) from my tomcat app and it's returning :


net use
New connections will be remembered.

There are no entries in the list.

This only happen when I run as a Windows service. If I run the tomcat  
batch file to start tomcat then net use returns
all my mapped network drives. The service login is an account that has  
access to the network shares as my app uses those
shares, but the service login should not preclude the command from  
executing properly. If I substitute dir for net use
that works and I get a directory listing. The combo of net use  
command using cmd.exe and running as a service seems

to be the conflict.

Any input much appreciated.

Thanks
Pat

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Upgrading Tomcat in the customer base

2013-03-19 Thread Patrick Flaherty

Hi,

We deploy tomcat in our own folder (c:\rsi_tc\tomcat) on a WIndows  
machine as a service. We use the service.bat to install
as a service. Historically to update tomcat we would remove the  
current version and install the new version. There is rub in all
this which we have to change the service login to be an account that  
can access files from a network share. Therefore when
we upgrade tomcat, we remove the current version and install the new  
version and then someone ( the customer :-(  ) has to
go into the service and change the service login back to the account  
that will give them access to the network share.


I'm looking for a way (if possible) to avoid having the customer to  
have change the service login. I'm looking for suggestions
to make this easier and have the following questions about whether  
some of my thoughts to make it easier are safe.


1. Can I *not* uninstall the service and just replace the folder  
structure on the file system with the new version? I have tried it
and it seems to work but question whether or not it is safe. I  
know if a major version changes I cannot do this as the service
calls tomcat6.exe vs tomcat7.exe for instance and therefore would  
have to do the complete uninstall/install.


2. If I do the above does calling the service.bat install again  
using the *newer* service.bat version make a difference? We are  
calling it (the newer service.bat)
and it seems to be harmless and thought that it might help in  
case something in the batch install changed, we would get the changes.


Bottom line, has anyone faced this dilemma and found a successful way  
to upgrade a tomcat instance that uses a unique service login.


Thanks for any input.
Pat



 
   


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-08 Thread Patrick Flaherty


On Mar 7, 2013, at 7:33 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Patrick,

On 3/7/13 8:40 AM, Patrick Flaherty wrote:

Thanks for that. Fixed the spinning bug that you pointed out and no
more 25% cpu but I still cannot hit the app! :-( So the spinning
bug was not related to the inability to get to the ROOT Tomcat app
or my app /rrmt.


It may have been contributing to it. Just because fixing it doesn't
make your server available doesn't mean it wasn't a problem: it just
wasn't the /whole/ problem.


Simply, 7.0.37 server does not respond to GET / HTTP/1.1. Remove my
war restart Tomcat and I *can *get to the ROOT app. Something in my
app that causing the connector to stop responding apparently. Now
that I have the JVisualvm configured, is there anything I can
derive that it?


Another thread dump? The JVM must be doing *something*.

Hi Chris,

Here's the thread dump as Tomcat is not responding to requests to the  
ROOT Tomcat or to my app /rrmt:



2013-03-08 10:03:06
Full thread dump Java HotSpot(TM) Client VM (23.7-b01 mixed mode,  
sharing):


JMX server connection timeout 488 daemon prio=6 tid=0x05b09400  
nid=0x1d54 in Object.wait() [0x0847f000]

   java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
	at com.sun.jmx.remote.internal.ServerCommunicatorAdmin 
$Timeout.run(Unknown Source)

- locked 0x2551fd00 (a [I)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

RMI Scheduler(0) daemon prio=6 tid=0x05b0a000 nid=0x214c waiting on  
condition [0x083cf000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  0x29db73a8 (a  
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer 
$ConditionObject.awaitNanos(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor 
$DelayedWorkQueue.take(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor 
$DelayedWorkQueue.take(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

RMI TCP Connection(1)-192.168.41.41 daemon prio=6 tid=0x05b0ac00  
nid=0x4a0 runnable [0x0831f000]

   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked 0x254fc5e8 (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown  
Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown  
Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- 0x254a4a50 (a java.util.concurrent.ThreadPoolExecutor$Worker)

pool-1-thread-434 daemon prio=6 tid=0x05b0b400 nid=0x9c0 waiting on  
condition [0x081ff000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  0x2a9539c8 (a  
java.util.concurrent.SynchronousQueue$TransferStack)

at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
	at java.util.concurrent.SynchronousQueue 
$TransferStack.awaitFulfill(Unknown Source)
	at java.util.concurrent.SynchronousQueue 
$TransferStack.transfer(Unknown Source)

at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

pool-1-thread-433 daemon prio=6 tid=0x05b0a800 nid=0x12ec waiting on  
condition [0x0791f000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  0x2a9539c8 (a  
java.util.concurrent.SynchronousQueue$TransferStack)

at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
	at java.util.concurrent.SynchronousQueue

Re: Cannot access my app after Tomcat 7.0.28

2013-03-07 Thread Patrick Flaherty

Hi Mark,

Thanks for that. Fixed the spinning bug that you pointed out and no  
more 25% cpu but I still cannot hit the app! :-(
So the spinning bug was not related to the inability to get to the  
ROOT Tomcat app or my app /rrmt.


Simply, 7.0.37 server does not respond to GET / HTTP/1.1. Remove my  
war restart Tomcat and I *can *get to the ROOT app.
Something in my app that causing the connector to stop responding  
apparently. Now that I have the JVisualvm configured,

is there anything I can derive that it?

Thanks once again.
Pat

On Mar 6, 2013, at 12:34 PM, Mark Thomas wrote:


On 06/03/2013 17:12, Patrick Flaherty wrote:

This looks to be the culprit.

That is application code so you'll have to take a look to see what  
it is doing in line 84 of  
com.rampageinc.base.serverpush.RRServerPushContextListener


Mark


localhost-startStop-1 daemon prio=6 tid=0x0550c000 nid=0x1fc4  
runnable

[0x059ef000]
   java.lang.Thread.State: RUNNABLE
at
com 
.rampageinc 
.base 
.serverpush 
.RRServerPushContextListener 
.contextInitialized(RRServerPushContextListener.java:84)


at
org 
.apache 
.catalina.core.StandardContext.listenerStart(StandardContext.java: 
4797)


at
org 
.apache 
.catalina.core.StandardContext.startInternal(StandardContext.java: 
5291)


- locked 0x299102d0 (a  
org.apache.catalina.core.StandardContext)

at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- locked 0x299102d0 (a  
org.apache.catalina.core.StandardContext)

at
org 
.apache 
.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)


at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java: 
877)

at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
at
org.apache.catalina.startup.HostConfig 
$DeployWar.run(HostConfig.java:1655)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown  
Source)

at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown  
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown  
Source)

at java.lang.Thread.run(Unknown Source)



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-06 Thread Patrick Flaherty


On Mar 5, 2013, at 9:45 PM, Howard W. Smith, Jr. wrote:


1. What is the file path of 7.0.27 (where is it installed?

C:\apache-tomcat-7.0.27 or somewhere else?)



c:\rsi_tc\tomcat



2. what is the file path of 7.0.28+ ? (where is it installed)?



c:\rsi_tc\tomcat (same)


3. when you 'switch 7.0.27 back in', what does that mean? Does it  
mean

that
while you are attempting to migrate to 7.0.28+, 7.0.27 install  
remains on
the hard disk? you have not deleted/removed 7.0.27 yet...while  
attempting

to migrate to 7.0.28



I have 2 tomcat folders (Versions 7.0.27  7.0.37) both named  
tomcat. I

remove the service (Service remove Tomcat7)
Move the folder out.
Move in the other folder and install the service (Service install  
Tomcat7)





Move the folder out? can you explain this more clearly?

if you are moving the 'unused' tomcat folder to Recycle Bin, I have  
seen

issues with using Recycle Bin. if you are moving to recycle bin, then
delete whatever is in recycle bin, too...as one of your steps before
installing and running 7.0.28+. I don't use Recycle Bin ever, i always
Shift-Delete (permanent delete).


No, just move them to and from a temp folder on the c: drive.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-06 Thread Patrick Flaherty


On Mar 6, 2013, at 9:30 AM, Howard W. Smith, Jr. wrote:




I have 2 tomcat folders (Versions 7.0.27  7.0.37) both named  
tomcat. I

remove the service (Service remove Tomcat7)
Move the folder out.
Move in the other folder and install the service (Service install
Tomcat7)



Move the folder out? can you explain this more clearly?


if you are moving the 'unused' tomcat folder to Recycle Bin, I  
have seen
issues with using Recycle Bin. if you are moving to recycle bin,  
then

delete whatever is in recycle bin, too...as one of your steps before
installing and running 7.0.28+. I don't use Recycle Bin ever, i  
always

Shift-Delete (permanent delete).



No, just move them to and from a temp folder on the c: drive.


Did you download .exe install program and then run .exe to install  
Tomcat

7.0.28+, or did you download Tomcat 7.0.28+ .zip file and unzip the
contents to that tomcat folder on your C:\?

I ask, because there was a recent discussion about the Tomcat .exe,  
and I

think that discussion had findings that there was an issue in Tomcat's
Windows Registry key that is/was updated by the Tomcat .exe install  
program.


FYI, I don't use .exe... I only use .zip and unzip to my hard drive.


I'm using the zip files.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-06 Thread Patrick Flaherty


On Mar 6, 2013, at 10:53 AM, Howard W. Smith, Jr. wrote:


Patrick,

On Tue, Mar 5, 2013 at 6:51 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:


From: Caldarale, Charles R
Subject: RE: Cannot access my app after Tomcat 7.0.28



Now I just noticed that on this 4 core server, tomcat7.exe *32 is

using 25% CPU.


Take several thread dumps and see what's looping.





http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F

I should have mentioned that Windows often makes this difficult when
running as a service, so you might want to try starting Tomcat with  
the

startup.bat script for this diagnostic effort.

- Chuck



Can you?

1. configure java options with a JMX port  in tomcat7w.exe, where  
JMX port

= an available port on localhost

2. start Tomcat7 windows service

3. open Java Visual VM (e.g. C:\Program
Files\Java\jdk1.7.0_13\bin\jvisualvm.exe)

4. In Java Visual VM, connect to the JMX port and perform a heap  
dump or

monitor the hotspots (to determine cause of the 25% CPU, etc...)


I am a novice with these tools so please bear with me.
I managed to get jvisualvm to connect to my local app, see screenshot  
below with a thread dump immediately after.
I hope someone knows what the thread dump tell us because I can't,  
sorry.








2013-03-06 12:04:42
Full thread dump Java HotSpot(TM) Client VM (23.7-b01 mixed mode,  
sharing):


pool-1-thread-29 daemon prio=6 tid=0x04baa800 nid=0x1740 waiting on  
condition [0x0a54f000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  0x2a537ca8 (a  
java.util.concurrent.SynchronousQueue$TransferStack)

at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
	at java.util.concurrent.SynchronousQueue 
$TransferStack.awaitFulfill(Unknown Source)
	at java.util.concurrent.SynchronousQueue 
$TransferStack.transfer(Unknown Source)

at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

pool-1-thread-28 daemon prio=6 tid=0x04baec00 nid=0xd00 waiting on  
condition [0x0a28f000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  0x2a537ca8 (a  
java.util.concurrent.SynchronousQueue$TransferStack)

at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
	at java.util.concurrent.SynchronousQueue 
$TransferStack.awaitFulfill(Unknown Source)
	at java.util.concurrent.SynchronousQueue 
$TransferStack.transfer(Unknown Source)

at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

RMI TCP Connection(22)-192.168.41.41 daemon prio=6 tid=0x0608f000  
nid=0x1ea8 runnable [0x078bf000]

   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked 0x2ba79440 (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown  
Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown  
Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- 0x2ba79558 (a java.util.concurrent.ThreadPoolExecutor$Worker)

RMI TCP Connection(21)-192.168.41.41 daemon prio=6 tid=0x06090400  
nid=0x1bb8 runnable [0x0792f000]

   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked 0x2b9fa4d0 (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(Unknown Source)
at 

Cannot access my app after Tomcat 7.0.28

2013-03-05 Thread Patrick Flaherty

Hi,

When using any build of Tomcat *post* 7.0.28, I cannot access my app !  
The app comes up as it does in 7.0.28 (which works) and
logs look the same (no errors). I just can't do an http call to the  
server. A packet trace shown the tcp connect (3 way handshake)
and then no response to Get / HTTP/1.1. The index.jsp in ROOT is a jsp  
containing a redirect to my app.


%
response.sendRedirect(/myapp/index.do);
%

Did something change in 7.0.29 and beyond that might cause this  
behavior? I looked through the changelog and nothing jumped

out at me.

Thanks
Pat


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-05 Thread Patrick Flaherty


On Mar 5, 2013, at 4:44 PM, Howard W. Smith, Jr. wrote:

On Tue, Mar 5, 2013 at 1:04 PM, Patrick Flaherty pflah...@rampageinc.com 
wrote:



Hi,

When using any build of Tomcat *post* 7.0.28, I cannot access my  
app ! The

app comes up as it does in 7.0.28 (which works) and
logs look the same (no errors). I just can't do an http call to the
server. A packet trace shown the tcp connect (3 way handshake)
and then no response to Get / HTTP/1.1. The index.jsp in ROOT is a  
jsp

containing a redirect to my app.

%
   response.sendRedirect(/myapp/**index.do);
%

Did something change in 7.0.29 and beyond that might cause this  
behavior?

I looked through the changelog and nothing jumped
out at me.

Thanks
Pat


You may want to share more details about your environment/ 
configuration. Is
it possible that your 7.0.29+ configuration is missing some  
configuration
that exists in your 7.0.28 configuration? You also may want to share  
the
steps you took while migrating to, installing, or configuring your  
7.0.29+

environment.
I downloaded the 32 bit zip version of the tomcat. Change the tcp port  
in the server.xml file from 8080 to 80.
The platform is Windows 7 64 bit. I run the service.bat file to  
install it as a service. (Service install Tomcat7).
I did not replace the index.jsp this time and did not introduce my  
war. I then started the service and I was able
to get to the standard Tomcat ROOT page. So I know Tomcat works. I  
stop tomcat, drop my war file in and
restart tomcat. I go to standardout.log and I see my app is completely  
up and is running, as it prints an info
line every 5 minutes to stdout. At this point I cannot get to the ROOT  
page (Now has the stock index.jsp) nor
can I get to my app by typing the URL consisting of the ip address of  
the computer +/myapp (e.g. http://192168.2.2/rrmt).
Both just hang in the browser. Now I just noticed that on this 4 core  
server, tomcat7.exe *32 is using 25% CPU.
My app *seems happy printing it's server is up message to the  
stdout.log.


Same war works in 7.0.27 and a few tomcats prior but every tomcat  
fails as described above for every version post 7.0.27 up
through 7.0.37. I have tried them all. It must be something in my code  
but I perplexed. The act of adding my war causes the problem.
I checked the changelog for tomcat and cannot see anything that would  
cause this.


Any thoughts appreciated.
Thanks
Pat








--**-- 
**-
To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.orgusers-unsubscr...@tomcat.apache.org 


For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-05 Thread Patrick Flaherty

Hi Chuck,

I ran tomcat7w.exe //MS//Tomcat7 and the service started and I have a  
monitor in the tray, I waited till my app
was up and CPU was again at 25%.  When I right-click and select  
'Thread Dump', I'm not getting any thread dump in stdout.log.
What I did notice is in the commons-daemon.2013...log is the following  
message:


[2013-03-05 20:03:16] [error] [ 7724] The handle is invalid

Any ideas?
Pat

On Mar 5, 2013, at 6:51 PM, Caldarale, Charles R wrote:


From: Caldarale, Charles R
Subject: RE: Cannot access my app after Tomcat 7.0.28


Now I just noticed that on this 4 core server, tomcat7.exe *32 is  
using 25% CPU.



Take several thread dumps and see what's looping.



http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F


I should have mentioned that Windows often makes this difficult when  
running as a service, so you might want to try starting Tomcat with  
the startup.bat script for this diagnostic effort.


- Chuck


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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-05 Thread Patrick Flaherty


On Mar 5, 2013, at 6:59 PM, Konstantin Kolinko wrote:


2013/3/5 Patrick Flaherty pflah...@rampageinc.com:

(...)
The index.jsp in ROOT is a jsp
containing a redirect to my app.

%
   response.sendRedirect(/myapp/index.do);
%



Confirming that a redirect such as above one works in current 7.0.x.

I replaced default ROOT/index.jsp with this simple page,
[[[
%
   response.sendRedirect(/examples/index.html);
%
]]]

It works.


Thanks for that confirmation.



I go to standardout.log and I see my app is completely up and is  
running


What about other log files?  localhost.DATE.log, catalina.DATE.log?
Is your request mentioned in the localhost_access_log.DATE.txt file?

Nothing


Is your Tomcat on C: drive? Sometimes file permissions there are off.
http://wiki.apache.org/tomcat/FAQ/Windows

I don't think so, I switch 7.0.27 back in and it works.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot access my app after Tomcat 7.0.28

2013-03-05 Thread Patrick Flaherty


On Mar 5, 2013, at 8:28 PM, Howard W. Smith, Jr. wrote:


Is your Tomcat on C: drive? Sometimes file permissions there are off.
http://wiki.apache.org/tomcat/**FAQ/Windowshttp://wiki.apache.org/tomcat/FAQ/Windows 




I don't think so, I switch 7.0.27 back in and it works.



1. What is the file path of 7.0.27 (where is it installed?
C:\apache-tomcat-7.0.27 or somewhere else?)


c:\rsi_tc\tomcat


2. what is the file path of 7.0.28+ ? (where is it installed)?


c:\rsi_tc\tomcat (same)


3. when you 'switch 7.0.27 back in', what does that mean? Does it  
mean that
while you are attempting to migrate to 7.0.28+, 7.0.27 install  
remains on
the hard disk? you have not deleted/removed 7.0.27 yet...while  
attempting

to migrate to 7.0.28


I have 2 tomcat folders (Versions 7.0.27  7.0.37) both named tomcat.  
I remove the service (Service remove Tomcat7)

Move the folder out.
Move in the other folder and install the service (Service install  
Tomcat7)




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



64 Bit Tomcat

2013-01-30 Thread Patrick Flaherty

Hello,

I have an open question about 32 bit vs 64 bit. We are currently  
deploying our app with 32 bit JVM and Tomcat. We are running into  
memory issues
as we add more functionality (some via tools in the open source  
ecosystem). We are testing our complete app with 64 bit JVM and 64 bit
Tomcat and so far we have seen no issues. My question is how prevalent  
is the deployment of 64 bit enterprise apps. (just to show my naiveté).
We use some open source tools and look to use more in the future. Is  
there things I should be worried about in moving to 64 bit in terms of  
open source

tools?

I'll take any and all input.

Thanks very much.
Pat


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting JVM Parameters in Windows Service for Tomcat7

2012-09-20 Thread Patrick Flaherty

HI Matthias,

I sent a question out a few days ago that I could *not* get the JVM  
Parameters set via the command-line using //US//.


Can you give me an example of the syntax that worked for you ? I'm  
just looking to set the min/max heap sizes.


Thanks
Pat

On Sep 20, 2012, at 5:41 AM, Matthias Müller wrote:


Hi,

I want to set JVM Parameters in a Windows Service (Windows7) for
Tomcat7 (7.0.30)

The documentation tells, that this could be done by calling tomcat7
//US//Tomcat7 ...
This method works, but it is not practicable for our production
environment, because these settings are stored in the registry.

Is it possible to specify these parameters in setenv.bat or  
somewhere else?

When I start tomcat with catalina.bat run the setenv.bat is read.
But when I start tomcat as a windows service the setenv.bat is  
ignored.


Matthias

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting JVM Parameters in Windows Service for Tomcat7

2012-09-20 Thread Patrick Flaherty


On Sep 20, 2012, at 9:25 AM, Brett Delle Grazie wrote:


On 20 September 2012 13:53, Mikolaj Rydzewski m...@ceti.pl wrote:

On 20.09.2012 14:49, Patrick Flaherty wrote:


I sent a question out a few days ago that I could *not* get the JVM
Parameters set via the command-line using //US//.

Can you give me an example of the syntax that worked for you ? I'm
just looking to set the min/max heap sizes.



http://commons.apache.org/daemon/procrun.html

Syntax is not so easy to use.
The easiest way is to use tomcatw.exe - unless you have to use CLI.


http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html

The default service name is 'Tomcat7' so presuming %CATALINA_HOME%
represents the tomcat home directory:
Note that for updating the service via command line you need to use
tomcat7.exe not tomcat7w.exe
so to increase your default heap size from 256 to 512 Mb you would  
use:

%CATALINA_HOME%/bin/tomcat.exe //US//Tomcat7 --JvmMx=512


Hi Mikolaj,

Have you tried this and gotten it to work ? My check to see if it took  
has been to open tomcatw.exe and check the values there.

No matter what I've tried I cannot get it to take.

Thanks
Pat







--
Mikolaj Rydzewski m...@ceti.pl


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



--
Best Regards,

Brett Delle Grazie

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting JVM Parameters in Windows Service for Tomcat7

2012-09-20 Thread Patrick Flaherty

Hi Mikolaj,

Is this a Windows platform ?

-Pat

On Sep 20, 2012, at 10:16 AM, Mikolaj Rydzewski wrote:


On 20.09.2012 15:59, Patrick Flaherty wrote:


Have you tried this and gotten it to work ? My check to see if it
took  has been to open tomcatw.exe and check the values there.
No matter what I've tried I cannot get it to take.


Yes, it works for me in both ways (either via CLI or GUI).
In fact I use ant script to modify service parameters (please  
forgive broken lines):


   target name=update-tomcat-service
   exec executable=${root}\\bin\\tomcat6.exe dir=${root}\ 
\bin
   arg line=//US//Tomcat6 --Startup=auto --JvmMs $ 
{tomcat.memory.size} --JvmMx ${tomcat.memory.size} --StartPath quot; 
${root}quot; --JvmOptions -Dcom.sun.management.jmxremote;- 
verbose:gc;-XX:-DisableExplicitGC;-XX:+PrintGCTimeStamps;-XX: 
+PrintGCDetails;-Xloggc:logs\gc.log;-XX:+HeapDumpOnOutOfMemoryError;- 
XX:HeapDumpPath=logs;-XX:+UseConcMarkSweepGC;-XX:+UseParNewGC;-XX: 
+CMSClassUnloadingEnabled;-XX:MaxPermSize=256m/

   /exec
   /target


--
Mikolaj Rydzewski m...@ceti.pl

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting JVM Parameters in Windows Service for Tomcat7

2012-09-20 Thread Patrick Flaherty

Hi Mikolaj,

I got it to work. I was not using a space after the --JvmMs and -- 
JvmMx switches.


So in summary the following works:  \tomcat7.exe //US//tomcat7 --JvmMs  
512 --JvmMx 1024


Thanks for everyone's help.

-Pat

On Sep 20, 2012, at 10:16 AM, Mikolaj Rydzewski wrote:


On 20.09.2012 15:59, Patrick Flaherty wrote:


Have you tried this and gotten it to work ? My check to see if it
took  has been to open tomcatw.exe and check the values there.
No matter what I've tried I cannot get it to take.


Yes, it works for me in both ways (either via CLI or GUI).
In fact I use ant script to modify service parameters (please  
forgive broken lines):


   target name=update-tomcat-service
   exec executable=${root}\\bin\\tomcat6.exe dir=${root}\ 
\bin
   arg line=//US//Tomcat6 --Startup=auto --JvmMs $ 
{tomcat.memory.size} --JvmMx ${tomcat.memory.size} --StartPath quot; 
${root}quot; --JvmOptions -Dcom.sun.management.jmxremote;- 
verbose:gc;-XX:-DisableExplicitGC;-XX:+PrintGCTimeStamps;-XX: 
+PrintGCDetails;-Xloggc:logs\gc.log;-XX:+HeapDumpOnOutOfMemoryError;- 
XX:HeapDumpPath=logs;-XX:+UseConcMarkSweepGC;-XX:+UseParNewGC;-XX: 
+CMSClassUnloadingEnabled;-XX:MaxPermSize=256m/

   /exec
   /target


--
Mikolaj Rydzewski m...@ceti.pl

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting JVM Parameters in Windows Service for Tomcat7

2012-09-20 Thread Patrick Flaherty


On Sep 20, 2012, at 3:02 PM, Matthias Müller wrote:


Hi,

Environment variables are irrelevant when running services. That's  
why

the registry values exist.


That's a good point!
Thanks for the nice discussion.

Matthias - can you please elaborate on exactly what it is not  
practicable

for our production environment means?


I want to put the configuration files and property settings in a local
VCS (e.g. a local git) so that I can track the changes.
But now I see, that there are some technical reasons for using the  
registry.

I think I will use a batch-script then which sets the registry.

Matthias

PS
There are two ways of setting the registry:

1. CLI via tomcat.exe //US//Tomcat7 ...
   There are some examples in the service.bat file.
2. gui via tomcatw.exe

But I think both ways are not compatible.
I.E. when using tomcat.exe //US//Tomcat7 I won't find the values in
tomcatw.exe
But that's not a problem for me.


I do not see the compatibility issue you describe. When I was  
struggling to get the command-line (tomcat7.exe //US//) to work. I was  
using the tomcatw.exe
GUI to see if my command-line was taking (I also check the registry).  
Now that I have figured out how to change the min/max heap via the  
command-line
I use tomcatw.exe and it reflects any change I make via the command- 
line. At least that is my experience.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Fwd: Setting initial memory for a Tomcat Windows Service

2012-09-18 Thread Patrick Flaherty

Hello,

Is this a bug or am I doing this wrong ?

Thanks again,
Pat


Begin forwarded message:


From: Patrick Flaherty pflah...@rampageinc.com
Date: September 13, 2012 6:19:34 PM EDT
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Setting initial memory for a Tomcat Windows Service


On Sep 13, 2012, at 5:37 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 9/13/12 11:41 AM, Patrick Flaherty wrote:

I'm trying to change the max memory (java heap -Xmx) using
Tomcat's //US// switch. I type it according to the Windows service
how-to. We would like to script this into our Tomcat deployment
script which right now simply installs the service using service
install.

With the service already installed I tried the following command
line options:

tomcat7.exe //US//tomcat7 --JvmMs=512 --JvmMx=1024


Hmm.


tomcat7.exe //US//tomcat7 --JvmOptions -Xms512m -Xmx1024m

Although I get no error, I know its not taking because after
starting tomcat.exe I look in the Windows process manager and it
shows its only using 50MB of ram instead of 512MB of ram (the -Xms
value)


Silly question: how do you start Tomcat? (tomcat.exe does not exist).


It's a Windows service. While testing this I'm just using the  
Services Control Manager to stop and start the service.



Any help would be greatly appreciated.


You didn't follow the instructions for --JvmOptions:
http://tomcat.eu.apache.org/tomcat-7.0-doc/windows-service-howto.html


I did follow the instructions. There are options for *just* min/max  
heap size (JvmMS  JvmMx)


You want:

- --JvmOptions -Xms=512#-Xmx=1024


No, this did not work.



After you do either of your commands, what do you see if you do:

C:\ tomcat7w.exe //ES//tomcat7


I'm just launching tomcat7w.exe in Windows and checking the Java tab  
to see if it took.




That should show you the current configuration (and let you edit
everything if you want).

Remember that you are only editing the service definition: you will
have to launch Tomcat via the service if you want that configuration
to take effect. Also, if Tomcat is running when you change the
configuration, you'll have to restart the service to notice any  
change.


- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBSUhAACgkQ9CaO5/Lv0PBzPgCePlVSr8zUutRBQleANxuTXNBw
WFQAoK+cTorm2zEbfAdgnfgMzNz6ouWi
=XEix
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







Re: Setting initial memory for a Tomcat Windows Service

2012-09-18 Thread Patrick Flaherty


On Sep 18, 2012, at 10:11 AM, David kerber wrote:


On 9/18/2012 10:03 AM, Patrick Flaherty wrote:

Hello,

Is this a bug or am I doing this wrong ?


I'm not totally sure what you're asking about, but I have found that  
tomcat7w does not always reflect the current settings if you have  
made changes.  IIRC, I usually need to restart it to get it to pick  
up changes.  The other option is to look in the registry for the  
values; the changes will appear there by hitting Refresh.


I'm am looking at the registry keys and they are not changing. If I  
use tomcatw.exe and make the change to max mem then I see the registry  
change to reflect the

change I make in the interface.

But I need to configure this via command-line !







Thanks again,
Pat


Begin forwarded message:


From: Patrick Flaherty pflah...@rampageinc.com
Date: September 13, 2012 6:19:34 PM EDT
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Setting initial memory for a Tomcat Windows Service


On Sep 13, 2012, at 5:37 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 9/13/12 11:41 AM, Patrick Flaherty wrote:

I'm trying to change the max memory (java heap -Xmx) using
Tomcat's //US// switch. I type it according to the Windows service
how-to. We would like to script this into our Tomcat deployment
script which right now simply installs the service using service
install.

With the service already installed I tried the following command
line options:

tomcat7.exe //US//tomcat7 --JvmMs=512 --JvmMx=1024


Hmm.


tomcat7.exe //US//tomcat7 --JvmOptions -Xms512m -Xmx1024m

Although I get no error, I know its not taking because after
starting tomcat.exe I look in the Windows process manager and it
shows its only using 50MB of ram instead of 512MB of ram (the -Xms
value)


Silly question: how do you start Tomcat? (tomcat.exe does not  
exist).


It's a Windows service. While testing this I'm just using the  
Services

Control Manager to stop and start the service.



Any help would be greatly appreciated.


You didn't follow the instructions for --JvmOptions:
http://tomcat.eu.apache.org/tomcat-7.0-doc/windows-service-howto.html


I did follow the instructions. There are options for *just* min/max
heap size (JvmMS  JvmMx)


You want:

- --JvmOptions -Xms=512#-Xmx=1024


No, this did not work.



After you do either of your commands, what do you see if you do:

C:\ tomcat7w.exe //ES//tomcat7


I'm just launching tomcat7w.exe in Windows and checking the Java tab
to see if it took.



That should show you the current configuration (and let you edit
everything if you want).

Remember that you are only editing the service definition: you will
have to launch Tomcat via the service if you want that  
configuration

to take effect. Also, if Tomcat is running when you change the
configuration, you'll have to restart the service to notice any  
change.


- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBSUhAACgkQ9CaO5/Lv0PBzPgCePlVSr8zUutRBQleANxuTXNBw
WFQAoK+cTorm2zEbfAdgnfgMzNz6ouWi
=XEix
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org









-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting initial memory for a Tomcat Windows Service

2012-09-18 Thread Patrick Flaherty


On Sep 18, 2012, at 11:39 AM, David kerber wrote:


On 9/18/2012 11:29 AM, Patrick Flaherty wrote:


On Sep 18, 2012, at 10:11 AM, David kerber wrote:


On 9/18/2012 10:03 AM, Patrick Flaherty wrote:

Hello,

Is this a bug or am I doing this wrong ?


I'm not totally sure what you're asking about, but I have found that
tomcat7w does not always reflect the current settings if you have  
made

changes. IIRC, I usually need to restart it to get it to pick up
changes. The other option is to look in the registry for the values;
the changes will appear there by hitting Refresh.


I'm am looking at the registry keys and they are not changing. If I  
use

tomcatw.exe and make the change to max mem then I see the registry
change to reflect the
change I make in the interface.

But I need to configure this via command-line !


I don't think you can start a service from the command line with  
different options from what are already stored in the registry.   
ISTM this would be a big security problem.


However, with some utility programs, you can change service settings  
from the cmd line before starting it with a net start... command.



If you read down this thread, I'm just trying to change the memory  
from the command line using the Tomcat tools and it does not work.















Thanks again,
Pat


Begin forwarded message:


From: Patrick Flaherty pflah...@rampageinc.com
Date: September 13, 2012 6:19:34 PM EDT
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Setting initial memory for a Tomcat Windows Service


On Sep 13, 2012, at 5:37 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 9/13/12 11:41 AM, Patrick Flaherty wrote:

I'm trying to change the max memory (java heap -Xmx) using
Tomcat's //US// switch. I type it according to the Windows  
service

how-to. We would like to script this into our Tomcat deployment
script which right now simply installs the service using  
service

install.

With the service already installed I tried the following command
line options:

tomcat7.exe //US//tomcat7 --JvmMs=512 --JvmMx=1024


Hmm.


tomcat7.exe //US//tomcat7 --JvmOptions -Xms512m -Xmx1024m

Although I get no error, I know its not taking because after
starting tomcat.exe I look in the Windows process manager and it
shows its only using 50MB of ram instead of 512MB of ram (the - 
Xms

value)


Silly question: how do you start Tomcat? (tomcat.exe does not  
exist).


It's a Windows service. While testing this I'm just using the  
Services

Control Manager to stop and start the service.



Any help would be greatly appreciated.


You didn't follow the instructions for --JvmOptions:
http://tomcat.eu.apache.org/tomcat-7.0-doc/windows-service-howto.html


I did follow the instructions. There are options for *just* min/ 
max

heap size (JvmMS  JvmMx)


You want:

- --JvmOptions -Xms=512#-Xmx=1024


No, this did not work.



After you do either of your commands, what do you see if you do:

C:\ tomcat7w.exe //ES//tomcat7


I'm just launching tomcat7w.exe in Windows and checking the Java  
tab

to see if it took.



That should show you the current configuration (and let you edit
everything if you want).

Remember that you are only editing the service definition: you  
will
have to launch Tomcat via the service if you want that  
configuration

to take effect. Also, if Tomcat is running when you change the
configuration, you'll have to restart the service to notice any
change.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBSUhAACgkQ9CaO5/Lv0PBzPgCePlVSr8zUutRBQleANxuTXNBw
WFQAoK+cTorm2zEbfAdgnfgMzNz6ouWi
=XEix
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org









-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting initial memory for a Tomcat Windows Service

2012-09-18 Thread Patrick Flaherty


On Sep 18, 2012, at 12:08 PM, David kerber wrote:


On 9/18/2012 11:52 AM, Patrick Flaherty wrote:


On Sep 18, 2012, at 11:39 AM, David kerber wrote:


On 9/18/2012 11:29 AM, Patrick Flaherty wrote:


On Sep 18, 2012, at 10:11 AM, David kerber wrote:


On 9/18/2012 10:03 AM, Patrick Flaherty wrote:

Hello,

Is this a bug or am I doing this wrong ?


I'm not totally sure what you're asking about, but I have found  
that
tomcat7w does not always reflect the current settings if you  
have made

changes. IIRC, I usually need to restart it to get it to pick up
changes. The other option is to look in the registry for the  
values;

the changes will appear there by hitting Refresh.


I'm am looking at the registry keys and they are not changing. If  
I use

tomcatw.exe and make the change to max mem then I see the registry
change to reflect the
change I make in the interface.

But I need to configure this via command-line !


I don't think you can start a service from the command line with
different options from what are already stored in the registry. ISTM
this would be a big security problem.

However, with some utility programs, you can change service settings
from the cmd line before starting it with a net start... command.



If you read down this thread, I'm just trying to change the memory  
from

the command line using the Tomcat tools and it does not work.


I see that, but you're doing it for a service, and apparently trying  
to do it from a command line.  I just don't think that's possible  
with the current tools.


I thought it was according to :  
http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html

If it doesn't work, can anyone confirm that you cannot do this ?























Thanks again,
Pat


Begin forwarded message:


From: Patrick Flaherty pflah...@rampageinc.com
Date: September 13, 2012 6:19:34 PM EDT
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Setting initial memory for a Tomcat Windows Service


On Sep 13, 2012, at 5:37 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 9/13/12 11:41 AM, Patrick Flaherty wrote:

I'm trying to change the max memory (java heap -Xmx) using
Tomcat's //US// switch. I type it according to the Windows  
service
how-to. We would like to script this into our Tomcat  
deployment
script which right now simply installs the service using  
service

install.

With the service already installed I tried the following  
command

line options:

tomcat7.exe //US//tomcat7 --JvmMs=512 --JvmMx=1024


Hmm.


tomcat7.exe //US//tomcat7 --JvmOptions -Xms512m -Xmx1024m

Although I get no error, I know its not taking because after
starting tomcat.exe I look in the Windows process manager  
and it
shows its only using 50MB of ram instead of 512MB of ram  
(the -Xms

value)


Silly question: how do you start Tomcat? (tomcat.exe does not
exist).


It's a Windows service. While testing this I'm just using the
Services
Control Manager to stop and start the service.



Any help would be greatly appreciated.


You didn't follow the instructions for --JvmOptions:
http://tomcat.eu.apache.org/tomcat-7.0-doc/windows-service-howto.html



I did follow the instructions. There are options for *just*  
min/max

heap size (JvmMS  JvmMx)


You want:

- --JvmOptions -Xms=512#-Xmx=1024


No, this did not work.



After you do either of your commands, what do you see if you  
do:


C:\ tomcat7w.exe //ES//tomcat7


I'm just launching tomcat7w.exe in Windows and checking the  
Java tab

to see if it took.



That should show you the current configuration (and let you  
edit

everything if you want).

Remember that you are only editing the service definition:  
you will
have to launch Tomcat via the service if you want that  
configuration

to take effect. Also, if Tomcat is running when you change the
configuration, you'll have to restart the service to notice any
change.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBSUhAACgkQ9CaO5/ 
Lv0PBzPgCePlVSr8zUutRBQleANxuTXNBw

WFQAoK+cTorm2zEbfAdgnfgMzNz6ouWi
=XEix
-END PGP SIGNATURE-



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Setting initial memory for a Tomcat Windows Service

2012-09-13 Thread Patrick Flaherty

Hello,

I'm trying to change the max memory (java heap -Xmx) using Tomcat's // 
US// switch. I type it according to
the Windows service how-to. We would like to script this into our  
Tomcat deployment script which right now

simply installs the service using service install.

With the service already installed I tried the following command line  
options:



tomcat7.exe //US//tomcat7 --JvmMs=512 --JvmMx=1024


tomcat7.exe //US//tomcat7 --JvmOptions -Xms512m -Xmx1024m

Although I get no error, I know its not taking because after starting  
tomcat.exe I look in the Windows process manager and it
shows its only using 50MB of ram instead of 512MB of ram (the -Xms  
value)


Any help would be greatly appreciated.

Thanks
Pat





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting initial memory for a Tomcat Windows Service

2012-09-13 Thread Patrick Flaherty


On Sep 13, 2012, at 5:37 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 9/13/12 11:41 AM, Patrick Flaherty wrote:

I'm trying to change the max memory (java heap -Xmx) using
Tomcat's //US// switch. I type it according to the Windows service
how-to. We would like to script this into our Tomcat deployment
script which right now simply installs the service using service
install.

With the service already installed I tried the following command
line options:

tomcat7.exe //US//tomcat7 --JvmMs=512 --JvmMx=1024


Hmm.


tomcat7.exe //US//tomcat7 --JvmOptions -Xms512m -Xmx1024m

Although I get no error, I know its not taking because after
starting tomcat.exe I look in the Windows process manager and it
shows its only using 50MB of ram instead of 512MB of ram (the -Xms
value)


Silly question: how do you start Tomcat? (tomcat.exe does not exist).


It's a Windows service. While testing this I'm just using the Services  
Control Manager to stop and start the service.



Any help would be greatly appreciated.


You didn't follow the instructions for --JvmOptions:
http://tomcat.eu.apache.org/tomcat-7.0-doc/windows-service-howto.html


I did follow the instructions. There are options for *just* min/max  
heap size (JvmMS  JvmMx)


You want:

- --JvmOptions -Xms=512#-Xmx=1024


No, this did not work.



After you do either of your commands, what do you see if you do:

C:\ tomcat7w.exe //ES//tomcat7


I'm just launching tomcat7w.exe in Windows and checking the Java tab  
to see if it took.




That should show you the current configuration (and let you edit
everything if you want).

Remember that you are only editing the service definition: you will
have to launch Tomcat via the service if you want that configuration
to take effect. Also, if Tomcat is running when you change the
configuration, you'll have to restart the service to notice any  
change.


- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBSUhAACgkQ9CaO5/Lv0PBzPgCePlVSr8zUutRBQleANxuTXNBw
WFQAoK+cTorm2zEbfAdgnfgMzNz6ouWi
=XEix
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Links in CSS vs JSPs

2011-09-20 Thread Patrick Flaherty


On Sep 19, 2011, at 6:06 PM, André Warnier wrote:


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Patrick,
On 9/18/2011 12:55 PM, Patrick Flaherty wrote:

All the skins work except image references in the style sheet (css)
cannot be found. Yet images referenced in the jsps are found!

Your JSPs are dynamic and include the webapp prefix, since you
(evidently) properly prefixed and encoded your URLs (good for you).
Your CSS files are not dynamic and, unless you put the prefixes on
there, your images will not be found. Note that any included CSS  
files

will also not be found (i.e. CSS includes CSS) for the same reason.

Is there a hard and fast rule here I’m missing. What’s best
practice ?

I dunno about best practice, but we do what you are doing: put the
webapp prefix into the CSS files and don't forget to change it if you
re-locate the webapp to another prefix (which pretty much never  
happens).

There are other options that I can think of off the top of my head:
1. Use the HTML base / tag to set the base URL in your dynamic  
pages.

  Any relative URLs will be relative to that base. This may ruin
  the URLs that you have carefully and properly prefixed and escaped
  in your JSPs, but it's an option.
2. Make your CSS files dynamic: have Tomcat serve them and perform  
the

  context-path translation on the fly.
3. Use server-side content filtering for .css files. This is roughly
  the same as #2 except that you would use a simpler string-replace
  mechanism instead of a fully-dynamic content-generation technology
  (such as JSP, etc.).
4. Write a bunch of URL rewrite rules that match the CSS/image files
  that you know aren't in the right place. This is going to be
  a pain in the neck.


And any of the above will cause problems if you want to give your  
app to a graphic designer, who will move these pages to his  
workstation and try to work on them.



I'm sure there are other options.


What I do not understand here (maybe due to my lack of knowledge of  
JSP pages logic) is why one would need to fix anything, if the  
links are correctly spelled-out in the first place, taking into  
account how a browser handles absolute/relative links.


e.g. imagine this structure :

(catalina_base)/webapps/
  myapp/ (contains *.JSP pages)
   /images/ (contains images)
   /css/ (contains stylesheets)

If the JSP pages contain links to stylesheets located in myapp/ 
css, their reference should say : href(or src)=css/name-of- 
stylesheet.css
If the css files in turn contain links to images, they can be  
expressed as : src=../images/some-image.jpg

And so on.
If you then move en block the whole myapp somewhere else, all  
links should keep working just fine.


Or does something there not work in a webapp/JSP context ?


My question was about why JSP links work *without* the app prefix and  
the CSS links do not. I think Chris' answer of the JSPs are dynamic
and intern automatically get the app prefix where CSS are not dynamic  
and therefore the CSS link has to account for the app prefix.


How it is fixed André was not the issue, but why JSP links and CSS  
links behave differently.


I will go with that explanation and appreciate your thoughts on this.






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





Re: Links in CSS vs JSPs

2011-09-20 Thread Patrick Flaherty


On Sep 20, 2011, at 9:09 AM, Konstantin Kolinko wrote:


2011/9/18 Patrick Flaherty pflah...@rampageinc.com


Hi,

We have just changed the way we deploy our webapp. We previously  
were putting our app into the ROOT folder under webapps , not good  
I know.
We now package the app as a war file called myapp.war and place it  
into the webapps folder where it explodes into a folder called  
myapp. Everything
works except for one thing. Our app has the option to let the user  
change the look  feel of the web app using predefined skins which  
we store in a
folder called templates inside the myapp folder. Inside the  
templates folder are the folders that represent all the various  
skins (skin1, skin2 etc ..).
These skin folders contain all the jsps, the css file and images  
that represent the content of each skin.


Here’s the problem which is easily remedied but I want to know why.  
Let me explain. All the skins work except image references in the  
style sheet (css)
cannot be found. Yet images referenced in the jsps are found ! The  
references to the images begin with the url /templates/skin1/images/ 
image1.png in both the
css case and the jsp case. Now to fix the problem I change the url  
in the style sheet by adding my app name in front (i.e. /myapp/ 
templates/skin1/images/image1.png)

and this fixes the problem.

I have no problem with changing this and it’s even logical. I’m  
just trying to understand why this only has presented a problem  
with links in the css and not the jsps.
In firebug the reference to images already have my app name  
prepended to the images automatically. (i.e. /myapp/templates/skin1/ 
images/image2.png) YET the jsps’
references only begin the url /templates/skin1/images/image1.png  
(no prepended app name)


1. Isn't it templates/skin1/images/image1.png in JSPs?
(Without leading /, thus relative to the current page and not to the
root of the web server).


No, it's actually templates/$(skin)/images/image1.png in the JSPs.


How do you print those links in JSPs? (Hard-coded, or you are using
some tag or API calls?)

Tags


2. How do you write the URLs in your css files?


Hard coded.
/templates/skin1/images/image1.pngIf I try removing the / prefix  
then the path in the browser becomes /appname/templates/skin1/css/ 
templates/skin1/images/image1.png




Read the official CSS spec from W3C on how relative links in css files
are resolved. In CSS 2.1 it is in ch.4.3.4. Citing:
For CSS style sheets, the base URI is that
of the style sheet, not that of the source document.


Interesting, I can try a relative path starting from the location of  
CSS ?

I read up.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Links in CSS vs JSPs

2011-09-18 Thread Patrick Flaherty
Hi,We have just changed the way we deploy our webapp. We previously were putting our app into the ROOT folder under webapps, not good I know.We now package the app as a war file calledmyapp.warand place it into the webapps folder where it explodes into a folder calledmyapp. Everythingworks except for one thing. Our app has the option to let the user change the look  feel of the web app using predefined skins which we store in afolder calledtemplatesinside themyappfolder. Inside thetemplates folderare the folders that represent all the various skins (skin1, skin2 etc ..).These skin folders contain all the jsps, the css file and images that represent the content of each skin.Here’s the problem which is easily remedied but I want to know why. Let me explain. All the skins work exceptimage references in the style sheet (css)cannot be found. Yet images referenced in the jsps are found ! The references to the images begin with the url /templates/skin1/images/image1.png in both thecss case and the jsp case. Now to fix the problem I change the url in the style sheet by adding my app name in front (i.e./myapp/templates/skin1/images/image1.png)and this fixes the problem.I have no problem with changing this and it’s even logical. I’m just trying to understand why this only has presented a problem with links in the css and not the jsps.In firebug the reference to images already havemy app nameprepended to the images automatically. (i.e./myapp/templates/skin1/images/image2.png) YET the jsps’references only begin the url /templates/skin1/images/image1.png (no prepended app name)I’m just wondering if this make sense to someone with Tomcat experience. Is there a hard and fast rule here I’m missing. What’s best practice ?Thanks in advancePat

Connector Connection Timeout

2011-08-19 Thread Patrick Flaherty

Hi,

I see that the default connection timeout for the Tomcat connector by  
default is set to 2 (20 sec).
This has been the shipping default for 5.x, 6.x and 7.x (in the  
server.xml) The documentation describes
the default timeout to be 6 (60 sec). Is the default value of  
2 in the server.xml for for 5.x, 6.x
and 7.x set to 2 for a reason instead of the documented 6  
default ?


Thanks
-Pat

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: My web application to use SSL (JSSE - RSA)

2011-06-10 Thread Patrick Flaherty

Hi,

Is APR/native Connector dramatically faster then Java Nio Blocking  
Connector or is it marginal ?


I'd love faster SSL but all my keys and certs are java based  
(keytool). Will APR ever support Java SSL ?


I find Java keytool to be reasonably easy to use. Is OpenSSL as easy  
to use ?


Thanks for any input.

Pat

On Jun 10, 2011, at 3:59 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Charles,

On 6/10/2011 9:25 AM, Charles Van Damme wrote:
10-jun-2011 15:14:11 org.apache.catalina.core.AprLifecycleListener  
init

INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: [...]


FWIW, that's just an INFO message, but if you are going to be using  
SSL,
you might want to go ahead and install the APR library: your  
performance
will improve measurably. Note that Connector configuration for an  
APR
connector using SSL is completely different if you choose to go  
this route.


If you are not going to be using APR, you can disable the APR  
lifecycle

listener because you aren't using it.


java.security.NoSuchAlgorithmException: RSA SSLContext not available


As Pid points out, it's pretty obvious that RSA is not a valid
algorithm in this situation:


at sun.security.jca.GetInstance.getInstance(GetInstance.java:142)
at javax.net.ssl.SSLContext.getInstance(SSLContext.java:125)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSSLContext 
(JSSESocketFactory.java:490)


So, it's an SSL configuration problem. Let's look at your SSL  
Connector:


!-- Define a non-blocking Java SSL Coyote HTTP/1.1 Connector  
on port

443 --
Connector protocol=org.apache.coyote.http11.Http11NioProtocol
port=443
   maxThreads=150 scheme=https secure=true
SSLEnabled=true
   keystoreFile=C:/Documents and Settings/ 
Papa/.keystore

keystorePass=changeit
   clientAuth=false sslProtocol=RSA /


SO, you have sslProtocol=RSA... seems like a good place to look. If
you check the Connector documentation, you can see that there are  
only

a few recognized protocols you can choose.

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#SSL_Support

Note that protocol refers to the protocol used for SSL, not for any
specific cipher, key exchange strategy, etc. Unfortunately, the Tomcat
documentation does not list all the available protocols, nor should  
it:

the protocols available to you are determined by JVM support.

The Javadoc for javax.net.ssl.SSLContext.getInstance has a pointer to
documentation for standard names (which takes you through several  
hops

to) here:
http://download.oracle.com/javase/6/docs/technotes/guides/security/ 
StandardNames.html#SSLContext


Those are the valid ssl protocol names you can choose.

If you want use only ciphers that use the RSA algorithm (which is  
really
limiting, IMO), you can look up their names here (after scrolling a  
bit

downward):

http://download.oracle.com/javase/6/docs/technotes/guides/security/ 
StandardNames.html#jssenames


Just look for stuff like SSL_DH_DSS_blah_blah_blah.

Of course, support for a certain algorithm might not be available in
your environment. It's best to find out what your JVM supports and  
use that.


I wrote a short bit of code a while back to determine the supported
algorithms and the default cipher suite for an SSLSocketFactory. I'll
try to dig it up and post it.


!-- Define an AJP 1.3 Connector on port 8009 --
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /


If you aren't using AJP, then disable the extra connector.


Hoping you are not overwhelmed. Anything else ?


You had other errors in the log file. After you get SSL working
properly, stop Tomcat, delete all your logs and re-launch it. Anything
that looks like an error should be investigated and fixed.

Feel free to come back to the list for help on those additional  
issues:

just remember start a new thread if you do.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3yd5IACgkQ9CaO5/Lv0PCSwQCggfhTML/aJwMtBlw1pVJ+mJIt
rg8AoJOrh9amZcTCiLFrXjZQtFRGQbd0
=fu8H
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Patrick Flaherty

Rampage Systems Inc.
411 Waverley Oaks Rd.   
Suite 138
Waltham, MA. 02452-8405
781-891-9400 x239   







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat logging changed between 6.0.29 6.0.32

2011-04-02 Thread Patrick Flaherty

Hello,

I noticed that I'm getting what appears to be *all* console logging  
showing up in my tomcat6-stdout log file.
It's capturing so much more that then it used to. I looked at the  
changelog from 6.0.29 to 6.0.32 and I don't

see anything that describes such a change.

Does anyone know what exactly did change and if there is a way to go  
back to previous behavior.


I tried playing around with the logging.properties in /conf and  
changed everything from FINE to SEVERE
to see if I could control the amount of info ending up in  tomcat6- 
stdout. Did not seem to change anything.


Any explanation and/or direction would be much appreciated.

Thanks
Pat




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat logging changed between 6.0.29 6.0.32

2011-04-02 Thread Patrick Flaherty
There are definitely changes. What used to show up was anything I  
printed from my app
via System.out.println. I don't see any of those messages in any of  
the logs.


What I see that's was never seen in any Tomcat logs is what looks  
like messaging from a

3rd party dll.

If I run the console via tomcat6.exe I do see the messages I print  
via System.out.println but I
also see messages that are not in my code which *ARE* the new  
messages seen now

in stdout from the 3rd party library.

Also of note, I see the stderr log with a *lot of the messages* that  
are in the Catalina log.

Exact duplicate line entries.

Finally I went back to 6.0.29 and noted this. There is a new log in  
6.0.32 called
commons-daemon.2011-04-01.log also the stderr  stdout have different  
names

between the two builds.

6.0.29 names
stdout_20110402.log
stderr_20110402.log

6.0.32 names
tomcat6-stderr.2011-04-02.log
tomcat6-stdout.2011-04-02.log

The OS is Windows 7 64 Bit.

Thanks
Pat


On Apr 2, 2011, at 3:40 PM, Konstantin Kolinko wrote:


2011/4/2 Patrick Flaherty pflah...@rampageinc.com:

Hello,

I noticed that I'm getting what appears to be *all* console  
logging showing

up in my tomcat6-stdout log file.
It's capturing so much more that then it used to. I looked at the  
changelog

from 6.0.29 to 6.0.32 and I don't
see anything that describes such a change.

Does anyone know what exactly did change and if there is a way to  
go back to

previous behavior.

I tried playing around with the logging.properties in /conf and  
changed

everything from FINE to SEVERE
to see if I could control the amount of info ending up in  tomcat6- 
stdout.

Did not seem to change anything.

Any explanation and/or direction would be much appreciated.



There should not be any such changes. What, exactly, is printed?

What is your OS?

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Patrick Flaherty

Rampage Systems Inc.
411 Waverley Oaks Rd.   
Suite 138
Waltham, MA. 02452-8405
781-891-9400 x239   





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat logging changed between 6.0.29 6.0.32

2011-04-02 Thread Patrick Flaherty


On Apr 2, 2011, at 6:53 PM, Konstantin Kolinko wrote:


2011/4/3 Patrick Flaherty pflah...@rampageinc.com:
Also of note, I see the stderr log with a *lot of the messages*  
that are in

the Catalina log.
Exact duplicate line entries.


That is expected. Remove java.util.logging.ConsoleHandler from
configuration. A 1catalina.org.apache.juli.FileHandler there is
enough.

Yes, That worked.





There is a new log in 6.0.32 called
commons-daemon.2011-04-01.log also the stderr  stdout have  
different names

between the two builds.

6.0.29 names
stdout_20110402.log
stderr_20110402.log

6.0.32 names
tomcat6-stderr.2011-04-02.log
tomcat6-stdout.2011-04-02.log


Yes, that is. It is just cosmetic changes though. From using a
different version of http://commons.apache.org/daemon/

Thanks for the explanation.


What I see that's was never seen in any Tomcat logs is what looks  
like

messaging from a 3rd party dll.


but I also see messages that are not in my code which *ARE* the  
new messages seen

now in stdout from the 3rd party library.


DLLs in Java?  Anyway, cannot say much from what you have wrote.
Neither you mention the actual messages.

This is the startup/beginning of my tomcat6-stdout:

2011-04-02 16:51:16 Commons Daemon procrun stdout initializedfound  
condition with property CSFONT_Group::CSFONT_isEmbedded
PRC MANIP: Changed severity for Rule Missing Fonts in RuleSet  
Automatic Rule Set

found condition with property CSFONT_Group::CSFONT_BaseFontName
PRC MANIP: Changed severity for Rule Missing Fonts in RuleSet  
Automatic Rule Set

found condition with property CSIMAGE_Group::CSIMAGE_Resolution
found condition with property CSIMAGE_Group::CSIMAGE_Resolution
found condition with property CSIMAGE_Group::CSIMAGE_Resolution
found condition with property CSIMAGE_Group::CSIMAGE_Resolution

These messages *do* show in the console when I run tomcat6.exe but  
historically never in any log.
Also my System.out.println messages *do not show* up in any log where  
they printed in stdout in 6.0.29.?



The OS is Windows 7 64 Bit.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Win7 calling native code via JNI

2010-03-27 Thread Patrick Flaherty

Hello,

I have a ROOT webapp running in Tomcat 6.0.20 as a SERVICE on  
Windows 7 and it runs fine calling native code via JNI.


Now for debugging purposes :

I'm trying to run it with tomcat not running as a service (tomcat  
started via startup.bat) and the load
of my bridge dll is ok, but as soon as I call the dll's init function  
(CPPInit) it crashed the JVM.
If you look at the code you will see I try to create a file on the  
root of the C drive (remotedebug.txt) and
this file never gets created but I don't think that is what is  
causing the crash as CPPInit is called after

this file create and CPPInit seems to be what's failing.

See Code and JVM crash below.

Native Code Header:

/*
 * Class: com_companyinc_direct_remote_bridge_RLBridge
 * Method:cppInit
 * Signature: (Ljava/lang/String;Ljava/lang/String;I[I)I
 */
JNIEXPORT jint JNICALL  
Java_com_companyinc_direct_remote_bridge_RLBridge_cppInit

  (JNIEnv *, jobject, jstring, jstring, jint, jintArray);

Native Code:

JNIEXPORT jint JNICALL  
Java_com_companyinc_direct_remote_bridge_RLBridge_cppInit
  (JNIEnv *env, jobject obj, jstring rdb, jstring jdb, jint dbl,  
jintArray rtn)

{
int result;
int version;
jint *rtn_array;
wchar_t *rdb_str = (wchar_t *)env-GetStringChars(rdb, 0);
wchar_t *jdb_str = (wchar_t *)env-GetStringChars(jdb, 0);

rtn_array = env-GetIntArrayElements(rtn, FALSE);

const char *s1 = env-GetStringUTFChars(rdb, NULL);
const char *s2 = env-GetStringUTFChars(jdb, NULL);

//FILE *fp = fopen(C:\\remotedebug.txt, at);
dbgout(CPP:Initializing bridge...);
dbgout(s1);
dbgout(s2);
//dbgout(rdb_str);
//dbgout(jdb_str);

	// Turn on debugging stuff so we can see it...remember to turn this  
off later!

RSWP_DBL(dbl);
dbgout(CPP:Debugging intialized.\n);
result = RSWP_Volumes(rdb_str, jdb_str, version);
//result = rswpINVALID;

rtn_array[0] = version;

dbgout(CPP:Bridge Initialized.\n);

env-ReleaseStringChars(rdb, rdb_str);
env-ReleaseStringChars(jdb, jdb_str);

env-ReleaseIntArrayElements(rtn, rtn_array, 0);

// Ok, now, we have to dig deeper if there's an error
	if (result == 2) // 2 means Dongle_INVALID, which is a catch-all for  
Paul

{
// Is this ACTUALLY a dongle error?
if (RSWP_CheckHasp(TRUE) == 0)
{
// THis really isn't a HASP error, is it a DB error?
if (RSWP_SetDataBase(TRUE, NULL, 0) == 0)
{
// Not a DB error either, let's return the 
WHO_KNOWS error (9)
result = 9; 
}
else
{
// This is indeed a DB error, set the right 
result
result = 4;
}
}
}

JVM CRASH:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x77c42272,  
pid=2804, tid=3128

#
# JRE version: 6.0_18-b07
# Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing  
windows-x86 )

# Problematic frame:
# C  [ntdll.dll+0x22272]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---  T H R E A D  ---

Current thread (0x050e5400):  JavaThread http-80-3 daemon  
[_thread_in_native, id=3128, stack(0x05df,0x05e4)]


siginfo: ExceptionCode=0xc005, writing address 0x0024

Registers:
EAX=0x0024, EBX=0x349ec398, ECX=0x05b5c5f8, EDX=0x0005
ESP=0x05e3f578, EBP=0x05e3f58c, ESI=0x0024, EDI=0x0020
EIP=0x77c42272, EFLAGS=0x00010202

Top of Stack: (sp=0x05e3f578)
0x05e3f578:   050e5400  05b52eae 05b5c658
0x05e3f588:   05b5c034 05e3f5c0 05b52d56 0020
0x05e3f598:   05b52e56  050e5400 349ec398
0x05e3f5a8:   349ec398 05b5104a  05b5c048
0x05e3f5b8:   05b5c04c  05e3f5e8 05b510c2
0x05e3f5c8:   05b5c04c 04c911a0 050eb120 349ec398
0x05e3f5d8:   04cfc008 04c90fc0 04cfc428 000e5400
0x05e3f5e8:   05e3f634 02569f47 050e5510 05e3f654

Instructions: (pc=0x77c42272)
0x77c42262:   55 8b ec 83 ec 0c 56 57 8b 7d 08 8d 77 04 8b c6
0x77c42272:   f0 0f ba 30 00 0f 83 5e 01 01 00 64 a1 18 00 00


Stack: [0x05df,0x05e4],  sp=0x05e3f578,  free space=13d05e3f05ck
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code,  
C=native code)

C  [ntdll.dll+0x22272]
C  [RRBridge.dll+0x2d56]
C  [RRBridge.dll+0x10c2]
j  com.companyinc.direct.remote.bridge.RLBridge.cppInit(Ljava/lang/ 

Re: Win7 calling native code via JNI

2010-03-27 Thread Patrick Flaherty
There is only a 32 bit JVM on the machine. The bridge dll has not been 
recompiled since
mid '08.  If it was an incompatibility with the Microsoft Runtime Library 
wouldn't you expect

the Service Version to do the same ?


If you look at the code you will see I try to create a file on the
root of the C drive (remotedebug.txt) and


The file does get created via the Service but not standalone, weird.  If it 
was crashing
as a result of the file creation, would you expect to see the CPPinit at the 
top

of the stack trace ?

Thanks again

--
From: Bill Barker billwbar...@verizon.net
Sent: Saturday, March 27, 2010 7:45 PM
To: users@tomcat.apache.org
Subject: Re: Win7 calling native code via JNI




Caldarale, Charles R chuck.caldar...@unisys.com wrote in message 
news:99c8b2929b39c24493377ac7a121e21f96d2507...@usea-exch8.na.uis.unisys.com...

From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Win7 calling native code via JNI



as soon as I call the dll's init function
(CPPInit) it crashed the JVM.


Are you using the same JVM when you run Tomcat as a service?  The one in 
this crash is the 32-bit client, but you're on a 64-bit platform, and I 
wouldn't be surprised that the service is using a 64-bit server JVM 
(assuming you have one installed).




It wouldn't even get that far if he tried to load a 32-bit dll in a 64-bit 
JVM.


My guess is an incompatibility in the MSVCRT.dll versions.  If you compile 
the JNI dll with a newer version of MSVC, then you can see weird crashes 
like this.



If you look at the code you will see I try to create a file on the
root of the C drive (remotedebug.txt) and


Does the account you're running on have permission to do that?  (Win7 is 
a tad picky about things like that.)


- Chuck


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




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



What should docbase be set to ?

2010-03-23 Thread Patrick Flaherty

Hello,

I am deploying a single app under the ROOT context. My appbase is c:/ 
comapany/myapps.

So my app is in c:/company/myapps/ROOT.

My question is for *both* Tomcat 5.5.23 and 6.0.20, in my context.xml  
what should my docbase be set to ?


Right now I have it set to  docbase=.

Thanks



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



How should autoDeploy be set for an exploded app ?

2010-03-23 Thread Patrick Flaherty

Hello,

I'm deploying a web app which happens to be ROOT. It is not a WAR  
file but an exploded app.


My Host line is as follows :

Host name=192.168.20.20 appBase=c:/company/myapps debug=0  
unpackWARs=false autoDeploy=true

/Host

The fact the I'm deploying it as an exploded app what should  
autoDeploy be set to *ideally*.


The reason I write this is because we have made changes to the app  
and even sometimes deleted the /conf/Catalina/192.168.20.20/ROOT.xml
and find out that the ROOT folder off of the appBase has been  
completely deleted !!


I can't reproduce the scenario that causes the deletion but the  
autoDeploy attribute has piqued my curiosity.


Thanks


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Windows Installer with support for 32 bit JVM on 64 bit OS

2010-01-22 Thread Patrick Flaherty
Will there be an WIndows installer that will install and use a 32 bit  
JVM on a 64 bit OS (Like 6.0.20 did)?


I have some 32 bit native extensions (dlls) and have some time before  
I see a 64 bit version of the dll.


Thanks
-p

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Windows Installer with support for 32 bit JVM on 64 bit OS

2010-01-22 Thread Patrick Flaherty

Perfect, that works !

Thanks Charles.

-P

--
From: Caldarale, Charles R chuck.caldar...@unisys.com
Sent: Friday, January 22, 2010 7:19 PM
To: Tomcat Users List users@tomcat.apache.org
Subject: RE: Windows Installer with support for 32 bit JVM on 64 bit OS


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Windows Installer with support for 32 bit JVM on 64 bit OS

Will there be an WIndows installer that will install and use a 32 bit
JVM on a 64 bit OS (Like 6.0.20 did)?


Don't know, but you can use the *-x86.zip download and use the service.bat 
script to install the service.  The architecture-specific zip files are 
here:

http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.24/bin/

- Chuck


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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: servlet access to static resources (pictures)

2010-01-14 Thread Patrick Flaherty

That make sense.

Thank you.

-P

On Jan 14, 2010, at 10:20 AM, Caldarale, Charles R wrote:


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Re: servlet access to static resources (pictures)

Can I remove the context from the www.ft.com host altogether ?


(It's Context and Host - be precise; case matters, even on  
Windows.)  The Context element should never have been in server.xml.



I don't need context for this host.


Yes, you do, since there are Resource and numerous Environment  
elements included in it.  The Context element should be placed in  
C:\all-my-apps\ROOT\META-INF\context.xml or in conf\Catalina 
\www.ft.com\ROOT.xml.  The contents of the file should be:


Context reloadable=true
  Resource name=jdbc/rampage auth=Container  
type=javax.sql.DataSource description=database maxActive=100  
maxIdle=5 maxWait=15000 username=dbuser password=!Flyover  
driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql:// 
192.168.2.13:3306/ft driverName=jdbc:mysql://192.168.2.13:3306/ft/
  Environment name=company.id value=0 type=java.lang.Long  
override=false/
  Environment name=site.id value=0 type=java.lang.Integer  
override=false/
  Environment name=timeout.interval value=3600  
type=java.lang.Integer override=false/
  Environment name=service.jobs  
value=com.rampageinc.services.JobService type=java.lang.String  
override=false/
  Environment name=service.useraccesscontrol  
value=com.rampageinc.services.UserAccessControlService  
type=java.lang.String override=false/
  Environment name=service.cms  
value=com.rampageinc.services.CMSService type=java.lang.String  
override=false/
  Environment name=root.upload value=C:\TempUpload  
type=java.lang.String override=false/
  Environment name=root.job value=\\Winserve-2008\Pat-10-3 
\Jobs type=java.lang.String override=false/
  Environment name=root.db value=\\Winserve-2008\Pat-10-3\DB  
type=java.lang.String override=false/
  Environment name=root.preps value=\\win2k3-xeon\pat-10-3 
\Preps type=java.lang.String override=false/

/Context

Note that unused junk (such as Logger and debug) have been  
removed, along with the illegal path and docBase attributes.


 - Chuck


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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: servlet access to static resources (pictures)

2010-01-13 Thread Patrick Flaherty
Generally speaking, should your docBase point to the location  
containing your application ?


For example

Host :  www.myapp.com
appBase:  c:\all-my-apps


Application:
app1
Location:  c:\all-my-apps\app1

Generally speaking would point my docBase to c:\all-my-apps\app1?

Thanks
-P


On Jan 13, 2010, at 11:23 AM, Holger Rieß wrote:


The context elements are defined in /%CATALINA_HOME%/conf/server.xml:
Server ...
Service ...
Engine ...
Host ...
Context docBase= ...
Context docBase= ...
...
/Host
/Engine
/Service
/Server

There are two web applications that have access to these resources.  
The servlets main task is to calculate picture dimensions with  
java.awt.Toolkit. The request.getResource methods don't find these  
'extern' paths.


Holger


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






Re: servlet access to static resources (pictures)

2010-01-13 Thread Patrick Flaherty


On Jan 13, 2010, at 3:54 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

Aside from Chuck's comments...

On 1/13/2010 12:01 PM, Patrick Flaherty wrote:
Generally speaking, should your docBase point to the location  
containing

your application ?

For example

Host :  www.myapp.com
appBase:  c:\all-my-apps


Application:
app1
Location:  c:\all-my-apps\app1


If your Host for www.myapp.com has autoDeploy=true, then  
explicitly

creating a Context with docBase=[appBase]/something is likely to
create confusion because Tomcat may try to deploy the same webapp  
twice

on the same path. :(

If autoDeploy=true, then having a webapp in c:\all-my-apps 
\app1.war or

the directory c:\all-my-apps\app1 means that it will be automatically
deployed and therefore no Context element need appear in conf/ 
server.xml.



Generally speaking would point my docBase to c:\all-my-apps\app1?


Conceptually, yes. In practice, you should try to avoid explicitly
setting the docBase unless you are using conf-file-based deployment
using a deployment file in conf/[EngineName]/[HostName]/[AppName].xml.

So Chris,

Based on my setup as described above which is not a war file but a  
directory that we
just plunk down into appBase, should I remove the docBase parameter  
altogether (is that safe)
or should it be there set as docBase= (empty) which is what I have  
seen in my readings about

Context.

One other item in my Context is path and it is set to path= (is  
that safe). If this is the only app

for this host should it be set to path=/ (root) ?

Thanks
-P




- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktOMvkACgkQ9CaO5/Lv0PAl4wCdGn7y93C40qPUjCn2fmVKiaHU
eHgAn2P4tC94CdKVuZAnsrdu98JSPc0D
=lfnl
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: servlet access to static resources (pictures)

2010-01-13 Thread Patrick Flaherty
 documentation) --
  !--
  Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/
  --

  !-- The request dumper valve dumps useful debugging information about
   the request and response data received and sent by Tomcat.
   Documentation at: /docs/config/valve.html --
  !--
  Valve className=org.apache.catalina.valves.RequestDumperValve/
  --

  !-- This Realm uses the UserDatabase configured in the global JNDI
   resources under the key UserDatabase.  Any edits
   that are performed against this UserDatabase are immediately
   available for use by the Realm.  --
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/

  !-- Define the default virtual host
   Note: XML Schema validation will not work with Xerces 2.2.
   --
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

!-- SingleSignOn valve, share authentication between web applications
 Documentation at: /docs/config/valve.html --
!--
Valve className=org.apache.catalina.authenticator.SingleSignOn /
--

!-- Access log processes all example.
 Documentation at: /docs/config/valve.html --
!--
Valve className=org.apache.catalina.valves.AccessLogValve directory=logs  
   prefix=localhost_access_log. suffix=.txt pattern=common resolveHosts=false/
--

  /Host



Host name=www.ft.com appBase=c:/all-my-apps debug=0 unpackWARs=false autoDeploy=true
Alias192.168.2.13/Alias
   Context path= docBase=c:/all-my-apps/ROOT debug=0 reloadable=true
   Logger className=org.apache.catalina.logger.FileLogger prefix=inhouse. suffix=.log timestamp=true/
   Resource name=jdbc/rampage auth=Container type=javax.sql.DataSource description=database maxActive=100 maxIdle=5 maxWait=15000 username=dbuser password=!Flyover driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.2.13:3306/ft driverName=jdbc:mysql://192.168.2.13:3306/ft/
   Environment name=company.id value=0 type=java.lang.Long override=false/
   Environment name=site.id value=0 type=java.lang.Integer override=false/
			 Environment name=timeout.interval value=3600 type=java.lang.Integer override=false/

   Environment name=service.jobs value=com.rampageinc.services.JobService type=java.lang.String override=false/
   Environment name=service.useraccesscontrol value=com.rampageinc.services.UserAccessControlService type=java.lang.String override=false/
 Environment name=service.cms value=com.rampageinc.services.CMSService type=java.lang.String override=false/
		
Environment name=root.upload value=C:\TempUpload type=java.lang.String override=false/
Environment name=root.job value=\\Winserve-2008\Pat-10-3\Jobs type=java.lang.String override=false/
   Environment name=root.db value=\\Winserve-2008\Pat-10-3\DB type=java.lang.String override=false/
   Environment name=root.preps value=\\win2k3-xeon\pat-10-3\Preps type=java.lang.String override=false/

   /Context
/Host


/Engine
  /Service
/Server




On Jan 13, 2010, at 6:04 PM, Caldarale, Charles R wrote:


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Re: servlet access to static resources (pictures)

Based on my setup as described above which is not a war file but a
directory that we just plunk down into appBase, should I remove the
docBase parameter altogether (is that safe) or should it be there
set as docBase= (empty) which is what I have seen in my readings
about Context.


The docBase attribute must *never* be set to an empty string -  
doing so creates all sorts of havoc.  It can be omitted in almost  
all cases except when the webapp is located outside of the Host  
appBase directory.



One other item in my Context is path and it is set to path= (is
that safe).


The proper way to do this is remove the Context elements from  
server.xml.  If you only have one webapp, name its directory  
(or .war file) ROOT (case-sensitive), under the Host appBase  
directory.  The Context element, if needed, should be placed in  
[appBase]/ROOT/META-INF/context.xml, and must not contain path or  
docBase attributes.  If there's nothing left in the Context  
element, you don't need it at all.



If this is the only app for this host should it be
set to path=/ (root) ?


No, / is not the default webapp;  is.  But you shouldn't ever  
be setting path, anyway.


 - Chuck


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

Re: Tomcat Filter Mapping Issue

2010-01-10 Thread Patrick Flaherty


On Jan 10, 2010, at 12:25 AM, Caldarale, Charles R wrote:


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Re: Tomcat Filter Mapping Issue

Meaning every host should have a ROOT app regardless of whether  
you are

hosting ONE or MORE apps on a host !


Correct.


Good !



That is what I had. I had the ROOT app off the webapps folder of a
default Tomcat install.


No, that ROOT app applied only to the default Host - no others.   
Each Host has an entirely separate and independent set of webapps.


When I say a ROOT app it is THE ROOT app that Tomcat installs,  
nothing to do with my app. It's content is the default Tomcat home  
page with
Administration, Documentation. Tomcat Online, and  
Miscellaneous on the left side of the page. So right after a fresh  
install of Tomcat
this page is displayed when you type http://localhost. I don't touch  
that app, I leave it alone and it remains the machine's ROOT APP.



We then created a virtual host (with a real domain name) where OUR
app responded to that domain name. (ie Host Name : www.myapp.com
 appBase =  c:/myapp)


No, an app is not equivalent to a domain (Host) name.  As stated  
previously by several of us, the ROOT app for the particular Host  
will handle any requests directed to the Host that do not map to  
any other apps *for that Host*.  Again, each Host is completely  
independent of the others.


If running three apps on one host , how do you get to those apps.  
Correct me if I am wrong :

Example one is a Single Host domain name called www.myapp.com.

To get to app1, I would type http://www.myapp.com/app1
To get to app2, I would type http://www.myapp.com/app2
To get to app3, I would type http://www.myapp.com/app3

Is this correct ? If it is, (Which I think it is and will work) then  
I don't like to have our customers having to add /app1 or /app2  or / 
app3 to the end of SINGLE URL (domain name) to get to a particular app.
But I'm pretty sure this is VALID and SHOULD work but the additional  
leg appended to the URL to get to a particular app is awful to me.


Example two is one machine with one public IP address and three  
domain names mapping to that one IP address.


The three domain names are www.myapp1.com, www.myapp2.com, and  
finally www.myapp3.com, all mapping to one public IP address.


I set up three VIRTUAL HOSTS matching the names of the 3 PUBLIC  
domain names I have mapping to the IP address of the box.


Like the following :

Host name = www.myapp1.com   appbase = c:/app1
Host name = www.myapp2.com   appbase = c:/app2
Host name = www.myapp3.com   appbase = c:/app3

The content of each appBase folder is all of our app files. (classes,  
libs WEB-INF/web.xml, Proofs folder) These folders (c:/app1, c:/ 
app2,c:/app3) behave like
the web root of each of the domain names  
(www.myapp1.com,www.myapp2.com,www.myapp3.com) accordingly.


Is this Valid ? I hope so because this is how we have been deploying  
multiple apps on a single box and it has been working. Is this just  
dumb luck ? Maybe !
If this is NOT valid please give an example of deploying three app  
from one machine. By the way this configuration is where FIlter  
Mapping was NOT working.


FIlter mapping started to work when I added a ROOT folder to say the  
first app. So now the following folder exists c:/app1/ROOT and this  
is where I
put my infamous Proofs folder (c:/app1/ROOT/Proofs). I did change my  
FILTER MAPPING PATTERN in my web.xml to be /ROOT/Proofs/* and then I  
started

to get my FILTER MAPPING HITS.

I would NOT gets hits when my infamous Proofs folder was located in  
c:/app1/Proofs and the FILTER MAPPING PATTERN in my web.xml was / 
Proofs/*

Which is where this all started.

I apologize for and confusion I may have caused anyone while I'm  
trying to get my arm around this by trying and retrying things. Your  
help and insight

is greatly appreciated.




Everything in this config has worked for a couple years. The infamous
Proofs folder was located in c:/myapp/Proofs which I assume c:/myapp
to be the web root for this www.myapp.com host.


Whatever you had working appears to have been dumb luck, and  
dependent on undefined behavior of having an empty docBase (which  
is illegal).


Covered above I think.



After suggestions from the forum about moving the app (WEB_INF and
all) under a ROOT folder I added to c:/myapp folder which now  
contains
everything for the app under it, viola, Filter Mapping started to  
work !


Because you were finally using a valid configuration.


Actually now I have found that I can leave my app in c:/app1 and just  
make the changes noted above (add ROOT/Proofs to my appBase path and  
change
my FILTER MAPPING PATTERN in my web.xml to be /ROOT/Proofs/* and then  
I started to get my FILTER MAPPING HITS.)


There is something magic about adding the folder ROOT and having it  
end up in the URL's being passed back and forth for ME to start  
getting FILTER MAPPING HITS.


Do people have secondary

Re: Tomcat Filter Mapping Issue

2010-01-10 Thread Patrick Flaherty

Hi Hassan,

I have not read that explicitly. I have looked online at various How- 
To's and it's not clear to me this
is the case. I have 2 Tomcat reference books neither which mention  
this about Virtual Hosts.

I will look some more.

I do not dispute you at all, don't get me wrong. It's even been  
proven in my testing that this is

what made filter mapping work for me.

If you have a link that illustrates this I would appreciate you  
sharing it. Then I can rest knowing

this is how we should have been doing it from day one.

Thanks once again.

-P

On Jan 10, 2010, at 1:23 PM, Hassan Schroeder wrote:


On Sun, Jan 10, 2010 at 9:55 AM, Patrick Flaherty
pflah...@rampageinc.com wrote:

I set up three VIRTUAL HOSTS matching the names of the 3 PUBLIC  
domain names

I have mapping to the IP address of the box.

Like the following :

Host name = www.myapp1.com   appbase = c:/app1
Host name = www.myapp2.com   appbase = c:/app2
Host name = www.myapp3.com   appbase = c:/app3


Have you *read* the virtual-hosting how-to?

The content of each appBase folder is all of our app files.  
(classes, libs
WEB-INF/web.xml, Proofs folder) These folders (c:/app1, c:/app2,c:/ 
app3)

behave like
the web root of each of the domain names
(www.myapp1.com,www.myapp2.com,www.myapp3.com) accordingly.

Is this Valid ?


Not remotely. Your apps need to be in

  c:/app1/ROOT
  c:/app2/ROOT
  c:/app3/ROOT

respectively. As the docs say.

--
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Filter Mapping Issue

2010-01-10 Thread Patrick Flaherty


On Jan 10, 2010, at 1:53 PM, Caldarale, Charles R wrote:


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Re: Tomcat Filter Mapping Issue

I don't touch that app, I leave it alone and it remains the
machine's ROOT APP.


No, it is that particular Host's ROOT app; not the machine's.  
Every Host must have a ROOT app, and most likely not the ROOT app  
that ships with Tomcat's localhost Host.



If running three apps on one host , how do you get to those apps.


If by host, you mean a Host entry in server.xml, the apps will  
have different names under the appBase directory of that Host.   
One should be named ROOT, the others can be whatever you want your  
users to refer to them as.



Example one is a Single Host domain name called www.myapp.com.

To get to app1, I would type http://www.myapp.com/app1
To get to app2, I would type http://www.myapp.com/app2
To get to app3, I would type http://www.myapp.com/app3


Correct.  You also need a ROOT app to handle URIs for www.myapp.com  
that don't reference app1, app2, or app3.



I don't like to have our customers having to add /app1 or /app2  or
/app3 to the end of SINGLE URL (domain name) to get to a  
particular app.


Don't confuse URL with domain name; the domain name is only a part  
of a URL.  The users are going to need to differentiate the apps by  
some means, and the part after the domain name is as good as any.



But I'm pretty sure this is VALID and SHOULD work but the additional
leg appended to the URL to get to a particular app is awful to me.


How do you suggest the users specify which app they want to  
access?  Your misgivings are unfounded.



Host name = www.myapp1.com   appbase = c:/app1
Host name = www.myapp2.com   appbase = c:/app2
Host name = www.myapp3.com   appbase = c:/app3


O.k. so far, but it does give the (sometimes desirable) impression  
that there are three different servers.



The content of each appBase folder is all of our app files.


That's where you're not getting it.  The app files must go under C:/ 
appx/ROOT, not directly under the appBase.



These folders (c:/app1, c:/app2, c:/app3) behave like the web
root of each of the domain names (www.myapp1.com, www.myapp2.com,
www.myapp3.com) accordingly.


Wrong.  The appBase is just the location of *all* webapps for the  
Host.  The default webapp for the Host MUST be placed in a  
directory named ROOT (case sensitive) UNDER the appBase directory.   
Other webapps for the Host - if any - go into other directories  
under that Host's appBase.


Ahh  That makes sense Finally ! The appBase is just a location  
for ALL webapps for a given Host. Therefore every Host MUST have  
at least a ROOT app which MAY be the only app
for that Host. GOT IT !  One final question on your final  
statement.  If I have 3 apps for a given Host then off my appBase I  
would have :


/ROOT  (a must default for each Host)
/app2
/app3

To access these apps, the URL's for the apps would be :

http://www.my-three-apps.com  (This for the ROOT app)
http://www.my-three-apps.com/app2  (This for the /app2 app)
http://www.my-three-apps.com/app3  (This for the /app3 app)

If this is correct I finally got it.

Thanks Hassan for the link, my books are outdated and are being tossed.

Thank you Chuck, I hope my last reply is correct. (We were not  
deployed this way for years yet it did worked, which is what I got  
caught up on.


Thanks to all again.

-P






If this is NOT valid please give an example of deploying three app
from one machine.


We already did, several times, as does the doc page Hassan pointed to.

By the way this configuration is where FIlter Mapping was NOT  
working.


Completely understandable, since it's an invalid configuration.


I did change my FILTER MAPPING PATTERN in my web.xml to be
/ROOT/Proofs/* and then I started to get my FILTER MAPPING HITS.


No, the webapp name (ROOT in this case) must not be part of the  
filter mapping.



Actually now I have found that I can leave my app in c:/app1 and just
make the changes noted above (add ROOT/Proofs to my appBase path and
change my FILTER MAPPING PATTERN in my web.xml to be /ROOT/Proofs/*
and then I started to get my FILTER MAPPING HITS.)


More dumb luck, depending on the behavior of this particular  
version of Tomcat when presented with a broken, invalid  
configuration.  Just do it the right way.



There is something magic about adding the folder ROOT and having it
end up in the URL's being passed back and forth for ME to start
getting FILTER MAPPING HITS.


It's not magic, it's defined behavior; ROOT is the default webapp  
for the Host.



Do you still have the same thought after what I covered above ?


Yes, you're still refusing to do things in the proper, documented way.

 - Chuck


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

Re: Tomcat Filter Mapping Issue

2010-01-10 Thread Patrick Flaherty

Uncle !

I just created a ROOT folder off of my appBase, cut and pasted all of what 
was in my appbase
into the new ROOT folder. Restart Tomcat and I try and hit the app with the 
hostname and I get

a 404 for /.
(If I add /ROOT to the appBase path and I can hit the app successfully.)

I tried Tomcat v5.5 and v6.0 with the same result. I move all my files from 
ROOT up one level
back into appBase , delete the ROOT folder, remove /ROOT from my appBase and 
I can hit the

app successfully ? AH!!!

Can anyone post a virtual host snippet from their server.xml ?

I have to be missing something in my server.xml.

Thanks
-P

--
From: Caldarale, Charles R chuck.caldar...@unisys.com
Sent: Sunday, January 10, 2010 3:40 PM
To: Tomcat Users List users@tomcat.apache.org
Subject: RE: Tomcat Filter Mapping Issue


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Re: Tomcat Filter Mapping Issue

If I have 3 apps for a given Host then off my appBase I
would have :

/ROOT  (a must default for each Host)
/app2
/app3

To access these apps, the URL's for the apps would be :

http://www.my-three-apps.com  (This for the ROOT app)
http://www.my-three-apps.com/app2  (This for the /app2 app)
http://www.my-three-apps.com/app3  (This for the /app3 app)


The above is correct, but not quite complete.  The default (ROOT) webapp 
will handle any URIs that don't match any of the explicitly-named apps, 
where the spec-defined rule is that the longest match wins.  For example, 
if a user enters:


 http://www.my-three-apps.com/app4

the request will be directed to the default (ROOT) app, since it doesn't 
match the known app2 or app3 patterns.


- Chuck


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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Filter Mapping Issue

2010-01-10 Thread Patrick Flaherty

Charles,

Looking back you are correct. With all my confusion that clearly did
not register as I could plainly see it the host section of my server .xml.

You guys have a lot of patience with a guy like me and I shouldn't post
with such ignorance. I'm inheriting this project from the one who design
it. It clearly has flaws in it's config.  I have to go back a spend some 
time

on the Tomcat doc site and gain some expertise in Tomcat.

Thanks again for your patience.

-P

--
From: Caldarale, Charles R chuck.caldar...@unisys.com
Sent: Sunday, January 10, 2010 6:57 PM
To: Tomcat Users List users@tomcat.apache.org
Subject: RE: Tomcat Filter Mapping Issue


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Re: Tomcat Filter Mapping Issue

To solve it, I simply removed the docBase= from the Host ?


Note that we mentioned an empty docBase was illegal quite some time ago.

You should not have *any* Context elements in server.xml.  Whatever 
you've been reading that suggested you do so is sadly out of date, or 
flat-out wrong.  Again, use the real Tomcat doc, not 3rd-party 
scribblings.



it's ok not to have a docBase ?


There is always a docBase; but when the Context elements are properly 
located, it's calculated automatically from the location of the webapp.


For Tomcat versions starting with 5.0.x, the proper place to put your 
Context elements is in each app's META-INF/context.xml file.  When doing 
so, the path and docBase attributes must be omitted.  An alternate 
location for Context elements is in conf/Catalina/[host]/[appName].xml, 
and again the path attribute must be omitted.  You *may* use the docBase 
attribute in this latter case, but only if the webapp is located outside 
of the Host appBase directory.


Again, post your server.xml and we'll show you what to fix.

- Chuck


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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Filter Mapping Issue

2010-01-09 Thread Patrick Flaherty

Chris,

Although adding ROOT of my appBase fixed my Filter mapping issue, I'm  
guessing that I need to
put every bit of my app (all classes, libs etc ) into that ROOT  
folder, correct ?


So then if I decide to deploy another app in a virtual host say for  
instance :


Host Name : www.domain.com   appBase=c:/app123

If that has a folder called proofs that I want filter mapping hits  
on, do I

created a ROOT folder off of my appBase (ie  c:/app123/ROOT) and put
every bit of my app (all classes, libs etc ) into that ROOT folder ?

I'm sorry to belabor the point. I know that adding the ROOT folder  
fixed my
initial problem but I not sure if that is because when only running 1  
host it
should be called ROOT or is it that every Host needs to have a ROOT  
folder
off of it's appBase and everything should bit of the app should be  
put in there.


It seems the ROOT folder was the key here but before we wanted to add  
filter

mapping app worked fine when appBase is what we deemed to be the web
root for the app. It has worked well like that for years.

Is there a hard and fast rule about deployment that I'm missing ?  
(Probably)
If there is. it seems to revolve around having a ROOT folder for each  
app maybe ?


Any more enlightenment would be appreciated.

Thanks once again.

-P



On Jan 9, 2010, at 3:28 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 1/8/2010 6:17 PM, Patrick Flaherty wrote:

Thanks a lot. I added a ROOT folder off my appBase and cut and pasted
everything under that ROOT folder
and now I am getting filter mapping hits with my ft.com ! We are not
deploying correctly and this sheds all the
light on that fact.


Proper deployment is always a good idea. Then, everything works  
properly :)


Curiously I was not able to get to ft.com/WEB-INF/web.xml , I got  
a 404.

But I am able to get to other files off the root as expected.
Maybe Tomcat has it's own filter mapping for /WEB-INF/web.xml ? I  
could

not get to any file in /META-INF/* either ?


If you deployed correctly under webapps/ROOT, then the WEB-INF folder
and its contents should be protected by the DefaultServlet and should
return a 404: this is expected behavior.

If you have webapps/WEB-INF/web.xml, then I'd expect you to be able to
successfully request /WEB-INF/web.xml because /WEB-INF looks like a
context to Tomcat. It's possible that Tomcat actively protects
[appBase]/WEB-INF similar to protecting a real webapp's WEB-INF
directory, but it is not required to do so.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktI5vQACgkQ9CaO5/Lv0PBI+wCgkJrpG5w21CEZjYSYDCV6eTJq
R6MAmQEO8EWXkoWm2aOjKS+ZZ8e0UqFI
=HDIu
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






Re: Tomcat Filter Mapping Issue

2010-01-09 Thread Patrick Flaherty



--
From: Konstantin Kolinko knst.koli...@gmail.com
Sent: Saturday, January 09, 2010 7:00 PM
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Tomcat Filter Mapping Issue


2010/1/10 Patrick Flaherty pflah...@rampageinc.com:

Chris,

Although adding ROOT of my appBase fixed my Filter mapping issue, I'm
guessing that I need to
put every bit of my app (all classes, libs etc ) into that ROOT 
folder,

correct ?

So then if I decide to deploy another app in a virtual host say for 
instance

:

Host Name : www.domain.com   appBase=c:/app123

If that has a folder called proofs that I want filter mapping hits on, do 
I

created a ROOT folder off of my appBase (ie  c:/app123/ROOT) and put
every bit of my app (all classes, libs etc ) into that ROOT folder ?

I'm sorry to belabor the point. I know that adding the ROOT folder fixed 
my
initial problem but I not sure if that is because when only running 1 
host

it
should be called ROOT or is it that every Host needs to have a ROOT 
folder

off of it's appBase and everything should bit of the app should be put in
there.

It seems the ROOT folder was the key here but before we wanted to add 
filter

mapping app worked fine when appBase is what we deemed to be the web
root for the app. It has worked well like that for years.

Is there a hard and fast rule about deployment that I'm missing ? 
(Probably)

If there is. it seems to revolve around having a ROOT folder for each app
maybe ?

Any more enlightenment would be appreciated.

Thanks once again.



ROOT (in uppercase) is not a folder, but a web application.


Yes, that is understood.


It behaves like any other web application (You should remember, that
web applications are independent of each other). The only difference
is that it is mapped to the URL /.


Your say the ROOT app is mapped to URL / then yes that is understood.


Every host should have a ROOT application.


Meaning every host should have a ROOT app regardless of whether you are 
hosting ONE or MORE apps on a host !




Any requests that cannot be mapped to any other web application  will
be directed to this one, so that it can show its 404th error page or
otherwise process it.

(If there is no ROOT application deployed, such requests cannot be
processed and will result in a zero-length empty response.)


If you have two applications
 /mywebapp
 /ROOT
then
- any request to /myweapp/foo will be processed by mywebapp (and the
ROOT one will not see it at all),


That is what I had. I had the ROOT app off the webapps folder of a default 
Tomcat install.
We then created a virtual host (with a real domain name) where OUR app 
responded to

that domain name. (ie Host Name : www.myapp.com  appBase =  c:/myapp)
Everything in this config has worked for a couple years. The infamous Proofs 
folder was
located in c:/myapp/Proofs which I assume c:/myapp to be the web root for 
this www.myapp.com host.

It seems to have always behaved as such.

Am I ok up to this point ? (maybe not ?)

Finally we decided a wanted to use Filter Mapping for added security. Filter 
Mapping would not give us a hit
for an URL's of type http://www.myapp.com/Proofs/* (our filter map using 
/Proofs/*).


After suggestions from the forum about moving the app (WEB_INF and all) 
under a ROOT folder I added to c:/myapp
folder which now contains everything for the app under it, viola, Filter 
Mapping started to work !


I don't know why this was the case but I went with it.


- any request to /myweapp2/foo will be processed by ROOT (because
there is no myweapp2 application to process it).
Do people have secondary app (after ROOT) setup like I described above 
running  with filter mapping functioning ?


Seems like maybe a bug to me or a misconfiguration of some sort on my part.

Thanks again Konstantin and other.




Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat Filter Mapping Issue

2010-01-08 Thread Patrick Flaherty

Hello,

I'm trying to get filter mapping working in Windows Tomcat 6.0.20. I  
can get it to work one way but not another.


I have 2 virtual hosts where filter mapping on one host is working (I  
get a hit) and another host that does not work (no hits)


Here are the 2 virtual hosts as seen in Server.xml file :

Fails (no hits)
  Host name=ft.com  appBase=c:/FilterTest
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host


Works (I get hits)
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

  /Host

Here is my filter :

 filter
filter-nameFileAccessFilter/filter-name
filter-classcom.mcs.webapp.filter.FileAccessFilter/filter-class
   /filter

   filter-mapping
filter-nameFileAccessFilter/filter-name
url-pattern/Proofs/*/url-pattern
   /filter-mapping

If I type the following I get a hit (Using Second host from above) :
http://localhost/Proofs/1/calendar.png

If I type the following I DO NOT get a hit (Using First host from  
above) :

http://ft.com/Proofs/1/calendar.png

In both cases the png image is found and displayed in the browser.

My guest is it has something to do with the appBase where the one that
works is :
appBase=webapps

and the one that fails is :
appBase=c:/FilterTest

Any help would be greatly appreciated.

Thanks

Re: Tomcat Filter Mapping Issue

2010-01-08 Thread Patrick Flaherty

Hello,

Thanks for your response. I don't intend to run 2 apps (virtual  
hosts) on the server, just one. I have 2 setup
on the same server so I could compare results from the different  
setups. I could not get it to work using our
shipping configuration which is appBase pointing to a folder off the  
c:\ drive. But I discovered it worked

setting up the app the traditional way.

We have an established customer  where the appBase is not off of % 
CATALINAHOME% but instead in a folder off the c:\ drive.
Therefore I'm trying to get the filter mapping to work with the  
appBase set to a folder of the c:\ drive.


If I understand what you are saying, this will and cannot not work  
with appBase set to a folder of the c:\ drive ?


Thanks for any clarification.

-P




On Jan 8, 2010, at 11:01 AM, Pid wrote:


On 08/01/2010 14:55, Patrick Flaherty wrote:

Hello,

I'm trying to get filter mapping working in Windows Tomcat 6.0.20.  
I can

get it to work one way but not another.

I have 2 virtual hosts where filter mapping on one host is working (I
get a hit) and another host that does not work (no hits)

Here are the 2 virtual hosts as seen in Server.xml file :

Fails (no hits)
Host name=ft.com appBase=c:/FilterTest
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
/Host


Works (I get hits)
Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

/Host

Here is my filter :

filter
filter-nameFileAccessFilter/filter-name
filter-classcom.mcs.webapp.filter.FileAccessFilter/filter-class
/filter

filter-mapping
filter-nameFileAccessFilter/filter-name
url-pattern/Proofs/*/url-pattern
/filter-mapping

If I type the following I get a hit (Using Second host from above) :
http://localhost/Proofs/1/calendar.png

If I type the following I DO NOT get a hit (Using First host from  
above) :

http://ft.com/Proofs/1/calendar.png

In both cases the png image is found and displayed in the browser.

My guest is it has something to do with the appBase where the one  
that

works is :
appBase=webapps

and the one that fails is :
appBase=c:/FilterTest


Yes, you are correct.

The appBase attribute sets the location where applications  
reside, it does not set the location of a specific application.


Unless your application is called ROOT.war (or is the exploded dir  
ROOT) and is placed inside C:/FilterTest, you're not going to get  
any joy.



You're also likely to have trouble seeing requests on that Host,  
unless you are requesting http://ft.com/Proofs/calendar.jpg; - as  
you've set no aliases and the Host named localhost will pick up  
all other requests as it's probably set as the defaultHost in the  
Engine.


See the docs for more info about configuring virtual hosts and  
contexts.


 http://tomcat.apache.org/


p


Any help would be greatly appreciated.

Thanks



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Filter Mapping Issue

2010-01-08 Thread Patrick Flaherty
If I use a host name of ft.com with a appBase of c:/FilterTest then  
doesn't c:/FilterTest become my web server root for ft.com?
Is seems to work that way for us although it may not be the correct  
way to deploy a web app. The proofs folder is
just that a folder off the (Our c:/FilterTest) web root and we are  
try to get a filter mapping hit when you type

http://ft.com/Proofs/1/calendar.png.

If you deploy an app off of %CATALINAHOME% then doesn't the user have  
to type http://my.domainname.com/myapp ?
I want it to hit my app when I type http://my.domainname.com. That is  
how it works with our product today.


It starting to sound like the complete URL has to be part of % 
CATALINAHOME%'s path to get a filter hit ?


Thanks


On Jan 8, 2010, at 2:16 PM, Caldarale, Charles R wrote:


From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
Subject: Re: Tomcat Filter Mapping Issue

I could not get it to work using our shipping configuration
which is appBase pointing to a folder off the c:\ drive.


That's because you don't seem to understand the function of  
appBase: it doesn't point to a single webapp, it points to a  
*directory* under which each of your webapps is installed.  For  
example, the single Host in the default Tomcat config is  
$CATALINA_HOME/webapps, and under webapps, you'll find ROOT,  
manager, docs, examples, etc.


You appear to have placed your webapp named Proofs under the  
default Host's appBase, and everything works as expected.  To use  
the webapp under the appBase of the ft.com Host, place the Proofs  
directory (or .war file) under the declared C:\FilterTest directory:

C:\FilterTest\
  Proofs\
WEB-INF\
  lib\
  classes\
META-INF\
  context.xml
etc.


filter-mapping
filter-nameFileAccessFilter/filter-name
url-pattern/Proofs/*/url-pattern
/filter-mapping


The url-pattern must not include the context name; it should  
really be just /*.


 - Chuck


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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






Re: Tomcat Filter Mapping Issue

2010-01-08 Thread Patrick Flaherty

Christopher and Charles.

Thanks a lot. I added a ROOT folder off my appBase and cut and pasted  
everything under that ROOT folder
and now I am getting filter mapping hits with my ft.com ! We are not  
deploying correctly and this sheds all the

light on that fact.

Curiously I was not able to get to ft.com/WEB-INF/web.xml , I got a  
404. But I am able to get to other files off the root as expected.
Maybe Tomcat has it's own filter mapping for /WEB-INF/web.xml ? I  
could not get to any file in /META-INF/* either ?


Anyway, thanks again for your patience and help.

-P


On Jan 8, 2010, at 4:06 PM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 1/8/2010 3:49 PM, Patrick Flaherty wrote:

If I use a host name of ft.com with a appBase of c:/FilterTest then
doesn't c:/FilterTest become my web server root for ft.com?


As Chuck points out, no: C:\FilterTest\ROOT is the server root for
ft.com. Remember, Tomcat isn't a web server: it's an app server.

Is seems to work that way for us although it may not be the  
correct way

to deploy a web app.


I suspect what's happening is that you have a layout like this:

C:\FilterTest
C:\FilterTest\WEB-INF
C:\FilterTest\WEB-INF\web.xml
C:\FilterTest\Proofs
C:\FilterTest\Proofs\[content]

Tomcat, seeing that a directory called \Proofs exists, is deploying it
as it's own web application, and the DefaultServlet is serving all  
your

content correctly. Since /Proofs doesn't have a WEB-INF/web.xml file,
your filter is not being created and it's not being called.

I'll bet that you can also request this file:

http://ft.com/WEB-INF/web.xml

Here, Tomcat will serve this file that might be expected to be  
protected

because /WEB-INF looks like a (poorly-named) web application and not a
proper deployment descriptor directory in a proper web app.

If you deploy an app off of %CATALINAHOME% then doesn't the user  
have to

type http://my.domainname.com/myapp ?
I want it to hit my app when I type http://my.domainname.com. That is
how it works with our product today.


You need to fix your deployments, or nothing is going to make  
sense. If

you want your webapp to be deployed without a leading path (i.e. on /
instead of /foo), then you need to name your webapp ROOT.war (or  
put it

in the ROOT subdirectory under your appBase directory).


It starting to sound like the complete URL has to be part of
%CATALINAHOME%'s path to get a filter hit ?


No, this is not true. If your webapp is properly deployed, your  
relative

URIs will be properly mapped and your filter will get called.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktHnmUACgkQ9CaO5/Lv0PCjzQCgvPHG6/1ZwJ0iyZrHj/coqoLW
R20AoJJ0RXVvIdMHJ+mofNRo92EvUu0e
=8MkQ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org