Using Payara

Download Location

Production Features of Payara Server You May Not Know About

  • Payara Server has a full web based administration console
  • Payara Server has a fully scriptable Command Line Interface
  • Payara Server has a full REST based management console
  • Payara Server is fully instrumented via JMX
  • Payara Server supports rolling upgrades of Java EE applications
  • Payara Server is fully supported in Production

Usefull Links

Payara Commands

Payara Version

 
D:\dev\payara5> asadmin version
  Version = Payara Server  5.184 #badassfish (build 89)
  Command version executed successfully.

Start Payara

 
asadmin.bat start-domain
  Waiting for domain1 to start ...............
Successfully started the domain : domain1
domain  Location: C:\tools\payara41\glassfish\domains\domain1
Log File: C:\tools\payara41\glassfish\domains\domain1\logs\server.log
Admin Port: 4848
Command start-domain executed successfully.

Stop Payara

 
asadmin.bat stop-domain

Use Management console

 
Link: http:/localhost:4848 

Logfile

 
d:\dev\payara41\glassfish\domains\domain1\logs\server.log

JDBC Resources and Connection Pools

Delete a JDBC Connection Pool

D:\dev\payara41>  asadmin delete-jdbc-connection-pool  InfoThekPoo  
JDBC Connection pool InfoThekPoo deleted successfully
Command delete-jdbc-connection-pool executed successfully.

Delete a JDBC Resource

D:\dev\payara41>  asadmin asadmin delete-jdbc-resource infohm 
JDBC resource infohm deleted successfully
Command delete-jdbc-resource executed successfully.

Ping failed creating a Payara Connection Pool in a Docker Environment

 Payara Log Entry  ./glassfish/domains/domain1/logs/server.log  
 
[2018-04-16T13:17:54.095+0200] [Payara 4.1] [SEVERE] [] [] [tid: _ThreadID=106 _ThreadName=admin-thread-pool::admin-listener(4)] 
 [timeMillis: 1523877474095] [levelValue: 1000] [[
  Mon Apr 16 13:17:54 CEST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. 
  According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option 
  isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. 
  You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server 
  certificate verification.]]

[2018-04-16T13:17:54.103+0200] [Payara 4.1] [WARNING] [] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] 
  [tid: _ThreadID=106 _ThreadName=admin-thread-pool::admin-listener(4)] [timeMillis: 1523877474103] [levelValue: 900] [[
  RAR8054: Exception while creating an unpooled [test] connection for pool [ InfoThekPoo ], 
  Connection could not be allocated because: Communications link failure

The last packet successfully received from the server was 8 milliseconds ago.  The last packet sent successfully to the server 
was 8 milliseconds ago.]]

[2018-04-16T13:17:54.104+0200] [Payara 4.1] [SEVERE] [] [org.glassfish.admingui] [tid: _ThreadID=91 
 _ThreadName=admin-thread-pool::admin-listener(3)] [timeMillis: 1523877474104] [levelValue: 1000] [[
  RestResponse.getResponse() gives FAILURE.  endpoint = 'http://localhost:4848/management/domain/resources/ping-connection-pool.json';
  attrs = '{id=InfoThekPoo}']]

  WA: add connection property:  useSSL=false 

Payara List JVM Options

C:\Users\helmu> asadmin list-jvm-options
-XX:MaxPermSize=192m
-client
-Djava.awt.headless=true
-Djdk.corba.allowOutputStreamSubclass=true
-Djavax.xml.accessExternalSchema=all
..
Dorg.glassfish.grizzly.DEFAULT_MEMORY_MANAGER=org.glassfish.grizzly.memory.HeapMemoryManager
-Ddeployment.resource.validation=false
-ea
Command list-jvm-options executed successfully.

Createa a new domain

D:\dev\payara5> asadmin create-domain  --domaindir D:\dev\payara5\glassfish\domains --adminport 5848 --instanceport 9080 mockdomain
  Enter admin user name [Enter to accept default "admin" / no password]>
  Using port 5848 for Admin.
  Using port 9080 for HTTP Instance.
  Default port 7676 for JMS is in use. Using 57985
  Default port 3700 for IIOP is in use. Using 57986
  Default port 8181 for HTTP_SSL is in use. Using 57987
  Using default port 3820 for IIOP_SSL.
  Using default port 3920 for IIOP_MUTUALAUTH.
  Default port 8686 for JMX_ADMIN is in use. Using 57988
  Using default port 6666 for OSGI_SHELL.
  Using default port 9009 for JAVA_DEBUGGER.
  Distinguished Name of the self-signed X.509 Server Certificate is:
  [CN=DESKTOP-7V4CT9V,OU=Payara,O=Payara Foundation,L=Great Malvern,ST=Worcestershire,C=UK]
  Distinguished Name of the self-signed X.509 Server Certificate is:
  [CN=DESKTOP-7V4CT9V-instance,OU=Payara,O=Payara Foundation,L=Great Malvern,ST=Worcestershire,C=UK]
  Domain mockdomain created.
  Domain mockdomain admin port is 5848.
  Domain mockdomain allows admin login as user "admin" with no password.
  Command create-domain executed successfully.

D:\dev\payara5> asadmin list-domains
  domain1 not running
  mockdomain not running
  payaradomain not running
  Command list-domains executed successfully.

Where do Payara/Glassfish keep war file deployed from web (admin console)?

  • Navigate to the glassfish config folder under domains and then open the domains.xml
  • Locate the sections keeping the application elements and finally locate your deployed application

-<applications>

  -<application name="server-2.0-SNAPSHOT" location="file:/D:/dev/myProjects/infohm-server/target/server-2.0-SNAPSHOT/" directory-deployed="true" object-type="user"context-root="/infohm" time-deployed="1529656867936" deployment-time="13726">
    <property name="archiveType" value="war"/>
    <property name="cdiDevModeEnabled" value="false"/>
    <property name="appLocation" value="file:/D:/dev/myProjects/infohm-server/target/server-2.0-SNAPSHOT/"/>
    <property name="org.glassfish.ejb.container.application_unique_id" value="100247591703085056"/>
    <property name="defaultAppName" value="server-2.0-SNAPSHOT"/>

    <module name="server-2.0-SNAPSHOT">
      <engine sniffer="cdi"/>
      <engine sniffer="ejb"/>
      <engine sniffer="security"/>
      <engine sniffer="jpa"/>
      <engine sniffer="web"/>
    </module>
  </application>
</applications>

Payara 4.1 install guide on CentOS 7

Payara 4.1 Reset admin password