frifle
Posts: 1
Joined: Sat Jul 28, 2018 1:30 pm

"From Zero To Hello" - deploying a simple application to payara java-ee-server on my PI

Sat Jul 28, 2018 1:59 pm

I recently watched the video by Adam Bien "From Zero To Hello..." where Adam installed payara5-server on his machine, cloned a simple githup-application, builded and deployed it on the server. Just for fun I repeated the steps on my Raspberry Pi 3B.

It took me less than two minutes to get Adams ping-app deployed and running - cool! And the time for a deployment is a very few seconds. This makes even a PI suitable for running simple enterprise java applications!

Have Fun!

Code: Select all

[email protected]:~ $ time unzip -q downloads/payara-5.182.zip                       

real    0m13,131s
user    0m5,691s
sys     0m0,968s
[email protected]:~ $ time git clone http://github.com/adambien/ping              
Klone nach 'ping' ...
remote: Counting objects: 233, done.
remote: Total 233 (delta 0), reused 0 (delta 0), pack-reused 233
Empfange Objekte: 100% (233/233), 26.59 KiB | 0 bytes/s, Fertig.
Löse Unterschiede auf: 100% (64/64), Fertig.

real    0m1,566s
user    0m0,476s
sys     0m0,169s
[email protected]:~ $ cd ping 
[email protected]:~/ping $ time mvn package  
[INFO] Scanning for projects...
[INFO]                                                                          
[INFO] ------------------------------------------------------------------------
[INFO] Building ping 0.0.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]  
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ping ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/pi/ping/src/main/resources
[INFO]  
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ ping ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 5 source files to /home/pi/ping/target/classes
[INFO]  
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ping ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/pi/ping/src/test/resources
[INFO]  
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ ping ---
[INFO] No sources to compile
[INFO]  
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ ping ---
[INFO] No tests to run.
[INFO]  
[INFO] --- maven-war-plugin:2.2:war (default-war) @ ping ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ping] in [/home/pi/ping/target/ping]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/pi/ping/src/main/webapp]
[INFO] Webapp assembled in [103 msecs]
[INFO] Building war: /home/pi/ping/target/ping.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.946 s
[INFO] Finished at: 2018-07-27T16:55:41+02:00
[INFO] Final Memory: 12M/28M
[INFO] ------------------------------------------------------------------------

real    0m14,297s
user    0m16,702s
sys     0m0,481s
[email protected]:~/ping $ cd ..
[email protected]:~ $ time payara5/bin/asadmin start-domain
Waiting for domain1 to start .................................
Successfully started the domain : domain1
domain  Location: /home/pi/payara5/glassfish/domains/domain1
Log File: /home/pi/payara5/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

real    0m36,581s
user    0m4,101s
sys     0m0,199s
[email protected]:~ $ time payara5/bin/asadmin deploy ping/target/ping.war  
Application deployed with name ping.
Command deploy executed successfully.

real    0m37,173s
user    0m2,113s
sys     0m0,092s
[email protected]:~ $ time payara5/bin/asadmin undeploy ping
Command undeploy executed successfully.

real    0m3,188s
user    0m1,974s
sys     0m0,172s
[email protected]:~ $ time payara5/bin/asadmin deploy ping/target/ping.war  
Application deployed with name ping.
Command deploy executed successfully.

real    0m6,197s
user    0m2,069s
sys     0m0,089s
[email protected]:~ $ curl http://localhost:8080/ping/resources/pings/echo/hello_Adam          
hello_Adam

Balin
Posts: 9
Joined: Mon Sep 17, 2018 7:43 am

Re: "From Zero To Hello" - deploying a simple application to payara java-ee-server on my PI

Fri Sep 28, 2018 8:44 am

Cool!

I'll try payara ASAP. Looks promising!

Thanks for posting this!
Regards, Balin.

static916
Posts: 2
Joined: Tue Oct 16, 2018 10:37 pm

Re: "From Zero To Hello" - deploying a simple application to payara java-ee-server on my PI

Thu Oct 18, 2018 3:04 pm

I also recommend trying the Payara Micro. It uses 1/10 of the resources of the full Payara Server with most of the full JavaEE features. I was incredibly impressed!

Return to “Java”