Running Java EE applications with Payara Micro on the Raspberry Pi

Cloud & Microservices

Payara Micro is a new way of running Java EE applications without having to install a full application server.

As Payara Micro requires no installation and has a <60MB runtime footprint it is ideal for running on small platforms like the Raspberry Pi.This blog will give you a step by step rundown of getting a Payara Micro cluster running on a pair of  Raspberry Pi’s. However the steps here can be used to test Payara Micro on any Linux platform.Here’s our two servers Piyara1 and Piyara2 we are using the latest raspbian that has Java already installed.

So let’s login and check Java is installed

 

piyara1

Installing Payara Micro

Let’s download Payara Micro

wget http://bit.ly/2x14U4F -O payara-micro.jar
piyara1

Ok now we’ve got Payara Installed let’s boot it up.

java -jar payara-micro.jar
piyara1

That’s it Payara Micro Running on a Raspberry Pi!If we run top we can see that there’s still plenty of resources left on the Raspberry Pi.

piyara1

Running a war File

At this stage however we aren’t running any JavaEE Applications. So let’s try a demo application by downloading the Prime faces showcase application.

wget http://repository.primefaces.org/org/primefaces/showcase/5.2/showcase-5.2.war

Let’s run that on Payara Micro

java -jar payara-micro.jar --deploy showcase-5.2.war
piyara1

You will see the message “Deployed 1 wars” and before that “showcase-5.2 was successfully deployed…”You can then test your deployed Prime Faces showcase by browsing to <a href=”http://:8080/showcase-5.2″>http://<your-pi-ip>:8080/showcase-5.2<a href=”http://:8080/showcase-5.2″>

Prime Faces Showcase

You can run any war file using the –deploy input parameter to Payara Micro. The parameter can be used multiple times if you have multiple jars. Alternatively you can use the parameter
–deploymentDir to deploy all the war files in a specific directory.
To see all the command line options run;

java -jar payara-micro.jar --help
piyara1

How about Clustering

Clustering is simple with Payara Micro. Just run a second Payara Micro Server on the same network and they will “find” each other and form a cluster.What you will see in the log output of Payara Micro is something like;

[2015-05-12T17:05:27.331+0000] [Payara 4.1] [INFO] [] [com.hazelcast.cluster.ClusterService] [tid: _ThreadID=36 _ThreadName=hz.glassfish-web.server.generic-operation.thread-0] [timeMillis: 1431450327331] [levelValue: 800] [[
[192.168.0.23]:5900 [dev] [3.4.2]
Members [2] {
Member [192.168.0.23]:5900 this
Member [192.168.0.24]:5900
}
]]

This is Payara Micro forming a cluster and all the members of the cluster are shown in the message. In this case our piyara1 and piyara2 servers. The cluster will include full session replication as well as a clustered Hazelcast Cache accessible using the JSR107 (JCache api) similar to standard Payara.

piyara1

Feedback Wanted

It is incredibly easy to get started with Payara Micro on any platform, there is no installation and no fancy maven packaging you need to get your head around to use Payara Micro. Just download and run.As this is a new feature of Payara we are looking for feedback. If you have any ideas or you find issues where Payara Micro won’t run your application, please raise them on the GitHub project https://github.com/payara/Payara

 

Comments (4)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Nico Michael

    How do i configure jdbc ppols and the on?

    1. Stephen Millidge

      Hi Nico,

      You can use standard JavaEE deployment descriptors to deploy the datasource. There is an example here;
      https://github.com/payara/Payara-Examples/blob/master/Payara-Micro/datasource-example/src/main/webapp/WEB-INF/web.xml

  2. Robert Frackowiak

    Can I use nohup to run payara micro after logout?

    1. Steve Millidge

      Hi Robert – I haven’t tested it but it should work.

Related Posts

Timeline showing Payara Platform Enterprise 4, 5, and 6 support phases (Full, Extended, Lifetime) from 2023–2033, along with JDK 8, 11, 17, and 21 support periods and end-of-life markers. 4 minutes
Thought Leadership

Understanding the Payara Platform Enterprise Software Lifecycle: How We Support Long-Term Stability 

Keeping an application server running smoothly isn’t so much about new features, but more about predictability and consistency. Software […]

Patrik Dudits presenting at Devoxx Belgium 2025 5 minutes
Cloud & Microservices

Devoxx BE 2025: It Only Starts with a Container & How Abstraction Becomes Reality 

At Devoxx Belgium 2025, I was able to talk about what happens after you build your container. In theory, […]

payara qube logo 5 minutes
Payara

Payara Cloud Is Now part of Payara Qube family of Unified Platforms for Enterprise Java

Payara Cloud is becoming part of Payara Qube family of Java application deployment runtimes. This move reflects how the […]