tomcat

Java/MSSQL: java.sql.SQLException Invalid object name 'TableName'.

I'm trying to move a java application from an old server to a new server. The application runs on Tomcat, uses Microsoft SQL Server as the backend DB, and used a system DSN defined in Data Sources (ODBC) to decide where to connect to. The old server used Windows 2000/SQL server 2000, the new server uses Windows 2003/SQL Server 2005. T...

JSP Expression Language Error Behavior?

I'm running Tomcat 6.0.18 on Linux. I have a JSP that uses a bean like this: <jsp:useBean id="helper" type="com.example.SomeType" scope="request"/> The page references an attribute of helper with the expression language like this: <!-- This works properly, but could fail silently if the bean name is incorre...

Tomcat does not recognize my context

I have a web application and use tomcat-5.5.27, eclipse 3.4 on open SUSE. I use it from eclipse (deploy, run, debug, etc...) I have to set some JNDI resources (datasources) that Tomcat will expose them. These resources are defined now in \META-INF\context.xml. This works fine. But, when I move this file (context.xml) in tomcat-5.5.27/c...

JMX and Tomcat: create and use MBeans in a servlet

Hi all, does anybody have some ideas on how to achieve that? Or even a good documentation on how to do that? Basicly everything is done in a test standalone version (by a java client or jconsole I am able to call mbeans methods and everything works fine), but I need to put it in my Tomcat servlet.... Thanks for every suggestions! Ro...

Tomcat 6 and log4j application logging produce no output

I'm trying to get log4j application (webapp) logging working in a Tomcat 6 app. I have log4j-1.2.15.jar in my WEB-INF directory, log4j.dtd and log4j.xml in WEB-INF/classes. My log4j.xml looks like: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" > <log4j:configuration> <appender name="massAppende...

Running Tomcat from NetBeans

Hi, I have installed Apache Tomcat and then I installed NetBeans. Then I added the Tomcat instance to NetBeans servers. Whe I try to run the server from NetBeans, something goes wrong.. Server starts and is running, but NetBeans does not know that and waits for the server to start forever (until a unsuccesfull message is displayed). I ...

Java Class file from SVN to Tomcat on server: How to compile automatically?

I'm currently fixing a JSP project and it currently has a seemingly random collection of .class files in it's Tomcat's WEB-INF folder. As a way of simplifying this, I was planning to get .java files from these classes straight from SVN to WEB-INF folder on server and I got that to work but what would be the simplest way of compiling thes...

How to run a Maven Project In Tomcat From Eclipse

Hi I am running a multi level maven project. It has webapps packaged as WAR, which depend on components packaged as JAR files Most of the code changes that i do belong to those JAR files. To test the changes, i need to repackage the JAR and the WAR and deploy externally in tomcat. I tried using sysdeo-tomcat-maven-eclipse plugin, bu...

How to tell Eclipse 3.4 WTP to not restart tomcat on JSP save?

Whenever I save a JSP file in my WTP project, Eclipse restarts its Tomcat instance. This is sorta driving me nuts. I don't want to disable auto reload completely, I just don't want it to happen when I save a file that doesn't require a restart. I'm not sure how Eclipse WTP works in this regard. Could it be my project structure? The ...

Multiple dynamic data sources for a servlet context

I'm developing a java servlet web application that manages information from multiple databases (all structurally the same) each corresponding to a different "business". The user selects "the current business" which is stored in the session and the application can display or modify that "current business". I would like to use tomcat ...

Apache is incorrectly converting jsp pages to "text/plain"

I've got a fairly normal setup in which Apache proxies requests to a servlet running inside Tomcat over the AJP protocol. We've run this setup on Apache 2.0.46/Tomcat 5.0.28 for ages without problems but have recently updated to Apache 2.2.3/Tomcat 5.5. The problem is that we've noticed that intermittently (maybe one time in 3) Apache...

Tomcat: Session count. What is it?

Okay, I think I already know, but I want to make sure, and this surprisingly simple question was surprisingly hard to google. :P In the tomcat manager, I have some session stats, like so: Active sessions: 1 Session count: 1 Max active sessions: 1 Rejected session creations: 0 Expired sessions: 0 Longest session alive time: 0 s Average ...

Disable Apache 503 response when Tomcat is down

We have some independent servers, connected behind a hardware balancer. Each one of the machines is running Apache 2.2, Tomcat 5.0 and mod_proxy_ajp as the connector. Everything works fine, but when Tomcat is shutdown, Apache returns error code 503 (as it's expected to do, I guess). The problem is our load balancer, which doesn't interp...

How can I access a config file from a servlet deployed as a .war-file and running in Tomcat 5.5?

I'm trying to access a config file from a a servlet inside of .war-file. The problem is, that the default file path is the tomcat root itself and hardcoding the path to the file seems not like an option either. Is it possible to get any information through the ServletContext or any Tomcat variables? ...

How to update the UserPrincipal with a new role without logging out and in?

Hi all, I am using form based authentication with tomcat. In a certain point in my site I allow the user to decide whether they want to add a role to their account. i.e. a user can decide to be an administrator as well. This request results in a new database entry. Now, in the site I show or hide certain links depending to what roles t...

PreparedStatement caching in Tomcat

I am looking for a way to achieve PreparedStatement caching, so as to save recreating the PreparedStatement objects for queries that were already executed in the past. Is there some built in way to achieve this using Tomcat? Or must I program this cache myself? ...

Is it possible to use wildcards within J2EE - fitlers?

I would like to apply a filter to severl url endings. The next configuraiton seems to work. <filter> <filter-name>LanguageFilter</filter-name> <filter-class>filters.LanguageFilter</filter-class> </filter> <filter-mapping> <filter-name>LanguageFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter...

What is a good strategy for caching prepared statements in Tomcat?

Hello, I am looking for a way to cache prepared statements in a servlet environment (specifically, Tomcat 5.5). This is meant to reduce the number of times that prepared statements are created, i.e. the number of times that connection.prepareStatement(sql) is called. My initial idea was to store PreparedStatement objects in the session...

Servlet security authentication

How to make security authentication for a web application that is using servlets and .jsp. I want to make authentication using tomcat. Can anyone explain steps I need to take in servlet and jsp for FORM authentication. Servlet is taking care of .jsp page that needs to be secured. ...

Speeding up Eclipse and JSF+Tomcat development

Hi Is there any way I can speed up the development of JSF in Eclipse and Tomcat? Basically I'm looking for a way to make the client-side changes (.jsf, .html, .css, .js) to happen a lot faster, and with out having to restart tomcat. And if possible, also a way to make tomcat (or any other Windows + Eclipse compatible Servlet Contain...