Monday, July 4, 2016

Integrating Tomcat 8.5.x and TomEE 7.x in Eclipse

Are you also seeing below error when trying to integrate Tomcat 8.5.x or TomEE 7.x using Tomcat v8.0 Server plugin in Eclipse?

For searchbots, the error says The Apache Tomcat installation at this directory is version 8.5.3. A Tomcat 8.0 installation is expected. This error even occurs in the current Eclipse Neon release. Perhaps they'll fix it in Neon SR1 by adding a new Tomcat v8.5 Server plugin. But for now and for older versions a workaround is needed.

The Eclipse built-in Tomcat server plugin basically detects the server version based on server.info property of org/apache/catalina/util/ServerInfo.properties file of Tomcat's /lib/catalina.jar file which looks like below in case of Tomcat 8.5.3:

The same procedure applies to TomEE 7.x which is based on Tomcat 8.5.x.

The difference between Tomcat 8.0 and 8.5 is the integration of Jaspic which is the first step towards standardizing Java EE authentication as part of JSR375. You probably already know that the ways to configure Java EE container managed authentication are totally scattered across different servers, making third party libraries such as Shiro and Spring Security more attractive. Each server needed its own way of configuring "realms" or "identity stores" to manage the database of users, passwords and roles. This will with JSR375 be unified using annotations and CDI provided via standard javax.security.* API. See also a.o. the question Java EE authentication: how to capture login event?

1 comment:

With Neon comes "Tomcat 9" as a drop down option for Targeted Runtimes. However, there is a problem in picking up the "servlet-api.jar" from the Tomcat 9 "lib" folder (e.g., D:\apache-tomcat-9.0.0.M9\lib where D:\apache-tomcat-9.0.0.M9 was given as the Tomcat installation directory while creating the server) and so javax.servlet.* does leads to compile errors.

Selecting "servlet-api.jar" as an external jar or putting it in WEB-INF/lib works but is there a proper workaround?

About

Donate

For the ones who want to express their excessive thanks for my work, I used to have an Amazon wishlist with a list of books, but right now I don't have any interesting books on the list anymore (to anyone who've sent books before: thank you very much, I got 6 books in 6 months). You can always donate something so that I can use it for other stuff, such as Nespresso coffee.