AbstractMethodError on deploying Spring 4.0 in Tomcat 6

The error has nothing to do with the EL. It has all to do with the javax.validation api and hibernate. java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider Hibernate validator 4.3.x is an implementation of javax.validation 1.0 (JSR-303). However you are including the 1.1 API version. Either downgrade the included javax.validation version or upgrade your hibernate validator to 5.0.x.

Get the server port number from tomcat without a request

With this: List<String> getEndPoints() throws MalformedObjectNameException, NullPointerException, UnknownHostException, AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); QueryExp subQuery1 = Query.match(Query.attr(“protocol”), Query.value(“HTTP/1.1”)); QueryExp subQuery2 = Query.anySubString(Query.attr(“protocol”), Query.value(“Http11”)); QueryExp query = Query.or(subQuery1, subQuery2); Set<ObjectName> objs = mbs.queryNames(new ObjectName(“*:type=Connector,*”), query); String hostname = InetAddress.getLocalHost().getHostName(); InetAddress[] addresses = InetAddress.getAllByName(hostname); ArrayList<String> endPoints = new ArrayList<String>(); for (Iterator<ObjectName> i = … 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

Looking for an example for inserting content into the response using a servlet filter

The codebase I am using, calls the getOutputStream method, instead of getWriter when it processes the response, so the examples included in the other answer doesn’t help. Here is a more complete answer that works with both the OutputStream and the PrintWriter, even erroring correctly, if the writer is accessed twice. This is derived from … Read more

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>

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

How to change the port of Tomcat from 8080 to 80?

1) Go to conf folder in tomcat installation directory e.g. C:\Tomcat 6.0\conf\ 2) Edit following tag in server.xml file <Connector connectionTimeout=”20000″ port=”8080″ protocol=”HTTP/1.1″ redirectPort=”8443″/> 3) Change the port=8080 value to port=80 4) Save file. 5) Stop your Tomcat and restart it.

How to change the ROOT application?

There are three methods: First shutdown your Tomcat from the its bin directory (sh shutdown.sh). Then delete all the content of your Tomcat webapps folder (rm -fr *). Then rename your WAR file to ROOT.war, and finally start your Tomcat from the bin directory (sh startup.sh). Leave your war file in $CATALINA_BASE/webapps under its original … Read more