RE: Shared Library Issue using JVM ext

2009-01-31 Thread Peter Crowther
 From: Ishtiaq Ahmed [mailto:ishtiaq.ah...@ooober.com]
 I know this has been discussed many time but couldn't find the exact
 thing I am looking for. I am deploying several application
 over tomcat6.
 Each having its own libraries in WEB-INF/lib. Many of the
 applications
 are using the same libraries like  hibernate3.jar so this is
 increasing the size of the deployment. What I want to do is
 to copy all
 those libraries in a single location something like
 /opt/java/jre/lib/ext and let all the application use
 that...

Is the size of the deployment actually a problem for you, or are you trying to 
tidy up?

Unless the size of the deployment is really, genuinely a problem, I'd keep the 
jars in each application.  Yes, it costs a little disk space.  Yet, it costs a 
little memory.  It will save you many headaches when one application's library 
version changes - you will be able to redeploy that single application without 
worrying about versioning of the other libraries.

If the size of the deployment is really a problem, read 
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html and choose 
whether you want to put your jars in $CATALINA_HOME/lib.

- Peter

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



Very OT: RE: Slightly OT: ApacheCon Europe 2009

2009-01-31 Thread Peter Crowther
 From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com]
 usually the tomcat committers crowd at one table during
 the hackathon, so feel free to seek us out and join us at the table.
 if you wear a red rose in your hair, it will be easier to find you

... why do I now have visions of a room full of (mainly male) hackers, most of 
whom have red roses in their hair so that it's easier to find them?

- Peter

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



Re: Very OT: RE: Slightly OT: ApacheCon Europe 2009

2009-01-31 Thread André Warnier

Peter Crowther wrote:

From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com]
usually the tomcat committers crowd at one table during
the hackathon, so feel free to seek us out and join us at the table.
if you wear a red rose in your hair, it will be easier to find you


... why do I now have visions of a room full of (mainly male) hackers, most of whom have 
red roses in their hair so that it's easier to find them?

To disambiguate the real hackers from the ones that just read these 
posts, I suggest the real ones also carry a bottle of La Trappe in their 
right hand.


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



Content-Language en-US

2009-01-31 Thread Rubens

I always see Content-Language en-US on the HTTP header response of Tomcat
6. 

I wrote code below to have a different locale and header on the response. 
However, this does not change the response header.

response.setLocale(userSession.getLocale());
((HttpServletResponse) response).setHeader(Content-Language,
userSession.getLocale().getLanguage());

Rubens.
-- 
View this message in context: 
http://www.nabble.com/Content-Language-en-US-tp21764367p21764367.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Content-Language en-US

2009-01-31 Thread André Warnier

Rubens wrote:

I always see Content-Language en-US on the HTTP header response of Tomcat
6. 

I wrote code below to have a different locale and header on the response. 
However, this does not change the response header.


response.setLocale(userSession.getLocale());
((HttpServletResponse) response).setHeader(Content-Language,
userSession.getLocale().getLanguage());

Rubens.

A suggestion : check the logfile.
If you see a message containing response already committed, it means 
that you are doing the above too late, when Tomcat has already started 
outputting the response (iow has already written out at least one 
header).  It will not let you play with the reponse headers anymore then.




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



RE: application.getRealPath() in JSP from a subdirectory

2009-01-31 Thread Caldarale, Charles R
 From: Qiao Jin [mailto:bra...@gmail.com]
 Subject: RE: application.getRealPath() in JSP from a subdirectory

 Could you elaborate a bit on your statement: Using
 getRealPath() inside an app server of any kind is
 pretty much always a Bad Idea?

The container (app server) is under no obligation to provide access to the file 
system, other than the workspace area indicated by the 
javax.servlet.context.tempdir ServletContext attribute.  The container may be 
running on a platform that does not even have a file system (e.g., a router), 
some webapps may be deployed only in memory, or the webapp may be deployed via 
an archive of some sort.  While getRealPath() likely will work when you're in 
complete control of the execution environment, you cannot count on it in 
general.

 - Chuck


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

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



RE: Tomcat 5.5 service won't start

2009-01-31 Thread Caldarale, Charles R
 From: arricherekk [mailto:arricher...@hotmail.com]
 Subject: Tomcat 5.5 service won't start

 I installed Tomcat 5.5 yesterday, with limited success.
 It took me until a few hours ago to manage to get all of
 the ports and such things set correctly, so that everything
 would run properly.

That's extremely odd, and indicates you're probably changing things you 
shouldn't.  Tomcat has always run right out of the box for me, ever since I 
started playing with early 5.0 releases on Windows, Linux, and proprietary 
platforms.

You will probably find it easier, on a Windows system, to download the .zip 
version and run Tomcat with the startup.bat script at first.  Once you're happy 
with that, use the service.bat script to create the service, if you need to.

Don't change ports, don't put anything in CLASSPATH, don't put the Tomcat bin 
directory in PATH, do set the JAVA_HOME environment variable to point to the 
JDK directory, then start Tomcat.  Once you've confirmed that's working - 
including the Tomcat servlet and JSP examples, then add your webapp.  Only 
after you're happy with that result should you consider modifying server.xml 
settings for a production-like environment.

Note that you don't install individual servlets into Tomcat, you install 
webapps that are comprised of servlets and JSPs.

 - Chuck


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

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



Location of properties file for web app in Tomcat

2009-01-31 Thread Flavius


Greetings, 

I've spent some time searching online and reading other threads here, such
as
http://www.nabble.com/where-to-put-config-file-in-a-webapp-td16448528.html#a16450373.

I have a question that wasn't quite answered there though.

I have a web app that needs to have property information set, such
as database IP, login, email server IP, login, etc.  Typically I would
put this in the WEB-INF/classes dir as a properties file.

My concern is this ends up being inside the war file distributed.  So
a user would have to expand the war to get at the properties file
and edit it.  If they configure tomcat to run the war without expanding
it, they now have to un jar it, edit the properties file, and jar it up
again.  I really don't want a consumer messing with the war at all,
or even going into the expanded dir.

I thought of just putting the properties file in the webapps dir, beside
the war itself and reading it with ClassLoader.getResourceAsStream();

1.  I don't see anybody else do this, so that suggests this is not the
best place to put the properties file.
2.  I was having some issues reading the properties file outside the war
file.

So my questions are:
1. Where is the best place to put the properties file
if I want it located outside the war itself?  

2. I can read it using ClassLoader.getResourceAsStream() or maybe
ClassLoader.getSystemClassLoader()?

I realize a consequence to this is if they run more than once instance 
of the app on different urls, they would both read the same config file.  
That's a corner case I don't think we'll ever run into, although if we did,
I could probably just have it read the app's configured uri as part of the
properties file (uri1.properties, uri2.properties, etc).

My ultimate goal is to give these instructions to a network admin:

1.  Download and install Tomcat
2.  Place war file in TomcatDir/webapps
3.  Put the app.properties file at __ and set your database and
email server info.
4.  Start tomcat

Thanks very much!
-- 
View this message in context: 
http://www.nabble.com/Location-of-properties-file-for-web-app-in-Tomcat-tp21767095p21767095.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: Location of properties file for web app in Tomcat

2009-01-31 Thread Caldarale, Charles R
 From: Flavius [mailto:flav...@silverlion.com]
 Subject: Location of properties file for web app in Tomcat

 1. Where is the best place to put the properties file
 if I want it located outside the war itself?

I don't think there's a best place that would be applicable to all 
environments.  One mechanism that is known to work is to have the admin specify 
a system property at Tomcat startup indicating where the property file is 
located; the webapp looks at the system property during initialization and 
reads its properties from the specified location.  The name of the system 
property can be whatever you choose, and could even include the context path of 
the webapp to allow multiple instances to be deployed in one container.

 - Chuck


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

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



Problem in listener

2009-01-31 Thread ahmet temiz
hello

I encountered this exception:

~

Jan 31, 2009 9:23:55 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener
instance of class
org.apache.myfaces.webapp.StartupServletContextListener
java.lang.NoClassDefFoundError: javax/faces/application/NavigationHandler
at java.lang.ClassLoader.defineClass1(Native Method)
~~

how can I solve this ?

regards

Ahmet Temiz

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



Re: commons-logging problem

2009-01-31 Thread John Holman
Certainly putting commons-logging and log4j in the container's 
common/lib directory is the documented configuration. However this does 
not allow application-level logging for libraries used by the 
application like digester or spring that themselves use commons logging. 
The application log messages they generate then end up in the 
container's log files, and have to be enabled by changing the 
container's logging config. This is far from ideal. Hence my desire to 
install commons-logging in the application's WEB-INF/lib directory .. 
when you hit the problem I encountered.


John.



Gregor Schneider wrote:

On Fri, Jan 30, 2009 at 8:33 PM, Rusty Wright rusty.wri...@gmail.com wrote:

Does that work reliably now?  I was under the impression that it caused
problems, but that may have been with a previous version of tomcat.  That's
why I asked my where else question; I was wondering if that's what he was
thinking of.


Since you're talking about TC 5.5, it's a definit yes.

Take a look at http://tomcat.apache.org/tomcat-5.5-doc/logging.html

I've got one 5.5-instance-running here, and it works like charm.

Rgds

Gregor


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



RE: Tomcat 5.5 service won't start

2009-01-31 Thread arricherekk



Caldarale, Charles R wrote:
 
 From: arricherekk [mailto:arricher...@hotmail.com]
 Subject: Tomcat 5.5 service won't start

 I installed Tomcat 5.5 yesterday, with limited success.
 It took me until a few hours ago to manage to get all of
 the ports and such things set correctly, so that everything
 would run properly.
 
 That's extremely odd, and indicates you're probably changing things you
 shouldn't.  Tomcat has always run right out of the box for me, ever since
 I started playing with early 5.0 releases on Windows, Linux, and
 proprietary platforms.
 
 You will probably find it easier, on a Windows system, to download the
 .zip version and run Tomcat with the startup.bat script at first.  Once
 you're happy with that, use the service.bat script to create the service,
 if you need to.
 
 Don't change ports, don't put anything in CLASSPATH, don't put the Tomcat
 bin directory in PATH, do set the JAVA_HOME environment variable to point
 to the JDK directory, then start Tomcat.  Once you've confirmed that's
 working - including the Tomcat servlet and JSP examples, then add your
 webapp.  Only after you're happy with that result should you consider
 modifying server.xml settings for a production-like environment.
 
 Note that you don't install individual servlets into Tomcat, you install
 webapps that are comprised of servlets and JSPs.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 


Thanks for the reply!  I downloaded 5.5.27, and ran startup.bat.  I got the
exact same error as before.  Any idea what the Apache Tomcat Native
Library is?  Apparently, it's not finding it, as both logs indicate
something missing.  Thanks!
-- 
View this message in context: 
http://www.nabble.com/Tomcat-5.5-service-won%27t-start-tp21760087p21769286.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Tomcat returns HTTP status of 200 when HttpServletResponse.sendError() called.

2009-01-31 Thread Nathan Potter



Chuck,

I got the same error with your version. Which got me thinking. So  
removed all of my webapp files and tried a again with a fresh war file  
and now they both work.


Thanks!


Nathan


On Jan 29, 2009, at 8:27 PM, Caldarale, Charles R wrote:


From: Nathan Potter [mailto:n...@opendap.org]
Subject: Re: Tomcat returns HTTP status of 200 when
HttpServletResponse.sendError() called.


Sorry for not responding earlier, things have been a little hectic  
this week.



I just got try it today and here is what happened:


I just tried the same thing, with no problems.


I made this class:


I don't see a package clause in your code, nor are the imports  
shown.  Here's the entire code I used, including the poor man's  
logger, System.out:


package mypackage;

import javax.servlet.http.HttpServletRequest;
import org.apache.catalina.Globals;

public class StaticContentServlet extends  
org.apache.catalina.servlets.DefaultServlet {

 protected String getRelativePath(HttpServletRequest request) {
   // Are we being processed by a RequestDispatcher.include()?
   if (request.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) !=  
null) {
 String result =  
(String)request.getAttribute(Globals.INCLUDE_PATH_INFO_ATTR);

 if (result == null) {
   result =  
(String)request.getAttribute(Globals.INCLUDE_SERVLET_PATH_ATTR);

 }
 if (result == null || result.equals()) result = /;
 System.out.println(StaticContentServlet returning  + result);
 return result;
   }
   // No, extract the desired path directly from the request.
   String result = request.getPathInfo();
   if (result == null) {
 result = request.getServletPath();
   } else {
 result = request.getServletPath() + result;
   }
   if (result == null || result.equals()) result = /;
   System.out.println(StaticContentServlet returning  + result);
   return result;
 }
}


I added it to my web.xml file:


Mine is almost the same, with the addition of a listings param:

servlet
 servlet-namedocs/servlet-name
 servlet-classmypackage.StaticContentServlet/servlet-class
 init-param
  param-namelistings/param-name
  param-valuetrue/param-value
 /init-param
 load-on-startup1/load-on-startup
/servlet

just so the /docs mapping would do something useful.  (The servlet  
mappings are identical to yours.)


Referencing the URLs:
 http://localhost:8080/sample/docs
 http://localhost:8080/sample/docs/test.txt
got me this result in stdout:
 StaticContentServlet returning /docs
 StaticContentServlet returning /docs/test.txt
and the expected directory listings and the text file contents in  
the browser window.


- Chuck


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


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



= = =
Nathan Potterndp at opendap.org
OPeNDAP, Inc.541.752.1852



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



Apache Tomcat 6.0 loads blank page

2009-01-31 Thread zia mohades
Hi there,

I am currently having issue loading my own page using tomcat apache 6.0 on
ubuntu, here are the details;

1) when I start the server using sudo /etc/init.d/tomcat restart and then
try to access the server via http://localhost:8080, i sucessfully
get the welcome page and the logo of the tomcat

2) I then place my own folder called mms_tets( containing html files) in
/usr/local/tomcat/webapps and then restart the server using the same
command. however when try to access the http://localhost:8080 i get a blank
page. Showing absolutely nothing and I don't even get any errors. I checked
the permission also and it seems like I gave the full permission:
drwxrwxrwx  9 mohadesz mohadesz 4096 2009-01-31 21:13 mms_test

 I also checked the log folder , and here are their results:

for  catalina.2009-01-31.log -- 31-Jan-2009 9:34:46 PM
org.apache.catalina.startup.Catalina start
INFO: Server startup in 1520 ms

for localhost.2009-01-31.log  --31-Jan-2009 9:34:46 PM
org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()


i definitely appreciate your help! I spent so much time on this and
seriously can't figure out the problem.

Thank you kindly


zia


RE: Tomcat 5.5 service won't start

2009-01-31 Thread Caldarale, Charles R
 From: arricherekk [mailto:arricher...@hotmail.com]
 Subject: RE: Tomcat 5.5 service won't start

 I got the exact same error as before.  Any idea what
 the Apache Tomcat Native Library is?

That's not an error; note the INFO tag.  It's ignorable.

APR is the Apache Portable Runtime, an optional component that can improve 
connector performance, primarily when using SSL.  Unless you're maxing out your 
system, you don't really need it, and it does complicate the configuration.  
Details are here:
http://tomcat.apache.org/tomcat-5.5-doc/apr.html

To just get rid of the INFO message, comment out the AprLifecycleListener in 
server.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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Problem in listener

2009-01-31 Thread Caldarale, Charles R
 From: ahmet temiz [mailto:ahmettemi...@gmail.com]
 Subject: Problem in listener

 how can I solve this ?

You can start by providing useful information: Tomcat version, JRE/JDK vendor 
and version, type of platform.

 - Chuck


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

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



RE: Problem in listener

2009-01-31 Thread Martin Gainty


http://www.java2s.com/Code/Jar/Spring-Related/Downloadjsfapijar.htm

HTH
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




 Date: Sat, 31 Jan 2009 21:37:40 +0200
 Subject: Problem in listener
 From: ahmettemi...@gmail.com
 To: users@tomcat.apache.org
 
 hello
 
 I encountered this exception:
 
 ~
 
 Jan 31, 2009 9:23:55 PM org.apache.catalina.core.StandardContext listenerStart
 SEVERE: Exception sending context initialized event to listener
 instance of class
 org.apache.myfaces.webapp.StartupServletContextListener
 java.lang.NoClassDefFoundError: javax/faces/application/NavigationHandler
   at java.lang.ClassLoader.defineClass1(Native Method)
 ~~
 
 how can I solve this ?
 
 regards
 
 Ahmet Temiz
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_allup_howitworks_012009

running tomcat with root user

2009-01-31 Thread epicwin...@hotmail.com

I have the latest tomcat 6 installed under centos 5.2.  The problem I am having 
is that it appears that I have to run tomcat as root user, because the spring 
app that tomcat starts needs to write files to other users' home directories.  
The tomcat user doesn't have access to these directories.

I tried making these users part of a shared group, but to complicate the 
problem the users are jailed using jailkit.  So it doesn't appear that jailkit 
lets me add group write privileges to the home directories and maintain a 
working jail.

Can anyone suggest another alternative?  I am not linux user expert so maybe 
there is an obvious solution i am missing?
thanks




_
Windows Live™ Hotmail®…more than just e-mail. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_howitworks_012009

RE: application.getRealPath() in JSP from a subdirectory

2009-01-31 Thread Qiao Jin
Mark, 

Thanks for your help. This makes sense. I misunderstood the meaning of
appBase. getRealPath() is behaving well now, although I will explore the
other options Chuck mentioned. 

Regards,
Qiao

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Friday, January 30, 2009 11:09 PM
To: Tomcat Users List
Subject: Re: application.getRealPath() in JSP from a subdirectory

Qiao Jin wrote:
 Serving mydomain.com, what I have is one application in an unpacked
 directory, 'app-root', with jsp files located in the root dir or its
 subdirs. The Host for mydomain.com has its appBase pointing to 'app-root'.

 
 The ROOT.xml for mydomain.com has only one line: Context path=
docBase=
 reloadable=true/
 
 I read the document on the two attributes appBase and docBase, but it is
not
 very clear to me what the difference is. In my case, what should docBase
be?

The quickest fix will be:
- stop Tomcat
- delete ROOT.xml
- create a new dir called ROOT under app-root
- copy the contents of app-root to app-root/ROOT
- make sure there is no ROOT.xml in CATALINA_BASE/conf/engine/host
- start Tomcat

Mark

 
 
 Thanks and regards,
 Qiao 
 
 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org] 
 Sent: Friday, January 30, 2009 9:23 PM
 To: Tomcat Users List
 Subject: Re: application.getRealPath() in JSP from a subdirectory
 
 Qiao Jin wrote:
 Chuck, thanks for your response. It turns out that the auto-deploy switch
 does affect the situation. New subdirs created after the auto-deploy is
 turned off are no longer being treated as separate apps and getRealPath
is
 returning the path as I expected.
 
 This looks very much like you have configured appBase == docBase for the
 ROOT
 web application. This is likely to cause a world of pain - the behaviour
you
 have seen here being just one example. Try restarting Tomcat and see what
 happens to your getRealPath() calls...
 
 docBase should never be set to the same location as appBase.
 
 Mark
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



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


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



failed ActiveMQ hangs tomcat

2009-01-31 Thread AD
hello,

 i am running into a situation where if our JMS server is down
(activemq) the tomcat application does not respond at all.  Not sure
why tomcat is relying so heavily on this connection , any ideas as to
why this would be ?

Thanks
Adam

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



Re: failed ActiveMQ hangs tomcat

2009-01-31 Thread Kirk True

Hi Adam,

AD wrote:

hello,

 i am running into a situation where if our JMS server is down
(activemq) the tomcat application does not respond at all.  Not sure
why tomcat is relying so heavily on this connection , any ideas as to
why this would be ?

  


Does your ActiveMQ connection URL include the failover:// prefix? I've 
seen applications hang near-indefinitely trying to fail over to the same 
(downed) ActiveMQ server over and over again.


One way to see where the actual hang is would be to get a thread dump. 
The standard 'kill -3 pid' of the Tomcat process (on Linux/UNIX) would 
do the trick.


This sounds more like a web application issue than an issue with Tomcat. 
Also, if you have integration tests that connect to a live JMS server 
you could experiment with 'pulling the cord' and see where it hangs. 
This would then remove Tomcat from the equation.


Kirk

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



Re: failed ActiveMQ hangs tomcat

2009-01-31 Thread AD
actually i think i did notice failover() with only 1 address in
non-prod.  I think the reason that was there was some config
templating issue.

Are you saying if you remove the failover and just go straight in this
might resolve it?

Will give it a shot

Adam

On Sun, Feb 1, 2009 at 12:05 AM, Kirk True k...@mustardgrain.com wrote:
 Hi Adam,

 AD wrote:

 hello,

  i am running into a situation where if our JMS server is down
 (activemq) the tomcat application does not respond at all.  Not sure
 why tomcat is relying so heavily on this connection , any ideas as to
 why this would be ?



 Does your ActiveMQ connection URL include the failover:// prefix? I've seen
 applications hang near-indefinitely trying to fail over to the same (downed)
 ActiveMQ server over and over again.

 One way to see where the actual hang is would be to get a thread dump. The
 standard 'kill -3 pid' of the Tomcat process (on Linux/UNIX) would do the
 trick.

 This sounds more like a web application issue than an issue with Tomcat.
 Also, if you have integration tests that connect to a live JMS server you
 could experiment with 'pulling the cord' and see where it hangs. This would
 then remove Tomcat from the equation.

 Kirk

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



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



Re: failed ActiveMQ hangs tomcat

2009-01-31 Thread Kirk True

Hi Adam,

AD wrote:

actually i think i did notice failover() with only 1 address in
non-prod.  I think the reason that was there was some config
templating issue.

Are you saying if you remove the failover and just go straight in this
might resolve it?

Will give it a shot
  



Failover is great if you have another server to which to fail over ;) 
But if there's only the one, it'll hang. However, there are some backoff 
settings that can be adjusted so it shouldn't hang /forever/, but 
possibly for many minutes.


So, removing failover will change it to 'fail fast' behavior. Of course 
it won't fix the core issue of the JMS server being down :\


Kirk



Re: Location of properties file for web app in Tomcat

2009-01-31 Thread Keshav Prasad
I think what Chuck mentioned is a nice approach. You could set an env
variable and read it off when app server initializes something like this-

String path = System.getenv(PROP_FILE_PATH);

Use this file path to read the properties file.

On Sat, Jan 31, 2009 at 11:19 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Flavius [mailto:flav...@silverlion.com]
  Subject: Location of properties file for web app in Tomcat
 
  1. Where is the best place to put the properties file
  if I want it located outside the war itself?

 I don't think there's a best place that would be applicable to all
 environments.  One mechanism that is known to work is to have the admin
 specify a system property at Tomcat startup indicating where the property
 file is located; the webapp looks at the system property during
 initialization and reads its properties from the specified location.  The
 name of the system property can be whatever you choose, and could even
 include the context path of the webapp to allow multiple instances to be
 deployed in one container.

  - Chuck


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

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




Re: Location of properties file for web app in Tomcat

2009-01-31 Thread Kirk True

Hi all,

Caldarale, Charles R wrote:

From: Flavius [mailto:flav...@silverlion.com]
Subject: Location of properties file for web app in Tomcat

1. Where is the best place to put the properties file
if I want it located outside the war itself?



I don't think there's a best place that would be applicable to all 
environments.  One mechanism that is known to work is to have the admin specify a system 
property at Tomcat startup indicating where the property file is located; the webapp 
looks at the system property during initialization and reads its properties from the 
specified location.  The name of the system property can be whatever you choose, and 
could even include the context path of the webapp to allow multiple instances to be 
deployed in one container.


  


+1

I had the same issue as the OP and the best I could come up with was to 
change catalina.sh to include a system property that was then read by 
the web app. But we did fall into the same problem of multiple instances 
and we just made the system property that pointed to the file more 
qualified.


Kirk


Re: Apache Tomcat 6.0 loads blank page

2009-01-31 Thread Keshav Prasad
After you placed the mms_tets inside the webapp directory, try accessing
http://localhost:8080/mms_tets/
or something like http://localhost:8080/mms_tets/somefile.html

Replace somefile.html with a file that exists.

On Sat, Jan 31, 2009 at 6:39 PM, zia mohades zia.si...@gmail.com wrote:

 Hi there,

 I am currently having issue loading my own page using tomcat apache 6.0 on
 ubuntu, here are the details;

 1) when I start the server using sudo /etc/init.d/tomcat restart and then
 try to access the server via http://localhost:8080, i sucessfully
 get the welcome page and the logo of the tomcat

 2) I then place my own folder called mms_tets( containing html files) in
 /usr/local/tomcat/webapps and then restart the server using the same
 command. however when try to access the http://localhost:8080 i get a
 blank
 page. Showing absolutely nothing and I don't even get any errors. I checked
 the permission also and it seems like I gave the full permission:
 drwxrwxrwx  9 mohadesz mohadesz 4096 2009-01-31 21:13 mms_test

  I also checked the log folder , and here are their results:

 for  catalina.2009-01-31.log -- 31-Jan-2009 9:34:46 PM
 org.apache.catalina.startup.Catalina start
 INFO: Server startup in 1520 ms

 for localhost.2009-01-31.log  --31-Jan-2009 9:34:46 PM
 org.apache.catalina.core.ApplicationContext log
 INFO: SessionListener: contextInitialized()


 i definitely appreciate your help! I spent so much time on this and
 seriously can't figure out the problem.

 Thank you kindly


 zia