HTTPS login with Spring Security redirects to HTTP

Your spring configuration should be agnostic to the used protocol. If you use something like “requires-channel”, you’ll run into problems sooner or later, especially if you want to deploy the same application to a development environment without https. Instead, consider to configure your tomcat properly. You can do this with RemoteIpValve. Depending on which headers … Read more

Eclipse – How can I change a ‘Project Facet’ from Tomcat 6 to Tomcat 5.5?

This is kind of hacking eclipse and you can get into trouble doing this but this should work: Open the navigator view and find that there is a .settings folder under your project expand it and then open the file: org.eclipse.wst.common.project.facet.core.xml you should see a line that says: <installed facet=”jst.web” version=”2.5″/> Change that to 2.4 … Read more

Tomcat 6 server creation using eclipse IDE on ubuntu

There’s a better workaround so you can keep Ubuntu’s Tomcat6 (taken from http://ubuntuforums.org/showthread.php?p=8541057, by DisDis) In a terminal: sudo apt-get install tomcat6 cd /usr/share/tomcat6 sudo ln -s /var/lib/tomcat6/conf conf sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy sudo ln -s /var/log/tomcat6 log sudo chmod -R 777 /usr/share/tomcat6/conf There. Now just go to Window/Preferences/Sever/Runtime Environments, add the Apache Tomcat6 … Read more

How to embed Tomcat 6?

Code speaks for itself. See the pom.xml snippet and the class to run tomcat. <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>catalina</artifactId> <version>6.0.18</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>coyote</artifactId> <version>6.0.18</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>jasper</artifactId> <version>6.0.18</version> <scope>test</scope> </dependency> public class RunWebApplicationTomcat { private String path = null; private Embedded container = null; private Log logger = LogFactory.getLog(getClass()); /** * The directory … Read more

Profile Tomcat Application With VisualVM

I have VisualVM profiling working with my Tomcat application now. I needed to add the following parameters to the tomcat startup: -Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false Here is a nice article on monitoring Tomcat with VisualVM.

How to run different apps on single Tomcat instance behind different ports?

I think you can configure that in you server.xml file and put 2 services : <Service name=”app1″> <Connector port=”8081″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app1″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service> <Service name=”app2″> <Connector port=”8082″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app2″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service>

Proxy Error 502 : The proxy server received an invalid response from an upstream server

The HTTP 502 “Bad Gateway” response is generated when Apache web server does not receive a valid HTTP response from the upstream server, which in this case is your Tomcat web application. Some reasons why this might happen: Tomcat may have crashed The web application did not respond in time and the request from Apache … Read more

Increase permgen space

You can use : -XX:MaxPermSize=128m to increase the space. But this usually only postpones the inevitable. You can also enable the PermGen to be garbage collected -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled Usually this occurs when doing lots of redeploys. I am surprised you have it using something like indexing. Use virtualvm or jconsole to monitor the Perm … Read more