Skip to main content

BBjServices

Open in ChatGPT

In BBjServices, the build starts no server of its own. mvn compile webforj:watch runs the app in the BBjServices of your own machine through BBjShip, straight from the project. An archetype project with the BBj flavor sets this as its default Maven goal, so mvn with no arguments compiles the app, starts the frontend watch, and runs the app.

Requirements​

A Maven project set up for BBjShip, see Getting started or Existing projects, with BBj installed on the same machine as the project. BBjServices loads the classes from the folders the build compiles into, so a BBj server on another machine gets deploys only, with neither live reload nor hotswap.

Turning live reload on​

webforj.conf
webforj.devtools.livereload.enabled = true

The remaining keys are listed in the settings.

Class changes​

In BBjServices, a class change reaches the running app only through a hotswap tool. Without one, a compiled change doesn't apply and the page doesn't reload until the watch starts again. An archetype project configures HotswapAgent:

pom.xml
<hotswap>
<hotswapAgent/>
</hotswap>

The tool attaches to BBjServices, not to the build. The first run adds it to the Java arguments of BBjServices and restarts BBjServices once. Later runs start without a restart. On macOS and Linux, and on Windows when BBjServices isn't registered as a Windows service, the restarted BBjServices runs outside the service manager of the operating system until the machine restarts. Troubleshooting lists the messages of a development run and what to do about each.

Restarts BBjServices

The first run changes the Java settings of BBjServices in <BBj home>/cfg/BBj.properties and restarts BBjServices. The restart ends every running BBj session on that machine, not only webforJ ones, so run it when nobody else uses that BBj. Before the first change, a copy of the file is kept as BBj.properties.before-webforj in the folder <BBj home>/plugins/.webforj-bbjship-deployments. Back up the file yourself first if you changed it by hand. mvn webforj:bbj-setup makes the same change.

A dependency change needs a new start of the watch.

Java of BBjServices​

With HotswapAgent, class structure changes depend on the Java that BBjServices runs on, not on the Java of the build. The watch never changes it. To run BBjServices on a JetBrains Runtime:

  1. In Enterprise Manager, go to BBjServices, Java Settings.
  2. Select BBjServices under Application and set the Java home.
  3. Restart BBjServices. Java Details in Enterprise Manager then shows the JDK and the version it runs on.

See Prerequisites for installing a JetBrains Runtime.

Production builds​

mvn install deploys the packaged app without development tools, see Deploying. The webforj.devtools.livereload.enabled property has no effect in a packaged app.