Skip to content

Local JBoss development

Christian Salmhofer edited this page Aug 19, 2022 · 13 revisions

TBD: Need to be tested or extended for Windows with Adaption of this page

If you want to develop Hogajama locally, you can start a local Wildfly and connect to a PostgreSQL and MongoDB running in Docker Containers.

Setup Guide

Setup PostgreSQL in Docker

docker run -d  --name hogarama-postgres -p 5432:5432 -e POSTGRES_DB=management -e POSTGRES_USER=hogajama -e POSTGRES_PASSWORD=changepassword postgres

Setup MongoDB in Docker

docker run -d  --name hogarama-mongo -p 27017:27017  -e MONGODB_USERNAME=hogajama -e MONGODB_PASSWORD=changepassword -e MONGODB_DATABASE=hogajamadb -e ALLOW_EMPTY_PASSWORD=yes bitnami/mongodb:latest

Setup Wildfly

Download the Wildfly Server (26.1.1.Final) and place the server source folder as a .zip file in the Downloads folder of your user. In this case there is a wildfly-26.1.1.Final.zip in the Downloads folder.

Clone JBoss Setup Scripts and setup JBSS environment: (in this example the JBSS Folder is placed next to the Hogarama Folder)

git clone [email protected]:Gepardec/JBSS.git
./JBSS/bin/setup.sh -i hogajama -r wildfly-26.1.1.Final
echo export ENV_FILE=`pwd`/Hogarama/codereadyworkspace/hogarama_local.env >> ~/.hogajamarc

Have a look to the hogarama_local.env file, this is the configuration of your local hogajama.

Configure your local JBoss:

cd  Hogarama/Hogajama/configuration/local_configuration/
hogajama configure .

Use hogajama help to find out more.

You may stop the unused MDB to prevent warnings in jboss-cli: /deployment=hogajama-rs-0.0.1-SNAPSHOT.war/subsystem=ejb3/message-driven-bean=WateringMDB:stop-delivery

Deployments

Following deployments are on the JBoss:

  • hogajama-rs
  • hogajama-frontend
  • hogajama-angular-frontend

Troubleshooting

Running Wildfly from IntelliJ in Debug Mode

Problem: ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.

This is happening, because IntelliJ is passing JAVA_OPTS parameters already defined in the standalone.conf

Solution: Edit the standalone.conf in your jboss-hogajama/bin Folder:

  • Comment out this line: JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"

Problem: Website shows "Could not load data. Please try again later."

Solution:

  • You didn't send data. You can send data with Raspberry-PI-Mocks-GUI
  • If you just added the environment variables, restart your JBoss, IDE