-
WildFly 26.1.3 Preview Jakarta 9.1: This is a critical dependency. WildFly 27+ only supports Jakarta EE 10.0.0 where
.xml
configurations for managed beans are no longer available. -
Jakarta EE Web Profile 9.1.0 and EclipseLink ORM 3.0.2: Ensure your
pom.xml
has these. Check pom.xml for reference.
- You can download WildFly 26.1.3 here.
- Use the port setup from lab2.
- Run the following command from the
[WILDFLY_ROOT]/bin
directory:
./jboss-cli.sh
Note: Don't worry if you get disconnected from the server; it's expected. Calmly proceed to the next step!
- Execute the following command:
module add --name=org.postgresql --resources=/usr/local/share/java/classes/postgresql.jar --dependencies=javax.api,javax.transaction.api
- Open
standalone.xml
located at[WILDFLY_ROOT]/standalone/configuration/
. - Replace the
<datasources>
section with the snippet below:
Don't forget to replace
username_from_pgpass
andpassword_from_pgpass
You can get them by executingcat .pgpass
from~
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<connection-url>jdbc:postgresql://pg:5432/studs</connection-url>
<driver>postgresql</driver>
<security>
<user-name>username_from_pgpass</user-name>
<password>password_from_pgpass</password>
</security>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<driver-class>org.postgresql.Driver</driver-class>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
<driver name="postgres" module="org.postgresql">
<driver-class>org.postgresql.Driver</driver-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
In some cases, you might need to increase the metaspace size.
- Add these lines to your
.bash_profile
:
export _JAVA_OPTIONS="-Xmx512M -XX:MaxMetaspaceSize=3200m"
export JAVA_VERSION="17.0+"
export JAVA_HOME="/usr/local/openjdk17"
export PATH=/usr/local/openjdk17/bin/:$PATH
You can do it like this:
echo 'these lines here' >> .bash_profile
Or just open Vim and do it like this
Note: Don't forget to relogin into Helios for these changes to take effect.
! Important !: If your server crashed - check if it is still running (ps -A
) and then kill -9 [PID]
- Provide the correct login and password in the
resources/db.cfg
file. - Also, manually create database schema in /studs (
psql -h pg -d studs
) and add it tojava/example/entity/ResultEntity
class
Same credentials from
.pgpass
- Build the Maven
.war
archive - In my deploy.sh: change
sXXXXX
with your ISU and deploy it to the server:
./deploy.sh