Tomcat Tomee

 

Hi there AppWorks fans,

Apache TomEE, pronounced 'Tommy', is an all-Apache Java EE 6 Web Profile certified stack where Apache Tomcat is top dog. Apache TomEE is assembled from a vanilla Apache Tomcat zip file. We start with Apache Tomcat, add our jars and zip up the rest. The result is Tomcat with added EE features - TomEE. Welcome to the Apache Tomcat ® 10.x software download page. This page provides download links for obtaining the latest version of Tomcat 10.0.x software, as well as links to the archives of older releases. Apache TomEE is a lightweight, yet powerful, JavaEE Application server with feature rich tooling. It is the Java Enterprise Edition of Apache Tomcat (Tomcat + Java EE = TomEE) and currently is a JakartaEE (formerly JavaEE) and Microprofile compliant application server. For windows machine Go to the tomcat directory C: apache-tomcat-x.0.xx bin binversion.bat Using CATALINABASE: 'C: apache-tomcat-x.0.xx' Using CATALINAHOME: 'C: apache-tomcat-x.0.xx' Using CATALINATMPDIR: 'C: apache-tomcat-x.0.xx temp' Using JREHOME: 'C: Program Files Java jdk1.8.065' Using CLASSPATH: 'C: apache-tomcat-x.0.xx bin bootstrap.jar;C: apache-tomcat-x.0.xx bin tomcat-juli.jar. Tomcat和TomEE,TomEE和TomEE Plus有什么区别? 我想在一台服务器上部署EJB ear,但是在tomcat , TomEE和TomEE Plusselect一台服务器真的很困惑。. Tomcat和TomEE什么TomEE ?; TomEE和TomEE Plus有哪些新function?; 在这种情况下,是否有意义去使用TomEE和TomEE Plus ?; 所以我需要一些build议才能做出明智的决定。.

Welcome to a new installment of AppWorks tips.

This guide will help you to install the TomEE application server on our Java supported CentOS VM image. The instance of TomEE is used to host the AppWorks platform.

This post is part of the series for ‘AppWorks installation in 10 great steps’.

This is the list of ingredients we are going to use:

Tomee
  • The already installed ‘Oracle Virtual Box’ software from the previous post
  • Our Java supported CentOS VM image from the previous post
  • PuTTY (SSH client). Downloaded from: putty.org

Let get right into it…

Start the Oracle VM VirtualBox tooling and start-up our image. Leave the image as is and make a connection with PuTTY.

As for Java also for TomEE a specific version is required as the documentation will tell us.

For TomEE, we first create a tomcat user who owns the installation: sudo useradd -s /sbin/nologin tomcat

Next, we need the URL from where we can download TomEE. This can be found here (for the version 8 that is required for our image): TomEE 8.0.6 Plus

It gives a list of mirror sites where we can download the correct file from with the command: wget https://ftp.nluug.nl/internet/apache/tomee/tomee-8.0.6/apache-tomee-8.0.6-plus.tar.gz

After the download is done, we need to extract the file: tar xvf apache-tomee-8.0.6-plus.tar.gz

The OpenText installation manual makes an additional step this time, it has to do with a ‘commons-daemon’ service, and the ‘jsvc’ tool that you need to generate! All these (complex steps) are needed to run tomcat in ‘daemon’ mode which is the Unix way for running TomEE as a service (like in Windows). The documentation is even talking about a ‘known issue’ in that daemon scripts which OpenText fixes with a downloadable zip with the corrected files!?

As we already saw in previous installations we can simply create our own ‘systemctl’ service and start/stop our TomEE with systemctl stop start tomee like we do for all our services! Automatically enable this service to start on system start-up. Far better in my opinion, and I’m not the only one. Great example here.

Also, make sure to use a GA version of TomEE (this time we use 8.0.6) found here since Jan. 2021. I had too many problems with the M1/M2 (‘Milestone’-releases!)

Why so sure about the 8.0.6 version? I got an error after the first upgrade try-out: Unsupported TomEE version '8.0.0-M2'. Supported: [^8.0.[0-9]+$]. Put that information on https://regex101.com/ with input ^8.0.[0-9]+$ on test string 8.0.0-M2 and it gives indeed no result! Test string 8.0.0 does give result!

Let’s move it all to a nice location with a service to start/stop it:

  • Create a directory: sudo mkdir /opt/tomee
  • Move the extracted folder: sudo mv apache-tomee-plus-8.0.6/ /opt/tomee/
  • Own the new folder by the ‘tomcat’ user: sudo chown -R tomcat:tomcat /opt/tomee/
  • Make a nice link to it: sudo ln -s /opt/tomee/apache-tomee-plus-8.0.6/ /opt/tomee/latest

Don’t use this link in any other configuration file like the ‘tomee.service’ or the system variables like the CLASSPATH as it fails the whole AppWorks installation…That’s my own experience!

  • Create a cool service for it: sudo vi /usr/lib/systemd/system/tomee.service

Add this content to the new file

Now save and quit the file :wq

Last steps…

  • Reload the services daemon as we changed it with a new service: systemctl daemon-reload
  • Enable the TomEE service: systemctl enable tomee.service
  • Now the big moment where we all waited for: systemctl start tomee.service

Check if it’s all running fine by browsing with your local machine to the URL: http://192.168.56.107:8080

For log file monitoring use the tail command: sudo tail -f /opt/tomee/latest/logs/catalina.out

Now let’s add tomcat users

Edit the tomcat-users.xml file: sudo vi /opt/tomee/latest/conf/tomcat-users.xml

Add these lines just before the last end-tag </tomcat-users>

Make sure the role names are is typed in correctly with the ‘-‘ in between

Tomcat And Tomee Integration Plugin Intellij Download

Make the ‘manager’ and ‘host-manager’ apps available for remote users (like our local machine!)

Create and edit a new file with the name ‘manager.xml’

sudo vi /opt/tomee/latest/conf/Catalina/localhost/manager.xml

Add this content to it

Create and edit a new file with the name ‘host-manager.xml’

sudo vi /opt/tomee/latest/conf/Catalina/localhost/host-manager.xml

Apache Tomee

Add this content to it

Restart tomcat systemctl restart tomee.service and check the result on these URLs. They should both give a pop-up for ‘HTTP Basic authentication’ where you can use the credentials as described in the tomcat-users.xml

Apache Tomcat Tomee /8.0.32 7.0.0-m3

As a final step is the proper way to add the correct environment variables for the TomEE instance.

Edit the ~/.bash_profile again for the ‘sysadmin’ user: vi ~/.bash_profile

The final version should look like this for now:

When done reload your profile via the command: source ~/.bash_profile

Check if it’s all OK via: env grep tomee

And that’s a big ‘DONE’ for this installment of AppWorks tips where we installed TomEE. This instance can now be used for hosting the AppWorks platform we will install in a further step on the series ‘AppWorks installation in 10 great steps’. Next step in to install PostgreSQL database, so we can save data steady.

Let me know what you think in the comments and have a good one for today…See U next time!