Re: Disable Caching for JNDI Object Factories?
Andreas Schildbach wrote: currently, if I locate a resource (EJB Home) from Tomcat's JNDI Context, and I have configured an Object Factory for that location, the factory is only exactly queried once. For the records: I finally filed a bug about this one. http://issues.apache.org/bugzilla/show_bug.cgi?id=42494 Regards, Andreas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Basic Auth without modification to web.xml?
Hi everyone, Is it possible with Tomcat to hide an application behind a Basic Authentication (or something similar), without modifying the web application itself (also not modifying web.xml)? I am thinking about adding a Valve or something to the context.xml. The content to be protected would just be the whole application, and there is only one user/role needed that has access. Is there something like this possible? Regards, Andreas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What happened to MailSessionFactory?
Russ Bonsall wrote: We just moved from Tomcat 5.5.17 to 5.5.20. Our application uses the JavaMail Session as a resource configured in the server.xml. When sending an email in our application I was getting the following exception: =20 javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: I've got the same problem. Is there any solution? Regards, Andreas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JMX remote with JMXMP
Hello everyone, I'd like to remotely access my MBeans by using the JMXMP protocol. JMXMP is an alternative to the default RMI protocol and aims to be much more firewall friendly. I already have downloaded the JMX remote reference implementation and thus have got hold of jmxremote_optional.jar. I know how I can get jconsole to talk JMXMP instead of RMI, but I don't know how to tell Tomcat 5.5 and/or the JVM 1.5 to expose MBeans with JMXMP instead of RMI. Can you help? Regards, Andreas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JMX via SSH tunnel does not work?
Hello Mikolaj, I have set up the JMX server of JDK 1.5.0_06/Tomcat 5.5.15. It works fine locally, I'm testing with jconsole. However, if I tunnel the JMX port over SSH, it does not work. I can connect to the port, but there is no flow of data. jconsole is hanging around for a minute, and then the connect dialog pops up. What is going wrong here? http://forum.java.sun.com/thread.jspa?threadID=565139tstart=30 http://forum.java.sun.com/thread.jspa?threadID=289869messageID=1242288 I understand the problem, but do not know how to solve it. Can you give an example how the java.rmi.server.hostname and java.rmi.server.useLocalHostname properties on the client and the server should be set in this case? Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JMX via SSH tunnel does not work?
Hello everyone, I have set up the JMX server of JDK 1.5.0_06/Tomcat 5.5.15. It works fine locally, I'm testing with jconsole. However, if I tunnel the JMX port over SSH, it does not work. I can connect to the port, but there is no flow of data. jconsole is hanging around for a minute, and then the connect dialog pops up. What is going wrong here? Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: per-webapp logging problem with Tomcat 5.5
Remy Maucherat wrote: Could it be that all libraries I use go to the wrong log? All your libraries, like Spring, will use their own logger names. All these loggers are not defined in your configuration, so will all use the handlers for the root logger (.handlers). org.apache.catalina.core.ContainerBase.[Catalina].[app2.de] is only used for logging the container logs for the specified host. Could you tell me if it's possible to redirect logging of own logger names to the webapps logs? I want true per-webapp/context logging, including Spring/Hibernate and the like (actually those a far more important for me than the container log). The documentation describes how to specify per webapp logging (with an example). You should read it. I have read http://tomcat.apache.org/tomcat-5.5-doc/logging.html over and over again during the last months. I must admit that I don't understand it entirely; for example it is nowhere mentioned that I have to list all handlers in the handlers property. It is also not clear what the digits in the prefixes mean, and if they have to be unique or in an ascending order without gaps. Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: per-webapp logging problem with Tomcat 5.5
Boris Unckel wrote: Could it be that all libraries I use go to the wrong log? This depends on the common and shared classloader. Please put any JAR which is not delivered by Tomcat and already there in a default installation in your WEB-INF/lib folder. Test again. I don't understand. The jars I've put into common/lib are: - database driver, dbcp... as I am using DataSource injection via JNDI, it is not recommended to add database drivers to the application itself (it should remain independant of the actual database used. - javamail... same, I am using JNDI for that. Also, javamail does not log in non-debug mode AFAIK. - JSTL... I could move them to the application (actually it belongs there until J2EE 5.0), but they don't do any logging at all. The libraries whose logging goes to the wrong log are already all in my application (e.g. Spring Hibernate). If that does not help: It may also be usefull to have a logging.properties per webapp (put it into WEB-INF/classes) This is not an option, as I would have to hardcode my applications loglevels. This is something the deployer will do, and he may not change the application. Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: per-webapp logging problem with Tomcat 5.5
Boris Unckel wrote: You want to have a _one_ central place for your log configuration _and_ the correct logging just for that application - currently impossible. I would not necessarely say that logging has to be configured in one central place/file, but I think putting logging config _into_ the applications is a bad idea. Let me elaborate why: The idea of a webapp is that you can deploy it on any spec-conforming server without changes (to the webapp). Thus, good webapps need to stay independant of specific implementations. As Juli is very Tomcat-specific, placing logging.properties into the webapp would create a dependancy to Tomcat 5.5 (for example ruling out Tomcat 5.0 as a possible container for the same Servlet 2.4 app). Furthermore, webapps should not (must not?) refer to files outside of their webapp directory, so refering to ${catalina.base}/logs is really bad practise (actually I'm surprised that it works). How can a webapp know that their container has got that environment variable, and I can it know that it points to a directory which contains a directory called logs? logging.properties also contains the log levels, something that is usually container instance specific. For example, production environments have different logging requirements than integration or development environments, even if they use the same container implementation. Would logging.properties be inside the application, you'd have to customize log levels for each deployment. I don't know if the widely used Eclipse/Web Tools Project combinations even allows for automatic customizations during deployment. Surely you could write complicated Ant scripts for deployment, but that's cumbersome and old-school. Thanks for your explanation about why real per-webapp logging is currently not possible with Tomcat 5.5 and Juli/java.util.logging. Is it the same with Log4J? Personally I feel this is a big regression from Tomcat 5.0/4.1: With the swallowOutput option, it was possible to do per-webapp logging _and_ logging configuration outside of webapp quite easily. I know swallowOutput was just a hack for lazy System.out.println() coders, but it had the nice side-effect of solving the problem very elegant and efficiently. And there was nothing wrong with the option, just with the habit of the lazy coders. As far as I know, swallowOutput is not there any more. Could it be re-activated? Is there anything else planned to support per-webapp logging? Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: per-webapp logging problem with Tomcat 5.5
Remy Maucherat wrote: Very funny. Funny what? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: per-webapp logging problem with Tomcat 5.5
Hi Boris, I have now switched my server to one-properties-per-webabb (inside webapp dir). It's not nice, but it works. Thanks a lot for your help. Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: per-webapp logging problem with Tomcat 5.5
Hello Boris, thanks for your answer. I could not see any error but one: handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3app1.org.apache.juli.FileHandler, 4app2.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler as first line (aside from comments) of your logging.properties. What is that line good for? How is it different to the .handlers line I've already got in my logging.properties? When I insert your line, the following happens: Some events are indeed logged to app1.xxx.log and app2.xxx.log. However, most events are logged to catalina.xxx.log. Here is what goes to the correct log: Feb 26, 2006 11:41:21 AM org.apache.catalina.core.ApplicationContext log INFO: Loading Spring root WebApplicationContext Feb 26, 2006 11:42:02 AM org.apache.catalina.core.ApplicationContext log INFO: Loading WebApplicationContext for Spring FrameworkServlet 'front_controller' Feb 26, 2006 11:44:27 AM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext Feb 26, 2006 11:44:27 AM org.apache.catalina.core.ApplicationContext log INFO: Closing WebApplicationContext of Spring FrameworkServlet 'front_controller' Here are some examples of what goes to the wrong log: Feb 26, 2006 11:41:22 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/webContext.xml] or Feb 26, 2006 11:41:34 AM org.springframework.orm.hibernate3.LocalSessionFactoryBean afterPropertiesSet INFO: Building new Hibernate SessionFactory Could it be that all libraries I use go to the wrong log? Do I need to have unique numbers as a prefix to app1 and app2? (could I use 0app1 and 0app2?) Do you have an answer for this question? Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
per-webapp logging problem with Tomcat 5.5
Hello everyone, I despair of configuring per-webapp logging for Tomcat 5.5, something that was easily possible with swallowOutput on pre-5.5 Tomcats. I've got 2 hosts (app1.de, app2.de), containing one context each. In addition, there is also the localhost context from the example server.xml. My conf/logging.properties looks like this (sorry about the wrapping): # Handler specific properties. # Describes specific configuration info for Handlers. 1catalina.org.apache.juli.FileHandler.level = FINE 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.FileHandler.prefix = catalina. 2localhost.org.apache.juli.FileHandler.level = FINE 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 2localhost.org.apache.juli.FileHandler.prefix = localhost. 3app1.org.apache.juli.FileHandler.level = FINE 3app1.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 3app1.org.apache.juli.FileHandler.prefix = app1. 4app2.org.apache.juli.FileHandler.level = FINE 4app2.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 4app2.org.apache.juli.FileHandler.prefix = app2. java.util.logging.ConsoleHandler.level = FINE java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Facility specific properties. # Provides extra control for each logger. .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[app1.de].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[app1.de].handlers = 3app1.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[app2.de].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[app2.de].handlers = 4app2.org.apache.juli.FileHandler My problem is, there is no logging going to any logfile. What am I doing wrong? Do I need to have unique numbers as a prefix to app1 and app2? (could I use 0app1 and 0app2?) Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]