tomcat

Using relative path for a static image in a Jfree report template

I have a JfreeReport Application which run under Tomcat inside a jar. In the report template (which exists outside the jar) I have the following: file:///var/lib/tomcat5.5/webapps/Reports/images/logo.gif But then I get exception: org.jfree.report.modules.ModuleInitializeException: Unable to create the specified directory. The...

Starting a threadpool in a servlet container

I have a servlet S which handles callbacks from a 3rd party site. The callback invocations happen in a specific order. Thus, I need to queue them. I propose to use an in-memory queue like java.util.ConcurrentLinkedQueue So the logic looks like this: Servlet S receives a callback & queues the received item into queue Q. By this ...

How can I know when my tomcat web application stopped?

Hi all, I want to get an 'event' before tomcat stops my web application. My application needs to "wrap up" staff before it is being closed. Any hint? -- Yonatan ...

Best way to alter constants in Java build process

I have inherited a Java application (servlets) that runs under Tomcat. For historical reasons, the code has different "look and feel" options based on where the application will be deployed (essentially a matter of branding). There are several constants that control this branding process, which have different functions and should not be...

How can I retrieve application parameters without passing ServletContext object around?

I have defined several application parameters for my webapp in the web.xml file, as follows: <context-param> <param-name>smtpHost</param-name> <param-value>smtp.gmail.com</param-value> </context-param> If I have a ServletContext Object object available, I can access them easily . For example in my Struts action classes. Ser...

Can an MBean be run under Tomcat?

We have 2 applications that run under JBoss. I am looking for a way to reduce the overhead of the server. The main app runs under Tomcat. The other app is made up of MBeans. Is there a way to run MBeans under Tomcat? Alternative suggestions are appreciated. ...

Is it a good Idea to integrate IIS with Tomcat, or forget about it and stick to Apache HTTP with Tomcat

Do you think it is possible to achieve the same performance found in ["Apache Http"-"Tomcat"] with ["IIS"-"Tomcat"] ? Just want to know what you think about the IIS-Tomcat combo (Performance-wise) ...

How do I make Tomcat stop caching my servlet responses?

I'm learning Servlets programming, using Apache Tomcat 6 on a Ubuntu 8.10 machine, and I'm running with a very annoying issue -- apparently, related to caching. This is what I'm doing: I write a servlet, put it in a nice directory structure and deploy it using the Tomcat Web Application Manager. It works as expected. Then I edit the ser...

How to config Tomcat to serve images from an external folder outside webapps?

How can i use Tomcat to serve image files from a public folder outside webapps? I dont want to use a 2nd Apache fileserver on a different port since the image files are part of the same app. And i dont want to create a symlink to the public folder inside webapps since my app is deployed as a war file....Is there a simpler solution simila...

Cannot get IIS ISAPI Tomcat connector to pass BASIC Authentication through to Tomcat

We've successfully configured IIS to front 2 Tomcat instances using isapi_redirect.dll. It's doing everything smartly, and we've been very happy. Now, however, we're using one of the Tomcat instances to serve up web services through AXIS. This requires BASIC Auth, and .NET clients are failing. + .NET clients can bypass IIS by surfing to ...

SQL Server connection management in Tomcat 6

We are having trouble with a Java web application running within Tomcat 6 that uses JDBC to connect to a SQL Server database. After a few requests, the application server dies and the in the log files we find exceptions related to database connection failures. We are not using any connection pooling right now and we are using the stand...

Changing the owner of an existing process in Linux

I would like to start tomcat (Web Server) as a privileged user, and then bring it back to an unprivileged user once it has started. Is there a way to do this programatically, or in general with Linux? Thanks. ...

Working with Eclipse, writing servlets in java...

Another day, another class... I have gotten everything working for my class in which I am using Tomcat and Eclipse to write java servlets. What I would like to know is why eclipse seems to give me problems when I try to edit the servlet-name in the web.xml file. Does eclipse not allow you to edit this file? I know that it automaticall...

java.util.ConcurrentLinkedQueue

I want to use java.util.ConcurrentLinkedQueue as a non-durable queue for a Servlet. Here's the blurb from the javadoc for the class. An unbounded thread-safe queue based on linked nodes. A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection. This queue does not permit null element...

Supporting Sessions Without Cookies in Tomcat

I am currently running an application with the following properties: Java-based with Spring and Acegi Running on Tomcat 5 I need the ability to support user sessions without cookies. Could someone please point me in the right direction. Thank you. ...

How do I send users to a different "site" in Apache while also using mod_proxy?

I have a web site that I administer that uses Apache 2.0 on the front with Tomcat 6 on the back-end (with mod_proxy proxying the connection between the two). I want to be able to use the same VirtualHost to also access the phpMyAdmin application running on the box. So, for example, www.mywebsite.com will pass all traffic to Tomcat, but ...

How to configure Tomcat to use Windows NTLM authentication?

I would like to use NTLM authentication with Tomcat so that Iexplorer send automatically both the user id+pwd to webapp. Is this possible? With "BASIC" authentication IE pops up the usual pwd dialog but I want to skip this dialog. ( Note, I use JNDIReal/ldap) ...

Install of Tomcat 5.5 on Ubuntu (using apt) leaves CATALINA_HOME unset

Hi, I'm setting up my development environment for writing web applications using Java, and I'm in need of some help. What I have done: Installation of Java SE 6 from Sun I installed (sudo apt-get install …) the following packages (one at a time as some of them requires user interaction) to get Java SE 6 from Sun: sun-java6-bin sun-ja...

java.awt.HeadlessException - Applet not displayed

I am using Tomcat 5.5.23, JDK 1.5 on HP Unix. We have an application which when invoked form tomcat starts an applet. It was working fine till JDK 1.4. But now we have moved to JDK 1.5 and the applet does not start. The exception thrown is - java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an opera...

Apache/Tomcat - LDAP Authentication based on AD Group Membership

We currently have an Apache/Tomcat (5.5) application running and we're using the LDAP authentication feature (by configuring the realm) against a multi domain structure and it's working great. One thing we would like to do is limit access to users based on their membership on a specific group in AD. Basically, only users of GroupA will...