Skip to content

Lifebeat startup crashes with NullPointerException: hostName when WOHost isn't set #93

Closed

Description

@hugithordarson

Summary

With -WOLifebeatEnabled YES but no -WOHost, application startup dies with

INFO ng.appserver.wointegration.NGLifebeatThread - Creating LifebeatThread: appName=Vacation, appPort=1299, hostName=null, wotaskdPort=1085, interval=PT30S
java.lang.NullPointerException: hostName

and the app never starts listening.

Where it comes from

  • NGWOIntegrationPlugin.load() starts the lifebeat thread whenever WOLifebeatEnabled is set.
  • NGLifebeatThreadRunner.start() passes properties.d().propWOHost() straight through; it's null when the property isn't given.
  • NGLifebeatThread's constructor does Objects.requireNonNull( hostName, "hostName" ).

Reproduce

Run any ng app with wotaskd-style arguments, minus WOHost:

-WOPort 1299 -WOMonitorEnabled YES -WOLifebeatEnabled YES -WOLifebeatDestinationPort 1085 -WOLifebeatInterval 30 -WOApplicationName Vacation

Adding -WOHost localhost makes it start (and serve under the /cgi-bin/WebObjects/X.woa and /Apps/WebObjects/X.woa/1 prefixes) fine.

Thoughts

wotaskd normally passes -WOHost, so this mostly bites manual or scripted launches. But the failure is a bare NPE at startup that names a constructor parameter, not the property, so it takes a moment to connect it to WOHost. Options:

  • default WOHost to the local host name, as WO does (as far as I remember, WOApplication.host() falls back to the machine's name);
  • or fail with a message naming the missing property (WOLifebeatEnabled is set, but WOHost isn't).

Also worth a look while in there: the same _hostName is used both as the destination host for the wotaskd lifebeat URL and as the host the app reports for itself (sendMessage()), which is only right when wotaskd runs on the app's own host.

Related: #55 (proper wotaskd integration).

Activity

  1. hugithordarson commented on Oct 18, 2026

    @hugithordarson
    CollaboratorAuthor

    On the last point (the same host used both as the lifebeat destination and as the host the app reports): that matches WO. WO's lifebeat thread also connects to the app's own host address and reports that host. wotaskd only manages instances on its own machine, so it's always local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions