tomcat

Mysql not reconnecting with JNDI Tomcat 6

I am using JNDI with Tomcat6 to manage Mysql connections, my Catalina/domain.com/ROOT.xml has: <Resource name="jdbc/db" auth="Container" type="javax.sql.DataSource" username="db1" password="somepass" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/db?autoReconnect=true" maxActive="15" maxIdle=...

Reduce number of Tomcat's Daemon Threads

I'm using Tomcat 5.5 with Eclipse and at every startup the Tomcat spawns about 15 to 20 Daemon threads. It's usefull if you want to handle several requests "at once". This is superficial on my development server and wastes ressources. How can I reduce this number of Daemon threads? ...

HttpSession.setMaxInactiveInterval not working in Tomcat 6

I'm trying to adjust the session timeout using HttpSession.setMaxInactiveInterval and it's not working. Here is my code (Groovy), which is executing without exceptions: def paramValue = WebAttributes.REQUEST.getParameter('maxInactiveSeconds'); println 'paramValue=' + paramValue; if (paramValue != null) { def seconds = Integer.parseIn...

Can I use the flash.net.NetConnection over https

Is it possible to use the flash.net.NetConnection object to connect to my Flash remoting enabled web application over HTTPS within Tomcat or any other servlet container? I am using the SpiceFactory cinnamon project for amf remoting and have searched for examples of using HTTPS but see only the reference to a proxy type in the NetConnect...

Can a Wicket application trigger a restart of itself without a manager password?

I'm new to Wicket and would like to maintain a web application from inside itself using some sort of maintenance admin page for running clean-up, DB updates, recovery and so on. Since I plan to use Hibernate or similar for data binding I would like to trigger a complete reboot of the application from inside itself without giving everybod...

What is wrong with runing app in tomcat server???

Recently I created a maven based web project and used tomcat as application server to debug ... But tomcat is frequently dead (pergem error which means out of memery ) after run app from the Project context menu directly. The worst is that It created many idle threads and they are all can not be killed by manually. And tomcat statu...

Java error: Only a type can be imported. XYZ resolves to a package.

I get the error: "Only a type can be imported. XYZ resolves to a package." Someone has explained the cause here but I am not sure what I supposed to do to fix this. FYI: I am using Eclipse. I have added the code that does the importing below. The java.util.* import works fine. <%@ page import="java.util.*"%> <%@ page import="org.ivec...

TCP Connect takes X100 longer than ping

I have a java process on machine A communicating with a Tomcat on machine B via TCP. The TCP connect (just the syn-syn/ack exchange) takes on the order of 100 ms consistently, while a ping request takes 1 ms (the serves are on the same LAN). What could cause the increased delay in establishing a TCP connection? How do I optimize it? ...

Tomcat: Handle Servlet Exception

I am setting up PHP on my Tomcatserver using the PECL-servlet (PHP/PECL-version 5.2.5). The server now sucessfully handles real PHP-files, but i am having a problem with requests for nonexistent pages. A request for such a page, f.ex: http://www.mydomain.com/nonexistentfile.php, causes the servlet to raise a java.io.IOException, which i...

How To Get MBean Server of Apache Tomcat.

Hi, I use ManagementFactory.getPlatformMBeanServer() from within Apache Tomcat and from a regular JAR file (outside the scope of apache). I think (And correct me if im wrong) I'm getting different MBean Servers. My question is - How Do I reach the Tomcat mbean server from outside or alternatively, how do I register the MBeans from ins...

Why is restlet running under tomcat under JBoss 5.1 returning my index.html page as type "application/octet-stream" instead of "text/html"?

I have a home page home.html inside a war file named "webapp-1.0.war". When the browser requests "http://domain/myapp" I want the home.html served up, but I want the browswer address bar to continue to display "http://domain/myapp". I DO NOT want "http://domain/myapp/home.html" in the address bar. So I put this into the web.xml: <wel...

How to ensure SSL-only access without authorising in Java webapp?

Hey all, I'm interested in ensuring that a couple of pages in a webapp are only accessible via https, but I don't want to authenticate the users. Can I do this declaratively with security-constraints. or do I need to do something programmatically? Any help appreciated, thanks folks (Tomcat 5.5, servlet spec 2.3 - it's a legacy thing....

JDBC Connection pool not reopening Connections in tomcat

Hi, I have set up tomcat to use a connection pool yet after the mysql timeout on connections the connections previously open in the pool are not opened.Here is what my context.xml file looks like: <Resource name="jdbc/hpsgDB" auth="Container" type="javax.sql.DataSource" maxActive="5" maxIdle="3" maxWait="10000" u...

HOW to Pass parameters to tomcat in ubuntu?

I am trying to configure cruisecontrol to use Tomcat rather then Jetty servlet engine. I am following a tutorial on this and I am stuck on where it says: Pass startup parameter to tomcat. -Ddashboard.config=/home/cruisecontrol/work/dashboard-config.xml Where do I put this in which file in tomact is it the startup.sh in tomcat directo...

why we need to restart tomcat server when a class file is changed,is there no other way?

why we need to restart tomcat server when a class file is changed,is there no other way? ...

Can fatwire run on tomcat?

Currently running fatwire on weblogic, would it be easy to port it to to tomcat, does it require J2EE? If not tomcat how about Jboss? ...

How to get original page url/uri after request dispatcher forward

I have a Error404Servlet which is configured as error-page for 404 in web.xml: <servlet> <servlet-name>Error404</servlet-name> <servlet-class>com.foo.bar.Error404Servlet</servlet-class> </servlet> <error-page> <error-code>404</error-code> <location>/error404</location> </error-page> In this servlet...

RequestDispatcher.forward() versus RequestDispatcher.include()

Hi, I have observed that while RequestDispatcher.forward(request, response) can throw an IllegalStateException (if the response is committed) , RequestDispatcher.include(request, response) does not throw an IllegalStateException(even if the response was committed before). I have verified this on Tomcat 6.0.20. I am aware that the incl...

Tomcat vs Websphere's web container performance

Anybody knows about a performance comparison for Tomcat vs Websphere app server's web container? www.webperformanceinc.com provides such a comparison but it's very outdated, somebody knows if there is a newer one, say with Websphere v6.1 or v7? ...

Read User Input from Tomcat startup

I have a Tomcat application that requires multiple passwords on startup. My current configuration uses a Java Properties object to load in the passwords from a password.conf file. There's now a requirement that no passwords are allowed in 'the clear' on the system. I had suggested encrypting the password file, but this isn't an option. ...