Re: serving content from outside the context

2005-10-12 Thread Darryl L. Miles

John Laughton wrote:


Hi, I hope this is the right mailing list for this question

I am using tomcat 5.0.28
I have a simple web app and want to serve up some images in the jsp 
pages, but the images are outside the context


The HTTP statement looks like
trtd
img alt=thumb image src=/data/webData/family/DSC01183.JPG/
/td/tr

The web app is under /usr/local/tomcat/webapp/family
On the browser it only shows thumb image as it cannot get to the 
hyperlink http://xx.xx.xx.xx/data/webData/family/DSC01183.JPG

(IP shown as xx.xx.xx.xx for security)

I have read a lot about tomcat and figure there must be a way to 
configure server.xml and/or web.xml to allow this to work, but cannot 
see it ?


It is possible ?


Are you wanting TC to serve the static files or do you use AJP connector 
and Apache.  The easiest way to serve files from outside is to let 
Apache serve them and configure up AJP connector, then mount the entire 
content or just *.jsp pages to TC.


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



RE: serving content from outside the context

2005-10-12 Thread Arup Vidyerthy
Or if you don't want to do what Darryl is suggesting you can configure your
tomcat to use unix symlinks by setting the allowLinking attribute to true.

Then you can simply create a softlink inside your webapp directory that
points to your data directory.

That will work as well.

Arup 

-Original Message-
From: Darryl L. Miles [mailto:[EMAIL PROTECTED] 
Sent: 12 October 2005 09:59
To: Tomcat Users List
Subject: Re: serving content from outside the context

John Laughton wrote:

 Hi, I hope this is the right mailing list for this question

 I am using tomcat 5.0.28
 I have a simple web app and want to serve up some images in the jsp 
 pages, but the images are outside the context

 The HTTP statement looks like
 trtd
 img alt=thumb image src=/data/webData/family/DSC01183.JPG/
 /td/tr

 The web app is under /usr/local/tomcat/webapp/family On the browser it 
 only shows thumb image as it cannot get to the hyperlink 
 http://xx.xx.xx.xx/data/webData/family/DSC01183.JPG
 (IP shown as xx.xx.xx.xx for security)

 I have read a lot about tomcat and figure there must be a way to 
 configure server.xml and/or web.xml to allow this to work, but cannot 
 see it ?

 It is possible ?

Are you wanting TC to serve the static files or do you use AJP connector and
Apache.  The easiest way to serve files from outside is to let Apache serve
them and configure up AJP connector, then mount the entire content or just
*.jsp pages to TC.

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





___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com

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



RE: serving content from outside the context

2005-10-12 Thread John Laughton

Thanks for the suggestions
I didn't really want to run Apache, especially as I have tomcat (which is 
suppose to be a web server - I thought ?)


For now I have added a file to
.../tomcat/conf/Catalina/localhost/myData.xml
This xml file contains

?xml version='1.0' encoding='utf-8'?
Context path = /myData docBase=/data/webData
/Context

now I can access http://xx.xx.xx.xx/myData/

In the dir /data/webData, I created a WEB-INF and a WEB-INF/web.xml

I guess what I have done is created a new context in the area of my hard 
drive where the static jpg files exist

The only issue I have is that I expose /data/webData part of my hard drive

John
At 10:06 AM 10/12/2005 +0100, Arup Vidyerthy wrote:

Or if you don't want to do what Darryl is suggesting you can configure your
tomcat to use unix symlinks by setting the allowLinking attribute to true.

Then you can simply create a softlink inside your webapp directory that
points to your data directory.

That will work as well.

Arup

-Original Message-
From: Darryl L. Miles [mailto:[EMAIL PROTECTED]
Sent: 12 October 2005 09:59
To: Tomcat Users List
Subject: Re: serving content from outside the context

John Laughton wrote:

 Hi, I hope this is the right mailing list for this question

 I am using tomcat 5.0.28
 I have a simple web app and want to serve up some images in the jsp
 pages, but the images are outside the context

 The HTTP statement looks like
 trtd
 img alt=thumb image src=/data/webData/family/DSC01183.JPG/
 /td/tr

 The web app is under /usr/local/tomcat/webapp/family On the browser it
 only shows thumb image as it cannot get to the hyperlink
 http://xx.xx.xx.xx/data/webData/family/DSC01183.JPG
 (IP shown as xx.xx.xx.xx for security)

 I have read a lot about tomcat and figure there must be a way to
 configure server.xml and/or web.xml to allow this to work, but cannot
 see it ?

 It is possible ?

Are you wanting TC to serve the static files or do you use AJP connector and
Apache.  The easiest way to serve files from outside is to let Apache serve
them and configure up AJP connector, then mount the entire content or just
*.jsp pages to TC.

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





___
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with 
voicemail http://uk.messenger.yahoo.com


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


*
  John Laughton,Cisco Systems
  ([EMAIL PROTECTED])
  408.902.3592 (voicemail and fax)
  page - 1 800 365 4578
*


Context Relative versus Path Relative error pages

2005-10-12 Thread Arlene Milgram
Hi All,

We ran into a problem with JSP pages under Tomcat 5.5.9 which did not
exist under Tomcat 4.1.31.

In Tomcat 5.5.9 if we forward to a JSP page that is in a different
directory then the initial request the errorPage directive does not work
as we expected.

If we use a path relative errorPage directive then Tomcat 5.5.9 seems to
assume that the errorPage path is relative to the path of the initial
HTTP request not the JSP page.  Is this behavior correct?

For example, Error 404, /servlet/PopError.jsp appears if an HTTP request
of /servlet/PathServ forwards to a JSP page, /popdrv/pathRelative.jsp,
that uses relative paths and then throws an exception.

%@ page language=java
session=true
errorPage=PopError.jsp
%

We found a similar entry in BugZilla which was closed because the
problem could not be reproduced.

http://issues.eu.apache.org/bugzilla/show_bug.cgi?id=35230

One can get the correct errorPage by using a Context relative path.

%@ page language=java
session=true
errorPage=/popdrv/PopError.jsp
%

We have attached 6 files, PathServ.java, pathRelative.jsp,
ContextServ.java, contextRelative.jsp, PopError.jsp, and web.xml.  To
see the issue one can create a context and place PathServ.java in the
directory com.optimedsys.servlet, pathRelative.jsp and PopError.jsp in
the directory popdrv.   To see the workaround one can place
ContextServ.java in the directory com.optimedsys.servlet,
contextRelative.jsp and PopError.jsp in the popdrv directory.

Request context/servlet/PathServ to see the 404 error or
context/servlet/ContextServ to get the correct errorPage.

Thank You

Lee Breslow
[EMAIL PROTECTED]

Arlene Milgram
[EMAIL PROTECTED]
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
	servlet
		servlet-namePathServ/servlet-name
		display-nameDemo use of error directive with error page being relative to the path./display-name
		descriptionPath Servlet/description
		servlet-classcom.optimedsys.servlet.PathServ/servlet-class
	/servlet
	servlet
		servlet-nameContextServ/servlet-name
		display-nameDemo use of error directive with error page being relative to the context/display-name
		descriptionContext Servlet/description
		servlet-classcom.optimedsys.servlet.ContextServ/servlet-class
	/servlet
	servlet
		servlet-namecontextRelative.jsp/servlet-name
		display-namecontextRelative/display-name
		descriptioncontext Relative/description
		jsp-file/popdrv/contextRelative.jsp/jsp-file
	/servlet
	servlet
		servlet-namepathRelative.jsp/servlet-name
		display-namepathRelative/display-name
		descriptionpath Relative/description
		jsp-file/popdrv/pathRelative.jsp/jsp-file
/servlet
	servlet
		servlet-namePopError.jsp/servlet-name
		display-namePopError/display-name
		descriptionPopError/description
		jsp-file/popdrv/PopError.jsp/jsp-file
	/servlet
	servlet-mapping
		servlet-nameContextServ/servlet-name
		url-pattern/servlet/ContextServ/url-pattern
	/servlet-mapping
	servlet-mapping
		servlet-namePathServ/servlet-name
		url-pattern/servlet/PathServ/url-pattern
	/servlet-mapping
/web-app
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: apache virtual hosting + server.xml + context

2005-10-12 Thread sudip shrestha
We are having the similar problem,
but if we place context in server.xml, ( I also have a META-INF/context.xml
) and as we are using dbcp connection pool, and it seems that tomcat
initializes those pool twice

On 10/7/05, gianni dalmasso [EMAIL PROTECTED] wrote:

 hi list, i have a problem. i have apache 2.0 + tomcat 5.5.
 i have N name based virtual hosts on the same machine managed by apache;
 some of them need to use tomcat (have jsp pages and servlets...)
 if i set a server.xml of tomcat with several hosts, and every host has ist
 context -- it's ok ( but tomcat documentation says Please note that for
 tomcat 5, unlike tomcat 4.x, it is NOT recommended to place Context
 elements directly in the server.xml file)
 if i try to move the context informations in a .xml file in a
 $CATALINA_HOME/conf/[enginename]/[hostname]/ directory, tomcat cannot serve
 anything (it acts as he cannot find files in docBase);
 - which is the right configuration ?
 - is it necessary to define different host in server.xml ?(-- so, when i
 add a new host i need to restart apache and tomcat...)
 thanks in advance

 here is the configuration that works..

 HTTPD.CONF
 
 Include /var/jakarta-tomcat-5.5.9/conf/mod_jk.conf

 MOD_JK.CONF
 .

 NameVirtualHost xx.yy.zz.kk:80

 VirtualHost xx.yy.zz.kk:80

 DocumentRoot /var/www/html

 ServerName web.ccc.com http://web.ccc.com

 /VirtualHost



 VirtualHost xx.yy.zz.kk:80

 Directory /var/www/html/aaa 

 DirectoryIndex index.htm index.html index.jsp

 /Directory

 ServerName www.aaa.com http://www.aaa.com

 DocumentRoot /var/www/html/aaa

 JkMount /*.jsp ajp13

 JkMount /servlet/* ajp13

 /VirtualHost



 VirtualHost xx.yy.zz.kk:80

 Directory /var/jakarta-tomcat-5.5.9/webapps/bbb 

 DirectoryIndex index.htm index.html

 /Directory

 ServerName www.bbb.com http://www.bbb.com

 DocumentRoot /var/jakarta-tomcat-5.5.9/webapps/bbb

 JkMount /*.jsp ajp13

 JkMount /servlet/* ajp13

 /VirtualHost



 SERVER.XML

 

 Host name=www.aaa.com http://www.aaa.com

 Context path=

 docBase=/var/www/html/aaa

 debug=0

 reloadable=true 

 /Context

 /Host



 Host name=www.bbb.com http://www.bbb.com

 Context path=

 docBase=/var/jakarta-tomcat-5.5.9/webapps/bbb

 debug=0

 reloadable=true 

 /Context

 /Host




 



 This for example, don't work



 setting :

 SERVER.XML



 

 Host name=www.aaa.com http://www.aaa.com

 appBase = /var/www/html/aaa (or similar... )

 /Host



 Host name=www.bbb.com http://www.bbb.com

 /Host


 the file : $CATALINA_HOME/conf/Catalina/www.aaa.com/aaa.xml

 Context path=

 docBase=/var/www/html/aaa

 debug=0

 reloadable=true 

 /Context







 -
 Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3



RE: apache virtual hosting + server.xml + context

2005-10-12 Thread Caldarale, Charles R
 From: sudip shrestha [mailto:[EMAIL PROTECTED] 
 Subject: Re: apache virtual hosting + server.xml + context
 
 We are having the similar problem,
 but if we place context in server.xml, ( I also have a 
 META-INF/context.xml
 ) and as we are using dbcp connection pool, and it seems that tomcat
 initializes those pool twice

Which is exactly as it's defined to work.  You should only have one
instance for each unique Context element, otherwise you will get
multiple deployments and corresponding initializations.

 - Chuck


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

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



After adding a context xml file, web-app doesn't always start

2005-10-11 Thread David Farrell
Hi all,

For a while my web app was connecting manually to the db but obviously
that's a bit rubbish so I looked at some examples and moved the db stuff
into the context file for my app.  I have never written a context file and
I think I may have missed something.

Now when I use ant to install my app, it sometimes fails - ant says
successful build but tomcat throw an exeption that my app conspiracy
cannot be found under /webapps/conspiracy  - it isn't being installed from
that location - ant installs it from my build dir outside of the tomcat
folder entirely.

If this was happening all the time, it would be more understandable but
roughly 50% of the time (and every time i re-type ant remove install
immediately after a fail) it installs fine.

I imagine that I need to do something to my context xml file?  I'm not
really sure but the only change in the app pre and post this error is
moving the db stuff to the xml file.

The xml file is attached:?xml version='1.0' encoding='utf-8'?
Context crossContext=true debug=5 docBase=conspiracy path=/conspiracy reloadable=true
Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_conspiracy_log. suffix=.txt timestamp=true/
Resource name=jdbc/conspiracy_db type=javax.sql.DataSource/
ResourceParams name=jdbc/conspiracy_db
parameter
nameurl/name
valuejdbc:mysql://localhost:3306/conspiracy_db?autoReconnect=true/value
/parameter
parameter
namevalidationQuery/name
valueselect now()/value
/parameter
parameter
namemaxIdle/name
value30/value
/parameter
parameter
namemaxActive/name
value100/value
/parameter
parameter
namedriverClassName/name
valuecom.mysql.jdbc.Driver/value
/parameter
parameter
namemaxWait/name
value1/value
/parameter
parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
nameusername/name
valueroot/value
/parameter
parameter
namepassword/name
valuepassword/value
/parameter

parameter
	nameremoveAbandoned/name
	valuetrue/value
/parameter
parameter
	nameremoveAbandonedTimeout/name
	value60/value
/parameter
parameter
	namelogAbandoned/name
	valuetrue/value
/parameter
/ResourceParams
/Context
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Manage a context via JMX

2005-10-11 Thread Björn König

Hello,

i'm using jmx to access the tomcat 5.5 server. I succeeded in retrieving a
list of context mbeans. My problem is that the context-mbean doesn't contain
any information about the availability of a context, the context description
and number of sessions. I tried to get the original context object via the
managedResource property of the mbean, but it doesn't work. It might be
because I'm using a JmxMbeanServerConnection stead of a MbeanServer object.

Does any one know, how to get this information about a context via JMX?

Thanks!
Bjoern


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



RE: After adding a context xml file, web-app doesn't always start

2005-10-11 Thread Caldarale, Charles R
 From: David Farrell [mailto:[EMAIL PROTECTED] 
 Subject: After adding a context xml file, web-app doesn't always start
 
 I think I may have missed something.

Such as telling us which version of Tomcat you're using.

 tomcat throw an exeption that my app conspiracy
 cannot be found under /webapps/conspiracy

Your docBase attribute says webapps/conspiracy is the location of the
app.

 I imagine that I need to do something to my context xml file?  I'm not
 really sure but the only change in the app pre and post this error is
 moving the db stuff to the xml file.

Where is your context xml file?  What is it's actual name?  (The
attached file is named context_home.xml, which can't be really be what
you're using.)  Read up on the attribute fields of the Context element
for the version of Tomcat you're using.  In particular, if you're using
5.5.x, don't put Context in server.xml, and don't use the path
attribute.

 - Chuck


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

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



serving content from outside the context

2005-10-11 Thread John Laughton

Hi, I hope this is the right mailing list for this question

I am using tomcat 5.0.28
I have a simple web app and want to serve up some images in the jsp pages, 
but the images are outside the context


The HTTP statement looks like
trtd
img alt=thumb image src=/data/webData/family/DSC01183.JPG/
/td/tr

The web app is under /usr/local/tomcat/webapp/family
On the browser it only shows thumb image as it cannot get to the 
hyperlink http://xx.xx.xx.xx/data/webData/family/DSC01183.JPG

(IP shown as xx.xx.xx.xx for security)

I have read a lot about tomcat and figure there must be a way to configure 
server.xml and/or web.xml to allow this to work, but cannot see it ?


It is possible ?

Thanks
John 

mod_jk + context don't work ?

2005-10-08 Thread gianni dalmasso
i configured several  html virtual hosts sites with jsps ; (apache 2.0 + 
mod_jk.+ tomcat 5.5.)
- virtual hosting managed by apache (name based virtual host)
- connector ajp13 for all jsps
- if a i create in server.xml : an host www.aaa.com + context infos -- 
everythink works but it's no longer good 
- if i put the site under localhost (i.e adding anything to default server.xml) 
and the context in a $CATALINA_HOME/conf/Catalina/localhost/ file , then : 
1: under the tomcat manager (pure tomcat space) -- it works 

2: if managed by apache -- the jsp cannot be reached.

it seems that the jsp managing passed by apache to tomcat have the bad context.

thanks in advance;

gianni

 

here is the configuration that DON'T work:

--

HTTPD.CONF 

 

Include /var/jakarta-tomcat-5.5.9/conf/mod_jk.conf 

 

MOD_JK.CONF 

. 

NameVirtualHost xx.yy.zz.kk:80

VirtualHost xx.yy.zz.kk:80

Directory /var/www/html/aaa 

DirectoryIndex index.htm index.html index.jsp

/Directory

ServerName www.aaa.com

DocumentRoot /var/www/html/aaa

JkMount /*.jsp ajp13

JkMount /servlet/* ajp13

/VirtualHost

 

SERVER.XML 

the default (appBase is $CATALINA_HOME/conf/webapps)

 

the file : $CATALINA_HOME/conf/Catalina/locahost/aaa.xml 

Context path=aaa(or /aaa)

docBase=/var/www/html/aaa

debug=0

reloadable=true 

/Context

 
 
 


-
Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3

apache virtual hosting + server.xml + context

2005-10-07 Thread gianni dalmasso
hi list, i have a problem. i have apache 2.0 + tomcat 5.5.
i have N name based virtual hosts on the same machine managed by apache; some 
of them need to use tomcat (have jsp pages and servlets...)
if i set a server.xml of tomcat with several hosts, and every host has ist 
context -- it's ok ( but tomcat documentation says Please note that for 
tomcat 5, unlike tomcat 4.x, it is NOT recommended to place Context elements 
directly in the server.xml file)
if i try to move the context informations in a .xml file in a 
$CATALINA_HOME/conf/[enginename]/[hostname]/ directory, tomcat cannot serve 
anything (it acts as he cannot find files in docBase);
- which is the right configuration ?
- is it necessary to define different host in server.xml ?(-- so, when i add a 
new host i need to restart apache and tomcat...)
thanks in advance
 
here is the configuration that works..
 
HTTPD.CONF

Include /var/jakarta-tomcat-5.5.9/conf/mod_jk.conf
 
MOD_JK.CONF
.

NameVirtualHost xx.yy.zz.kk:80

VirtualHost xx.yy.zz.kk:80

DocumentRoot /var/www/html

ServerName web.ccc.com

/VirtualHost

 

VirtualHost xx.yy.zz.kk:80

Directory /var/www/html/aaa 

DirectoryIndex index.htm index.html index.jsp

/Directory

ServerName www.aaa.com

DocumentRoot /var/www/html/aaa

JkMount /*.jsp ajp13

JkMount /servlet/* ajp13

/VirtualHost

 

VirtualHost xx.yy.zz.kk:80

Directory /var/jakarta-tomcat-5.5.9/webapps/bbb 

DirectoryIndex index.htm index.html

/Directory

ServerName www.bbb.com

DocumentRoot /var/jakarta-tomcat-5.5.9/webapps/bbb

JkMount /*.jsp ajp13

JkMount /servlet/* ajp13

/VirtualHost

 

SERVER.XML



Host name=www.aaa.com

Context path=

docBase=/var/www/html/aaa

debug=0

reloadable=true 

/Context

/Host



Host name=www.bbb.com

Context path=

docBase=/var/jakarta-tomcat-5.5.9/webapps/bbb 

debug=0

reloadable=true 

/Context

/Host

 



 

This for example, don't work

 

setting : 

SERVER.XML

 



Host name=www.aaa.com

appBase = /var/www/html/aaa (or similar... )

/Host



Host name=www.bbb.com

/Host

 
the file : $CATALINA_HOME/conf/Catalina/www.aaa.com/aaa.xml

Context path=

docBase=/var/www/html/aaa

debug=0

reloadable=true 

/Context

 





-
Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3

RE: apache virtual hosting + server.xml + context [255643:132138]

2005-10-07 Thread RTE - Meridian Club
Many thanks for your email. This is an automated response acknowledging receipt.

Please be advised that Badge mailing commences beginning of October 2005.

Should your message require a response we will respond shortly.

Regards
Meridian Club


 -Original Message-
 From: gianni dalmasso [EMAIL PROTECTED]
 Received: 10/7/2005 10:51 AM
 To: tomcat-user@jakarta.apache.org
 Subject: apache virtual hosting + server.xml + context

 hi list, i have a problem. i have apache 2.0 + tomcat 5.5.
 i have N name based virtual hosts on the same machine managed by apache; some 
 of them need to use tomcat (have jsp pages and servlets...)
 if i set a server.xml of tomcat with several hosts, and every host has ist 
 context -- it's ok ( but tomcat documentation says Please note that for 
 tomcat 5, unlike tomcat 4.x, it is NOT recommended to place Context 
 elements directly in the server.xml file)
 if i try to move the context informations in a .xml file in a 
 $CATALINA_HOME/conf/[enginename]/[hostname]/ directory, tomcat cannot serve 
 anything (it acts as he cannot find files in docBase);
 - which is the right configuration ?
 - is it necessary to define different host in server.xml ?(-- so, when i add 
 a new host i need to restart apache and tomcat...)
 thanks in advance
  
 here is the configuration that works..
  
 HTTPD.CONF
 
 Include /var/jakarta-tomcat-5.5.9/conf/mod_jk.conf
  
 MOD_JK.CONF
 .
 
 NameVirtualHost xx.yy.zz.kk:80
 
 VirtualHost xx.yy.zz.kk:80
 
 DocumentRoot /var/www/html
 
 ServerName web.ccc.com
 
 /VirtualHost
 
  
 
 VirtualHost xx.yy.zz.kk:80
 
 Directory /var/www/html/aaa 
 
 DirectoryIndex index.htm index.html index.jsp
 
 /Directory
 
 ServerName www.aaa.com
 
 DocumentRoot /var/www/html/aaa
 
 JkMount /*.jsp ajp13
 
 JkMount /servlet/* ajp13
 
 /VirtualHost
 
  
 
 VirtualHost xx.yy.zz.kk:80
 
 Directory /var/jakarta-tomcat-5.5.9/webapps/bbb 
 
 DirectoryIndex index.htm index.html
 
 /Directory
 
 ServerName www.bbb.com
 
 DocumentRoot /var/jakarta-tomcat-5.5.9/webapps/bbb
 
 JkMount /*.jsp ajp13
 
 JkMount /servlet/* ajp13
 
 /VirtualHost
 
  
 
 SERVER.XML
 
 
 
 Host name=www.aaa.com
 
 Context path=
 
 docBase=/var/www/html/aaa
 
 debug=0
 
 reloadable=true 
 
 /Context
 
 /Host
 
 
 
 Host name=www.bbb.com
 
 Context path=
 
 docBase=/var/jakarta-tomcat-5.5.9/webapps/bbb 
 
 debug=0
 
 reloadable=true 
 
 /Context
 
 /Host
 
  
 
 
 
  
 
 This for example, don't work
 
  
 
 setting : 
 
 SERVER.XML
 
  
 
 
 
 Host name=www.aaa.com
 
 appBase = /var/www/html/aaa (or similar... )
 
 /Host
 
 
 
 Host name=www.bbb.com
 
 /Host
 
  
 the file : $CATALINA_HOME/conf/Catalina/www.aaa.com/aaa.xml
 
 Context path=
 
 docBase=/var/www/html/aaa
 
 debug=0
 
 reloadable=true 
 
 /Context
 
  
 
 
 
 
   
 -
 Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3

--
Meridian Club
Unit 5, Caxton Centre
Porters Wood
St Albans
Herts
UNITED KINGDOM
AL3 6XT

Tel: +44 1727 738855
Fax: +44 1700 578955
email: [EMAIL PROTECTED]


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



Re: Context path changes in context.xml not working

2005-10-06 Thread David Kerber
I did a bunch of googling before posting my question, but never came 
across that post; thanks for listing it; it appears to be exactly what I 
need.


Dave


Caldarale, Charles R wrote:

From: David Kerber [EMAIL PROTECTED]
Subject: Re: Context path changes in context.xml not working



Nobody has any suggestions about setting up a 2-level context path 
*without* putting it in the server.xml (it works fine in there)?



I thought I remembered something about this, and went googling for the
issue.  Take a look at:
http://marc.theaimsgroup.com/?l=tomcat-userm=110989168604231w=2

If you put your Context fragment in
   conf/[enginename]/[hostname]/dir1#dir2#appname.xml
you can access the webapp via http://[hostname]/dir1/dir2/appname, which
I think is what you want.  Haven't been able to find this in the Tomcat
doc yet, but I did test it successfully on 5.5.9.  Have no idea if this
trick with the # would work on the name of a .war file.

 - Chuck



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



Add context to URI (Tomcat5/Apache2)

2005-10-05 Thread Benjamin Lerman
 Hi all,

 I'm looking through docs and FAQs, but I cannot find how to do the
following.

 I use Tomcat5 and Apache2. My apache server can accede the tomcat
server, and things like:

[uri:/manager/*]
info=A scriptable management web application for the Tomcat Web Server.
debug=0

in the workers2.properties works perfectly (meaning manager is
accessible from http://localhost/manager/).

 Now, I'd like to be able to deploy new application on the tomcat server
without having to add a line in the workers2.properties file.

 I do *not* want to add a line like:

[uri:/*]
debug=0

 What I want is to have a line like:

[uri:/tomcat/*]
debug=0

and that that all the URI in /tomcat/foo be converted in /foo for the
tomcat server.

 For that to work it should be a parameter to give to the tomcat server,
but I did not find the right one. Context seems to be the right one,
but when I add

Context path=/tomcat docBase=./ privileged=1/

to my host parameter in server.xml, it does allow me to use .jsp, but
not servlets.

 Do someone know how I could achieve something like that?

 Thanks.

Benjamin

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



Context path changes in context.xml not working

2005-10-05 Thread David Kerber

Running Tomcat 5.5.9 on Windows 2000 server.

I am trying to change the context path of an application, and it works 
fine when I put this into my server.xml:


 Context path=/wradev/pelican 
docBase=e:\TomcatClients\Pelican\webapps\SiteData debug=0 
reloadable=true autoDeploy=true unpackWARs=true crossContext=false/


According to the docs, putting this into the server.xml is not the 
preferred way, but when I put it into my 
webapps/SiteData/META-INF/context.xml, it doesn't seem to take effect, 
even when I stop and restart Tomcat.


Is there something I'm missing here?  Or is it a bug which will be fixed 
in a later release.


Dave

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



Re: Context path changes in context.xml not working

2005-10-05 Thread Mark Eggers
As mentioned several times on the mailing list, path
is no longer read from webapp/META-INF/context.xml.

Try placing the context information in: 

engine-name\hostname\appname.xml

under %CATALINA_HOME%\conf or %CATALINA_BASE%\conf if
you're using multiple Tomcats served from one binary.

If you're using the defaults, then engine-name is
Catalina and hostname is localhost.

HTH

/mde/

--- David Kerber [EMAIL PROTECTED] wrote:

 Running Tomcat 5.5.9 on Windows 2000 server.
 
 I am trying to change the context path of an
 application, and it works 
 fine when I put this into my server.xml:
 
   Context path=/wradev/pelican 
 docBase=e:\TomcatClients\Pelican\webapps\SiteData
 debug=0 
 reloadable=true autoDeploy=true
 unpackWARs=true crossContext=false/
 
 According to the docs, putting this into the
 server.xml is not the 
 preferred way, but when I put it into my 
 webapps/SiteData/META-INF/context.xml, it doesn't
 seem to take effect, 
 even when I stop and restart Tomcat.
 
 Is there something I'm missing here?  Or is it a bug
 which will be fixed 
 in a later release.
 
 Dave
 

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




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: Context path changes in context.xml not working

2005-10-05 Thread David Smith
Intended behavior.  path attributes are ignored in context xml files.

If you'd like to change the name of the webapp, I'd suggest changing the
name of the .war file to change it's name.  If you aren't working with
.war files, change the name of the webapp folder and then the name of
it's context xml file located in config/Catalina/localhost.  Restart
tomcat and you're done.

--David

David Kerber wrote:

 Running Tomcat 5.5.9 on Windows 2000 server.

 I am trying to change the context path of an application, and it works
 fine when I put this into my server.xml:

  Context path=/wradev/pelican
 docBase=e:\TomcatClients\Pelican\webapps\SiteData debug=0
 reloadable=true autoDeploy=true unpackWARs=true
 crossContext=false/

 According to the docs, putting this into the server.xml is not the
 preferred way, but when I put it into my
 webapps/SiteData/META-INF/context.xml, it doesn't seem to take effect,
 even when I stop and restart Tomcat.

 Is there something I'm missing here?  Or is it a bug which will be
 fixed in a later release.

 Dave

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



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Context path changes in context.xml not working

2005-10-05 Thread David Kerber

I guess I missed that part about paths - thanks for pointing that out.

How do I rename things to get the 2-level context path?  This is an app 
I'm migrating from SilverStream to Tomcat, and I don't want to change 
the url my users use to connect to it.




David Smith wrote:

Intended behavior.  path attributes are ignored in context xml files.

If you'd like to change the name of the webapp, I'd suggest changing the
name of the .war file to change it's name.  If you aren't working with
.war files, change the name of the webapp folder and then the name of
it's context xml file located in config/Catalina/localhost.  Restart
tomcat and you're done.

--David

David Kerber wrote:



Running Tomcat 5.5.9 on Windows 2000 server.

I am trying to change the context path of an application, and it works
fine when I put this into my server.xml:

Context path=/wradev/pelican
docBase=e:\TomcatClients\Pelican\webapps\SiteData debug=0
reloadable=true autoDeploy=true unpackWARs=true
crossContext=false/

According to the docs, putting this into the server.xml is not the
preferred way, but when I put it into my
webapps/SiteData/META-INF/context.xml, it doesn't seem to take effect,
even when I stop and restart Tomcat.

Is there something I'm missing here?  Or is it a bug which will be
fixed in a later release.

Dave

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








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



Re: Context path changes in context.xml not working

2005-10-05 Thread David Kerber
Nobody has any suggestions about setting up a 2-level context path 
*without* putting it in the server.xml (it works fine in there)?


Dave


David Kerber wrote:


I guess I missed that part about paths - thanks for pointing that out.

How do I rename things to get the 2-level context path?  This is an 
app I'm migrating from SilverStream to Tomcat, and I don't want to 
change the url my users use to connect to it.




David Smith wrote:


Intended behavior.  path attributes are ignored in context xml files.

If you'd like to change the name of the webapp, I'd suggest changing the
name of the .war file to change it's name.  If you aren't working with
.war files, change the name of the webapp folder and then the name of
it's context xml file located in config/Catalina/localhost.  Restart
tomcat and you're done.

--David

David Kerber wrote:



Running Tomcat 5.5.9 on Windows 2000 server.

I am trying to change the context path of an application, and it works
fine when I put this into my server.xml:

Context path=/wradev/pelican
docBase=e:\TomcatClients\Pelican\webapps\SiteData debug=0
reloadable=true autoDeploy=true unpackWARs=true
crossContext=false/

According to the docs, putting this into the server.xml is not the
preferred way, but when I put it into my
webapps/SiteData/META-INF/context.xml, it doesn't seem to take effect,
even when I stop and restart Tomcat.

Is there something I'm missing here?  Or is it a bug which will be
fixed in a later release.

Dave






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



Re: Context path changes in context.xml not working

2005-10-05 Thread Mark Eggers
Did you try it in:

$CATALINA_HOME/conf/engine-name/hostname/appname.xml?

/mde/

--- David Kerber [EMAIL PROTECTED] wrote:

 Nobody has any suggestions about setting up a
 2-level context path 
 *without* putting it in the server.xml (it works
 fine in there)?
 
 Dave




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: Context path changes in context.xml not working

2005-10-05 Thread Caldarale, Charles R
 From: David Kerber [EMAIL PROTECTED]
 Subject: Re: Context path changes in context.xml not working

 Nobody has any suggestions about setting up a 2-level context path 
 *without* putting it in the server.xml (it works fine in there)?

I thought I remembered something about this, and went googling for the
issue.  Take a look at:
http://marc.theaimsgroup.com/?l=tomcat-userm=110989168604231w=2

If you put your Context fragment in
   conf/[enginename]/[hostname]/dir1#dir2#appname.xml
you can access the webapp via http://[hostname]/dir1/dir2/appname, which
I think is what you want.  Haven't been able to find this in the Tomcat
doc yet, but I did test it successfully on 5.5.9.  Have no idea if this
trick with the # would work on the name of a .war file.

 - Chuck


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

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



setting the context path in tomcat5.5.9?

2005-10-04 Thread Mbah Tenjoh-Okwen
hello

i would like to know how to set the context path in
tomcat5.5.9 hi

 I  also read something and a build.properties file
and i dont know how to do this too.

please i need help on this cause i cant see my
application file when i give in the uri
http://localhost:8080/myApp






___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

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



RE: setting the context path in tomcat5.5.9?

2005-10-04 Thread Trung Nguyen
To add the context path, you need to edit the $TOMCAT_HOME/conf/server.xml file 
and these lines:

Host name=www.yourdomainname.com debug=0 unpackWARs=true
Context path=/myApp docBase=/where/you/store/your/apps debug=0 
reloadable=true crossContext=true /
/Host

Hope this help...

---Trung


-Original Message-
From: Mbah Tenjoh-Okwen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 04, 2005 4:13 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: setting the context path in tomcat5.5.9?


hello

i would like to know how to set the context path in
tomcat5.5.9 hi

 I  also read something and a build.properties file
and i dont know how to do this too.

please i need help on this cause i cant see my
application file when i give in the uri
http://localhost:8080/myApp






___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

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


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



RE: setting the context path in tomcat5.5.9?

2005-10-04 Thread Caldarale, Charles R
 From: Trung Nguyen [mailto:[EMAIL PROTECTED] 
 Subject: RE: setting the context path in tomcat5.5.9?
 
 To add the context path, you need to edit the 
 $TOMCAT_HOME/conf/server.xml file and these lines:

This completely ignores the admonition in the Tomcat doc:
Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended
to place Context elements directly in the server.xml file.

I'd suggest that a careful reading of:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
is in order.

 - Chuck


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

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



RE: setting the context path in tomcat5.5.9?

2005-10-04 Thread Stephen Faustino
In an issue related to this and the documentation cited below, my attempts
to create a Context in the 
META-INF/context.xml were not successful, that is, I could create the
context.xml file but the attributes did not seem to take affect. I could set
them in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory and it
would work.
As an example, if I defined the attributes antiJARLocking=true and
antiResourceLocking=true in the application's META-INF/context.xml file, I
would still have jar and resource locking issues. When I defined the same
attributes in the $CATALINA_HOME/conf/[enginename]/[hostname] directory, jar
and resource locking was not an issue.


Stephen L. Faustino
Senior Software Engineer

SecureLogix Corporation
13750 San Pedro, Suite 230
San Antonio, TX 78232
Direct/Vmail (210) 402-9669 x949
http://www.securelogix.com

SECURELOGIX CORPORATION EMAIL NOTICE - This transmission may be strictly
confidential. If you are not the intended recipient of this message, you may
not disclose, print, copy, or disseminate this information. If you have
received this in error, please reply and notify the sender (only) and delete
the message. Unauthorized interception of this e-mail is a violation of
federal criminal law. This communication does not reflect an intention by
the sender or the sender's principal to conduct a transaction or make any
agreement by electronic means. Nothing contained in this message or in any
attachment shall satisfy the requirements for a writing, and nothing
contained herein shall constitute a contract or electronic signature under
the Electronic Signatures in Global and National Commerce Act, any version
of the Uniform Electronic Transactions Act, or any other statute governing
electronic transactions.


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 04, 2005 9:33 AM
To: Tomcat Users List
Subject: RE: setting the context path in tomcat5.5.9?


 From: Trung Nguyen [mailto:[EMAIL PROTECTED] 
 Subject: RE: setting the context path in tomcat5.5.9?
 
 To add the context path, you need to edit the 
 $TOMCAT_HOME/conf/server.xml file and these lines:

This completely ignores the admonition in the Tomcat doc:
Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended
to place Context elements directly in the server.xml file.

I'd suggest that a careful reading of:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
is in order.

 - Chuck


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

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


RE: setting the context path in tomcat5.5.9?

2005-10-04 Thread Caldarale, Charles R
 From: Stephen Faustino [mailto:[EMAIL PROTECTED] 
 Subject: RE: setting the context path in tomcat5.5.9?
 
 my attempts to create a Context in the META-INF/context.xml
 were not successful, that is, I could create the context.xml
 file but the attributes did not seem to take affect. I could
 set them in the $CATALINA_HOME/conf/[enginename]/[hostname]/ 
 directory and it would work.

(This is really a different topic; a new thread would be more
appropriate.)

The conf/[enginename]/[hostname]/[appname].xml overrides
META-INF/context.xml, so make sure to remove the former before trying
the latter.  Also, check the tag spelling in your context.xml file
carefully; numerous people have been caught out by using context
instead of Context, for example.  If that checks out try posting your
META-INF/context.xml file for people to look at.

 - Chuck


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

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



Tomcat sample initial context for jboss

2005-10-04 Thread Lee Morgan
Does anyone have a sample initial context setup that works with jboss
external?  Do I need to create a resource for the context that will be
performing the JNDI lookup in the conf/server.xml file?  I have read
all
the docs and scoured the net but cannot find a solution.


*Disclaimer
This e-mail and any attachments may contain confidential and/or 
privileged material; it  is for the intended addressee(s) only.  If 
you are not a named addressee, you must not use, retain or disclose 
such information.
 
Serco cannot guarantee that the e-mail or any attachments are free 
from viruses.
 
The views expressed in this e-mail are those of the originator and do 
not necessarily represent the views of Serco.
 
Nothing in this e-mail shall bind Serco in any contract or obligation.
 
Serco Group plc.  Registered in England and Wales.  No: 2048608
Registered Office:  Serco House, 16 Bartley Wood Business Park, 
Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom.
*End Disclaimer


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



Re: setting the context path in tomcat5.5.9?

2005-10-04 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a 
new topic) please do not reply to an existing message and change the 
subject line. To many of the list archiving services and mail clients 
used by list subscribers this  makes your new message appear as part 
of the old thread. This makes it harder for other users to find 
relevant information when searching the lists.


This is known as thread hijacking and is behaviour that is frowned 
upon on this list. Frequent offenders will be removed from the list. 
It should also be noted that many list subscribers automatically 
ignore any messages that hijack another thread.


The correct procedure is to create a new message with a new subject. 
This will start a new thread.


Mark
tomcat-user-owner


Mbah Tenjoh-Okwen wrote:

hello

i would like to know how to set the context path in
tomcat5.5.9 hi

 I  also read something and a build.properties file
and i dont know how to do this too.

please i need help on this cause i cant see my
application file when i give in the uri
http://localhost:8080/myApp






___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com


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








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



Multi-level context paths possible in TC 5.5.9?

2005-09-30 Thread David Kerber
I am trying to migrate a webapp from SilverStream 3.7.5 to Tomcat, while 
keeping the same URL for my users.  Right now, they hit it at 
www.myserver.com:port/level1/level2/Login.jsp, where level1 is a 
database name, and level2 is a name we assigned.


The .war that provides the content is called SiteData.war, so when I 
deploy it to tomcat, it shows up at context path /SiteData.  I would 
love it if Tomcat could present the same stuff at the /level1/level2 
path.  If I have to deploy it as individual files instead of in a .war 
file, that's ok to, as would be other mods to path names, etc.  If 
someone could just give me some hints, I'd be very grateful.


BTW, I spent several hours googling and searching newsgroups, and found 
nothing showing multi-level context paths, so I don't even know for sure 
if it's possible.


Thanks!

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



RE: Multi-level context paths possible in TC 5.5.9?

2005-09-30 Thread Trung Nguyen
David,

You can do this by modify the server.xml file from $TOMAT_HOME/conf/ directory:

Host name=www.myserver.com debug=0 unpackWARs=true
Context path=/level1/level2 docBase=/usr/var/apps/SiteData 
debug=0 reloadable=true crossContext=true /
/Host

Where docBase is where you store your app. (SiteData)

Hope this help

---Trung


-Original Message-
From: David Kerber [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 1:47 PM
To: Tomcat Users List
Subject: Multi-level context paths possible in TC 5.5.9?


I am trying to migrate a webapp from SilverStream 3.7.5 to Tomcat, while 
keeping the same URL for my users.  Right now, they hit it at 
www.myserver.com:port/level1/level2/Login.jsp, where level1 is a 
database name, and level2 is a name we assigned.

The .war that provides the content is called SiteData.war, so when I 
deploy it to tomcat, it shows up at context path /SiteData.  I would 
love it if Tomcat could present the same stuff at the /level1/level2 
path.  If I have to deploy it as individual files instead of in a .war 
file, that's ok to, as would be other mods to path names, etc.  If 
someone could just give me some hints, I'd be very grateful.

BTW, I spent several hours googling and searching newsgroups, and found 
nothing showing multi-level context paths, so I don't even know for sure 
if it's possible.

Thanks!

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


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



Re: Multi-level context paths possible in TC 5.5.9?

2005-09-30 Thread David Kerber
Awesome!!!  Worked first time.  I had tried messing with context 
paths in an application .xml, but never thought to try the server.xml.


One question:  what does the crossContext flag do?  Or is that what 
lets it look to a different path for the context path?  The help files I 
looked through don't list it...


Thanks a bunch!!


Trung Nguyen wrote:

David,

You can do this by modify the server.xml file from $TOMAT_HOME/conf/ directory:

Host name=www.myserver.com debug=0 unpackWARs=true
Context path=/level1/level2 docBase=/usr/var/apps/SiteData debug=0 
reloadable=true crossContext=true /
/Host

Where docBase is where you store your app. (SiteData)

Hope this help

---Trung


-Original Message-
From: David Kerber [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 1:47 PM
To: Tomcat Users List
Subject: Multi-level context paths possible in TC 5.5.9?


I am trying to migrate a webapp from SilverStream 3.7.5 to Tomcat, while 
keeping the same URL for my users.  Right now, they hit it at 
www.myserver.com:port/level1/level2/Login.jsp, where level1 is a 
database name, and level2 is a name we assigned.


The .war that provides the content is called SiteData.war, so when I 
deploy it to tomcat, it shows up at context path /SiteData.  I would 
love it if Tomcat could present the same stuff at the /level1/level2 
path.  If I have to deploy it as individual files instead of in a .war 
file, that's ok to, as would be other mods to path names, etc.  If 
someone could just give me some hints, I'd be very grateful.


BTW, I spent several hours googling and searching newsgroups, and found 
nothing showing multi-level context paths, so I don't even know for sure 
if it's possible.


Thanks!

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


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





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



RE: Multi-level context paths possible in TC 5.5.9?

2005-09-30 Thread Trung Nguyen
David,

Set crossContext to true if you want calls within this application to 
ServletContext.getContext() to successfully return a request dispatcher for 
other web applications running on this virtual host. Set to false (the default) 
in security conscious environments, to make getContext() always return null.

Hope this help.

---Trung


-Original Message-
From: David Kerber [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 2:47 PM
To: Tomcat Users List
Subject: Re: Multi-level context paths possible in TC 5.5.9?


Awesome!!!  Worked first time.  I had tried messing with context 
paths in an application .xml, but never thought to try the server.xml.

One question:  what does the crossContext flag do?  Or is that what 
lets it look to a different path for the context path?  The help files I 
looked through don't list it...

Thanks a bunch!!


Trung Nguyen wrote:
 David,
 
 You can do this by modify the server.xml file from $TOMAT_HOME/conf/ 
 directory:
 
 Host name=www.myserver.com debug=0 unpackWARs=true
   Context path=/level1/level2 docBase=/usr/var/apps/SiteData 
 debug=0 reloadable=true crossContext=true /
 /Host
 
 Where docBase is where you store your app. (SiteData)
 
 Hope this help
 
 ---Trung
 
 
 -Original Message-
 From: David Kerber [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 30, 2005 1:47 PM
 To: Tomcat Users List
 Subject: Multi-level context paths possible in TC 5.5.9?
 
 
 I am trying to migrate a webapp from SilverStream 3.7.5 to Tomcat, while 
 keeping the same URL for my users.  Right now, they hit it at 
 www.myserver.com:port/level1/level2/Login.jsp, where level1 is a 
 database name, and level2 is a name we assigned.
 
 The .war that provides the content is called SiteData.war, so when I 
 deploy it to tomcat, it shows up at context path /SiteData.  I would 
 love it if Tomcat could present the same stuff at the /level1/level2 
 path.  If I have to deploy it as individual files instead of in a .war 
 file, that's ok to, as would be other mods to path names, etc.  If 
 someone could just give me some hints, I'd be very grateful.
 
 BTW, I spent several hours googling and searching newsgroups, and found 
 nothing showing multi-level context paths, so I don't even know for sure 
 if it's possible.
 
 Thanks!
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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


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



Re: Multi-level context paths possible in TC 5.5.9?

2005-09-30 Thread David Kerber

It does help; thanks for the explanation.

Dave


Trung Nguyen wrote:

David,

Set crossContext to true if you want calls within this application to 
ServletContext.getContext() to successfully return a request dispatcher for other web 
applications running on this virtual host. Set to false (the default) in security 
conscious environments, to make getContext() always return null.

Hope this help.

---Trung


-Original Message-
From: David Kerber [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 2:47 PM
To: Tomcat Users List
Subject: Re: Multi-level context paths possible in TC 5.5.9?


Awesome!!!  Worked first time.  I had tried messing with context 
paths in an application .xml, but never thought to try the server.xml.


One question:  what does the crossContext flag do?  Or is that what 
lets it look to a different path for the context path?  The help files I 
looked through don't list it...


Thanks a bunch!!


Trung Nguyen wrote:


David,

You can do this by modify the server.xml file from $TOMAT_HOME/conf/ directory:

Host name=www.myserver.com debug=0 unpackWARs=true
Context path=/level1/level2 docBase=/usr/var/apps/SiteData debug=0 
reloadable=true crossContext=true /
/Host

Where docBase is where you store your app. (SiteData)

Hope this help

---Trung


-Original Message-
From: David Kerber [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 1:47 PM
To: Tomcat Users List
Subject: Multi-level context paths possible in TC 5.5.9?


I am trying to migrate a webapp from SilverStream 3.7.5 to Tomcat, while 
keeping the same URL for my users.  Right now, they hit it at 
www.myserver.com:port/level1/level2/Login.jsp, where level1 is a 
database name, and level2 is a name we assigned.


The .war that provides the content is called SiteData.war, so when I 
deploy it to tomcat, it shows up at context path /SiteData.  I would 
love it if Tomcat could present the same stuff at the /level1/level2 
path.  If I have to deploy it as individual files instead of in a .war 
file, that's ok to, as would be other mods to path names, etc.  If 
someone could just give me some hints, I'd be very grateful.


BTW, I spent several hours googling and searching newsgroups, and found 
nothing showing multi-level context paths, so I don't even know for sure 
if it's possible.


Thanks!



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



Re: Why doesn't my context work?

2005-09-29 Thread Mark Eggers
--- Michael Sullivan [EMAIL PROTECTED] wrote:

[ lots of stuff snipped ]

OK, I finally got around to putting this together on
my Limux (Fedora Core 4) box.

My environment:
2.6.12-1.1456_FC4 running on a Dell 8200 with 768 MB
java 1.5.0_04-b05
apache 2.0.54
mod_jk 1.2.14.1
tomcat 5.5.9

My configurations:

#
# httpd.conf stuff
#
LoadModulejk_module modules/mod_jk.so

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevelwarn
JkLogStampFormat  [%a %b %d %H:%M:%S %Y] 
JkShmFile logs/shm-file

LoadModule userdir_module modules/mod_userdir.so
IfModule mod_userdir.c
UserDir enable username
/IfModule

Directory /home/*/webspace
  AllowOverride FileInfo AuthConfig Limit
  Options MultiViews Indexes SymLinksIfOwnerMatch
IncludesNoExec
Limit GET POST OPTIONS
Order allow,deny
Allow from all
/Limit
LimitExcept GET POST OPTIONS
Order deny,allow
Deny from all
/LimitExcept
/Directory

#
# Adding JkMounts for UserDir
#
JkMount /~*/*.jsp local
JkMount /~*/*/*.jsp   local
JkMount /~*/servlet/* local
JkMount /~*/*.do  local

#
# workers.properties stuff - mostly default for now
#
worker.list=local

#
# one to serve the applications
#
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009

#
# server.xml stuff in Tomcat under Host/Host
#
!-- adding listener to test local host directories
--
Listener 
  className=org.apache.catalina.startup.UserConfig
  directoryName=webspace
  userClass=
 org.apache.catalina.startup.PasswdUserDatabase/

NOTES
=
httpd.conf
--
1. Add the appropriate user names in the line:

UserDir enable username

This is a space-separated list of user names. 
Otherwise you can just have:

UserDir enabled

to get them all.

2. Excuse the wrapping in the Options line under the
Directory directive.

workers.properties
--
This is just a bare bones one.  There are lots of
options to explore.

server.xml
--
This is the listener that will add the same directory
to Tomcat that was added to Apache with the userdir
module.

RESULTS
===
You will get a single web application under
/~username.  If you look at Tomcat's manager
application, you will see a /~username application.

I ran the first application from the Head First
Servlets  JSP book (my standard is it working
application) and this setup worked.

One thing to note.  I did not get Tomcat to explode a
war file in /~username.  I had to explode the war
manually in ~username/webspace.

I didn't see a way of adding multiple user
applications by using this listener.  I just did a
quick scan of the UserConfig javadoc.  My guess is
that if you want multiple web applications per user
you will have to set up a virtual host for each user.

Just some thoughts.

HTH

/mde/




__ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


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



mangae more than one context in META-INF/context.xml

2005-09-27 Thread [EMAIL PROTECTED]
Anyone knows how mangae more than one context in META-INF/context.xml?



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



setting more than one context in META-INF/context.xml

2005-09-27 Thread [EMAIL PROTECTED]
Hi all
I'd like to set more than one context in META-INF/context.xml
Any idea?
Is it usefulle creating another context.xml in METa-INF and how to configure 
it??
please help
Regards


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



Re: Why doesn't my context work?

2005-09-26 Thread Mark Eggers
--- Michael Sullivan [EMAIL PROTECTED] wrote:
 
 Right now I use symlinks
 to my individual
 users' website directories, but now that I've
 discovered Alias I'll
 probably switch completely to using Aliases.

Good.  
 I
 created a test Alias
 point to the ~/webspace/webapps directory in my
 personal account, but I
 can't seem to JkMount it, and I can't figure out
 why.  Here is the
 mod_jk portion of my httpd.conf file:
 
 #mod_jk stuff
 
 LoadModule jk_module
 modules/mod_jk.so
 
 JkMount /*.jsp wrkr

I think your JSP JkMount line will only get
hostname/*.jsp.  It won't match hostname/*/*.jsp. 
I think you'll need another line in there that says:

JkMount /*/*.jsp wrkr

 JkMount /servlet/* wrkr

You will probably have the same issue with the servlet
matching.  Try this instead:

JkMount /*/servlet/* wrkr

Good idea here.

 # Deny direct access to WEB-INF
 LocationMatch .*WEB-INF.*
AllowOverride None
deny from all
 /LocationMatch

Good start.

 Alias /michael /home/michael/webspace/webapps

I would probably change some of the Directory
directives.  Since this lives outside your normal
DocumentRoot, this Directory is not going to inherit
the permissions you gave to DocumentRoot.

Something like the following might work better:

Directory /home/michael/webspace/webapps
  Options Indexes
  Allow Override None
  Order allow,deny
  Allow from all
/Directory

 Directory /home/michael/webspace/webapps
 Options FollowSymLinks
 AllowOverride None
 /Directory

I tend to put the Directory and Aliases before the
JkMount statement, if I do that, then I can do the
following:

Alias /michael /home/michael/webspace/webapps
Directory /home/michael/webspace/webapps
  Options Indexes
  Allow Override None
  Order allow,deny
  Allow from all
/Directory

JkMount /michael/*.jsp wrkr
JkMount /michael/*/*.jsp wrkr
JkMount /michael/*/servlet/* wrkr

Finally, make sure the user Tomcat is running as has
read access to everything in
/home/michael/webspace/webapps.

If there are a lot of applications, you can group all
the Directory directives, followed by all the Alias
directives, followed by all the JkMount statements.

Another way to organize your httpd.conf file is by
application.  In other words, for each application:

Directory
  # directory directives
/Directory
Alias /desired_mapping /directory_napping
JkMount /desired_mapping/*.jsp tomcat-worker
JkMount /desired_mapping/servlet/* tomcat-worker

I'm away from my system right now, but I think either
of these methods should work fine.

The ugly thing about doing it this way is that every
time you add a new user, you'll have to update Apache,
which means you'll have to stop and start the server.

If you could get the user directory idea to work, then
everything would just happen.

HTH

/mde/

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

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



Re: Why doesn't my context work?

2005-09-26 Thread Michael Sullivan
On Sun, 2005-09-25 at 23:21 -0700, Mark Eggers wrote:
 --- Michael Sullivan [EMAIL PROTECTED] wrote:
  
  Right now I use symlinks
  to my individual
  users' website directories, but now that I've
  discovered Alias I'll
  probably switch completely to using Aliases.
 
 Good.  
  I
  created a test Alias
  point to the ~/webspace/webapps directory in my
  personal account, but I
  can't seem to JkMount it, and I can't figure out
  why.  Here is the
  mod_jk portion of my httpd.conf file:
  
  #mod_jk stuff
  
  LoadModule jk_module
  modules/mod_jk.so
  
  JkMount /*.jsp wrkr
 
 I think your JSP JkMount line will only get
 hostname/*.jsp.  It won't match hostname/*/*.jsp. 
 I think you'll need another line in there that says:
 
 JkMount /*/*.jsp wrkr
 
  JkMount /servlet/* wrkr
 
 You will probably have the same issue with the servlet
 matching.  Try this instead:
 
 JkMount /*/servlet/* wrkr
 
 Good idea here.
 
  # Deny direct access to WEB-INF
  LocationMatch .*WEB-INF.*
 AllowOverride None
 deny from all
  /LocationMatch
 
 Good start.
 
  Alias /michael /home/michael/webspace/webapps
 
 I would probably change some of the Directory
 directives.  Since this lives outside your normal
 DocumentRoot, this Directory is not going to inherit
 the permissions you gave to DocumentRoot.
 
 Something like the following might work better:
 
 Directory /home/michael/webspace/webapps
   Options Indexes
   Allow Override None
   Order allow,deny
   Allow from all
 /Directory
 
  Directory /home/michael/webspace/webapps
  Options FollowSymLinks
  AllowOverride None
  /Directory
 
 I tend to put the Directory and Aliases before the
 JkMount statement, if I do that, then I can do the
 following:
 
 Alias /michael /home/michael/webspace/webapps
 Directory /home/michael/webspace/webapps
   Options Indexes
   Allow Override None
   Order allow,deny
   Allow from all
 /Directory
 
 JkMount /michael/*.jsp wrkr
 JkMount /michael/*/*.jsp wrkr
 JkMount /michael/*/servlet/* wrkr
 
 Finally, make sure the user Tomcat is running as has
 read access to everything in
 /home/michael/webspace/webapps.
 
 If there are a lot of applications, you can group all
 the Directory directives, followed by all the Alias
 directives, followed by all the JkMount statements.
 
 Another way to organize your httpd.conf file is by
 application.  In other words, for each application:
 
 Directory
   # directory directives
 /Directory
 Alias /desired_mapping /directory_napping
 JkMount /desired_mapping/*.jsp tomcat-worker
 JkMount /desired_mapping/servlet/* tomcat-worker
 
 I'm away from my system right now, but I think either
 of these methods should work fine.
 
 The ugly thing about doing it this way is that every
 time you add a new user, you'll have to update Apache,
 which means you'll have to stop and start the server.
 
 If you could get the user directory idea to work, then
 everything would just happen.
 
 HTH
 
 /mde/


Here is my updated mod_jk section in /etc/apache2/httpd.conf:

#mod_jk stuff

LoadModule jk_module modules/mod_jk.so

JkMount /*.jsp wrkr
JkMount /*/*.jsp wrkr
JkMount /servlet/* wrkr
JkMount /*/servlet/* wrkr
# Deny direct access to WEB-INF
LocationMatch .*WEB-INF.*
   AllowOverride None
   deny from all
/LocationMatch
Alias /michael /home/michael/webspace/webapps
Directory /home/michael/webspace/webapps
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
/Directory

JkMount /michael/*.jsp wrkr
JkMount /michael/*/*.jsp wrkr
JkMount /michael/*/servlet/* wrkr


It still doesn't work.  Everything in the directory tree from /home
to /home/michael/webspace/webapps/colors.jsp is all readable/executable.
I don't know why this isn't working.  www.espersunited.com/index.jsp
still works though, but www.espersunited.com/michael/colors.jsp gives me
Tomcat 404.


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



Re: Why doesn't my context work?

2005-09-25 Thread Michael Sullivan
On Fri, 2005-09-16 at 19:31 -0700, Mark Eggers wrote:
 
 --- Michael Sullivan [EMAIL PROTECTED] wrote:
 
  OK.  For clarification I am running
  tomcat-5.0.27-r6.  I want user's
  tomcat files to be read from
  /home/*/webspace/webapps.  My personal
  account is michael so my personal tomcat directory 
  would
  be /home/michael/webspace/webapps .  Just for the
  sake of arguments I
  created a directory called user under
  /home/michael/webspace/webapps and
  moved my jsp files into it.
  My /opt/tomcat5/conf/Catalina/localhost/user.xml
  file looks like this
  now:
  
  Context
  docBase=/home/michael/webspace/webapps/user
  debug=0 privileged=true
  /Context
 
 You don't need privledged=true, so let's remove
 that.
 
  I restarted Tomcat.  I am using mod_jk and when I go
  to
  www.espersunited.com/index.jsp I see the Tomcat
  start page.  However,
 
 Good, you're using mod_jk.  You will need to do some
 Apache configuration in order for this to work.
 
 I am going to assume that /home/* lies outside of the
 DocumentRoot directory tree.
 
 1. Get Apache to recognize web directories outside of
 the DocumentRoot tree.  There are several ways of
 doing this.  One such way is given in the actuall
 httpd.conf file that comes with the stock Apache.
 
 Basically you need to give a set of Directory
 directives that give Apache access to the material in
 the home directories.
 
 If you use the userdir_module in Apache, then
 ~username/directory will become a part of the web
 space (if you take the comments out).
 
 If you do this by hand, you'll need to give both
 Directory directives and an Alias directive to move it
 into the web space that Apache serves.
 
 2. Once you do that, you'll need to add JkMount
 statements as well.  I suspect that JkMount statements
 will respond to Alias directives since JkMount deals
 with web space and not directories.
 
 I don't know if JkMount interacts with the
 userdir_module.  In other words, I don't know what
 will happen if you put in a JkMount statment that
 reads:
 
 JkMount /~*/*.jsp tomcat
 
 It would be interesting to find out if that would end
 up mapping to /~username/directory/*.jsp where
 username is the user name and directory is the
 value of UserDir.
 
 3. Once you do that, it's always nice to make a small
 WEB-INF/web.xml, even for plain jsp pages.  Something
 like the following should work:
 
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE web-app PUBLIC
 -//Sun Microsystems, Inc.//DTD Web Application
 2.3//EN
  http://java.sun.com/dtd/web-app_2_3.dtd;
 web-app
 display-nameBeginning JSP/display-name
 descriptionContainer for quick
 jsptests/description
 welcome-file-list
   welcome-fileindex.jsp/welcome-file
 /welcome-file-list
 /webapp
 
 Sorry for the wrapping.
 
 In short, you need to do the following three steps.
 
 1. Make sure your Apache server knows about
 directories outside of DocumentRoot.  Use Directory
 and Alias directives or userdir_module.
 
 2. Use JkMount to map the expected incoming URLs to
 the Tomcat server.  Experiment to see if JkMount picks
 up on the substitutions done by userdir_module.
 
 3. Make a small WEB-INF/web.xml with the appropriate
 structure.  Creating a proper web application is
 useful, especially once you start adding servlets to
 the mix.
 
 /mde/
 


I've been wrestling the past week with the hassles of upgrading to
Apache-2.0.54-r31 on my Gentoo system.  I think I've finally got
everything working the way it's supposed to except mod_jk for my user
directories.  I tried to do the userdir thing you suggested, but I
couldn't get it to work.  Right now I use symlinks to my individual
users' website directories, but now that I've discovered Alias I'll
probably switch completely to using Aliases.  I created a test Alias
point to the ~/webspace/webapps directory in my personal account, but I
can't seem to JkMount it, and I can't figure out why.  Here is the
mod_jk portion of my httpd.conf file:

#mod_jk stuff

LoadModule jk_module modules/mod_jk.so

JkMount /*.jsp wrkr
JkMount /servlet/* wrkr
# Deny direct access to WEB-INF
LocationMatch .*WEB-INF.*
   AllowOverride None
   deny from all
/LocationMatch
Alias /michael /home/michael/webspace/webapps
Directory /home/michael/webspace/webapps
Options FollowSymLinks
AllowOverride None
/Directory

I don't know if I need that LocationMatch stuff - It was part of a
VirtualHost block that seemed to be unecessary, so I took it out.  I
tried putting my JkMount statements inside the Directory block, but
when I tried to restart Apache it gave me the following error:

JkMount can not have a path when defined in a location

In /home/michael/webspace/webapps there is a file called colors.jsp.
When I navigate my browser to www.espersunited.com/michael/colors.jsp I
get the Tomcat 404 error, yet when I navigate to
www.espersunited.com/index.jsp I get the Tomcat start page.  What am I
doing wrong

Re: session tracking in a context that contains JSP and servlets

2005-09-22 Thread Leon Rosenberg
On 9/22/05, Mark [EMAIL PROTECTED] wrote:
 I would think that this is possible.  I have been writing servlets for
 over a year, but have not written a single line of JSP.

Technically speaking each JSP is actually a servlet... more or less.
Everything that works in the server works in the jsp too.

regards
Leon

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



session tracking in a context that contains JSP and servlets

2005-09-21 Thread Mark
I want to create a webapp that will contain both servlets and JSP.  I
will be using a login page to authenticate users.  I will probably use
one of the Tomcat supported authentication modules.

I am wondering if it is possible for tomcat to properly manage session
information when going between servlet and JSP pages.

Thank you.

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



Re: session tracking in a context that contains JSP and servlets

2005-09-21 Thread David Wall

Mark wrote:


I want to create a webapp that will contain both servlets and JSP.  I
will be using a login page to authenticate users.  I will probably use
one of the Tomcat supported authentication modules.

I am wondering if it is possible for tomcat to properly manage session
information when going between servlet and JSP pages.
 

Of course.  After all, every JSP is compiled into a servlet.  Naturally, 
if the browser supports session cookies, all is very easy, but if they 
block such cookies, then you'll need to use URL rewriting for every 
reference to an URL within your web app so that the session id can be 
transmitted back.  Use response.encodeURL() and 
response.encodeRedirectURL() as necessary.


David

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



Re: session tracking in a context that contains JSP and servlets

2005-09-21 Thread Mark
I would think that this is possible.  I have been writing servlets for
over a year, but have not written a single line of JSP.

On 9/21/05, David Wall [EMAIL PROTECTED] wrote:
 Mark wrote:

 I want to create a webapp that will contain both servlets and JSP.  I
 will be using a login page to authenticate users.  I will probably use
 one of the Tomcat supported authentication modules.
 
 I am wondering if it is possible for tomcat to properly manage session
 information when going between servlet and JSP pages.
 
 
 Of course.  After all, every JSP is compiled into a servlet.  Naturally,
 if the browser supports session cookies, all is very easy, but if they
 block such cookies, then you'll need to use URL rewriting for every
 reference to an URL within your web app so that the session id can be
 transmitted back.  Use response.encodeURL() and
 response.encodeRedirectURL() as necessary.

 David

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



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



Unable to start context - Mail session not bound...

2005-09-20 Thread Darryl L. Pierce
I have a context which includes a mail session. However, when I startup 
Tomcat (version 5.0.28 on Windows XP) and it loads the context, I get an 
error message saying:


11:09:53,556 ERROR ContextLoader:177 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating 
bean with name 'mailSession' defined in ServletContext resource 
[/WEB-INF/classes/cares-batch-context.xml]: Initialization of bean 
failed; nested exception is javax.naming.NameNotFoundException: Name 
CARESMailSession

 is not bound in this Context
javax.naming.NameNotFoundException: Name CARESMailSession
 is not bound in this Context

However, the context file for this webapp does indeed define a resource 
named CARESMailSession:


Context displayName=CARES Batch docBase=cares-batch 
path=/cares-batch workDir=work\Catalina\localhost\cares-batch

  Resource name=CARESMailSession type=javax.mail.Session/
  ResourceParams name=CARESMailSession
parameter
  namemail.smtp.host/name
  valuemail.akc.org/value
/parameter
  /ResourceParams
/Context

and the Spring bean is using the proper name:

	bean id=mailSession 
class=org.springframework.jndi.JndiObjectFactoryBean

property name=jndiName
valuejava:comp/env/mail/CARESMailSession
/value
/property
/bean


Any help? This has had me down for two days now... :(
--
Darryl L. Pierce [EMAIL PROTECTED]
Homepage: http://mcpierce.multiply.com/
By doubting we come to inquiry, through inquiry truth. - Peter Abelard

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



How to get process URL in different context?

2005-09-19 Thread Kyle

Hi,

I need to get hold of and process an http-encoded URL (effectively an 
operational servlet) within a different context on the same machine and 
read back the response it provides.


e.g.

from the root Context within a doPost, I need to execute 
/abc/api/action.do?param1=123param2=abc and retrieve a String response


I have tried getServletContext().getContext() to get hold of the other 
context, but that appears to return null. I can only presume this is a 
security constraint setup somewhere. ... Or is there some simple 
programming trick I appear to be missing. Can someone point me in the 
right directon as to what to read to find out how to get tomcat to let 
me do this please?

--

Kind Regards

Kyle


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



Why doesn't my context work?

2005-09-16 Thread Michael Sullivan
I wrote in yesterday asking about how to map certain directories to
tomcat contexts.  When nobody answered me I did some Google research.  I
didn't find much that made sense to me.  I prefer man and info pages to
what I found.  Anyway, I created a file called home.xml
in /opt/tomcat5/conf/Catalina/localhost.  I made home.xml by copying
admin.xml and altering it.  Here are the contents of home.xml:

Context path=/user appBase=/home docBase=michael/webspace/webapps
debug=0 privileged=true
/Context


If I understand this correctly, when I ask for
www.espersunited.com/user/index.jsp, Tomcat should deliver to my browser
the contents of /home/michael/webspace/webapps/index.jsp.  I restarted
Tomcat and went to www.espersunited.com/user/index.jsp in my browser.  I
got a Tomcat 404 Resource Not Available error.  Why?  Do I not have the
syntax of my context tag right?  I would think that this would be a
pretty basic thing to do, but maybe not since no one has answered me.
What should I do?  I've looked over the Tomcat docs on the
jakarta.apache.org/tomcat website and as I said there are no man or info
pages...


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



Re: Why doesn't my context work?

2005-09-16 Thread Mark Eggers
 Here are the contents of
 home.xml:
 
 Context path=/user appBase=/home
 docBase=michael/webspace/webapps
 debug=0 privileged=true
 /Context

From the documentation for Tomcat 5.5.9 at
http://localhost:8080/tomcat-docs/config/context.html:

The Document Base (also known as the Context Root) 
directory for this web application, or the pathname
to the web application archive file (if this web
application is being executed directly from the WAR 
file). You may specify an absolute pathname for this 
directory or WAR file, or a pathname that is relative 
to the appBase directory of the owning Host.

If you've not changed server.xml, then the appBase is
$CATALINA_HOME/webapps.

Rather than using a combination of appBase and docBase

in your context file (and I don't think appBase is
appropriate in a context node - at least in 5.5.9),
you could use an absolute path for docBase:

/home/michael/webspace/webapps/user

This means that the following URL would potentially
work.

www.espersunited.com/user/index.jsp

The next issue is one of permissions.  If you're on a
UNIX machine, make sure that 

/home/michael/webspace/webapps/user

is readable by the owner of the process running
Tomcat.  Otherwise you'll not be able to serve the
files.

Finally, I notice that you're going directly at this
URL:

http://www.espersunited.com/user/index.jsp

Unless your Tomcat is configured to run on port 80,
you will be hitting any web server that is running,
and not your Tomcat server.  By default, Tomcat serves
http on port 8080.

In order to get Tomcat and Apache talking, you'll have
to do a lot more work.  This involves getting mod_jk
(or mod_proxy) built and installed, configuring Apache
httpd.conf, workers.properties, and possibly
server.xml (although the default server.xml already
has the ajp 1.3 connector configured).

I hope that starts you down a more productive path.

/mde/

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

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



Re: Why doesn't my context work?

2005-09-16 Thread Hassan Schroeder

Michael Sullivan wrote:


what I found.  Anyway, I created a file called home.xml
in /opt/tomcat5/conf/Catalina/localhost.  I made home.xml by copying
admin.xml and altering it.  Here are the contents of home.xml:

Context path=/user appBase=/home docBase=michael/webspace/webapps
debug=0 privileged=true
/Context


Per the Tomcat doc that's been quoted here half-a-dozen times in the
last couple of days, or so it seems :-) --

*take the path attribute out* because Tomcat *doesn't use it* unless
the Context is defined inside server.xml.

Either call the file user.xml or change your request to
  http://www.espersunited.com/home/index.jsp

And, as has already been pointed out, 'appBase' is not a valid
attribute of Context.

HTH,
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



Re: Why doesn't my context work?

2005-09-16 Thread Michael Sullivan
 From the documentation for Tomcat 5.5.9 at
 http://localhost:8080/tomcat-docs/config/context.html:
 
 The Document Base (also known as the Context Root) 
 directory for this web application, or the pathname
 to the web application archive file (if this web
 application is being executed directly from the WAR 
 file). You may specify an absolute pathname for this 
 directory or WAR file, or a pathname that is relative 
 to the appBase directory of the owning Host.
 
 If you've not changed server.xml, then the appBase is
 $CATALINA_HOME/webapps.
 
 Rather than using a combination of appBase and docBase
 
 in your context file (and I don't think appBase is
 appropriate in a context node - at least in 5.5.9),
 you could use an absolute path for docBase:
 
 /home/michael/webspace/webapps/user
 
 This means that the following URL would potentially
 work.
 
 www.espersunited.com/user/index.jsp
 
 The next issue is one of permissions.  If you're on a
 UNIX machine, make sure that 
 
 /home/michael/webspace/webapps/user
 
 is readable by the owner of the process running
 Tomcat.  Otherwise you'll not be able to serve the
 files.
 
 Finally, I notice that you're going directly at this
 URL:
 
 http://www.espersunited.com/user/index.jsp
 
 Unless your Tomcat is configured to run on port 80,
 you will be hitting any web server that is running,
 and not your Tomcat server.  By default, Tomcat serves
 http on port 8080.
 
 In order to get Tomcat and Apache talking, you'll have
 to do a lot more work.  This involves getting mod_jk
 (or mod_proxy) built and installed, configuring Apache
 httpd.conf, workers.properties, and possibly
 server.xml (although the default server.xml already
 has the ajp 1.3 connector configured).
 
 I hope that starts you down a more productive path.
 
 /mde/
 
 __

OK.  For clarification I am running tomcat-5.0.27-r6.  I want user's
tomcat files to be read from /home/*/webspace/webapps.  My personal
account is michael so my personal tomcat directory  would
be /home/michael/webspace/webapps .  Just for the sake of arguments I
created a directory called user under /home/michael/webspace/webapps and
moved my jsp files into it.
My /opt/tomcat5/conf/Catalina/localhost/user.xml file looks like this
now:

Context docBase=/home/michael/webspace/webapps/user
debug=0 privileged=true
/Context


I restarted Tomcat.  I am using mod_jk and when I go to
www.espersunited.com/index.jsp I see the Tomcat start page.  However,
when I go to www.espersunited.com/user/index.jsp I get Tomcat 404
Resource Not Available for /user/index.jsp .  You reprinted the
paragraph from the Tomcat documentation and it made the same amount of
sense to me as it did when I read it in the Tomcat docs:  Basically
none.  I've taken the path and appBase attributes out of the my Context
tag as you see above.  The entire tree from /home/michael/webapps to the
files in /home/michael/webapps/user have been set chmod 755 (owner all,
group and others read/execute), and it still doesn't work.  Any other
ideas?  I haven't changed /opt/tomcat5/conf/server.xml at all...


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



Re: Why doesn't my context work?

2005-09-16 Thread Mark Eggers


--- Michael Sullivan [EMAIL PROTECTED] wrote:

 OK.  For clarification I am running
 tomcat-5.0.27-r6.  I want user's
 tomcat files to be read from
 /home/*/webspace/webapps.  My personal
 account is michael so my personal tomcat directory 
 would
 be /home/michael/webspace/webapps .  Just for the
 sake of arguments I
 created a directory called user under
 /home/michael/webspace/webapps and
 moved my jsp files into it.
 My /opt/tomcat5/conf/Catalina/localhost/user.xml
 file looks like this
 now:
 
 Context
 docBase=/home/michael/webspace/webapps/user
 debug=0 privileged=true
 /Context

You don't need privledged=true, so let's remove
that.

 I restarted Tomcat.  I am using mod_jk and when I go
 to
 www.espersunited.com/index.jsp I see the Tomcat
 start page.  However,

Good, you're using mod_jk.  You will need to do some
Apache configuration in order for this to work.

I am going to assume that /home/* lies outside of the
DocumentRoot directory tree.

1. Get Apache to recognize web directories outside of
the DocumentRoot tree.  There are several ways of
doing this.  One such way is given in the actuall
httpd.conf file that comes with the stock Apache.

Basically you need to give a set of Directory
directives that give Apache access to the material in
the home directories.

If you use the userdir_module in Apache, then
~username/directory will become a part of the web
space (if you take the comments out).

If you do this by hand, you'll need to give both
Directory directives and an Alias directive to move it
into the web space that Apache serves.

2. Once you do that, you'll need to add JkMount
statements as well.  I suspect that JkMount statements
will respond to Alias directives since JkMount deals
with web space and not directories.

I don't know if JkMount interacts with the
userdir_module.  In other words, I don't know what
will happen if you put in a JkMount statment that
reads:

JkMount /~*/*.jsp tomcat

It would be interesting to find out if that would end
up mapping to /~username/directory/*.jsp where
username is the user name and directory is the
value of UserDir.

3. Once you do that, it's always nice to make a small
WEB-INF/web.xml, even for plain jsp pages.  Something
like the following should work:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC
-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
display-nameBeginning JSP/display-name
descriptionContainer for quick
jsptests/description
welcome-file-list
  welcome-fileindex.jsp/welcome-file
/welcome-file-list
/webapp

Sorry for the wrapping.

In short, you need to do the following three steps.

1. Make sure your Apache server knows about
directories outside of DocumentRoot.  Use Directory
and Alias directives or userdir_module.

2. Use JkMount to map the expected incoming URLs to
the Tomcat server.  Experiment to see if JkMount picks
up on the substitutions done by userdir_module.

3. Make a small WEB-INF/web.xml with the appropriate
structure.  Creating a proper web application is
useful, especially once you start adding servlets to
the mix.

/mde/

 when I go to www.espersunited.com/user/index.jsp I
 get Tomcat 404
 Resource Not Available for /user/index.jsp .  You
 reprinted the
 paragraph from the Tomcat documentation and it made
 the same amount of
 sense to me as it did when I read it in the Tomcat
 docs:  Basically
 none.

Hmm, let me see if I can give my explanation.

If you do not have a leading / in your appBase value,
then the containing Host's docBase value gets stuck
on in front.  In other words:

appBase-value/docBase-value

From the Host container documentation, if the
appBase value does not have a leading /, then it is
taken relative to $CATALINA_BASE.  The resulting path
to the application looks like:

$CATALINA_BASE/appBase-value/docBase-value

If you haven't defined $CATALINA_BASE, it defaults to
the same value as $CATALINA_HOME.  The resulting path
to the application the looks like:

$CATALINA_HOME/appBase-value/docBase-value

--

In combination with the userdir_module from Apache to
get the directories into Apache's web space, you might
also want to take a look at user web applications
section of the Host container document.  The section
is toward the end of:

http://localhost:8080/tomcat-docs/config/host.html

It looks like you could use the userdir_module,
appropriate JkMount directives, and the howto in the
Host container document to construct a pretty
flexible environment where every user could have a web
applications directory.

/mde/



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Deploying root context

2005-09-15 Thread Durfee, Bernard
Is there a way to use the Tomcat 5.5.9 manager to deploy a WAR file as
the root context? If not, how to I munge the deployed web application to
make it the root context?

Bernie


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



AW: cross context info

2005-09-14 Thread Bernhard Slominski
Hi Alain, 

First of all the session is ALWAYS on application scope, this is not an
Tomcat specific behaviour but a requirement of the Specification:
SRV.7.3 Session Scope
HttpSession objects must be scoped at the application (or servlet context)
level.
The underlying mechanism, such as the cookie used to establish the session,
can be
the same for different contexts, but the object referenced, including the
attributes in
that object, must never be shared between contexts by the container.

So there is no way around this, if the sessions were replicated across the
applications it would violate the specification.

When you enable crossConext for your application:
Context crossContext=true docBase=testapp path=/testapp
reloadable=true
/Context

you can get the context for another application:
ServletContext context2 = context.getContext(/testapp);

and set attributes:
context2.setAttribute(test,JSP is great!);

But you cannot get to the session in the other application.

So what you can do is implement the session swapping on your own (Cookies,
via the Database) or merge your applications into one.

Some links from the Sun Forums:
http://forum.java.sun.com/thread.jsp?forum=33thread=259394
http://forum.java.sun.com/thread.jsp?forum=45thread=492484
http://forum.java.sun.com/thread.jsp?forum=33thread=318569

Cheers Bernhard

 -Ursprüngliche Nachricht-
 Von: Alain Gaeremynck [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 14. September 2005 03:03
 An: Tomcat Users List
 Betreff: cross context info
 
 
 I have 2 webapps living on the same server and they are linked to the 
 same user experiance..  Now both apps require login but i 
 don't want my 
 users to have to login on both apps.  Also while they are browsing in 
 one context i don't want the session to expire for the other context. 
 
 so the question is  Is there a way to do session.setAtribute in one 
 context and retrieve it from another and also to link the 2 
 session so 
 that they don't expire or expire at the same time? 
 
 i'd like not to have to use hidden iframe and stuff like that
 
 thanks!
 
 -- 
 Alain Gaeremynck
 CTO Le Groupe Interstructure
 (514) 374-1110
 (514) 825-7810 cell
 weblog: http://www.sanssucre.ca
 (En informatique, comme en musique, n'importe quoi sauf du commercial)
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



Re: cross context info

2005-09-14 Thread Edmund Urbani

Alain Gaeremynck wrote:

I have 2 webapps living on the same server and they are linked to the 
same user experiance..  Now both apps require login but i don't want 
my users to have to login on both apps.  Also while they are browsing 
in one context i don't want the session to expire for the other context.
so the question is  Is there a way to do session.setAtribute in one 
context and retrieve it from another and also to link the 2 session so 
that they don't expire or expire at the same time?

i'd like not to have to use hidden iframe and stuff like that

thanks!

with tomcat there's also a different approach to this problem using the 
SSOValve (org.liland.tomcat.valve.sso.SingleSignOn). however, in order 
to use this valve, the webapps need to let tomcat handle the 
authentication (see 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/realm-howto.html or 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/realm-howto.html).
depending on your webapps this kind of setup may be anything from 
simply a matter of configuration to impossible.


Edmund


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



tomcat4 does not close database connections on reload context

2005-09-14 Thread armin walland
hi list!

this is my first post to this list :)
i have searched this list's archives but could not find a lot about that topic 
so i am posting it. i am not sure if this is really a tomcat issue; if it is 
not i hope someone may point me the right direction.


i develop JSP applications (tomcat4, java 1.4, postgres database7.4 with jdbc 
connectivity, the OS is linux 2.6.8, debian sarge) with CodeCharge Studio 
(yessoftware.com) which create a connection pool of, say 10 connections. when 
i upload a new version of an application to the server tomcat reloads the 
context correctly but it seems that open database connections continue to 
exist forever and are never closed. on initialisation the newly uploaded app 
creates new database connections so after so-many uploads i of course run 
into a max_connections_exceeded error from the database. the connections are 
closed only when i restart tomcat. who should take care of open db 
connections? my guess is that tomcat should do so when it reloads the 
context. is that assumption wrong? is there a way to make tomcat close idle 
db connections after some timeout?


-- 
best rgds, armin walland

focus media research
IT :: development, administration
focusmr.com
maculangasse 8
1220 wien
+43 (0)1-258 97 01 291

please try not to send me HTML emails!


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



cross context info

2005-09-13 Thread Alain Gaeremynck
I have 2 webapps living on the same server and they are linked to the 
same user experiance..  Now both apps require login but i don't want my 
users to have to login on both apps.  Also while they are browsing in 
one context i don't want the session to expire for the other context. 

so the question is  Is there a way to do session.setAtribute in one 
context and retrieve it from another and also to link the 2 session so 
that they don't expire or expire at the same time? 


i'd like not to have to use hidden iframe and stuff like that

thanks!

--
Alain Gaeremynck
CTO Le Groupe Interstructure
(514) 374-1110
(514) 825-7810 cell
weblog: http://www.sanssucre.ca
(En informatique, comme en musique, n'importe quoi sauf du commercial)


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



suppressing cookies for only part of a context

2005-09-09 Thread Brian Moseley
i've got a webapp deployed in tomcat 5.5.9 that provides three separate 
interfaces to my business logic:


1) web ui
2) webdav
3) rest

i want session management via cookies and url-rewriting for the web ui 
but not for the other interfaces. is there a clean way to achieve that 
portably with the servlet api, or (less preferably) by configuring or 
extending tomcat?


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



RE: getRealPath() returns real path plus context path

2005-09-06 Thread Raghupathy,Gurumoorthy
servletContext.getRealPath() is real path to the context path + the argument
...
So if you say servletContext.getRealPath(hithere) .. It will return
C:\path\to\tomcat\webapps\tool\hithere

Regards
Guru

-Original Message-
From: Franz-Josef Herpers [mailto:[EMAIL PROTECTED] 
Sent: 05 September 2005 20:40
To: Tomcat Users List
Subject: getRealPath() returns real path plus context path


Hi,

I've a problem when using ServletContext#getRealPath() with Tomcat 5.5.9.

My web application resides under the name tool in the webapps 
directory. When I call 
servletContext.getRealPath(request.getContextPath() I get the real path 
but always with the context path added at the end. That means a path 
like C:\path\to\tomcat\webapps\tool\tool.

Is there any explanation for this behaviour? Or am I doing something wrong?

Thanks for any hints in advance

Regards
Franz

-- 
Franz-Josef Herpers
Puschkinallee 9A
12435 Berlin
030/53 21 33 02
0173/54 23 666
[EMAIL PROTECTED]



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

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



Re: getRealPath() returns real path plus context path

2005-09-06 Thread Edmund Urbani

Franz-Josef Herpers wrote:


Hi,

I've a problem when using ServletContext#getRealPath() with Tomcat 5.5.9.

My web application resides under the name tool in the webapps 
directory. When I call 
servletContext.getRealPath(request.getContextPath() I get the real 
path but always with the context path added at the end. That means a 
path like C:\path\to\tomcat\webapps\tool\tool.


Is there any explanation for this behaviour? Or am I doing something 
wrong?


Thanks for any hints in advance

Regards
Franz

the getRealPath method simply returns a path inside the webapp's 
directory. eg. you can do getRealPath(images/someimg.jpg) and get the 
actual filesystem path for that file, so you can access it using 
java.io.File and do something with it. getRealPath(/) should give you 
the webapp directory itself.
note that you probably should not use this method, if you ever want to 
be able to run your webapp directly from a .war file.


Edmund


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



Re: getRealPath() returns real path plus context path

2005-09-06 Thread Franz-Josef Herpers

Hi,

Edmund Urbani wrote:

the getRealPath method simply returns a path inside the webapp's 
directory. eg. you can do getRealPath(images/someimg.jpg) and get the 
actual filesystem path for that file, so you can access it using 
java.io.File and do something with it. getRealPath(/) should give you 
the webapp directory itself.
note that you probably should not use this method, if you ever want to 
be able to run your webapp directly from a .war file.


I know about the problem with the war file. That's the reason why I 
until today never used this method and apparently never read the 
Javadocs


Thanks for the helpful answer.

Regards
Franz


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



getRealPath() returns real path plus context path

2005-09-05 Thread Franz-Josef Herpers

Hi,

I've a problem when using ServletContext#getRealPath() with Tomcat 5.5.9.

My web application resides under the name tool in the webapps 
directory. When I call 
servletContext.getRealPath(request.getContextPath() I get the real path 
but always with the context path added at the end. That means a path 
like C:\path\to\tomcat\webapps\tool\tool.


Is there any explanation for this behaviour? Or am I doing something wrong?

Thanks for any hints in advance

Regards
Franz

--
Franz-Josef Herpers
Puschkinallee 9A
12435 Berlin
030/53 21 33 02
0173/54 23 666
[EMAIL PROTECTED]



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



[jasper] compiling jsp in an osgi context

2005-09-05 Thread Gilles Dodinet

hi-

resending a mail i inadvertently sent to commons-user..

i'm trying to execute jsp in an osgi context with no luck as of today. 
i've embedded jetty as an osgi bundle and registered a BundleListener 
which registers installed bundles as webapp if they contain a web 
descriptor file. so far so good. it plays nice with simple html files. 
however i'm encountering troubles when it comes to jsp. generated 
servlets don't compile anything because javax.servlet.* classes are not 
found (please note that the transformation process is successfull).


in the manifest i declare javax.servlet as Import-Package (most prolly 
this seems to cause the issue) and jetty, jasper and related 
dependencies as bundled libs. Also as jasper seems to require an 
urlclassloader i've come up with a (pretty simple) custom urlclassloader 
which delegates all calls to either the target bundle (i.e. the 
installed bundle which wraps the webapp) or the current bundle.  jasper 
classes are succesfully loaded, but not the javax.servlet.* classes. 
googling about this using various criteria gives me in only three 
relevant results :


1/ embedded pagebox whose earlier version (2001) targets the same 
problematic as me. since it is released under lgpl i've tried to use it 
to match my specific needs, however it pretty quick became total hackery 
- 2000 lines src files not maintained since 2001 or so and they 
duplicate lot of services already provided by containers.

2/ a thread on oscar user list with no anwer
3/ a wiki page (entitled 'Tomcat as osgi bundles' and hosted on safehaus 
- with just a listing of bundles i'm unable to find) so i thought i 
could ask here if someone came to a solution to this problem. Has it 
already be done yet ?


below are the relevant manifest entries and webapp registration code. 
the target bundle as no Import-Package and no classes (just the simplest 
hello world). webapp registration [1] assigns the currentThead 
contextClassLoader to the simple delegating classloader discussed above 
- needed to start the webapp, and [2] sets the WebApplicationContext 
ClassLoader to the exact same ClassLoader - which i thought would have 
provided javax.servlet.* classes.


this may not be the best list for this question (should i rather ask on 
jetty or [EMAIL PROTECTED] user lists ?), anyway thanks for any input.



Import-Package: org.osgi.service.http,javax.servlet,
javax.servlet.http,org.osgi.framework,net.joss.utils
Bundle-Classpath: .,
org.mortbay.jetty-5.1.4.jar,
commons-logging-1.0.4.jar,
servlet-api-2.4.jar,
xerces-2.4.0.jar,
xmlParserAPIs-2.6.2.jar,
xml-apis-2.0.2.jar,
jsp-api-2.0.jar,
jasper-compiler-5.5.9.jar,
jasper-runtime-5.5.9.jar,
commons-el-1.0.jar,
ant-1.6.2.jar

class JettyWrapper
{
   public void createApplication(final String appName, final File app, 
final Bundle fromBundle)

   {
  Thread thread = new Thread()
  {
  public void run()
 {
  try
  {
  ClassLoader loader = new DelegatingClassLoader(
  fromBundle,
  this.getClass().getClassLoader());

  
Thread.currentThread().setContextClassLoader(loader);[1]


  String location = app.getAbsolutePath();

  WebApplicationContext context =
  jetty.addWebApplication(/ + appName, 
location);

context.setClassLoader(loader);[2]

  ...
  context.start();
  }
  catch (Exception e)
  {
  LOG.error(Unable to start ' + appName + ' 
context, e);

  }
  }
  };
thread.start();
}
}

-- gd


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



Re: Manager error 'FAIL - Invalid context path null was specified'

2005-09-04 Thread Mark Thomas

Andy wrote:

When I request a reload like this -

http://testxtb.example.com/manager/reload?xtb

I get this response-

FAIL - Invalid context path null was specified

However according to this page -

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html

This is a valid syntax


You need to read this page again and look more closely at the 
examples. For a reload the example is:

http://localhost:8080/manager/reload?path=/examples

so you need

http://localhost:8080/manager/reload?path=/xtb

Mark


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



Manager error 'FAIL - Invalid context path null was specified'

2005-09-03 Thread Andy

Hi All,

I'm trying to configure the manager application with virtual
hosts.

When I request a reload like this -

http://testxtb.example.com/manager/reload?xtb

I get this response-

FAIL - Invalid context path null was specified

However according to this page -

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html

This is a valid syntax, as 'xtb' is my web application name in the
webapps directory - my web application works fine btw, and so does the
manager's list command.

I can only think I haven't understood something correctly, and my
configuration is somehow wrong.

It would be great if somebody could tell me what's wrong so I don't
spend an entire weekend on this. My config follows -

$CATALINA_HOME/conf/server.xml (chopped)

Engine name=Catalina defaultHost=testxtb.example.com

Host name=testxtb.example.com appBase=C:\Program Files\Apache
Software Foundation\Tomcat 5.5\webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

... chopped ...

/Host

/Engine

$CATALINA_HOME/conf/Catalina/testxtb.example.com/context.xml.default


Context docBase=xtb
 privileged=true antiResourceLocking=false
antiJARLocking=false

/Context


$CATALINA_HOME/conf/Catalina/testxtb.example.com/manager.xml
-

Context docBase=${catalina.home}/server/webapps/manager
 privileged=true antiResourceLocking=false
antiJARLocking=false

  !-- Link to the user database we will get roles from --
  ResourceLink name=users global=UserDatabase
type=org.apache.catalina.UserDatabase/

/Context


$CATALINA_HOME/webapps/xtb/
--

Web application files under this directory - this is why
reload?xtb should work.


Thanks,

Andy.





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



Context in separate file doesn't work

2005-09-02 Thread Trond Hersløv
Hi tomcat fellas!
http://venus:8080 gives me the index.html in the folder /home/trond/GTG/inside, 
but only when I use the server.xml below.
When I take the Context. / and put it in a separate file, 
${CATALINA_HOME}/conf/Catalina/venus/test.xml it doesnt work anymore.
Does anybody know why? Do I have to set any attributes like autoDeploy=false 
in the Host tag or what am I missing here?

Thanks in advance.

\trond


* server.xml 

Server port=8005 shutdown=SHUTDOWN

  GlobalNamingResources
!-- Used by Manager webapp --
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
   description=User database that can be updated and saved
   factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /
  /GlobalNamingResources

  Service name=Catalina
Connector port=8080 /

!-- This is here for compatibility only, not required --
Connector port=8009 protocol=AJP/1.3 /

Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase /
  Host name=localhost appBase=/home/trond/GTG/outside /
  Host name=venus appBase=/home/trond/GTG/inside 
Context docBase=/home/trond/GTG/inside path=/ /
  /Host
/Engine

  /Service
/Server
**


**
This email message has been swept by
MIMEsweeper for the presence of computer viruses.
**


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



RE: Context in separate file doesn't work

2005-09-02 Thread George Sexton
The context name and the file name have to match exactly.

Also, root contexts need to have a path of . 

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

 -Original Message-
 From: Trond Hersløv [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 02, 2005 4:50 AM
 To: Tomcat Users List
 Subject: Context in separate file doesn't work
 
 Hi tomcat fellas!
 http://venus:8080 gives me the index.html in the folder 
 /home/trond/GTG/inside, but only when I use the server.xml below.
 When I take the Context. / and put it in a separate 
 file, ${CATALINA_HOME}/conf/Catalina/venus/test.xml it doesnt 
 work anymore.
 Does anybody know why? Do I have to set any attributes like 
 autoDeploy=false in the Host tag or what am I missing here?
 
 Thanks in advance.
 
 \trond
 
 
 * server.xml 
 
 Server port=8005 shutdown=SHUTDOWN
 
   GlobalNamingResources
 !-- Used by Manager webapp --
 Resource name=UserDatabase auth=Container
   type=org.apache.catalina.UserDatabase
description=User database that can be updated and saved

 factory=org.apache.catalina.users.MemoryUserDatabaseFactory
   pathname=conf/tomcat-users.xml /
   /GlobalNamingResources
 
   Service name=Catalina
 Connector port=8080 /
 
 !-- This is here for compatibility only, not required --
 Connector port=8009 protocol=AJP/1.3 /
 
 Engine name=Catalina defaultHost=localhost
   Realm className=org.apache.catalina.realm.UserDatabaseRealm
  resourceName=UserDatabase /
   Host name=localhost appBase=/home/trond/GTG/outside /
   Host name=venus appBase=/home/trond/GTG/inside 
 Context docBase=/home/trond/GTG/inside path=/ /
   /Host
 /Engine
 
   /Service
 /Server
 **
 
 
 
 **
 This email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 **
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



RE: Context in separate file doesn't work

2005-09-02 Thread George Sexton
One other thing, for a ROOT context, the file should be named ROOT.xml

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

 -Original Message-
 From: Trond Hersløv [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 02, 2005 4:50 AM
 To: Tomcat Users List
 Subject: Context in separate file doesn't work
 
 Hi tomcat fellas!
 http://venus:8080 gives me the index.html in the folder 
 /home/trond/GTG/inside, but only when I use the server.xml below.
 When I take the Context. / and put it in a separate 
 file, ${CATALINA_HOME}/conf/Catalina/venus/test.xml it doesnt 
 work anymore.
 Does anybody know why? Do I have to set any attributes like 
 autoDeploy=false in the Host tag or what am I missing here?
 
 Thanks in advance.
 
 \trond
 
 
 * server.xml 
 
 Server port=8005 shutdown=SHUTDOWN
 
   GlobalNamingResources
 !-- Used by Manager webapp --
 Resource name=UserDatabase auth=Container
   type=org.apache.catalina.UserDatabase
description=User database that can be updated and saved

 factory=org.apache.catalina.users.MemoryUserDatabaseFactory
   pathname=conf/tomcat-users.xml /
   /GlobalNamingResources
 
   Service name=Catalina
 Connector port=8080 /
 
 !-- This is here for compatibility only, not required --
 Connector port=8009 protocol=AJP/1.3 /
 
 Engine name=Catalina defaultHost=localhost
   Realm className=org.apache.catalina.realm.UserDatabaseRealm
  resourceName=UserDatabase /
   Host name=localhost appBase=/home/trond/GTG/outside /
   Host name=venus appBase=/home/trond/GTG/inside 
 Context docBase=/home/trond/GTG/inside path=/ /
   /Host
 /Engine
 
   /Service
 /Server
 **
 
 
 
 **
 This email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 **
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



RE: Context in separate file doesn't work

2005-09-02 Thread Trond Hersløv
Hi George,

Thank you very much, you made my day!!
I thought I could name the .xml files whatever I like to, but that was a huge 
mistake that costed me 2 days.
Naming the file ROOT.xml solved the problem. Can't remember having read that 
anywhere in the doc's. 
Don't know if it's just a bad style, but path= and path=/ seems both to 
work well. But I'll listen to you and use an empty string.


Once again, thank you very much and have a nice weekend


-Original Message-
From: George Sexton [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 02, 2005 18:13
To: 'Tomcat Users List'
Subject: RE: Context in separate file doesn't work

One other thing, for a ROOT context, the file should be named ROOT.xml

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

 -Original Message-
 From: Trond Hersløv [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 02, 2005 4:50 AM
 To: Tomcat Users List
 Subject: Context in separate file doesn't work
 
 Hi tomcat fellas!
 http://venus:8080 gives me the index.html in the folder 
 /home/trond/GTG/inside, but only when I use the server.xml below.
 When I take the Context. / and put it in a separate file, 
 ${CATALINA_HOME}/conf/Catalina/venus/test.xml it doesnt work anymore.
 Does anybody know why? Do I have to set any attributes like 
 autoDeploy=false in the Host tag or what am I missing here?
 
 Thanks in advance.
 
 \trond
 
 
 * server.xml
 
 Server port=8005 shutdown=SHUTDOWN
 
   GlobalNamingResources
 !-- Used by Manager webapp --
 Resource name=UserDatabase auth=Container
   type=org.apache.catalina.UserDatabase
description=User database that can be updated and saved

 factory=org.apache.catalina.users.MemoryUserDatabaseFactory
   pathname=conf/tomcat-users.xml /
   /GlobalNamingResources
 
   Service name=Catalina
 Connector port=8080 /
 
 !-- This is here for compatibility only, not required --
 Connector port=8009 protocol=AJP/1.3 /
 
 Engine name=Catalina defaultHost=localhost
   Realm className=org.apache.catalina.realm.UserDatabaseRealm
  resourceName=UserDatabase /
   Host name=localhost appBase=/home/trond/GTG/outside /
   Host name=venus appBase=/home/trond/GTG/inside 
 Context docBase=/home/trond/GTG/inside path=/ /
   /Host
 /Engine
 
   /Service
 /Server
 **
 
 
 
 **
 This email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 **
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

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



RE: Context in separate file doesn't work

2005-09-02 Thread George Sexton
I'd like to claim superior knowledge and intellect, but really I just did
this one myself a few weeks ago.

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

 -Original Message-
 From: Trond Hersløv [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 02, 2005 12:02 PM
 To: Tomcat Users List
 Subject: RE: Context in separate file doesn't work
 
 Hi George,
 
 Thank you very much, you made my day!!
 I thought I could name the .xml files whatever I like to, but 
 that was a huge mistake that costed me 2 days.
 Naming the file ROOT.xml solved the problem. Can't remember 
 having read that anywhere in the doc's. 
 Don't know if it's just a bad style, but path= and path=/ 
 seems both to work well. But I'll listen to you and use an 
 empty string.
 
 
 Once again, thank you very much and have a nice weekend
 
 
 -Original Message-
 From: George Sexton [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 02, 2005 18:13
 To: 'Tomcat Users List'
 Subject: RE: Context in separate file doesn't work
 
 One other thing, for a ROOT context, the file should be named ROOT.xml
 
 George Sexton
 MH Software, Inc.
 http://www.mhsoftware.com/
 Voice: 303 438 9585
   
 
  -Original Message-
  From: Trond Hersløv [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 02, 2005 4:50 AM
  To: Tomcat Users List
  Subject: Context in separate file doesn't work
  
  Hi tomcat fellas!
  http://venus:8080 gives me the index.html in the folder 
  /home/trond/GTG/inside, but only when I use the server.xml below.
  When I take the Context. / and put it in a separate file, 
  ${CATALINA_HOME}/conf/Catalina/venus/test.xml it doesnt 
 work anymore.
  Does anybody know why? Do I have to set any attributes like 
  autoDeploy=false in the Host tag or what am I missing here?
  
  Thanks in advance.
  
  \trond
  
  
  * server.xml
  
  Server port=8005 shutdown=SHUTDOWN
  
GlobalNamingResources
  !-- Used by Manager webapp --
  Resource name=UserDatabase auth=Container
type=org.apache.catalina.UserDatabase
 description=User database that can be updated and saved
 
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
pathname=conf/tomcat-users.xml /
/GlobalNamingResources
  
Service name=Catalina
  Connector port=8080 /
  
  !-- This is here for compatibility only, not required --
  Connector port=8009 protocol=AJP/1.3 /
  
  Engine name=Catalina defaultHost=localhost
Realm className=org.apache.catalina.realm.UserDatabaseRealm
   resourceName=UserDatabase /
Host name=localhost appBase=/home/trond/GTG/outside /
Host name=venus appBase=/home/trond/GTG/inside 
  Context docBase=/home/trond/GTG/inside path=/ /
/Host
  /Engine
  
/Service
  /Server
  **
  
  
  
  
 **
  This email message has been swept by
  MIMEsweeper for the presence of computer viruses.
  
 **
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



tomcat not finding the context root.

2005-09-01 Thread bachoo jahnkar
Hi,
 
my application is in the /webapps/hst/htdocs directory. I have created a war 
file from ../hst directory and named it hst.war. I have used ant task to do it.
 
war destfile=${tomcat.home}/webapps/hst/hst.war 
webxml=${tomcat.home}/webapps/hst/htdocs/WEB-INF/web.xml

fileset dir=${tomcat.home}/webapps/hst/
excludesfile 
name=${tomcat.home}/webapps/hst/htdocs/WEB-INF/web.xml/
   /war
  
 
when i copy the war file to the unix box and restart tomcat, it creates WEB-INF 
file under
/hst ( webapps/hst/WEB-INF/web.xml). there is also 
webapps/hst/htdocs/WEB-INF/web.xml.
my server.xml has context which has docbase=hst/htdocs. When i try to run my 
application on tomcat i get the following error.  Context path is set to /hst 
and not /hst/htdocs as in server.xml. Please help
 
---log---
 
2005-09-01 12:59:29 StandardHost[localhost]: Installing web application at 
context path /hst from URL jar:file:/var/jakarta-tomcat-4.0.3/webapps/hst.war!/
2005-09-01 12:59:42 WebappLoader[/hst]: Deploying class repositories to work 
directory /var/jakarta-tomcat-4.0.3/work/localhost/hst
2005-09-01 12:59:42 StandardManager[/hst]: Seeding random number generator 
class java.security.SecureRandom
2005-09-01 12:59:42 StandardManager[/hst]: Seeding of random number generator 
has been completed
2005-09-01 12:59:42 ContextConfig[/hst]: Added certificates - request 
attribute Valve
2005-09-01 12:59:42 ContextConfig[/hst]: Configured an authenticator for method 
FORM
2005-09-01 12:59:43 StandardWrapper[/hst:default]: Loading container servlet 
default
2005-09-01 12:59:43 default: init
2005-09-01 12:59:43 StandardWrapper[/hst:invoker]: Loading container servlet 
invoker
2005-09-01 12:59:43 invoker: init
2005-09-01 12:59:43 jsp: init
2005-09-01 12:59:43 StandardWrapper[/hst:cgi]: Loading container servlet cgi
2005-09-01 12:59:43 cgi: init
2005-09-01 12:59:43 cgi: init: loglevel set to 6
2005-09-01 12:59:43 StandardWrapper[/hst:ControllerServlet]: Marking servlet 
ControllerServlet as unavailable
2005-09-01 12:59:43 StandardContext[/hst]: Servlet /hst threw load() exception
javax.servlet.ServletException: Wrapper cannot find servlet class 
edu.mit.hst.ControllerServlet or a class it depends on
 at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:871)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
 at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3266)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:714)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:324)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
 at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
 at org.apache.catalina.core.StandardService.start(StandardService.java:388)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
- Root Cause -
java.lang.ClassNotFoundException: edu.mit.hst.ControllerServlet
 at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1394)
 at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1243)
 at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:865)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
 at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3266)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:714)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:324)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389

Realm in Context in War

2005-08-29 Thread Chirag
Software

Tomcat 5.5.2
JDK 1.5


I have created a webapplication named b
It works perfectly fine including the realm declared
inside the context.xml file in META-INF folder

THen I created war by using

C:\webapps\bjar cvf c.war *.*

Later I copied c.war in the webapps folder and started
Tomcat

but when i try to login it throws an exception

---

Aug 29, 2005 11:21:50 PM
org.apache.catalina.realm.JAASRealm authenticate
SEVERE: Unexpected error
java.lang.SecurityException: Unable to locate a login
configuration
at
com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:97)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at
javax.security.auth.login.Configuration$3.run(Configuration.java:216)

at
java.security.AccessController.doPrivileged(Native
Method)
at
javax.security.auth.login.Configuration.getConfiguration(Configuratio
n.java:210)
at
javax.security.auth.login.LoginContext$1.run(LoginContext.java:237)
at
java.security.AccessController.doPrivileged(Native
Method)
at
javax.security.auth.login.LoginContext.init(LoginContext.java:234)
at
javax.security.auth.login.LoginContext.init(LoginContext.java:403)
at
org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:298)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(Form
Authenticator.java:230)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:391)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:106)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
526)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:799)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:576)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to locate a
login configuration
at
com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:206)
at
com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:95)
... 26 more



I have used the following Realm Tag in context.xml
which works perfectly fine in webapplication b but not
in c.war

Realm 
className=org.apache.catalina.realm.JDBCRealm
debug=99 driverName=com.mysql.jdbc.Driver 
connectionURL=jdbc:mysql://localhost:3306/db1   
 connectionName=root connectionPassword=b 
userTable=mastercompany userNameCol=EmailAdd
userCredCol=password 
userRoleTable=user_roles roleNameCol=role_name /


Thanks in advance

CSJakharia

 Subscribe to bermudaEmail:  [input]  [input]  Browse Archives at 
groups-beta.google.com 






Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



Re: Automatic deploy of updated war deletes the context file

2005-08-26 Thread Paul Austin
The test case I am using is running on Tomcat 5.5.9.

1. The web application is deployed as a the app.war file, with no
context.xml file to the wars/host directory
2. The Host configuration is as follows.
  Host debug=99 name=host unpackWARs=false
deployXML=false
 Logger className=org.apache.catalina.logger.FileLogger
 prefix=host timestamp=false /
  /Host
3. In conf/Catalina/host/app.xml
  ?xml version='1.0' encoding='utf-8'?
  Context debug=9 docBase=wars/host/app.war path=/app
reloadable=true workDir=work/Catalina/host/app
ResourceLink global=jdbc/appDs name=jdbc/appDs
type=javax.sql.DataSource/
  /Context

When I copy app.war into wars/host to repeploy using the automatic
deployer I check the conf/Catalina/host/ and
http://host/manager/list and the app.xml and the /app context are
deleted.



On Thu, 2005-08-25 at 16:32 -0700, Hassan Schroeder wrote:
 Paul Austin wrote:
  Right but where should it go so that tomcat doesn't delete it?
  
  I've tried setting the deployXML=false on the host and having it just
  in the conf/Catalina/host directory (which is my preferred location),
  just in the war file and all various combinations.
 
 I've used both locations -- separately! -- without problems. Are you
 saying that with *only* /conf/Catalina/host/context.xml, nothing
 in META-INF/context.xml, your deployment fails and the context.xml
 file is removed?
 


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



Re: Automatic deploy of updated war deletes the context file

2005-08-26 Thread Hassan Schroeder

Paul Austin wrote:

The test case I am using is running on Tomcat 5.5.9.

1. The web application is deployed as a the app.war file, with no
context.xml file to the wars/host directory


_and_ no META-INF/context.xml in the war file, right?


2. The Host configuration is as follows.
  Host debug=99 name=host unpackWARs=false
deployXML=false
 Logger className=org.apache.catalina.logger.FileLogger
 prefix=host timestamp=false /
  /Host
3. In conf/Catalina/host/app.xml
  ?xml version='1.0' encoding='utf-8'?
  Context debug=9 docBase=wars/host/app.war path=/app
reloadable=true workDir=work/Catalina/host/app
ResourceLink global=jdbc/appDs name=jdbc/appDs
type=javax.sql.DataSource/
  /Context

When I copy app.war into wars/host to repeploy using the automatic
deployer I check the conf/Catalina/host/ and
http://host/manager/list and the app.xml and the /app context are
deleted.


I would check your logs for errors, but also go through all your
entries in your server.xml and app.xml files

For instance, for the path attribute of Context:
  The value of this field must not be set except when statically
  defining a Context in server.xml, as it will be infered from the
  filenames used for either the .xml context file or the docBase.

Sometimes the subtle config errors will bite'cha :-)

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



Re: Automatic deploy of updated war deletes the context file

2005-08-26 Thread Remy Maucherat
On 8/26/05, Paul Austin [EMAIL PROTECTED] wrote:
 The test case I am using is running on Tomcat 5.5.9.
 
 1. The web application is deployed as a the app.war file, with no
 context.xml file to the wars/host directory
 2. The Host configuration is as follows.
   Host debug=99 name=host unpackWARs=false
 deployXML=false
  Logger className=org.apache.catalina.logger.FileLogger
  prefix=host timestamp=false /
   /Host
 3. In conf/Catalina/host/app.xml
   ?xml version='1.0' encoding='utf-8'?
   Context debug=9 docBase=wars/host/app.war path=/app
 reloadable=true workDir=work/Catalina/host/app
 ResourceLink global=jdbc/appDs name=jdbc/appDs
 type=javax.sql.DataSource/
   /Context
 
 When I copy app.war into wars/host to repeploy using the automatic
 deployer I check the conf/Catalina/host/ and
 http://host/manager/list and the app.xml and the /app context are
 deleted.

Yes, this is normal.

-- 
x
Rémy Maucherat
Developer  Consultant
JBoss Group (Europe) SàRL
x

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



Re: Automatic deploy of updated war deletes the context file

2005-08-26 Thread Paul Austin
I know almost have it 'The way I want it to work (TM)' using the
following configuration.

- server.xml
  Host appBase=wars/host autoDeploy=false debug=99
name=host unpackWARs=false deployXML=false
  
Logger className=org.apache.catalina.logger.FileLogger
  prefix=host timestamp=false /
  /Host

- conf/Catalina/host/app.xml
  ?xml version='1.0' encoding='utf-8'?
  Context debug=9 docBase=app-web.war path=/app
reloadable=true
  
ResourceLink global=jdbc/appDs name=jdbc/appDs
  type=javax.sql.DataSource
  /
/Context

Now the final question is how can I set the path to be a sub directory?
So /subdir/app. This worked on my Tomcat 5 installation on Linux but
doesn't work here. It seems to just ignore the path.

And YES these context files are NOT deployed as part of the war file.


On Fri, 2005-08-26 at 08:33 -0700, Hassan Schroeder wrote:
 Paul Austin wrote:
  The test case I am using is running on Tomcat 5.5.9.
  
  1. The web application is deployed as a the app.war file, with no
  context.xml file to the wars/host directory
 
 _and_ no META-INF/context.xml in the war file, right?
 
  2. The Host configuration is as follows.
Host debug=99 name=host unpackWARs=false
  deployXML=false
   Logger className=org.apache.catalina.logger.FileLogger
   prefix=host timestamp=false /
/Host
  3. In conf/Catalina/host/app.xml
?xml version='1.0' encoding='utf-8'?
Context debug=9 docBase=wars/host/app.war path=/app
  reloadable=true workDir=work/Catalina/host/app
  ResourceLink global=jdbc/appDs name=jdbc/appDs
  type=javax.sql.DataSource/
/Context
  
  When I copy app.war into wars/host to repeploy using the automatic
  deployer I check the conf/Catalina/host/ and
  http://host/manager/list and the app.xml and the /app context are
  deleted.
 
 I would check your logs for errors, but also go through all your
 entries in your server.xml and app.xml files
 
 For instance, for the path attribute of Context:
The value of this field must not be set except when statically
defining a Context in server.xml, as it will be infered from the
filenames used for either the .xml context file or the docBase.
 
 Sometimes the subtle config errors will bite'cha :-)
 


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



Re: Automatic deploy of updated war deletes the context file

2005-08-26 Thread Hassan Schroeder

Paul Austin wrote:


Now the final question is how can I set the path to be a sub directory?
So /subdir/app. This worked on my Tomcat 5 installation on Linux but
doesn't work here. It seems to just ignore the path.


No idea, never had a reason to try such a configuration -- sorry!

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



Automatic deploy of updated war deletes the context file

2005-08-25 Thread Paul Austin
When I copy an updated copy of a war file that was deployed with a
context.xml file in the META-INF directory and also I have a copy of the
context.xml in the conf/Catalina/host directory the deployer just
deletes the context altogether and doesn't reploy the application.

How is this supposed to work, the only guess I can have as to why this
doesn't work is that tomcat detects the file change half way through the
file is being copied, undeploys the old application deleting the context
file and then barfs on reading the half copied war file and just gives
up and there is nothing in the logs to say what is going on.

The way I fix this is to then manually copy in the context file and then
it deploys, for now I'm just going to wait about 10 seconds in my ant
deploy script after copying the file and then copy the context in so it
redeploys.

Paul



Re: Automatic deploy of updated war deletes the context file

2005-08-25 Thread Hassan Schroeder

So Paul Austin says: Doctor,

When I copy an updated copy of a war file that was deployed with a
context.xml file in the META-INF directory and also I have a copy of the
context.xml in the conf/Catalina/host directory the deployer just
deletes the context altogether and doesn't reploy the application.


..and the Doctor says: Right, so don't do that.

/* Heh. Vaudeville :-)  */

Seriously, you only want to have your Context defined *one* place.

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



Re: Automatic deploy of updated war deletes the context file

2005-08-25 Thread Paul Austin
Right but where should it go so that tomcat doesn't delete it?

I've tried setting the deployXML=false on the host and having it just
in the conf/Catalina/host directory (which is my preferred location),
just in the war file and all various combinations.

Paul

On Thu, 2005-08-25 at 15:44 -0700, Hassan Schroeder wrote:

 So Paul Austin says: Doctor,
  When I copy an updated copy of a war file that was deployed with a
  context.xml file in the META-INF directory and also I have a copy of the
  context.xml in the conf/Catalina/host directory the deployer just
  deletes the context altogether and doesn't reploy the application.
 
 ..and the Doctor says: Right, so don't do that.
 
 /* Heh. Vaudeville :-)  */
 
 Seriously, you only want to have your Context defined *one* place.
 


Re: Automatic deploy of updated war deletes the context file

2005-08-25 Thread Hassan Schroeder

Paul Austin wrote:

Right but where should it go so that tomcat doesn't delete it?

I've tried setting the deployXML=false on the host and having it just
in the conf/Catalina/host directory (which is my preferred location),
just in the war file and all various combinations.


I've used both locations -- separately! -- without problems. Are you
saying that with *only* /conf/Catalina/host/context.xml, nothing
in META-INF/context.xml, your deployment fails and the context.xml
file is removed?

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



Remotely restart Tomcat container (not just a context)

2005-08-24 Thread Richard Gaywood
Hi List!

I have two Tomcat installs. One is on Windows, and hosts our build
system for our web service software. The other is on Linux, and is
where the build system deploys to. I want to run unit tests on the
Windows host that hit on the freshly deployed code on the Linux host.

So far, so good but there is a snag: the web service uses JNI. So,
whenever a new context is deployed, I have to restart the Tomcat
container to avoid classloader problems -- it tries to load the JNI
wrapper class twice, which causes it to just stop working.
Unfortunatly, the JNI is non-negotiable so I can't just remove it
(which is what I'd prefer to do anyway).

About the only way I can see out of this is with a SUID or suexec CGI
script run under Apache HTTPD on the Linux host to allow the Windows
host to remotely tear down and bring up Tomcat. The system is behind
firewalls and only used for development, so the security problems
aren't too much of an issue...

Actually, I just thought of a better way: use the Ant SSH task on the
Windows system with a passwordless certificate to allow logins to the
Linux host and arbitrary command line commands. That's neater than
CGI, at least.

Can anyone suggest any better methods I have overlooked?

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



Re: Securing Tomcat Context Descriptor

2005-08-20 Thread Peter Rossbach
I thing you can use the Java Security Manager and OS level file 
permisssion for this

or wrote your own DataSource JNDI Factory.

Peter

Brett Parsons schrieb:


Hi All,

There is a requirement on the server that we have Tomcat 5.0.28 
deployed that no username/password information can be stored in 
plaintext (in the open).  Like many people, we are using JNDI 
datasources in our web application.  The datasource connection 
information (including the database username/password) is stored in 
the Tomcat Context Descriptor under 
TOMCATDIR/conf/Catalina/localhost/myApp.xml.


Does Tomcat provide a more secure way of storing the connection 
information stored in these context deployment descriptors?  Has 
anyone else run into the same problem and been able to solve it somehow?


Thanks,

Brett



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








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



Re: Securing Tomcat Context Descriptor

2005-08-20 Thread Mark Thomas

A couple of observations:

- If someone can read the context descriptor they pretty much own
Tomcat and probably the server as well. If this person is unauthorised,
you have big problems regardless of whether or not they have read-only 
access to the database.


- If the password is encrypted, where do you store the decryption key?
Tomcat still needs to be able to decrypt the password in order to use
it to access the database. At best, this is security by obscurity
which is not very good security at all.

You could write some custom code that required the password to be 
entered on the command line when Tomcat starts but this still has the 
following issues:


- If Tomcat goes down, you need someone who knows the password to 
restart it. If the group of people that know the password is small, 
you have an availability issue.


- Chances are that everyone who administers Tomcat will know this 
password. Given that these people should be the only ones with access 
at the OS level to the Tomcat configuration files there seems little 
point in going to all this trouble.


In my experience securing the configuration files (Tomcat  JVM) using 
OS file permissions is usually the appropriate course of action to 
take unless your security environment is very unusual.


Mark

Brett Parsons wrote:

Hi All,

There is a requirement on the server that we have Tomcat 5.0.28 deployed 
that no username/password information can be stored in plaintext (in the 
open).  Like many people, we are using JNDI datasources in our web 
application.  The datasource connection information (including the 
database username/password) is stored in the Tomcat Context Descriptor 
under TOMCATDIR/conf/Catalina/localhost/myApp.xml.


Does Tomcat provide a more secure way of storing the connection 
information stored in these context deployment descriptors?  Has anyone 
else run into the same problem and been able to solve it somehow?


Thanks,

Brett



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








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



Re: Array as context parameter

2005-08-19 Thread Konrad Billewicz
Litty Preeth iamlitty at yahoo.com writes:

 Or u can use a comma separated list of strings and
 parse them using StringTokenizer.

That sounds better. It's surely more user friendly. But the chance of an error 
during entering coma-separated values is bigger. It's easy to forget about coma 
or place dot. Are there any other solutions?

Best regards,
Konrad Billewicz



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



[T4.1] java:comp is not bound in this context...

2005-08-19 Thread Arnaud Vandyck
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[Tomcat 4.1.31; Debian GNU/Linux Sarge]

Hi all,

I googled around and find someone with the same problem:
http://marc.theaimsgroup.com/?l=tomcat-userm=110151992910727w=2

... but I can't find an answer.

I also have a Realm configured using the DataSource and it works! But I
can't get an InitialContext. And hibernate does not find the datasource
but can connect to the MySQL database if I pass all the parameters
(driver, url, user and pass instead of the datasource).

Also, (maybe you won't beleive me) but I'm sure it used to work! :-D
What the hell did I changed to break this?!

In my configuration file:
server.xml:
I have a global resource, I have these resources in the context, I have
another resource in the context (not a reference), I can't call none of
them.

If I do:
Context ctx = new InitialContext();
log (Name in manespace:  + ctx.getNameInNamespace());

I have an exception:
Can't generate an absolute name for this namespace

If I do:
DataSource dataSource = (DataSource)
ctx.lookup(java:comp/env/jdbc/tobydb);

I have also an exception:
Name java:comp is not bound in this Context

If anyone can help on this...

Many thanks,

- --
Arnaud http://www.ressource-toi.org
Java Trap: http://www.gnu.org/philosophy/java-trap.html
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDBaFr4vzFZu62tMIRAoz8AJ9pSElEy9wj5zwZFIrEXXo3+3TqHwCcDqYw
CbbylLjZqzRcTb0pIrgNAh4=
=DOHB
-END PGP SIGNATURE-

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



RE: Array as context parameter

2005-08-19 Thread Richard Mixon (qwest)
Well,

Understand that once you enter the domain of having someone edit an XML
file, you are already into error prone territory.

You might consider changing the parameter to specify a file name. The
specified file could be formatted anyway you liked, but probably with
one value on each line of the file. Just have context listener read this
file at startup and place the array in the context.

Hope this helps - Richard

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Konrad Billewicz
Sent: Friday, August 19, 2005 12:29 AM
To: tomcat-user@jakarta.apache.org
Subject: Re: Array as context parameter

Litty Preeth iamlitty at yahoo.com writes:

 Or u can use a comma separated list of strings and parse them using 
 StringTokenizer.

That sounds better. It's surely more user friendly. But the chance of an
error during entering coma-separated values is bigger. It's easy to
forget about coma or place dot. Are there any other solutions?

Best regards,
Konrad Billewicz



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




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



Securing Tomcat Context Descriptor

2005-08-19 Thread Brett Parsons

Hi All,

There is a requirement on the server that we have Tomcat 5.0.28 deployed 
that no username/password information can be stored in plaintext (in the 
open).  Like many people, we are using JNDI datasources in our web 
application.  The datasource connection information (including the database 
username/password) is stored in the Tomcat Context Descriptor under 
TOMCATDIR/conf/Catalina/localhost/myApp.xml.


Does Tomcat provide a more secure way of storing the connection information 
stored in these context deployment descriptors?  Has anyone else run into 
the same problem and been able to solve it somehow?


Thanks,

Brett



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



Array as context parameter

2005-08-18 Thread Konrad Billewicz
I would like to pass an array to my application using Environment inside 
Context. Manual says that only primitive types are available. But... I need 
an 
array.

How would you handle this problem? My only, little dummy idea is to do 
something 
like:

Environment name=xxx/1 ...
Environment name=xxx/2 ...
...

And get them using context.lookup() until exception.


Best regards,
Konrad Billewicz



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



Re: Array as context parameter

2005-08-18 Thread Litty Preeth
Hi,

Or u can use a comma separated list of strings and
parse them using StringTokenizer.

With Regards,
Litty Preeth

--- Konrad Billewicz [EMAIL PROTECTED]
wrote:

 I would like to pass an array to my application
 using Environment inside 
 Context. Manual says that only primitive types are
 available. But... I need an 
 array.
 
 How would you handle this problem? My only, little
 dummy idea is to do something 
 like:
 
 Environment name=xxx/1 ...
 Environment name=xxx/2 ...
 ...
 
 And get them using context.lookup() until exception.
 
 
 Best regards,
 Konrad Billewicz
 
 
 

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





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



Context-specific System.properties

2005-08-15 Thread Nelson, Lorrin

I've got some 3rd-party dependencies that rely on System.Properties for
part of their configuration. I'd like to use these same dependencies in
multiple Contexts in a single Tomcat deployment. However, I'll want each
Context to have different values for those System.Properties. Is there
any way to pull this off?

Thanks

-Lorrin


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



Re: Context-specific System.properties

2005-08-15 Thread Larry Meadors
Not by the looks of the javadocs..fwiw, what 3rd-party dependency is
this, so I know to steer clear of it?

Larry


On 8/15/05, Nelson, Lorrin [EMAIL PROTECTED] wrote:
 I've got some 3rd-party dependencies that rely on System.Properties for
 part of their configuration. I'd like to use these same dependencies in
 multiple Contexts in a single Tomcat deployment. However, I'll want each
 Context to have different values for those System.Properties. Is there
 any way to pull this off?
 
 Thanks
 
 -Lorrin
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Problems with context

2005-08-12 Thread Fermin Jimenez Najar
Hi. I just has beginning to use the Tomcat, for programming in JSP.
I have the 5.0 version.

I make a web app that uses, in some jsp's files, the command
response.sendRedirect.

When i execute the pages locally in my computer, works fine, but, i if try
to
test the pages from another computer, i get an error.

This is the way i was executed the sendRedirect for test in another machine,
and always get an error:
response.sendRedirect(http://localhost:8080/activation/obligatorios.jsp;)
response.sendRedirect(http://192.168.1.137:8080/activation/obligatorios.jsp
)
response.sendRedirect(http://mycomputer:8080/activation/obligatorios.jsp;)
response.sendRedirect(/obligatorios.jsp)
response.sendRedirect(activation/obligatorios.jsp)


I think that could be some context problems because, for make the webapp
structure, i
copied one example webapp that comes with the tomcat, then i deleted and
renamed
those files and directories that i dont use (off course, the web-inf still
exist)

What can i do ? Is there is some file where i must configure the context of
the webapp ?

Thanks !!


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



RE: Problems with context

2005-08-12 Thread Allistair Crossley
And what is the error you are getting? 404? 500? Exception? What?

Allistair.

 -Original Message-
 From: Fermin Jimenez Najar [mailto:[EMAIL PROTECTED]
 Sent: 12 August 2005 08:54
 To: Tomcat Users List
 Subject: Problems with context
 
 
 Hi. I just has beginning to use the Tomcat, for programming in JSP.
 I have the 5.0 version.
 
 I make a web app that uses, in some jsp's files, the command
 response.sendRedirect.
 
 When i execute the pages locally in my computer, works fine, 
 but, i if try
 to
 test the pages from another computer, i get an error.
 
 This is the way i was executed the sendRedirect for test in 
 another machine,
 and always get an error:
 response.sendRedirect(http://localhost:8080/activation/obliga
 torios.jsp)
 response.sendRedirect(http://192.168.1.137:8080/activation/ob
 ligatorios.jsp
 )
 response.sendRedirect(http://mycomputer:8080/activation/oblig
 atorios.jsp)
 response.sendRedirect(/obligatorios.jsp)
 response.sendRedirect(activation/obligatorios.jsp)
 
 
 I think that could be some context problems because, for make 
 the webapp
 structure, i
 copied one example webapp that comes with the tomcat, then i 
 deleted and
 renamed
 those files and directories that i dont use (off course, the 
 web-inf still
 exist)
 
 What can i do ? Is there is some file where i must configure 
 the context of
 the webapp ?
 
 Thanks !!
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


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



RE: Problems with context

2005-08-12 Thread Scott Purcell
Actually I am getting no errors. Basically some of the images and includes do 
not show up unless I take out the unique from the querystring. That is why I 
am confused.

Originally, while building the application, I did not have an entry in the 
host element. I just used something like this:
http://localhost/unique/welcome.do
and all was good. But when I got my staticIP the other night, and entered the 
host information that is when things got out of wack.

Does that help?

Thanks,
Scott





-Original Message-
From: Allistair Crossley [mailto:[EMAIL PROTECTED]
Sent: Friday, August 12, 2005 10:22 AM
To: Tomcat Users List
Subject: RE: Problems with context


And what is the error you are getting? 404? 500? Exception? What?

Allistair.

 -Original Message-
 From: Fermin Jimenez Najar [mailto:[EMAIL PROTECTED]
 Sent: 12 August 2005 08:54
 To: Tomcat Users List
 Subject: Problems with context
 
 
 Hi. I just has beginning to use the Tomcat, for programming in JSP.
 I have the 5.0 version.
 
 I make a web app that uses, in some jsp's files, the command
 response.sendRedirect.
 
 When i execute the pages locally in my computer, works fine, 
 but, i if try
 to
 test the pages from another computer, i get an error.
 
 This is the way i was executed the sendRedirect for test in 
 another machine,
 and always get an error:
 response.sendRedirect(http://localhost:8080/activation/obliga
 torios.jsp)
 response.sendRedirect(http://192.168.1.137:8080/activation/ob
 ligatorios.jsp
 )
 response.sendRedirect(http://mycomputer:8080/activation/oblig
 atorios.jsp)
 response.sendRedirect(/obligatorios.jsp)
 response.sendRedirect(activation/obligatorios.jsp)
 
 
 I think that could be some context problems because, for make 
 the webapp
 structure, i
 copied one example webapp that comes with the tomcat, then i 
 deleted and
 renamed
 those files and directories that i dont use (off course, the 
 web-inf still
 exist)
 
 What can i do ? Is there is some file where i must configure 
 the context of
 the webapp ?
 
 Thanks !!
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


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


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



RE: Problems with context

2005-08-12 Thread Fermin Jimenez Najar
This is the question (by example)
a) In my computer (where the tomcat is installed)
   1. I call this page who have the
sendRedirect(http://192.168.1.64/activation/secondpage.jsp;)
   http://192.168.1.64/activation/firstpage.jsp

   2. Works fine, in the browser of my machine appears:
http://192.168.1.64/activation/secondpage.jsp

b)But the ERROR happens when i try to access from another computer:
  1. I call this page who have the
sendRedirect(http://192.168.1.64/activation/secondpage.jsp;)
   http://192.168.1.64/activation/firstpage.jsp

2. I get this as URL in the browser:
http://localhost/secondpage.jsp

  and this error:
  The page is not enabled (or something like that, without error
number)

-Message d'origine-
De : Allistair Crossley [mailto:[EMAIL PROTECTED]
Envoyé : Viernes, 12 de Agosto de 2005 05:22 p.m.
À : Tomcat Users List
Objet : RE: Problems with context


And what is the error you are getting? 404? 500? Exception? What?

Allistair.

 -Original Message-
 From: Fermin Jimenez Najar [mailto:[EMAIL PROTECTED]
 Sent: 12 August 2005 08:54
 To: Tomcat Users List
 Subject: Problems with context


 Hi. I just has beginning to use the Tomcat, for programming in JSP.
 I have the 5.0 version.

 I make a web app that uses, in some jsp's files, the command
 response.sendRedirect.

 When i execute the pages locally in my computer, works fine,
 but, i if try
 to
 test the pages from another computer, i get an error.

 This is the way i was executed the sendRedirect for test in
 another machine,
 and always get an error:
 response.sendRedirect(http://localhost:8080/activation/obliga
 torios.jsp)
 response.sendRedirect(http://192.168.1.137:8080/activation/ob
 ligatorios.jsp
 )
 response.sendRedirect(http://mycomputer:8080/activation/oblig
 atorios.jsp)
 response.sendRedirect(/obligatorios.jsp)
 response.sendRedirect(activation/obligatorios.jsp)


 I think that could be some context problems because, for make
 the webapp
 structure, i
 copied one example webapp that comes with the tomcat, then i
 deleted and
 renamed
 those files and directories that i dont use (off course, the
 web-inf still
 exist)

 What can i do ? Is there is some file where i must configure
 the context of
 the webapp ?

 Thanks !!


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




FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE
---
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


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


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



realm in context in war file

2005-08-11 Thread Michal Kwiatek
Has any of you tried defining a realm inside the context.xml taken form
META-INF file from inside the war file?

I have the following context definition:

context path=/test1 override=true docBase=webapps/test1
realm 
className=org.apache.catalina.realm.MemoryRealm
debug=
pathname=webapps/test1/META-INF/context-users.xml
/
/context

but the realm definition is simply ignored by tomcat. 

Any idea why?

Thanks in advance,
Michal.

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



RE: realm in context in war file

2005-08-11 Thread Caldarale, Charles R
 From: Michal Kwiatek [mailto:[EMAIL PROTECTED] 
 Subject: realm in context in war file
 
 I have the following context definition:
 
 context path=/test1 override=true docBase=webapps/test1
 realm 
   className=org.apache.catalina.realm.MemoryRealm
   debug=
   pathname=webapps/test1/META-INF/context-users.xml
 /
 /context

What level of Tomcat are you using?  If it's 5.5, you should not have a
path attribute.  If you remove the pathname attribute from the realm
tag, does authentication function with the default
conf/tomcat-users.xml?

 - Chuck


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

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



RE: realm in context in war file

2005-08-11 Thread Michal Kwiatek
I've sorted it out: the problem was in the syntax! I was using context
instead of Context, and tomcat (5.0.28) simply ignored it without
writing any error message.

But thanks for the tip for 5.5 - I'm going to migrate soon, so it will
be useful.

Michal.

 -Original Message-
 From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 11, 2005 4:03 PM
 To: Tomcat Users List
 Subject: RE: realm in context in war file
 
  From: Michal Kwiatek [mailto:[EMAIL PROTECTED]
  Subject: realm in context in war file
  
  I have the following context definition:
  
  context path=/test1 override=true 
 docBase=webapps/test1 realm
  className=org.apache.catalina.realm.MemoryRealm
  debug=
  pathname=webapps/test1/META-INF/context-users.xml
  /
  /context
 
 What level of Tomcat are you using?  If it's 5.5, you should 
 not have a path attribute.  If you remove the pathname 
 attribute from the realm tag, does authentication function 
 with the default conf/tomcat-users.xml?
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
 PROPRIETARY MATERIAL and is thus for use only by the intended 
 recipient. If you received this in error, please contact the 
 sender and delete the e-mail and its attachments from all computers.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Context reloading

2005-08-11 Thread Graham Smith
I'm having a problem reloading / redeploying one of my web applications using 
the ant tasks.

The target I am trying to run is this and it fails on when stopping the 
application.

target name=redeploy description=Reinstall the existing web application
stop url=${url} username=${username} 
password=${password} path=${path}/
delete dir=${base}/
copy todir=${base}
fileset dir=${content.base}/
/copy
start url=${url} username=${username} 
password=${password} path=${path}/
/target

The error message given is removeAttribute: Session already invalidated 
which seems to be exactly the same as this bug

http://issues.apache.org/bugzilla/show_bug.cgi?id=30489

Unfortunately I don't have  a test case either but I am running tomcat 5.5.9. 
Three other web applications deployed in the same instance of tomcat can be 
redeployed with an essentially identical ant target just fine. It is just 
this one application that fails. Annoyingly when it fails it takes out the 
tomcat manager as well meaning the whole of tomcat needs to be restarted. Any 
ideas what might be wrong?

TIA
Graham

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



Same servlets in 2 contexts. Update 1 of them, not reloaded on context reload

2005-08-10 Thread Martyn Hiemstra
Hi All,

I am having a problem with Tomcat. I have a website application that I use
over 2 aplications. 1 context I use for testing and the other is meant for
vistors (live version). This means that the same application is running
over 2 contexts . When I update a servlet in the test context and then
reload the test context the update isnt loaded. For example:


I have the exact same servlet in the test and live context. I then update
the servlet in the test context by adding the following code
System.out.println(Updated servlet); to the doGet function of the
servlet. I then reload the test context.

The situation at this point is that the test context has the updated
servlet and that the live context has the older version of the servlet.

When the servlet is executed in the test context the text 'Updated
servlet' doesnt appear in the catalina.out file. If the servlet had been
reloaded correctly then the test context should have printed 'Updated
servlet'  to the catalina.out file everytime the servlet is executed
(Called via the get method). This makes me beleive that there is something
very wrong with tomcat, that it cant keep a clear difference between the
same servlet (although slightly modified) over different contexts.

I am using jakarta-tomcat-5.0.27 and j2sdk1.4.2 on debian sarge.

A tomcat restart by the way does solve the problem but thats not a
solution for me.

Thanks,
Martyn


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



  1   2   3   4   5   6   7   8   9   10   >