How-to Update Payara in an Existing Pubserver
We deliver base packages containing a specific Payara version. We try to support updating an existing pubserver to any new pubserver version. Sometimes this is a problem since something might require specific Payara versions. How can we handle this? We need to update Payara in an existing pubserver.
This article currently is for Windows only. We will update it soon regarding Linux pubservers. Our Windows base packages contain these Payara versions:
Base Package | Contained Payara Version |
---|---|
PubServer_Base_4.4.0-Windows.zip | Payara 5.2022.5 (Payara release notes) |
PubServer_Base_4.3.0.1-Windows.zip | Payara 5.2022.5 (Payara release notes) |
PubServer_Base_4.2.0-Windows.zip PubServer_Base_4.2.0.1-Windows.zip | Payara 5.2022.5 (Payara release notes) |
PubServer_Base_4.1.9-Windows.zip PubServer_Base_4.1.9.1-Windows.zip PubServer_Base_4.1.9.2-Windows.zip | Payara 5.2022.5 (Payara release notes) |
PubServer_Base_4.1.7-Windows.zip | Payara 5.192 (2019/Q2) (Payara release notes) |
PubServer_Base_4.1.6-Windows.zip PubServer_Base_4.1.6.1-Windows.zip | Payara 5.191 (2019/Q1) (Payara release notes) |
PubServer_Base_4.1.5-Windows.zip | Payara 5.182 (2018/Q2) (Payara release notes) |
Since Payara 5.2020.5 does not contain derby anymore, we recommend not to use derby anymore. The default database for the timers was derby, and domain.xml in existing pubservers usually contains
<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" name="__TimerPool" res-type="javax.sql.XADataSource">
<property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/ejbtimer"></property>
<property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool>
There are two options for the timer database:
- Use the included h2 database instead of derby, see below.
- Use an external database management system. This is possible, but will not be explained here.
In both options the existing entries in the derby timer table will be lost. Standard timer events will be recreated when the pubserver is started again. Timer events connected to workflows are recreated automatically in this process. Unfortunately, server jobs/rendering scripts scheduled for a later run will need to be scheduled again.
To update Payara in an existing pubserver you need to do all the steps explained in the next sections. The Payara application server can be configured with very many different functions and options. We tested this procedure with a standard pubserver, but obviously we cannot test every possible configuration. If your pubserver cannot be updated in the described way, please contact us for support. We recommend to create a backup of the pubserver before starting this procedure! We recommend as well, that you first update a test or acceptance pubserver and test all functions in depth before you update a production system.
Step 1
Download the basic package you are interested in and the latest updater from the print FTP server.
Step 2
Stop your pubserver, and the included MySQL database as well, if you use it.
Step 3
Backup pubserver (see Backup of publishing server for more information).
Step 4
Backup domain pubserver via asadmin
command:
-
Open
cmd
-
Change directory to your pubserver folder
-
Execute
etc\settings.local.bat
-
Execute
etc\settings.default.bat
-
Create a top level folder
domainBackup
bymkdir domainBackup
-
Execute
"%GlassfishPath%\bin\asadmin.bat" --host %GlassfishHttpServer% --user %GlassfishUser% --passwordfile "%GlassfishPasswordFile%"
--port %GlassfishAdminPort% backup-domain --backupdir domainBackup pubserver -
In
domainBackup
there should be a backup now -
Keep the cmd for usage later on
Step 5
Rename top level glassfish
folder to glassfish.old
.
Step 6
Copy top level glassfish
folder from new base package to existing pubserver folder.
Step 7
Create folder glassfish\payara5\glassfish\domains\pubserver
.
Step 8
Restore domain pubserver via asadmin
command:
-
Use the cmd process from before
-
Execute
"%GlassfishPath%\bin\asadmin.bat" --host %GlassfishHttpServer% --user %GlassfishUser% --passwordfile "%GlassfishPasswordFile%"
--port %GlassfishAdminPort% restore-domain --backupdir domainBackup pubserver -
The folder
glassfish\payara5\glassfish\domains\pubserver
should contain the usual things now.
Step 9
Remove everything in glassfish\payara5\glassfish\domains\pubserver\generated
and glassfish\payara5\glassfish\domains\pubserver\osgi-cache
Step 10
(only Payara 5.192 and older)
Open glassfish\payara5\glassfish\domains\pubserver\config\domain.xml
in an editor of your choice and apply the following changes for removing derby usage:
-
Delete
<jdbc-resource pool-name="DerbyPool" object-type="system-all" jndi-name="jdbc/__derby"></jdbc-resource>
-
Delete
<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" name="__TimerPool" res-type="javax.sql.XADataSource">
<property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/ejbtimer"></property>
<property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool> -
Delete
<jdbc-connection-pool is-isolation-level-guaranteed="false" datasource-classname="org.apache.derby.jdbc.ClientDataSource" name="DerbyPool" res-type="javax.sql.DataSource">
<property name="PortNumber" value="1527"></property>
<property name="Password" value="APP"></property>
<property name="User" value="APP"></property>
<property name="serverName" value="localhost"></property>
<property name="DatabaseName" value="sun-appserv-samples"></property>
<property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool> -
Add the following
jdbc-connection-pool
to theresources
elements (for example directly after<resources>
)<jdbc-connection-pool datasource-classname="org.h2.jdbcx.JdbcDataSource" name="__TimerPool" res-type="javax.sql.XADataSource">
<property name="URL" value="jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/ejbtimer;AUTO_SERVER=TRUE"></property>
</jdbc-connection-pool>
Step 11
Check the used java version in the "java/jdk" folder.
To version 4.3:
Java 8 must be used.
From version 4.4:
Java 17 (for Rendering Service
and PriintBpm
) and Java 11 (for all the rest) must be used.
Latest base package contains those jdk's.
Step 12
Check your domain.xml if "jvm-options" for "grizzly-npn-bootstrap" exist for the java version you use:
<jvm-options>[1.8.0|1.8.0u120]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.6.jar</jvm-options>
<jvm-options>[1.8.0u121|1.8.0u160]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.7.jar</jvm-options>
<jvm-options>[1.8.0u161|1.8.0u190]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.jar</jvm-options>
<jvm-options>[1.8.0u191|1.8.0u250]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options>
<jvm-options>[1.8.0u251|]-Xbootclasspath/a:${com.sun.aas.installRoot}/lib/grizzly-npn-api.jar</jvm-options>
Sometimes on old installations “jvm-options” for “grizzly-npn-bootstrap” is one line and there is no switch depending on the java version.
If you have a situation like that, please copy & paste the jvm-options listed here.
Step 13
Update pubserver with the updater in the usual way. If the updater request access to a database unit "Camunda", create it as an empty database in your database management system. The name must be build using the same prefix as the other databases have. For example, if there is the database priint_pubserverkernel, create a database priint_camunda. The account priintadmin needs the same privileges/rights for the camunda unit as it has for the pubserverkernel unit.
Step 14
Sometimes the update installs a new jackrabbit version. We had to change the name of the jar. If your pubserver contains a jackrabbit with the wrong name (any jackrabbit jar except jackrabbit-jca.jar
), the wrong jackrabbit must be undeployed after updating the pubserver manually. Start Payara Administration Console and login as admin (default password is Comet4
). Display the list of deployed applications. Search for jackrabbit. If there is exactly one entry, jackrabbit-jca
, everything is fine. If you find other versions as well, please undeploy them. Please note, ONE jackrabbit must be deployed, never undeploy the last one.
Now you are done. If you run in additional problems during this procedure please contact the support.