Re: Tomcat on a machine with multiple ip addresses

2010-05-04 Thread Pid
On 04/05/2010 05:12, Dave Filchak wrote:
 Thanks for this. I did use the address attribute for port 80. No check
 that. I think what I did was pit address=XXX.XXX.XXX.XXX but did not
 specify the port ... just the address as it also listens on ports up in
 the 8000 range I believe. How do I stop it from listening on port 443? I
 will need to have another site (non tomcat) listening on 443 on the same
 IP under Apache. This machine basically has three IP numbers assigned to
 it.

Each connector listenes on one port and an address (which may be
0.0.0.0), just specify which port  address combination you do want it
to listen on.


p

 Dave
 
 On 22/07/64 2:59 PM, Mark Thomas wrote:
 On 03/05/2010 23:40, Dave Filchak wrote:
   
 Humm ... sorry it has taken a while to get back to you with this. I have
 been busy trying to get all my clients up. There is not a lot of them
 but it is very time consuming. Before I get to all the configs, does
 Tomcat, by default, take over ALL the ips' on port 443 i.e. 0.0.0.0:443?
 If so, where would/could I set this to only listen on one IP or even do
 not listen for 443 as I have another app that I will need for that port.
  
 By default, Tomcat will listen to all IPv4 and IPv6 addressed on the
 specified port.

 Use the address attribute of the connector to limit this to all IPv4
 only, all IPv6 only or a apecific IPv4 or IPv6 address.

 Mark




 




signature.asc
Description: OpenPGP digital signature


Re: Exception report - HTTP Status 500 -

2010-05-04 Thread Pid
On 04/05/2010 06:22, Paul Chany wrote:
 Warren Pace warren.p...@gmail.com writes:
 
 If you installed your Tomcat using the Debian package manager, take a
 look at the tomcat startup script.  While it's been a number of years
 since I used Debian, I seem to remember this from back in the day -
 look for a statement referencing security or use security or
 something to that effect and comment it out.  Restart Tomcat and see
 if that doesn't fix it.
 
 Yes, I'm installed my Tomcat using Debian package manager (aptitude).
 I edited the /etc/init.d/tomcat5.5 file:
 # Use the Java security manager? (yes/no)
 TOMCAT5_SECURITY=no
 
 and that fix the problem.
 
 Why don't work the Java security manager for me?

The repackaged versions of Tomcat usually move files around, causing
unexpected problems like this.  We usually recommend that people install
a 'real' Tomcat downloaded from http://tomcat.apache.org/


p

 Exactly which version of Tomcat 5.5.nn?
 
 I'm using Tomcat5.5.26-5.
 
 --
 Regards, Paul Chany
 You can freely correct me in my English.
 http://csanyi-pal.info
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: minSpareThreads maxSpareThreads

2010-05-04 Thread Mario Splivalo
Christopher Schultz wrote:
 Mario,
 
 On 5/3/2010 8:18 AM, Mario Splivalo wrote:
 André Warnier wrote:
 Mario Splivalo wrote:
 One just have to love Tomcat documentation :)

 Specially considering the price you pay for it.
 Oh, that is so professional. So, it's cheap therefore it can be
 unprofessional? It's a joke, I hear you saying?
 
 Relax.

Did so :) My apologies to the list, and esp. André.

 
 There really is NO mention whatsoever about
 minSpareThreads and maxSpareThreads in documentation, using executors or
 not.
 
 It's because you're looking for a specific word that's not in there. Try
 reading all the attributes for the HTTP Connector:
 http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
 
 You'll see that maxThreads is in there. There is no minThreads, but
 you can treat it as if minThreads is 0 (zero).
 
 
 Try looking at the Executor documentation again:
 http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html
 
 Specifically, minSpareThreads /is/ in there though there is no
 maxSpareThreads.
 

Yes, it actually makes sense now, to use executors for desired behavior.
It's just that I somehow missed the introduction of the executors.
I still don't understand the actual benefit of using executors - is
there any performance gain in using executors?

Mario
Mario

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



Re: How to force session replication per request in a Tomcat 6 cluster - SOLVED

2010-05-04 Thread Kevin Jansz
A bit more searching on the apache bugzilla led me to this:
https://issues.apache.org/bugzilla/show_bug.cgi?id=43866

This enhancement request describes (probably a bit clearer) the gap in
functionality going from 5.0 to 5.5/6.0 - namely there's no
useDirtyFlag, so no way to tell the (more sophisticated) DeltaManager
to behave in a dumber way and just send everything everytime.

A comment on this enhancement request about talking directly to the
DeltaSession made me think it's worth a try - a ClusterValve has
access to this and I already had a skeleton implementation on trying
Jon's suggestion with the SimpleTcpReplicationManager. If the valve
simply grabs all the attributes and puts them back in again this is
enough for the DeltaRequest to flag the session as dirty and full
replication happens after each request.

This was the config:
Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster
Valve className=org.apache.catalina.ha.tcp.ForceReplicationValve/
Valve className=org.apache.catalina.ha.tcp.ReplicationValve

filter=.*\.gif;.*\.jpg;.*\.png;.*\.js;.*\.htm;.*\.html;.*\.txt;.*\.css;/
/Cluster

the key bit of code in the ForceReplicationValve (I could share the
whole class if anyone's interested - after some clean up; better
logging; etc; etc):
@Override
public void invoke(Request request, Response response) throws
IOException, ServletException {
getNext().invoke(request, response);

Session session = null;
try {
session = request.getSessionInternal();
} catch (Throwable e) {
log.error(sm.getString(ReplicationValve.send.failure), e);
}

if (session != null) {
if (session instanceof ReplicatedSession) {
// it's a SimpleTcpReplicationManager - can just set to dirty
((ReplicatedSession) session).setIsDirty(true);
} else {
// for everything else - cycle all attributes
List cycledNames = new LinkedList();
// in a cluster this should be
org.apache.catalina.ha.session.DeltaSession - implements HttpSession
HttpSession deltaSession = (HttpSession)session;
for (EnumerationString names =
deltaSession.getAttributeNames() ; names.hasMoreElements() ; ) {
String name = names.nextElement();
cycledNames.add(name);
deltaSession.setAttribute(name,
deltaSession.getAttribute(name));
}
log.debug(getInfo() + : session  + session.getId() +
 cycled atrributes =  + cycledNames);
}
} else {
String id = request.getRequestedSessionId();

log.debug(sm.getString(ReplicationValve.session.invalid,
request.getContext().getName(), id));
}
}

PS thanks for the responses. Martin, the session manager project
sounds awesome but the use of memcached (c-based native code server if
I read correctly) would make it a non-starter for us. The future use
of ehcache sounds promising, but I'd consider this (and Terracotta
too) only for the most critical deployments. Sure the
broadcast-to-all-over-tcp approach above is not going to scale well
for up to dozens of nodes but is good enough for a couple of nodes in
a basic cluster - I believe we're yet to have tomcat instance go down
in the clusters we've been involved in setting up.


--
Kevin Jansz
kevin.ja...@exari.com
Level 7, 10-16 Queen Street, Melbourne 3000 Australia
Tel +61 3 9621 2773 | Fax +61 3 9621 2776
Exari Systems
Boston | London | Melbourne | Munich
www.exari.com

Test drive our software online - www.exari.com/demo-trial.html
Read our blog on document assembly - blog.exari.com



On 2 May 2010 07:21, Martin Grotzke martin.grot...@javakaffee.de wrote:

 Hi,

 I created the memcached-session-manager as an alternative session
 replication solution:
 code.google.com/p/memcached-session-manager/

 It keeps sessions in local memory and stores session additionally in
 memcached nodes (for backup, asynchronously if desired).
 Sessions are replicated when session data has changed, so that no
 setAttribute is required.

 There are also different serialization stategies available, additionally
 to default java serialization there's a javolution/xml based one, and I
 also just added serialization based on kryo [1] (very fast according to
 protobuf-thrift-compare benchmark). Both (javolution, kryo based) don't
 need objects in the session attributes object graph to implement
 Serializable - which is sometimes useful, e.g. if legacy projects
 shall get session failover.

 Cheers,
 Martin

 [1] code.google.com/p/kryo/


 On Wed, 2010-04-28 at 22:34 +1000, Kevin Jansz wrote:
  In a Tomcat 6 cluster can you force session replication on every
  request? In Tomcat 5.0.x you had the ability to set
  useDirtyFlag=false on the manager
  (org.apache.catalina.cluster.session.SimpleTcpReplicationManager) -
  meaning a mutable object in the session would 

Re: minSpareThreads maxSpareThreads

2010-05-04 Thread Pid
On 04/05/2010 07:51, Mario Splivalo wrote:
 Christopher Schultz wrote:
 Mario,


...

 Yes, it actually makes sense now, to use executors for desired behavior.
 It's just that I somehow missed the introduction of the executors.
 I still don't understand the actual benefit of using executors - is
 there any performance gain in using executors?
   Mario

Not sure about that, but it does now mean you can assign one pool to a
group of connectors.

E.g. you may wish to specify the max number of threads for the *server*,
rather than having to guess whether the combined threads for HTTP and
HTTPS are too much/enough.


p

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




signature.asc
Description: OpenPGP digital signature


Re: Problem with downloading file over servlet

2010-05-04 Thread André Warnier

Petr Hracek wrote:

If I understand right then sun.net.www.protocol.http.HttpURLConnection is
not part of any class, right / is obsolete?

Or is there any other class?

Sorry for that stupid question but I do not understand. Code has been really
adopted.


Petr,

I think what they are telling you is :
- this is a forum for help with Tomcat and Tomcat code, and the 
expertise of people here is with Tomcat
- the error that you show, is an error that happens within an 
application running under Tomcat, but it is not code that belongs to 
Tomcat, or which uses the Tomcat libraries
- nobody here knows that code, so nobody here can really help you with 
it, or answer your questions about it.  You need to find where that code 
comes from, and ask them for help.


It is not that people here do not want to help, it is that they cannot help.




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



Re: Problem with downloading file over servlet

2010-05-04 Thread Pid
On 04/05/2010 10:32, André Warnier wrote:
 Petr Hracek wrote:
 If I understand right then sun.net.www.protocol.http.HttpURLConnection is
 not part of any class, right / is obsolete?

 Or is there any other class?

 Sorry for that stupid question but I do not understand. Code has been
 really
 adopted.

 Petr,
 
 I think what they are telling you is :
 - this is a forum for help with Tomcat and Tomcat code, and the
 expertise of people here is with Tomcat
 - the error that you show, is an error that happens within an
 application running under Tomcat, but it is not code that belongs to
 Tomcat, or which uses the Tomcat libraries
 - nobody here knows that code, so nobody here can really help you with
 it, or answer your questions about it.  You need to find where that code
 comes from, and ask them for help.
 
 It is not that people here do not want to help, it is that they cannot
 help.

Using a sun.net... class is generally inadvisable.

You probably want the application to use the java.net.HttpURLConnection
class instead - it might be an artefact of an auto-import by an IDE.

On the other hand the author may, for some reason, be using that class
for a specific reason, however unwise it may be.

Disclaimer: I am guessing; you will definitely have to talk to the
authors to find out.


p

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




signature.asc
Description: OpenPGP digital signature


Re: Failed to deploy application

2010-05-04 Thread Luís de Sousa
Hello again,

Today I was able to get an application deployed with auto-deploy, by
simply copying the directory into webapps.

I still can't deploy an application at another disk location using the
GUI or the URL call, same error:

FAIL - Failed to deploy application at context path /JSPTut2

Thank you,

Luís

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



Re: JAXBContext leaks memory

2010-05-04 Thread Mark Shifman

On 05/03/2010 02:53 PM, Pid wrote:
 On 03/05/2010 18:30, Mark Shifman wrote:

 On 05/03/2010 12:48 PM, Pid wrote:
 On 03/05/2010 17:15, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.

 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in 
 number
 after running my unmarshal action, followed by undeploy and redeploy.  
 Find Leaks in the manager also finds leaks.
 
 Do you see log messages referring to potential leaks in the catalina.out
 log (assuming you're on a unix variant)?

 If so, can you post them please?

There are no messages in catalia.out concerning leaks (I am using Linux 
2.6.18-92.1.22.el5)
I also got rid of timeBetweenEvictionRunsMillis in datasource since it causes a 
leaky TimerThread).

 
 What does the manager 'find leaks' command report exactly?
...
leak (use a profiler to confirm):
/yp_results


My webapp is named yp_results.
 
 After a few undeploy/redeploy cycles does the number of
 WebappClassLoader's also increase?

 Yes it increases 1 for each undeploy/redeploy cycle.
 
 snip... 
 
 Maybe.

 JAXBContext.newInstance() can take a ClassLoader argument.  Is there some 
 ClassLoader I should be using that will get around this?
 
 OK, so I've looked at JAXBContext (and JAXBContextImpl) and it doesn't
 (after quick read through) look like it's storing the classloader
 argument anywhere during the newInstance call, which is the usual source
 of leaks.
 
 Where is the jar with the above code, in a webapp?
 The code above in in the war for the web app in a class in 
 WEB-INF/classes/org/blablabla

 It is called via a class that looks like this:

 public class JAXBMascot {
  protected static Log log = LogFactory.getLog(JAXBMascot.class);
  private XMLEventReader reader;
  private Unmarshaller u = 
 JAXBContextMascot.INSTANCE.createUnmarshaller();
 
 You're setting the XMLEventReader, Unmarshaller  InputStream as
 instance field values, rather than completing the parsing in the
 getInstance() method?
I have really big xmls to unmarshall so I am using streaming them in and 
unmarshalling the elements I want
and then insert into my database. I need the reader to see where I am and then 
the umarshaller

I didn't show the all the methods of JAXBMascot but here is workhorse:
public T T getNextElement(String theElement, String elementAfter, 
Class Tclazz) {
String elname = ;
T h = null;
try {
while(reader.hasNext()){
  if(reader.peek().isStartElement()){
 elname = 
reader.peek().asStartElement().getName().getLocalPart();
 if(elname.equals(theElement)){
   h= u.unmarshal(reader, clazz).getValue();
   return h;
 }
  } else if(reader.peek().isEndElement()){
elname = 
reader.peek().asEndElement().getName().getLocalPart();
if(elname.equals(elementAfter)){
return h;
}
}

  reader.nextEvent();
}
} catch (XMLStreamException e) {
throw new RuntimeException(e);
} catch (JAXBException e) {
throw new RuntimeException(e);
}
return h;
}

It also has a close method to clean up after I have gotten all the elements.
public void close(){
try {
reader.close();
} catch (XMLStreamException e) {
//quietly
}
IOUtils.closeQuietly(jxb_in);
u=null;
}
I don't think I am leaving any stuff hanging around but memory leaks are very 
sneaky.
mas
 
 This looks a bit odd to me, but I don't know what the rest of the
 instance does...
 
 
 p
 
  private InputStream jxb_in;

  public static JAXBMascot getInstance(InputStream in) {
  JAXBMascot m = new JAXBMascot();
  try {
  m.setJxb_in(in);
  
 m.setReader(XMLInputFactory.newInstance().createXMLEventReader(in));
  } catch (Exception e) {
  log.fatal(error getting JAXBMascot instance);
  IOUtils.closeQuietly(in);
  throw new RuntimeException(e);
  }

  return m;
  }
 
 }

 This is also in the webapp in WEB-INF/classes/org/blablabla
 
 
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu


Tomcat 5.5 won't do TLS

2010-05-04 Thread Looijmans, Mike
I'm trying to enable TLS (or SSL) in a Tomcat 5.5.29 server, on a
Windows XP machine.
 
Whatever I do, I always end up with a server that just delivers plain
HTML on port 443, and it doesn't even try to use TLS. That is, I can
connect to http://localhost:443/ and get the same as http://localhost/
and https://localhost/ just displays an invalid response error which
makes perfect sense because the webserver isn't attempting TLS
negotiation at all.
 
So far, I've followed various recipes for creating a selfsigned key that
Tomcat might want to use, but I am suspecting now that the key is not
the problem at all, because there is no error whatsoever in the log
files.
 
All my attempts have by now been accompagnied by completely removing
Tomcat, removing all left-over directories and installing it again
before attempting anything else.
 
The only change to the configuration is in conf/server.xml, I changed
the connectors:

!-- Define a non-SSL HTTP/1.1 Connector on port 80 --
Connector port=80 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=2 maxSpareThreads=75
   enableLookups=false redirectPort=443 acceptCount=10
   connectionTimeout=2 disableUploadTimeout=true /

!-- Define a SSL HTTP/1.1 Connector on port 443 --
Connector port=443 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=2 maxSpareThreads=75
   enableLookups=false disableUploadTimeout=true
   acceptCount=10 scheme=https secure=true
   clientAuth=false sslProtocol=TLS
   keystoreFile=conf/server.ks
   keystorePass=tomcat
/

All the rest is default, and yes, I removed the comment !-- -- markers
around this directive. In the catalina.2010-05-04.log file, I see the
following output if I start the tomcat service:

May 4, 2010 3:13:52 PM org.apache.catalina.core.AprLifecycleListener
init
INFO: Cannot find message associated with key aprListener.tcnValid
May 4, 2010 3:13:52 PM org.apache.catalina.core.AprLifecycleListener
init
INFO: Cannot find message associated with key aprListener.flags
May 4, 2010 3:13:52 PM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
May 4, 2010 3:13:52 PM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-443
May 4, 2010 3:13:52 PM org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
May 4, 2010 3:13:52 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 672 ms
May 4, 2010 3:13:52 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 4, 2010 3:13:52 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.29
May 4, 2010 3:13:52 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
May 4, 2010 3:13:53 PM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-80
May 4, 2010 3:13:53 PM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-443
May 4, 2010 3:13:53 PM org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
May 4, 2010 3:13:53 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
May 4, 2010 3:13:53 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 453 ms

Changing the keystoreFile to bogus does not seem to provoke any error
either.

No other webserver or anything is listening on port 80 or 443.

What am I missing?
--
Mike

This message and attachment(s) are intended solely for use by the addressee and 
may contain information that is privileged, confidential or otherwise exempt 
from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.

If you have received this communication in error, please notify the sender 
immediately by telephone and with a 'reply' message.

Thank you for your co-operation.



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



Re: Tomcat 5.5 won't do TLS

2010-05-04 Thread Peter Crowther
On 4 May 2010 14:22, Looijmans, Mike mike.looijm...@oce.com wrote:
 I'm trying to enable TLS (or SSL) in a Tomcat 5.5.29 server, on a
 Windows XP machine.

 Whatever I do, I always end up with a server that just delivers plain
 HTML on port 443, and it doesn't even try to use TLS.
[...]
    !-- Define a SSL HTTP/1.1 Connector on port 443 --
    Connector port=443 maxHttpHeaderSize=8192
               maxThreads=150 minSpareThreads=2 maxSpareThreads=75
               enableLookups=false disableUploadTimeout=true
               acceptCount=10 scheme=https secure=true
               clientAuth=false sslProtocol=TLS
               keystoreFile=conf/server.ks
               keystorePass=tomcat
                /

See http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html .  I
suspect you're missing:
SSLEnabled=true

- Peter

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



Re: Tomcat 5.5 won't do TLS

2010-05-04 Thread Konstantin Kolinko
2010/5/4 Looijmans, Mike mike.looijm...@oce.com:
 May 4, 2010 3:13:52 PM org.apache.coyote.http11.Http11AprProtocol init
 INFO: Initializing Coyote HTTP/1.1 on http-443

The Apr in the above message means that you are using APR version
of the connector.

!-- Define a SSL HTTP/1.1 Connector on port 443 --
Connector port=443 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=2 maxSpareThreads=75
   enableLookups=false disableUploadTimeout=true
   acceptCount=10 scheme=https secure=true
   clientAuth=false sslProtocol=TLS
   keystoreFile=conf/server.ks
   keystorePass=tomcat
/

When APR version of the connector is used, you should specify the
SSLCertificateFile and SSLCertificateKeyFile attributes. The
keystoreFile attribute is ignored.

 See http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html

See also configuration reference:
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

If you do not want to use the APR connector, you can either remove
bin/tcnative-1.dll, or set
protocol=org.apache.coyote.http11.Http11Protocol


FIXME:
1) The SSLEnabled attribute is @since Tomcat 6.
It should not be present in the examples, though it does not hurt,
because unknown configuration attributes are ignored in Tomcat 5.5
2) SSLCertificateFile, SSLCertificateKeyFile are not mentioned in the
configuration reference (config/http.html).

Best regards,
Konstantin Kolinko

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



RE: Tomcat 5.5 won't do TLS

2010-05-04 Thread Caldarale, Charles R
 From: Looijmans, Mike [mailto:mike.looijm...@oce.com]
 Subject: Tomcat 5.5 won't do TLS
 
 Connector port=443 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=2 maxSpareThreads=75
   enableLookups=false disableUploadTimeout=true
   acceptCount=10 scheme=https secure=true
   clientAuth=false sslProtocol=TLS
   keystoreFile=conf/server.ks
   keystorePass=tomcat
 /

Note that the above is for the Java-based SSL connector, but...

 May 4, 2010 3:13:52 PM org.apache.coyote.http11.Http11AprProtocol init
 INFO: Initializing Coyote HTTP/1.1 on http-443

You're using the APR version, since you have tcnative-1.dll in Tomcat's bin 
directory.

You can either disable APR by renaming or deleting the above .dll file (and 
adding the SSLEnabled=true attribute, as Peter mentioned), or change your SSL 
configuration to the APR settings:

http://tomcat.apache.org/tomcat-5.5-doc/apr.html#HTTPS

 - 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



mod_proxy_ajp configuration

2010-05-04 Thread Roche, Christian (EXT-Other - MA/Rabat)

Hi,

I have a problem with configuring mod_proxy_ajp to access Tomcat5 through 
Apache2. My setup:

CentOS release 5.4 (Final)
httpd-2.2.3-31.el5.centos.4
tomcat5-5.5.23-0jpp.7.el5_3.2

I have in /etc/httpd/conf.d/proxy_ajp.conf:

Location /tomcat/
  ProxyPass ajp://localhost:8009/
  ProxyPassReverse  ajp://localhost:8009/
/Location

i.e., I want all my Tomcat webapps accessible behind a /tomcat location.


Now if I try

 cut - cut --
wget http://copper/tomcat/admin
--2010-05-04 15:11:30--  http://copper/tomcat/admin
Resolving copper... 10.156.31.49
Connecting to copper|10.156.31.49|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://copper/admin/ [following]
--2010-05-04 15:11:30--  http://copper/admin/
Connecting to copper|10.156.31.49|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2010-05-04 15:11:30 ERROR 404: Not Found.
 cut - cut --

I get a 404 because the URL in incorrectly redirected.
If I try to access directly 

 cut - cut --
wget http://copper/tomcat/admin/
--2010-05-04 15:14:15--  http://copper/tomcat/admin/
Resolving copper... 10.156.31.49
Connecting to copper|10.156.31.49|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2504 (2.4K) [text/html]
Saving to: `index.html'
2010-05-04 15:14:15 (13.4 MB/s) - `index.html' saved [2504/2504]
 cut - cut --

I receive something, however it doesn't work since the answer contains

head
  base href=http://copper/admin/login.jsp;
/head

which is wrong.

To alleviate this I tried to modify the AJP connector in web.xml:

  Connector port=8009
proxyName=copper/tomcat proxyPort=80
enableLookups=false redirectPort=8443 protocol=AJP/1.3 /

It seems to work better however I receive HTTP Status 408, he time allowed for 
the login process has been exceeded which seems to indicate the cookie is not 
transmitted correctly. This could be related to the Attempt to fake the path 
that is shown by wget:

 cut - cut --
4MAL00298:~/testwget -d http://copper/tomcat/admin/
DEBUG output created by Wget 1.11.4 on cygwin.

--2010-05-04 15:19:16--  http://copper/tomcat/admin/
Resolving copper... 10.156.31.49
Caching copper = 10.156.31.49
Connecting to copper|10.156.31.49|:80... connected.
Created socket 3.
Releasing 0x006d91f0 (new refcount 1).

---request begin---
GET /tomcat/admin/ HTTP/1.0
User-Agent: Wget/1.11.4
Accept: */*
Host: copper
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Date: Tue, 04 May 2010 14:19:16 GMT
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 WET
Set-Cookie: JSESSIONID=80BF7B0E2875A3CFD025DA77EF051F71; Path=/admin
Content-Type: text/html;charset=utf-8
Content-Length: 2467
Connection: close

---response end---
200 OK
Attempt to fake the path: /admin, /tomcat/admin/
Length: 2467 (2.4K) [text/html]
Saving to: `index.html.2'
Closed fd 3
2010-05-04 15:19:16 (13.8 MB/s) - `index.html.2' saved [2467/2467]
 cut - cut --

So what gives? Is this all because I want my URL to be slighlty rewritten? Does 
nobody ever do that?

Thanks for your help,
Chris


Issue with clustering

2010-05-04 Thread Marc Wilmots
Hi List,

Since a few weeks now, I started to notice in the catalina.out log file
messages regarding the cluster's operatability.
It reports that a member or members in my cluster have disappeared, and
appeared (member still alive) again. That's reasonable...the strange thing
is that they occur at exactly the same time.

Sometimes this message appears several times in a minute, and sometimes it
doesn't appear for several  minutes.
I'm using Tomcat 6.0.18 with JDK 1.6.0_14 64bit on RedHat Linux 5.2.

I'm thinking about several posibilities here, as for example a bad switch or
something. Although, the thing is, I have other Tomcat instances in the same
network that do not show this behavior.

I would really apreciate it if someone could shed a light on what I can
investigate next.

As an example, I paste some output from my log:

Apr 29, 2010 1:43:31 PM org.apache.catalina.tribes.
group.interceptors.TcpFailureDetector memberDisappeared
INFO: Received
memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10,
-68, 4, -36}:4003,{10, -68, 4, -36},4003, alive=23576482,id={17 96 -31 30
-112 76 73 -38 -87 6 -74 21 -124 117 18 -66 }, payload={}, command={},
domain={}, ]] message. Will verify.
Apr 29, 2010 1:43:31 PM
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector
memberDisappeared
INFO: Verification complete. Member still
alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4,
-36}:4003,{10, -68, 4, -36},4003, alive=23576482,id={17 96 -31 30 -112 76 73
-38 -87 6 -74 21 -124 117 18 -66 }, payload={}, command={}, domain={}, ]]
Apr 29, 2010 1:47:59 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Member send is failing for:tcp://{10, -68, 4, -37}:4003 ; Setting
to suspect and retrying.
Apr 29, 2010 1:47:59 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is
disconnected.
Apr 29, 2010 1:47:59 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is
disconnected.
Apr 29, 2010 1:48:01 PM org.apache.catalina.ha.tcp.SimpleTcpCluster
memberDisappeared
INFO: Received member
disappeared:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68,
4, -37}:4003,{10, -68, 4, -37},4003, alive=23477210,id={96 77 36 -51 -85 -17
67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={},
]
Apr 29, 2010 1:48:01 PM
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector
performBasicCheck
INFO: Suspect member, confirmed
dead.[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4,
-37}:4003,{10, -68, 4, -37},4003, alive=23477210,id={96 77 36 -51 -85 -17 67
-53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={}, ]]
Apr 29, 2010 1:48:08 PM
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector
memberDisappeared
INFO: Received
memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10,
-68, 4, -37}:4003,{10, -68, 4, -37},4003, alive=24454627,id={96 77 36 -51
-85 -17 67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={},
domain={}, ]] message. Will verify.
Apr 29, 2010 1:48:08 PM
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector
memberDisappeared
INFO: Verification complete. Member
disappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68,
4, -37}:4003,{10, -68, 4, -37},4003, alive=24454627,id={96 77 36 -51 -85 -17
67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={},
]]
Apr 29, 2010 1:48:08 PM org.apache.catalina.ha.tcp.SimpleTcpCluster
memberDisappeared
INFO: Received member
disappeared:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68,
4, -37}:4003,{10, -68, 4, -37},4003, alive=24454627,id={96 77 36 -51 -85 -17
67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={},
]
Apr 29, 2010 1:48:09 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Member send is failing for:tcp://{10, -68, 4, -37}:4003 ; Setting
to suspect and retrying.
Apr 29, 2010 1:48:09 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is
disconnected.
Apr 29, 2010 1:48:09 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is
disconnected.
Apr 29, 2010 1:48:09 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is
disconnected.
Apr 29, 2010 1:48:09 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is
disconnected.
Apr 29, 2010 1:48:09 PM
org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop
WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is

Re: JAXBContext leaks memory

2010-05-04 Thread Pid
On 04/05/2010 14:10, Mark Shifman wrote:
 
 On 05/03/2010 02:53 PM, Pid wrote:
 On 03/05/2010 18:30, Mark Shifman wrote:

 On 05/03/2010 12:48 PM, Pid wrote:
 On 03/05/2010 17:15, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.

 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in 
 number
 after running my unmarshal action, followed by undeploy and redeploy.  
 Find Leaks in the manager also finds leaks.

 Do you see log messages referring to potential leaks in the catalina.out
 log (assuming you're on a unix variant)?

 If so, can you post them please?
 
 There are no messages in catalia.out concerning leaks (I am using Linux   
 2.6.18-92.1.22.el5)
 I also got rid of timeBetweenEvictionRunsMillis in datasource since it causes 
 a leaky TimerThread).
 

 What does the manager 'find leaks' command report exactly?
 ...
 leak (use a profiler to confirm):
 /yp_results

There are some useful commands in the JDK which may help track down
exactly which class is causing the problem.

 jmap -histo pid

(and other jmap subcommands)

If you take a snapshot periodically, esp after reload cycles you may be
able to see which classes are increasing in number.


If you can get a VisualVM working, or connect a JConsole to the remote
VM you may be able to poke around and see which classes aren't being
garbage collected.


 My webapp is named yp_results.

 After a few undeploy/redeploy cycles does the number of
 WebappClassLoader's also increase?

 Yes it increases 1 for each undeploy/redeploy cycle.

 snip... 

 Maybe.

 JAXBContext.newInstance() can take a ClassLoader argument.  Is there some 
 ClassLoader I should be using that will get around this?

 OK, so I've looked at JAXBContext (and JAXBContextImpl) and it doesn't
 (after quick read through) look like it's storing the classloader
 argument anywhere during the newInstance call, which is the usual source
 of leaks.


 Where is the jar with the above code, in a webapp?
 The code above in in the war for the web app in a class in 
 WEB-INF/classes/org/blablabla

 It is called via a class that looks like this:

 public class JAXBMascot {
 protected static Log log = LogFactory.getLog(JAXBMascot.class);
 private XMLEventReader reader;
 private Unmarshaller u = 
 JAXBContextMascot.INSTANCE.createUnmarshaller();

 You're setting the XMLEventReader, Unmarshaller  InputStream as
 instance field values, rather than completing the parsing in the
 getInstance() method?
 I have really big xmls to unmarshall so I am using streaming them in and 
 unmarshalling the elements I want
 and then insert into my database. I need the reader to see where I am and 
 then the umarshaller

I'll have a look at the code below a bit later, am pushed for time right
now.


p



 I didn't show the all the methods of JAXBMascot but here is workhorse:
   public T T getNextElement(String theElement, String elementAfter, 
 Class Tclazz) {
   String elname = ;
   T h = null;
   try {
   while(reader.hasNext()){
 if(reader.peek().isStartElement()){
elname = 
 reader.peek().asStartElement().getName().getLocalPart();
if(elname.equals(theElement)){
  h= u.unmarshal(reader, clazz).getValue();
  return h;
}
 } else if(reader.peek().isEndElement()){
   elname = 
 reader.peek().asEndElement().getName().getLocalPart();
   if(elname.equals(elementAfter)){
   return h;
   }
   }
 
 reader.nextEvent();
   }
   } catch (XMLStreamException e) {
   throw new RuntimeException(e);
   } catch (JAXBException e) {
   throw new RuntimeException(e);
   }
   return h;
 }
 
 It also has a close method to clean up after I have gotten all the elements.
   public void close(){
   try {
   reader.close();
   } catch (XMLStreamException e) {
   //quietly
   }
   IOUtils.closeQuietly(jxb_in);
   u=null;
   }
 I don't think I am leaving any stuff hanging around but memory leaks are very 
 sneaky.
 mas

 This looks a bit odd to me, but I don't know what the rest of the
 instance does...


 p

 private InputStream jxb_in;

 public static JAXBMascot getInstance(InputStream in) {
 JAXBMascot m = new JAXBMascot();
 try {
 m.setJxb_in(in);
   

Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Hey all,

We are using Tomcat 6 on a Windows XP box. We have a web application
named abc. It was initially in the c:\Tomcat\webapps directory. I then
moved the c:\Tomcat\webapps\abc directory to c:\Tomcat\abc. I then
changed the Tomcat/conf/server.xml file to reflect this change...
  Host name=abc.local appBase=abc
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=
ResourceLink global=jdbc/MySqlDatabase
name=jdbc/MySqlDatabase type=javax.sql.DataSource /
/Context
  /Host

Though the web application itself works fine, the web application
logging no longer works after this change! How do I get the log4j
logging to work again? Please advice!

Thank you,
Joe


log4j-1.2.15.jar file is in c:\Tomcat\lib directory
log4j.properties file is in c:\Tomcat\abc\WEB-INF\classes directory

/* Here's the c:\Tomcat\abc\WEB-INF\classes\log4j.properties directory */
log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat6/logs/abc.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4

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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Mark Thomas
On 04/05/2010 17:32, Joe Hansen wrote:
 Hey all,
 
 We are using Tomcat 6 on a Windows XP box. We have a web application
 named abc. It was initially in the c:\Tomcat\webapps directory. I then
 moved the c:\Tomcat\webapps\abc directory to c:\Tomcat\abc. I then
 changed the Tomcat/conf/server.xml file to reflect this change...
 Host name=abc.local appBase=abc
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=
   ResourceLink global=jdbc/MySqlDatabase
 name=jdbc/MySqlDatabase type=javax.sql.DataSource /
   /Context
 /Host
 
 Though the web application itself works fine, the web application
 logging no longer works after this change! How do I get the log4j
 logging to work again? Please advice!

Put the web application back where it belongs. docBase==appBase is *not*
a valid configuration. As you have seen, things break if you do that.

Mark



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



Re: JAXBContext leaks memory

2010-05-04 Thread Mark Shifman
Thanks.
I'll try Jconsole.
mas

On 05/04/2010 12:28 PM, Pid wrote:
 On 04/05/2010 14:10, Mark Shifman wrote:

 On 05/03/2010 02:53 PM, Pid wrote:
 On 03/05/2010 18:30, Mark Shifman wrote:

 On 05/03/2010 12:48 PM, Pid wrote:
 On 03/05/2010 17:15, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.

 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in 
 number
 after running my unmarshal action, followed by undeploy and redeploy.  
 Find Leaks in the manager also finds leaks.

 Do you see log messages referring to potential leaks in the catalina.out
 log (assuming you're on a unix variant)?

 If so, can you post them please?

 There are no messages in catalia.out concerning leaks (I am using Linux  
 2.6.18-92.1.22.el5)
 I also got rid of timeBetweenEvictionRunsMillis in datasource since it 
 causes a leaky TimerThread).


 What does the manager 'find leaks' command report exactly?
 ...
 leak (use a profiler to confirm):
 /yp_results
 
 There are some useful commands in the JDK which may help track down
 exactly which class is causing the problem.
 
  jmap -histo pid
 
 (and other jmap subcommands)
 
 If you take a snapshot periodically, esp after reload cycles you may be
 able to see which classes are increasing in number.
 
 
 If you can get a VisualVM working, or connect a JConsole to the remote
 VM you may be able to poke around and see which classes aren't being
 garbage collected.
 
 
 My webapp is named yp_results.

 After a few undeploy/redeploy cycles does the number of
 WebappClassLoader's also increase?

 Yes it increases 1 for each undeploy/redeploy cycle.

 snip... 

 Maybe.

 JAXBContext.newInstance() can take a ClassLoader argument.  Is there 
 some ClassLoader I should be using that will get around this?

 OK, so I've looked at JAXBContext (and JAXBContextImpl) and it doesn't
 (after quick read through) look like it's storing the classloader
 argument anywhere during the newInstance call, which is the usual source
 of leaks.
 
 
 Where is the jar with the above code, in a webapp?
 The code above in in the war for the web app in a class in 
 WEB-INF/classes/org/blablabla

 It is called via a class that looks like this:

 public class JAXBMascot {
protected static Log log = LogFactory.getLog(JAXBMascot.class);
private XMLEventReader reader;
private Unmarshaller u = 
 JAXBContextMascot.INSTANCE.createUnmarshaller();

 You're setting the XMLEventReader, Unmarshaller  InputStream as
 instance field values, rather than completing the parsing in the
 getInstance() method?
 I have really big xmls to unmarshall so I am using streaming them in and 
 unmarshalling the elements I want
 and then insert into my database. I need the reader to see where I am and 
 then the umarshaller
 
 I'll have a look at the code below a bit later, am pushed for time right
 now.
 
 
 p
 
 
 
 I didn't show the all the methods of JAXBMascot but here is workhorse:
  public T T getNextElement(String theElement, String elementAfter, 
 Class Tclazz) {
  String elname = ;
  T h = null;
  try {
  while(reader.hasNext()){
if(reader.peek().isStartElement()){
   elname = 
 reader.peek().asStartElement().getName().getLocalPart();
   if(elname.equals(theElement)){
 h= u.unmarshal(reader, clazz).getValue();
 return h;
   }
} else if(reader.peek().isEndElement()){
  elname = 
 reader.peek().asEndElement().getName().getLocalPart();
  if(elname.equals(elementAfter)){
  return h;
  }
  }

reader.nextEvent();
  }
  } catch (XMLStreamException e) {
  throw new RuntimeException(e);
  } catch (JAXBException e) {
  throw new RuntimeException(e);
  }
  return h;
 }

 It also has a close method to clean up after I have gotten all the elements.
  public void close(){
  try {
  reader.close();
  } catch (XMLStreamException e) {
  //quietly
  }
  IOUtils.closeQuietly(jxb_in);
  u=null;
  }
 I don't think I am leaving any stuff hanging around but memory leaks are 
 very sneaky.
 mas

 This looks a bit odd to me, but I don't know what the rest of the
 instance does...


 p

private InputStream jxb_in;

public static JAXBMascot getInstance(InputStream in) {
JAXBMascot m = new JAXBMascot();
try {

Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thank you for the super quick reply Mark! We are using Java Spring.
The reason for moving the web application out of the webapps directory
was that the Spring Context Loader was loading twice. First because
its in the webapps directory. Secondly, because it is being referred
to by the Host entry in the server.xml file.

So how do I keep the web application out of Tomcat/webapps directory
make the docBase different from the appBase? Or is there a way to keep
the web application in the Tomcat/webapps directory and NOT have
Spring Context Loader load twice.

Please advice.

Thanks,
Joe



On Tue, May 4, 2010 at 10:36 AM, Mark Thomas ma...@apache.org wrote:
 On 04/05/2010 17:32, Joe Hansen wrote:
 Hey all,

 We are using Tomcat 6 on a Windows XP box. We have a web application
 named abc. It was initially in the c:\Tomcat\webapps directory. I then
 moved the c:\Tomcat\webapps\abc directory to c:\Tomcat\abc. I then
 changed the Tomcat/conf/server.xml file to reflect this change...
         Host name=abc.local appBase=abc
                       unpackWARs=true autoDeploy=true
                       xmlValidation=false xmlNamespaceAware=false
                       Context path= docBase=
                               ResourceLink global=jdbc/MySqlDatabase
 name=jdbc/MySqlDatabase type=javax.sql.DataSource /
                       /Context
         /Host

 Though the web application itself works fine, the web application
 logging no longer works after this change! How do I get the log4j
 logging to work again? Please advice!

 Put the web application back where it belongs. docBase==appBase is *not*
 a valid configuration. As you have seen, things break if you do that.

 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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Mark Thomas
On 04/05/2010 17:43, Joe Hansen wrote:
 Thank you for the super quick reply Mark! We are using Java Spring.
 The reason for moving the web application out of the webapps directory
 was that the Spring Context Loader was loading twice. First because
 its in the webapps directory. Secondly, because it is being referred
 to by the Host entry in the server.xml file.
 
 So how do I keep the web application out of Tomcat/webapps directory
 make the docBase different from the appBase? Or is there a way to keep
 the web application in the Tomcat/webapps directory and NOT have
 Spring Context Loader load twice.

What was your server.xml before you moved it?

Mark



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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Mark, Here's the server.xml before moving abc out of the webapps directory:

?xml version='1.0' encoding='utf-8'?
Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
/

GlobalNamingResources
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 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
   maxThreads=150 scheme=https secure=true
   clientAuth=false sslProtocol=TLS /
Connector port=8009 protocol=AJP/1.3 redirectPort=443 /
Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host

  Host name=abc.local appBase=webapps/abc
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=
/Context
  /Host

/Engine
  /Service
/Server

On Tue, May 4, 2010 at 10:53 AM, Mark Thomas ma...@apache.org wrote:
 On 04/05/2010 17:43, Joe Hansen wrote:
 Thank you for the super quick reply Mark! We are using Java Spring.
 The reason for moving the web application out of the webapps directory
 was that the Spring Context Loader was loading twice. First because
 its in the webapps directory. Secondly, because it is being referred
 to by the Host entry in the server.xml file.

 So how do I keep the web application out of Tomcat/webapps directory
 make the docBase different from the appBase? Or is there a way to keep
 the web application in the Tomcat/webapps directory and NOT have
 Spring Context Loader load twice.

 What was your server.xml before you moved it?

 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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Mark Thomas
On 04/05/2010 17:59, Joe Hansen wrote:
 Mark, Here's the server.xml before moving abc out of the webapps directory:
 
 Host name=abc.local appBase=webapps/abc
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=
   /Context
 /Host

And therein lies the problem. docBase= is not valid.


Currently, your app is deployed once under localhost with context path
/abc and is partially deployed under abc.local with context path .
Additionally, every directory under webapps/abc will be deployed as a
web application under abc.local

Quite a mess.

What is it you are trying to achieve?

Mark



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



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
   Host name=localhost appBase=webapps
   /Host
 
 Host name=abc.local appBase=webapps/abc

First problem: overlapping appBase settings for multiple Host elements.  They 
must be distinct.

   Context path= docBase=
   /Context

Second problem: a completely invalid Context setting, plus it's in 
server.xml, which is inappropriate.

If you want a second Host (do you really need one?), and you want to specify 
a default webapp for it, create a separate directory for that Host's appBase, 
and place the desired webapp in ROOT (or ROOT.war) under that directory.  Note 
that the name ROOT is case-sensitive, even on Windows.

You do not need a Context element at all for this simple case.  Should the 
webapp evolve to where it does need a Context, it should be placed in 
ROOT/META-INF/context.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: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thanks for the reply, Mark. You made me understand the mess I have created.

I have written two web applications abc and xyz. I have mapped
abc.local and xyz.local to my machine's IP Address in my Windows HOST
file. So when I visit http://abc.local, I would want the abc web
application to be accessed. When I visit http://xyz.local, I would
want the xyz web application to be accessed. This is what I have been
trying to achieve. Apparently I have been doing this the wrong way.
Looks like I have some reading to do! Will post back after I read some
Tomcat documentation.

Thanks again!
Joe



On Tue, May 4, 2010 at 11:13 AM, Mark Thomas ma...@apache.org wrote:
 On 04/05/2010 17:59, Joe Hansen wrote:
 Mark, Here's the server.xml before moving abc out of the webapps directory:

         Host name=abc.local appBase=webapps/abc
                       unpackWARs=true autoDeploy=true
                       xmlValidation=false xmlNamespaceAware=false
                       Context path= docBase=
                       /Context
         /Host

 And therein lies the problem. docBase= is not valid.


 Currently, your app is deployed once under localhost with context path
 /abc and is partially deployed under abc.local with context path .
 Additionally, every directory under webapps/abc will be deployed as a
 web application under abc.local

 Quite a mess.

 What is it you are trying to achieve?

 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



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: RE: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 Looks like I have some reading to do! Will post back after 
 I read some Tomcat documentation.

Start here:

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

 - 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



Tomcat Clustering problem: Help

2010-05-04 Thread Josef Pullicino
Dear users,

 

I am trying to setup tomcat clustering/session replication between two
tomcats of version 6.0.18. The following is the cluster snippet inserted
into server.xml of both servers:

 

Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster

 channelSendOptions=8

 

  Manager
className=org.apache.catalina.ha.session.BackupManager

   expireSessionsOnShutdown=false

   notifyListenersOnReplication=true

   mapSendOptions=6/

 

  Channel
className=org.apache.catalina.tribes.group.GroupChannel

Membership
className=org.apache.catalina.tribes.membership.McastService

address=228.0.0.4

port=45564

frequency=500

dropTime=3000/

Receiver
className=org.apache.catalina.tribes.transport.nio.NioReceiver

  address=auto

  port=5000

  selectorTimeout=100

  maxThreads=6/

 

Sender
className=org.apache.catalina.tribes.transport.ReplicationTransmitter

  Transport
className=org.apache.catalina.tribes.transport.nio.PooledParallelSender
 timeout=6/

/Sender

 

Interceptor
className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetec
tor/

Interceptor
className=org.apache.catalina.tribes.group.interceptors.MessageDispatch
15Interceptor/

Interceptor
className=org.apache.catalina.tribes.group.interceptors.ThroughputInter
ceptor/

  /Channel

 

  Valve className=org.apache.catalina.ha.tcp.ReplicationValve

 
filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;
/

 

  Deployer
className=org.apache.catalina.ha.deploy.FarmWarDeployer

tempDir=/tmp/war-temp/

deployDir=/tmp/war-deploy/

watchDir=/tmp/war-listen/

watchEnabled=false/

 

  ClusterListener
className=org.apache.catalina.ha.session.ClusterSessionListener/

/Cluster

 

I am having the following errors on both of my tomcats:

 

May 4, 2010 5:51:46 AM org.apache.catalina.connector.CoyoteAdapter
service

SEVERE: An exception or error occurred in the container during the
request processing

java.lang.NullPointerException

at
org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java
:348)

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
86)

at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)

at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)

at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)

at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
697)

at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.
java:889)

at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:690)

at java.lang.Thread.run(Thread.java:619)

 

 

WARNING: Member send is failing for:tcp://{-84, 16, -68, 46}:5000 ;
Setting to suspect and retrying.

May 4, 2010 5:54:13 AM
org.apache.catalina.tribes.tipis.LazyReplicatedMap publishEntryInfo

SEVERE: Unable to replicate backup
key:B90703FBD00D77B21937383FBE71CBF1.tomcatA to
backup:org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 16,
-68, 46}:5000,{-84, 16, 

-68, 46},5000, alive=4660,id={-63 85 -65 15 -86 -78 66 26 -74 -118 51
-13 -50 97 102 -103 }, payload={}, command={}, domain={}, ]. Reason:Send
failed, attempt:2 max:1; Faulty memb

ers:tcp://{-84, 16, -68, 46}:5000; 

org.apache.catalina.tribes.ChannelException: Send failed, attempt:2
max:1; Faulty members:tcp://{-84, 16, -68, 46}:5000; 

at
org.apache.catalina.tribes.transport.nio.ParallelNioSender.doLoop(Parall
elNioSender.java:172)

at
org.apache.catalina.tribes.transport.nio.ParallelNioSender.sendMessage(P
arallelNioSender.java:78)

at
org.apache.catalina.tribes.transport.nio.PooledParallelSender.sendMessag
e(PooledParallelSender.java:53)

at
org.apache.catalina.tribes.transport.ReplicationTransmitter.sendMessage(
ReplicationTransmitter.java:80)

at
org.apache.catalina.tribes.group.ChannelCoordinator.sendMessage(ChannelC
oordinator.java:78)

at
org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(Chan
nelInterceptorBase.java:75)

at
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.send
Message(ThroughputInterceptor.java:61)

at
org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(Chan
nelInterceptorBase.java:75)

at
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor
.sendMessage(MessageDispatchInterceptor.java:73)

at

Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Many Thanks for the link Chuck! Here's what I did.

1. Created a directory named c:\Tomcat\abc\ROOT.
2. Moved the previous contents of c:\Tomcat\webapps\abc to
c:\Tomcat\abc\ROOT directory.
3. Created c:\Tomcat\abc\ROOT\META-INF\context.xml. Here's that file.
?xml version=1.0 encoding=UTF-8?
Context
ResourceLink global=jdbc/ProgressDatabase
name=jdbc/ProgressDatabase type=javax.sql.DataSource /
/Context
4. Changed c:\Tomcat\conf\server.xml to
Host name=localhost appBase=webapps unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
/Host

Host name=abc.local appBase=abc unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
/Host

End Result is:
1. Spring Context loader is loaded only once (Great!).
2. But the web application logging is working wierdly.The log entries
are written to c:\Tomcat\logs\xyz.log (i.e. the xyz web application's
log)  instead of writing to c:\Tomcat\logs\abc.log. .

Here's the c:\Tomcat\abc\ROOT\WEB-INF\classes\log4j.properties file.

log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat6/logs/trestlewood.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4

Please advise!

Thank you!
Joe

On Tue, May 4, 2010 at 11:30 AM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: RE: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 Looks like I have some reading to do! Will post back after
 I read some Tomcat documentation.

 Start here:

 http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

  - Chuck


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


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



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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread André Warnier

Joe Hansen wrote:

Many Thanks for the link Chuck! Here's what I did.

1. Created a directory named c:\Tomcat\abc\ROOT.
2. Moved the previous contents of c:\Tomcat\webapps\abc to
c:\Tomcat\abc\ROOT directory.

...

Let me throw in my grain of salt.
I like things organised in a logical way, with a structure that 
immediately makes it clear to anyone what one is trying to achieve.  And 
I like to have things that are logically at the same level, to also look 
that way at the physical level if possible.

Your mileage may vary as they say, but I would do as follows :

The basic Tomcat, which as downloaded and installed from the one and 
only original and genuine site, is structured as follows :


C:/tomcat : top installation dir   (*)
  |
  --- bin : the programs
  --- conf : the configuration files
  --- lib : common things
  --- webapps : standard and example applications
+ maybe your applications
  |
  --- ROOT : the standard default application
  --- etc..

Nice, clear, clean, matches the documentation etc..

In your server.xml, there is a single Host defined, it answers to the 
name localhost, and it is also the default host, which means that if 
some DNS hostname evaluates to the IP address of your host computer, 
then any request addressed to that DNS hostname will be processed 
according to the setup of that Host.


To indicate that the web applications for that host live under 
c:/tomcat/webapps, there is the appBase attribute of the Host tag :

Host name=localhost appBase=webapps
webapps being relative and thus interpreted as a subdirectory of the 
tomcat running directory, or CATALINA_BASE, which itself by default is 
the same as CATALINA_HOME, which is the tomcat installation directory 
c:/tomcat.


Now you add two web applications abc and xyz.
The normal place would be to install these under c:/tomcat/webapps/abc 
and c:/tomcat/webapps/xyz.

But then, you would have to access them via URLs like
http://hostname:port/abc
http://hostname:port/xyz

Instead, you would like to access them as respectively
http://abc.local/
http://xyz.local

That requires 2 parts :

1) you have to make abc.local and xyz.local into DNS aliases evaluating 
to the same IP address as your physical host.

That, you did already, in part.

2) you have to make each of these applications be the default 
application, so that you can call them without the prefix (abc or xyz).

That is a problem, because
  - there is already a ROOT application (the default Tomcat one)
  - abc and xyz cannot be both renamed to ROOT
So you decide to solve this by using virtual hosts.
Very good, that is one of the ways.

So we add 2 virtual host declarations to the Tomcat server.xml, for a 
total of 3 :

   Host namelocalhost appBase=webapps
...
   Host nameabc.local appBase=webapps-abc
...
   Host name=xyz.local appBase=webapps-xyz

and we change our basic directory layout to be :

C:/tomcat : top installation dir
  |
  --- bin : the programs
  --- conf : the configuration files
  --- lib : common things
  --- webapps : standard and example applications
+ maybe some of your applications
  |
  --- ROOT : the standard default application
  --- webapps-abc : the applications of the abc.local host
  |
  |-- ROOT : the default application of the abc.local host
  --- webapps-xyz : the applications of the xyz.local host
  |
  |-- ROOT : the default application of the xyz.local host
  --- etc..

This way, you get to keep the standard and example applications of the 
original Tomcat, to test and play around with.  These will be called 
whenever there is a request to

http://localhost/
http://127.0.0.1/
http://anything/
  as long as anything evaluates to one of the IP addresses of your 
physical host, and there is no specific Host name=anything defined.
And whenever someone uses one of the names defined in a Host tag, they 
will be directed to the corresponding appBase applications.
Also, the appBase's do not overlap, and they are at the same level in 
the file hierarchy, which is easy to understand, conveys well the idea 
that they are two choices at the same level, simplifies permission 
settings, is easy for backups etc..


There are other techniques and layouts possible to achieve the same 
effect, but I would not in any case base one application under 
tomcat_dir/abc

and another one under
tomcat_dir/webapps/xyz
because I would find that confusing, and because I would not want the 
future Tomcat developers of version 9.3 to suddenly find that abc or 
xyz would be a cute name for a future indispensable Tomcat 
subdirectory to store whatever.
I would also not want my boss to get the idea that the real nice name 
for application abc should really be server, and make things really 
messy.



(*) In fact, it isn't.  It normally wants to install itself in some 
awfully chosen directory with plenty of spaces in the name, guaranteed 
to give you stomac acidity some 

Re: How to force session replication per request in a Tomcat 6 cluster - SOLVED

2010-05-04 Thread Martin Grotzke
On Tue, 2010-05-04 at 16:53 +1000, Kevin Jansz wrote:
 PS thanks for the responses. Martin, the session manager project
 sounds awesome but the use of memcached (c-based native code server if
 I read correctly) would make it a non-starter for us. The future use
 of ehcache sounds promising, but I'd consider this (and Terracotta
 too) only for the most critical deployments.
Well, the memcached-session-manager does not require the one (native)
memcached server, but only s.th. that speaks the memcached protocol
(there are actually several implementations/adaptions out there).
There's e.g. jmemcached (code.google.com/p/jmemcache-daemon/) which is
a Java implementation of the daemon (server) side of the memcached
protocol (copied from their site), which is also working great (I use
this for integration testing, really nice!) - just run it as any other
java program.

This just as a note for clarification regarding memcached protocol vs.
the actual implementation :-)

Cheers,
Martin


 Sure the
 broadcast-to-all-over-tcp approach above is not going to scale well
 for up to dozens of nodes but is good enough for a couple of nodes in
 a basic cluster - I believe we're yet to have tomcat instance go down
 in the clusters we've been involved in setting up.
 
 
 --
 Kevin Jansz
 kevin.ja...@exari.com
 Level 7, 10-16 Queen Street, Melbourne 3000 Australia
 Tel +61 3 9621 2773 | Fax +61 3 9621 2776
 Exari Systems
 Boston | London | Melbourne | Munich
 www.exari.com
 
 Test drive our software online - www.exari.com/demo-trial.html
 Read our blog on document assembly - blog.exari.com
 
 
 
 On 2 May 2010 07:21, Martin Grotzke martin.grot...@javakaffee.de wrote:
 
  Hi,
 
  I created the memcached-session-manager as an alternative session
  replication solution:
  code.google.com/p/memcached-session-manager/
 
  It keeps sessions in local memory and stores session additionally in
  memcached nodes (for backup, asynchronously if desired).
  Sessions are replicated when session data has changed, so that no
  setAttribute is required.
 
  There are also different serialization stategies available, additionally
  to default java serialization there's a javolution/xml based one, and I
  also just added serialization based on kryo [1] (very fast according to
  protobuf-thrift-compare benchmark). Both (javolution, kryo based) don't
  need objects in the session attributes object graph to implement
  Serializable - which is sometimes useful, e.g. if legacy projects
  shall get session failover.
 
  Cheers,
  Martin
 
  [1] code.google.com/p/kryo/
 
 
  On Wed, 2010-04-28 at 22:34 +1000, Kevin Jansz wrote:
   In a Tomcat 6 cluster can you force session replication on every
   request? In Tomcat 5.0.x you had the ability to set
   useDirtyFlag=false on the manager
   (org.apache.catalina.cluster.session.SimpleTcpReplicationManager) -
   meaning a mutable object in the session would always be
   re-replicated.
  
   Looking at the source I can see the old SimpleTcpReplicationManager
   manager implementation in the new org.apache.catalina.ha.session
   package - and it still has the useDirtyFlag but the javadoc comments
   in this state it's Tomcat Session Replication for Tomcat 4.0 ... I
   don't know if this is ok to use - I'm guessing not as it's not
   mentioned in the main cluster configuration documentation.
  
   aside: a similar question was posed on stackoverflow (with more detail
   and formatting) with no response:
   http://stackoverflow.com/questions/2680958 - I'd be happy with
   comments in either forum, and I'll share the advice.
  
   Regards,
   Kevin
  
   --
   Kevin Jansz
   kevin.ja...@exari.com
   Level 7, 10-16 Queen Street, Melbourne 3000 Australia
   Tel +61 3 9621 2773 | Fax +61 3 9621 2776
   Exari Systems
   Boston | London | Melbourne | Munich
   www.exari.com
  
   -
   To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
   For additional commands, e-mail: users-h...@tomcat.apache.org
  
 
  --
  Martin Grotzke
  http://www.javakaffee.de/blog/
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



signature.asc
Description: This is a digitally signed message part


Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joe,

On 5/4/2010 1:26 PM, Joe Hansen wrote:
 I have written two web applications abc and xyz. I have mapped
 abc.local and xyz.local to my machine's IP Address in my Windows HOST
 file. So when I visit http://abc.local, I would want the abc web
 application to be accessed. When I visit http://xyz.local, I would
 want the xyz web application to be accessed. This is what I have been
 trying to achieve. Apparently I have been doing this the wrong way.
 Looks like I have some reading to do! Will post back after I read some
 Tomcat documentation.

You want this:

webapps/abc
webapps/abc/ROOT  -- this is your abc webapp
webapps/abc/ROOT/META-INF
webapps/abc/ROOT/META-INF/context.xml
webapps/xyz
webapps/xyz/ROOT -- this is your xyz webapp
webapps/xyz/ROOT/META-INF
webapps/xyz/ROOT/META-INF/context.xml

It looks like you don't have any custom configuration for your
Context, so you don't even need META-INF/context.xml files for either
of your webapps.

Set up two Hosts:

Engine defaultHost=abc
  Host name=abc appBase=webapps/abc autoDeploy=true
Aliasabc.local/Alias
  /Host

  Host name=xyz appBase=webapps/xyz autoDeploy=true
Aliasxyz.local/Alias
  /Host
/Engine

Many administrators would expect that CATALINA_BASE/webapps is the
auto-deployment directory for a standard setup, so maybe instead of the
above paths, you'd want to move webapps/xyz and webapps/abc outside
of CATALINA_BASE, and then refer to them appropriately from within
server.xml.

This should avoid double-deployment.

Basically, these are the best-practices for Tomcat configuration:

1. Never declare Context elements in server.xml
2. Use the default auto-deploy Host and put your webapps into the
appBase directory... remember to use ROOT as appropriately
3. If you don't want your webapps to be in the auto-deploy directory,
then use conf/[Service]/[Engine]/[webappname].xml to configure your
webapps instead.

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

iEYEARECAAYFAkvgfKwACgkQ9CaO5/Lv0PBj4wCfaCKJ2cQUT7a9kC6rzdIVcho5
pGUAnioMCN5xtZD7bYPHV+5AdCRCKaX0
=6FLu
-END PGP SIGNATURE-

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



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 You want this:
 
 webapps/abc
 webapps/abc/ROOT  -- this is your abc webapp
 webapps/abc/ROOT/META-INF
 webapps/abc/ROOT/META-INF/context.xml
 webapps/xyz
 webapps/xyz/ROOT -- this is your xyz webapp
 webapps/xyz/ROOT/META-INF
 webapps/xyz/ROOT/META-INF/context.xml

No, you don't want the above.  That has overlapping appBase directories.  As 
pointed out by both André and myself, keep them separate, at the same level of 
the directory hierarchy:

webapps
webapps/ROOT
webapps/examples
...
webapps-abc
webapps-abc/ROOT  -- this is your abc webapp
webapps-abc/ROOT/META-INF
webapps-abc/ROOT/META-INF/context.xml
webapps-xyz
webapps-xyz/ROOT -- this is your xyz webapp
webapps-xyz/ROOT/META-INF
webapps-xyz/ROOT/META-INF/context.xml

The above will preserve your existing Tomcat webapps.

 Set up two Hosts:
 Engine defaultHost=abc
   Host name=abc appBase=webapps/abc autoDeploy=true
 Aliasabc.local/Alias
   /Host
   Host name=xyz appBase=webapps/xyz autoDeploy=true
 Aliasxyz.local/Alias
   /Host
 /Engine

This destroys access to the Tomcat-supplied webapps, so don't do that.  Add the 
two new Host elements, but don't replace the existing one, and don't change 
what defaultHost points to - unless you really, really want the replacement to 
be the default.

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



Hibernate validator in webapp?

2010-05-04 Thread Yucca Nel
Anyone can explain if I can use hibernate validator in tomcat 6 webapp? Current 
use case tests are not failing using validator annotations but is it because it 
will only work in EE container?

Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thanks Andre and Chuck.

Andre, I renamed Tomcat/abc/ to Tomcat/webapps-abc/ to keep the naming
consistent. The directory structure that you've advocated is exactly
the same as the one Chuck told me. And I have implemented that.

However, logging is still an issue. One webapp's log4j seems to stomp
over other webapp's log files. What could I be doing wrong?

Here are the log4j configuration files:
/* c:\Tomcat\webapps-abc\ROOT\WEB-INF\classes\log4j.properties */
log4j.rootLogger=INFO, A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A1.File=c:/Tomcat/logs/abc.log
log4j.appender.A1.MaxFileSize=100KB
log4j.appender.A1.MaxBackupIndex=4


/* c:\Tomcat\webapps-xyz\ROOT\WEB-INF\classes\log4j.properties */
log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat/logs/xyz.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4

According to the following link,
http://stackoverflow.com/questions/217929/problem-with-commons-logging-log4j-setup-in-spring-webapp-with-tomcat-6
If you have multiple webapps on the server, then you'll need
discipline that each webapp's log initialization does not stomp on the
initialization of other webapps. Each webapp will need to use unique
Logger IDs, which can be accomplished with unique package names.

Thank you!
Joe

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



RE: Hibernate validator in webapp?

2010-05-04 Thread Martin Gainty

post one code sample with one validation 
also post version number of annotated jars and hibernate you are using and 
where you put them
contents of hibernate.cfg.xml 
which container are you using..ARE you SURE you are using Tomcat..if so which 
version of Tomcat?

Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 From: yucca...@live.co.za
 To: users@tomcat.apache.org
 Subject: Hibernate validator in webapp?
 Date: Tue, 4 May 2010 22:27:58 +0200
 
 Anyone can explain if I can use hibernate validator in tomcat 6 webapp? 
 Current use case tests are not failing using validator annotations but is it 
 because it will only work in EE container?
  
_
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccountocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4

Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 5/4/2010 4:08 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 You want this:

 webapps/abc
 webapps/abc/ROOT  -- this is your abc webapp
 webapps/abc/ROOT/META-INF
 webapps/abc/ROOT/META-INF/context.xml
 webapps/xyz
 webapps/xyz/ROOT -- this is your xyz webapp
 webapps/xyz/ROOT/META-INF
 webapps/xyz/ROOT/META-INF/context.xml
 
 No, you don't want the above.  That has overlapping appBase directories.

FWIW, it doesn't (given my proposed server.xml).

 As pointed out by both André and myself, keep them separate, at the same 
 level of the directory hierarchy:

I did note that this would be a good idea, since most people expect
CATALINA_BASE/webapps to be the auto-deployment directory and seeing
subdirs would be confusing at least.

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

iEYEARECAAYFAkvgihwACgkQ9CaO5/Lv0PBMgQCggnmxr8NRL/fe0Zo5ibYxZ4/U
8l0AnRAD7nMj4MbsC5NNEJOnsZK8j8Vp
=DuXA
-END PGP SIGNATURE-

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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Pid
On 04/05/2010 18:59, Joe Hansen wrote:
 Many Thanks for the link Chuck! Here's what I did.
 
 1. Created a directory named c:\Tomcat\abc\ROOT.
 2. Moved the previous contents of c:\Tomcat\webapps\abc to
 c:\Tomcat\abc\ROOT directory.
 3. Created c:\Tomcat\abc\ROOT\META-INF\context.xml. Here's that file.
 ?xml version=1.0 encoding=UTF-8?
 Context
   ResourceLink global=jdbc/ProgressDatabase
 name=jdbc/ProgressDatabase type=javax.sql.DataSource /
 /Context
 4. Changed c:\Tomcat\conf\server.xml to
 Host name=localhost appBase=webapps unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false
 /Host
 
 Host name=abc.local appBase=abc unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false
 /Host
 
 End Result is:
 1. Spring Context loader is loaded only once (Great!).
 2. But the web application logging is working wierdly.The log entries
 are written to c:\Tomcat\logs\xyz.log (i.e. the xyz web application's
 log)  instead of writing to c:\Tomcat\logs\abc.log. .
 
 Here's the c:\Tomcat\abc\ROOT\WEB-INF\classes\log4j.properties file.
 
 log4j.rootLogger=INFO, A2
 log4j.appender.A2=org.apache.log4j.RollingFileAppender
 log4j.appender.A2.layout=org.apache.log4j.PatternLayout
 log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
 %-5p - [%c] : %m %n
 log4j.appender.A2.File=c:/Tomcat6/logs/trestlewood.log
 log4j.appender.A2.MaxFileSize=100KB
 log4j.appender.A2.MaxBackupIndex=4

And what about the xyz one?


p


 Please advise!
 
 Thank you!
 Joe
 
 On Tue, May 4, 2010 at 11:30 AM, Caldarale, Charles R
 chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: RE: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 Looks like I have some reading to do! Will post back after
 I read some Tomcat documentation.

 Start here:

 http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

  - Chuck


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


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


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




signature.asc
Description: OpenPGP digital signature


Re: Hibernate validator in webapp?

2010-05-04 Thread Pid
On 04/05/2010 21:27, Yucca Nel wrote:
 Anyone can explain if I can use hibernate validator in tomcat 6 webapp? 
 Current use case tests are not failing using validator annotations but is it 
 because it will only work in EE container?

Erm, yes?

Without more information I can't advise, someone else might do.

Depends what it does really...


p



signature.asc
Description: OpenPGP digital signature


RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 However, logging is still an issue. One webapp's log4j seems to stomp
 over other webapp's log files. What could I be doing wrong?

Where is your log4j.jar located?  You should have one copy in each webapp's 
WEB-INF/lib directory.  If you've placed log4j.jar in a common location, I 
think it will use the properties of the first webapp that references it for all 
the webapps.

 - 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: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Chuck,

Initially I placed log4j-1.2.15.jar in the c:\Tomcat\lib directory
only. This resulted in abc webapp logging in the
c:\Tomcat\logs\xyz.log file.

When I copied the log4j-1.2.15.jar to
c:\Tomcat\webapps-abc\ROOT\WEB-INF\lib and
c:\Tomcat\webapps-xyz\ROOT\WEB-INF\lib directories, it created empty
abc.log and xyz.log files.

When I delete c:\Tomcat\lib\log4j-1.2.15.jar, I get Tomcat startup
errors (NoClassDefFoundError: org/apache/log4j/Category). Also empty
abc.log and xyz.log files are created.

Joe

On Tue, May 4, 2010 at 3:20 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 However, logging is still an issue. One webapp's log4j seems to stomp
 over other webapp's log files. What could I be doing wrong?

 Where is your log4j.jar located?  You should have one copy in each webapp's 
 WEB-INF/lib directory.  If you've placed log4j.jar in a common location, I 
 think it will use the properties of the first webapp that references it for 
 all the webapps.

  - Chuck


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


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



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



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Initially I placed log4j-1.2.15.jar in the c:\Tomcat\lib 
 directory only. This resulted in abc webapp logging in the
 c:\Tomcat\logs\xyz.log file.

As expected - first one in wins.

 When I copied the log4j-1.2.15.jar to
 c:\Tomcat\webapps-abc\ROOT\WEB-INF\lib and
 c:\Tomcat\webapps-xyz\ROOT\WEB-INF\lib directories, it
 created empty abc.log and xyz.log files.

That's a least a good start - the separate appenders created the desired files. 
 One presumes you expected the files to actually have something in them...

 When I delete c:\Tomcat\lib\log4j-1.2.15.jar, I get Tomcat startup
 errors (NoClassDefFoundError: org/apache/log4j/Category).

Let's see the complete stack trace for that error.

Do you have other classes in Tomcat's lib directory that are shared by the 
webapps, and do those classes attempt to do logging?  Unless you really need 
them to be shared, put those classes in each webapp's WEB-INF/lib or 
WEB-INF/classes directories.  Otherwise, you'll need to modify your code and 
have each webapp pass in or otherwise expose its logger to the methods of the 
common classes.

 - 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: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Chuck,

There are common classes in Tomcat/lib/ but they don't attempt to do
any logging. However, the abc Spring Web application does initialize a
Quartz object which runs once every hour and does some logging. I
don't know if that has any implications.

Thanks,
Joe

Here's the stack trace from catalina.log file...
INFO: Initializing log4j from
[C:\Tomcat6\webapps-abc\ROOT\WEB-INF\classes\log4j.properties]
May 4, 2010 4:06:53 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener
instance of class
org.springframework.web.context.ContextLoaderListener
java.lang.ExceptionInInitializerError
at 
org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@20f443 for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@20f443 for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category))
at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at 
org.springframework.web.context.ContextLoader.clinit(ContextLoader.java:146)
... 26 more
Caused by: org.apache.commons.logging.LogConfigurationException: No
suitable Log constructor [Ljava.lang.Class;@20f443 for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 30 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
... 31 more

Here's the stack trace from localhost.log file...
INFO: Initializing log4j from
[C:\Tomcat6\webapps-xyz\ROOT\WEB-INF\classes\log4j.properties]
May 4, 2010 4:06:54 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception 

Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joe,

On 5/4/2010 1:59 PM, Joe Hansen wrote:
 2. But the web application logging is working wierdly.The log entries
 are written to c:\Tomcat\logs\xyz.log (i.e. the xyz web application's
 log)  instead of writing to c:\Tomcat\logs\abc.log. .
 
 Here's the c:\Tomcat\abc\ROOT\WEB-INF\classes\log4j.properties file.

Oh, I forgot to mention in my other message: you should put log4j.log
into your webapp's WEB-INF/lib directory and not share it between
webapps. Several reasons:

1. log4j can only be initialized in one way. You can re-initialize, but
that's not what you want.
2. Webapps ought to be self-contained, other than the APIs guaranteed to
be provided by the container.
3. Your webapp A might need a different version of log4j (or any other
library for that matter), and therefore they just can't share.

It's just a better idea to bundle the required libraries with your webapp.

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

iEYEARECAAYFAkvgfVAACgkQ9CaO5/Lv0PDG/ACeMCgC8sgx6u9do6yASUGESN25
tecAn3MwvXH7cqB75S6yUnSJfbv1GBaE
=ud2n
-END PGP SIGNATURE-

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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joe,

On 5/4/2010 6:15 PM, Joe Hansen wrote:
 There are common classes in Tomcat/lib/ but they don't attempt to do
 any logging.

Are you sure?

 However, the abc Spring Web application does initialize a
 Quartz object which runs once every hour and does some logging. I
 don't know if that has any implications.

It appears so:

 Here's the stack trace from catalina.log file...
 INFO: Initializing log4j from
 [C:\Tomcat6\webapps-abc\ROOT\WEB-INF\classes\log4j.properties]
 May 4, 2010 4:06:53 PM org.apache.catalina.core.StandardContext listenerStart
 SEVERE: Exception sending context initialized event to listener
 instance of class
 org.springframework.web.context.ContextLoaderListener
 java.lang.ExceptionInInitializerError
   at 
 org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)

[...]

 java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by
 org.apache.commons.logging.LogConfigurationException: No suitable Log
 constructor [Ljava.lang.Class;@20f443 for
 org.apache.commons.logging.impl.Log4JLogger (Caused by
 java.lang.NoClassDefFoundError: org/apache/log4j/Category))

Looks like you've got a common logging framework configured to use
log4j. If you use Spring and they use commons-logging, you need to:

1. Move spring.jar into WEB-INF/lib
2. Move commons-logging.jar into WEB-INF/lib

Basically, move everything your webapp needs into WEB-INF/lib.

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

iEYEARECAAYFAkvgnYYACgkQ9CaO5/Lv0PBeXwCfYQwTWJBVUg+fri9Wbz0/S/Tk
GI8An2kzGimP4qwxgLaqLPva5qYxe/hg
=mWKe
-END PGP SIGNATURE-

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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thanks for the reply, Charles!

When commons-logging.jar is present in Tomcat/lib and WEB-INF/lib
directories, I get the following error :
Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.

Here's the complete stack trace:
2010 May 04 / 16:28:34 ERROR -
[org.springframework.web.context.ContextLoader] : Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined
in ServletContext resource [/WEB-INF/abc-jdbc.xml]: Invocation of init
method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.quartz.impl.StdSchedulerFactory]:
Constructor threw exception; nested exception is
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class
loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.
(Caused by org.apache.commons.logging.LogConfigurationException:
Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.)
(Caused by org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class
loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.
(Caused by org.apache.commons.logging.LogConfigurationException:
Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.))
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at 
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 

[no subject]

2010-05-04 Thread Tomcat Users List
X-zuka-RWMailScanner-ID: AEE69538190.ABB3E
X-zuka-rw-MailScanner-Information: Please contact the ISP for more information
Received: from Magnolia.local (unknown [70.48.209.168])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
(Authenticated sender: dave.filc...@zuka.net)
by rosewood.zuka.net (Postfix) with ESMTP id AEE69538190
for users@tomcat.apache.org; Tue,  4 May 2010 18:43:50 -0400 (EDT)
Message-ID: 4be0a2de.5080...@zuka.net
Date: Tue, 04 May 2010 18:42:38 -0400
From: Dave Filchak sub...@zuka.net
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) 
Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4
MIME-Version: 1.0
To: users@tomcat.apache.org
Subject: error with jk_module
Content-Type: multipart/alternative;
 boundary=040106080009080709090308
X-Virus-Checked: Checked by ClamAV on apache.org
X-Old-Spam-Status: No
X-pstn-neptune: 0/0/0.00/0
X-pstn-levels: (S:73.05954/99.9 CV:99.9000 FC:95.5390 LC:95.5390 
R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
X-pstn-settings: 4 (1.5000:1.5000) s cv gt3 gt2 gt1 r p m c 
X-pstn-addresses: from sub...@zuka.net [294/10] 

--040106080009080709090308
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Can somebody enlighten me on what this means? I have been struggling 
with this for a while and need to restart my server but keep getting 
this config error.

httpd: Syntax error on line 439 of /usr/local/apache2/conf/httpd.conf: 
API module structure `jk_module' in file 
/usr/local/apache2/modules/mod_jk-1.2.28-httpd-2.0.X.so is garbled - 
perhaps this is not an Apache module DSO?

I have the following compiled in modules in Apache 2.2.3, 64-bit.

Compiled in modules:
   core.c
   mod_authn_file.c
   mod_authn_dbd.c
   mod_authn_default.c
   mod_authz_host.c
   mod_authz_groupfile.c
   mod_authz_user.c
   mod_authz_default.c
   mod_auth_basic.c
   mod_cache.c
   mod_disk_cache.c
   mod_dbd.c
   mod_echo.c
   mod_include.c
   mod_filter.c
   mod_log_config.c
   mod_env.c
   mod_mime_magic.c
   mod_expires.c
   mod_headers.c
   mod_usertrack.c
   mod_setenvif.c
   mod_ssl.c
   worker.c
   http_core.c
   mod_mime.c
   mod_dav.c
   mod_status.c
   mod_autoindex.c
   mod_asis.c
   mod_info.c
   mod_cgid.c
   mod_cgi.c
   mod_dav_fs.c
   mod_negotiation.c
   mod_dir.c
   mod_imagemap.c
   mod_actions.c
   mod_userdir.c
   mod_alias.c
   mod_rewrite.c
   mod_so.c

I am using Tomcat 6.0.18 and am trying to load this module like so:

LoadModule jk_module /usr/local/apache2/modules/mod_jk.so

I really am not sure what is the problem here. Is the module actually 
garbled or is it something else that produces this very misleading error?

Regards,

Dave





--040106080009080709090308--


[no subject]

2010-05-04 Thread Tomcat Users List
X-zuka-RWMailScanner-ID: AEE69538190.ABB3E
X-zuka-rw-MailScanner-Information: Please contact the ISP for more information
Received: from Magnolia.local (unknown [70.48.209.168])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
(Authenticated sender: dave.filc...@zuka.net)
by rosewood.zuka.net (Postfix) with ESMTP id AEE69538190
for users@tomcat.apache.org; Tue,  4 May 2010 18:43:50 -0400 (EDT)
Message-ID: 4be0a2de.5080...@zuka.net
Date: Tue, 04 May 2010 18:42:38 -0400
From: Dave Filchak sub...@zuka.net
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) 
Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4
MIME-Version: 1.0
To: users@tomcat.apache.org
Subject: error with jk_module
Content-Type: multipart/alternative;
 boundary=040106080009080709090308
X-Virus-Checked: Checked by ClamAV on apache.org
X-Old-Spam-Status: No
X-pstn-neptune: 0/0/0.00/0
X-pstn-levels: (S:73.05954/99.9 CV:99.9000 FC:95.5390 LC:95.5390 
R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
X-pstn-settings: 4 (1.5000:1.5000) s cv gt3 gt2 gt1 r p m c 
X-pstn-addresses: from sub...@zuka.net [294/10] 

--040106080009080709090308
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Can somebody enlighten me on what this means? I have been struggling 
with this for a while and need to restart my server but keep getting 
this config error.

httpd: Syntax error on line 439 of /usr/local/apache2/conf/httpd.conf: 
API module structure `jk_module' in file 
/usr/local/apache2/modules/mod_jk-1.2.28-httpd-2.0.X.so is garbled - 
perhaps this is not an Apache module DSO?

I have the following compiled in modules in Apache 2.2.3, 64-bit.

Compiled in modules:
   core.c
   mod_authn_file.c
   mod_authn_dbd.c
   mod_authn_default.c
   mod_authz_host.c
   mod_authz_groupfile.c
   mod_authz_user.c
   mod_authz_default.c
   mod_auth_basic.c
   mod_cache.c
   mod_disk_cache.c
   mod_dbd.c
   mod_echo.c
   mod_include.c
   mod_filter.c
   mod_log_config.c
   mod_env.c
   mod_mime_magic.c
   mod_expires.c
   mod_headers.c
   mod_usertrack.c
   mod_setenvif.c
   mod_ssl.c
   worker.c
   http_core.c
   mod_mime.c
   mod_dav.c
   mod_status.c
   mod_autoindex.c
   mod_asis.c
   mod_info.c
   mod_cgid.c
   mod_cgi.c
   mod_dav_fs.c
   mod_negotiation.c
   mod_dir.c
   mod_imagemap.c
   mod_actions.c
   mod_userdir.c
   mod_alias.c
   mod_rewrite.c
   mod_so.c

I am using Tomcat 6.0.18 and am trying to load this module like so:

LoadModule jk_module /usr/local/apache2/modules/mod_jk.so

I really am not sure what is the problem here. Is the module actually 
garbled or is it something else that produces this very misleading error?

Regards,

Dave





--040106080009080709090308--


RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Oh, I forgot to mention in my other message: you should put log4j.log
 into your webapp's WEB-INF/lib directory

Presumably, you mean log4j.jar, not log4j.log - which we already told him to 
move.

 - Chuck


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




Re: error with jk_module

2010-05-04 Thread André Warnier

Dave Filchak wrote:
...
this :


httpd: Syntax error on line 439 of /usr/local/apache2/conf/httpd.conf: 
API module structure `jk_module' in file 
/usr/local/apache2/modules/mod_jk-1.2.28-httpd-2.0.X.so is garbled - 
perhaps this is not an Apache module DSO?



...
and this :


LoadModule jk_module /usr/local/apache2/modules/mod_jk.so

do not seem to match (the filename), unless mod_jk.so is a link to the 
other one. Are you sure it is ?


Also, if it is a link, and if your Apache is a 2.2 version, then it 
would appear that you may have downloaded a wrong version of the 
mod_jk.so.  The end of the version says httpd-2.0.X.so, which would 
appear to make it a version for Apache 2.0.x, not 2.2.x.




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



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 When commons-logging.jar is present in Tomcat/lib and WEB-INF/lib
 directories, I get the following error :

As you should.  As Chris said, put everything (including the spring jars) in 
each webapp's WEB-INF/lib directory, and as little as possible (preferably 
nothing) in Tomcat's lib directory.

 - 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: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Chuck, please note that when commons-logging.jar is present only in
the WEB-INF/lib directory,
I get the following error:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

So, either I get
a) Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.

or

b) java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

I am really stumped. I even tried the following:
Context
 loader delegate=“false”/
/Context
which the following link recommends.
http://www.richardrauser.com/index.php/2009/09/02/log4j-multiple-web-apps-common-lib-logging/
But that doesn't solve my issue.

Thanks,
Joe

On Tue, May 4, 2010 at 4:58 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 When commons-logging.jar is present in Tomcat/lib and WEB-INF/lib
 directories, I get the following error :

 As you should.  As Chris said, put everything (including the spring jars) in 
 each webapp's WEB-INF/lib directory, and as little as possible (preferably 
 nothing) in Tomcat's lib directory.

  - Chuck


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


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



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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread André Warnier

Joe Hansen wrote:

Chuck, please note that when commons-logging.jar is present only in
the WEB-INF/lib directory,
I get the following error:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

So, either I get
a) Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.

or

b) java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

Really adventuring into areas unknown to me here, but might there not by 
any chance be /another/ webapp, in which you did /not/ in that case give 
its own copy of the jar of its own ?

(like under server/webapps ?)


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



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
This thread has grown too long. For anyone following this thread,
here's the summary:

Two web applications, each with a Virtual Host entry in server.xml file.
Tomcat/webapps-abc
Tomcat/webapps-xyz

These two web applications have different log4j.properties files.
These log4j property files log to different log files
(Tomcat/logs/abc.log and Tomcat/logs/xyz.log).
Tomcat/webapps-abc/ROOT/WEB-INF/classes/log4j.properties
Tomcat/webapps-xyz/ROOT/WEB-INF/classes/log4j.properties

The web applications abc and xyz using Java Commons Logging API (Log
and LogFactory classes) to perform logging.

Scenario 1:
log4j.jar is in Tomcat/lib directory
log4j.jar is NOT in WEB-INF/lib directories

Result:
abc webapp's log entries are written to xyz.log file


Scenario 2:
log4j.jar is NOT in Tomcat/lib directory
log4j.jar is in WEB-INF/lib directories

Result:
ClassNotFoundError in Tomcat/logs/catalina.log files


Scenario 3:
log4j.jar is in Tomcat/lib directory
log4j.jar is in WEB-INF/lib directories

Result:
Empty abc.log and xyz.log files.


Here's the relevant portion of the webapps-abc/ROOT/WEB-INF/web.xml file:
listener

listener-classorg.springframework.web.util.Log4jConfigListener/listener-class
/listener
context-param
param-namelog4jConfigLocation/param-name
param-value/WEB-INF/classes/log4j.properties/param-value
/context-param
context-param
param-namelog4jExposeWebAppRoot/param-name
param-valuefalse/param-value
/context-param
listener

listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener


 webapps-xyz/ROOT/WEB-INF/web.xml file looks just the same

/* webapps-abc/ROOT/WEB-INF/classes/log4j.properties */
log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat6/logs/abc.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4


/* webapps-xyz/ROOT/WEB-INF/classes/log4j.properties */
log4j.rootLogger=INFO, A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A1.File=c:/Tomcat6/logs/xyz.log
log4j.appender.A1.MaxFileSize=100KB
log4j.appender.A1.MaxBackupIndex=4

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



RE: Memory leak in Tomcat 5.5.16

2010-05-04 Thread KT2010

Hello Tom,

I am facing a similar issue. Could you please send that piece of code that
was causing you this
error, just that snippet should be good.

Thanks


Tom Price-3 wrote:
 
 Hi all,
 
 No more help required - I traced back all the references to the Request
 objects and it did turn out to be a bug in my application code.  One of
 my tracing classes (written a long time ago, before we used Tomcat) was
 caching all created Thread objects.  So when Tomcat decided to allocate
 new threads to process incoming requests (and un-referenced the old
 ones), my application cached the old threads and they slowly leaked.
 I'm assuming that Tomcat only does this when handling multiple
 concurrent connections (i.e. threads are reused when handling
 single-threaded connections), hence the fact that I could only reproduce
 the problem when sending in concurrent requests.
 
 Thanks for everyone's suggestions.
 
 Tom.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Memory-leak-in-Tomcat-5.5.16-tp16335734p28454415.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: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Scenario 1:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is NOT in WEB-INF/lib directories

Have you added *anything* else to Tomcat's lib directory?

 Scenario 3:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is in WEB-INF/lib directories

You must never have the same classes located in more than one spot in a given 
branch of the classloader tree, so the above is not a valid configuration.

 - 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