Release 2025.4.0 · OpenEMS/openems

Hi @stefan.feilmeier,

I’m experiencing a problem with the UI in the new 2025.4.0 release. When starting the app, I’m getting the following error:

NullInjectorError: R3InjectorError(AppModule)[ApplicationInitStatus -> InjectionToken Application Initializer -> [object Object] -> NavigationService -> NavigationService]:
  NullInjectorError: No provider for NavigationService!
    at NullInjector.get (core.mjs:1621:27)
    at R3Injector.get (core.mjs:2148:33)
    at R3Injector.get (core.mjs:2148:33)
    at injectInjectorOnly (core.mjs:1116:32)
    at ɵɵinject (core.mjs:1122:60)
    at injectArgs (core.mjs:1253:23)
    at Object.factory (core.mjs:2374:52)
    at core.mjs:2271:47
    at runInInjectorProfilerContext (core.mjs:877:9)
    at R3Injector.hydrate (core.mjs:2270:21)

It seems Angular’s dependency injection system isn’t finding a provider for NavigationService. This might be due to the new version not registering the service correctly (for example, via providedIn: 'root' or in the module’s providers array), which then causes the APP_INITIALIZER to fail during bootstrapping.

Could the recent changes have inadvertently removed or misconfigured the provider for NavigationService? Any insights on whether this is an oversight or if there’s a new pattern for handling this dependency would be greatly appreciated.

Thanks!

Hi all, thanks for the update!
I updated to FEMS 2025.4.1 and it seems that the Modbus entities that I use for the Home Assistant Integration do not work anymore. Did you make any changes on Modbus?

Hi,

yes we all know about these Issues right now…

1 Like

Ok, thanks for the info

1 Like

Hi,

this issue was most likely caused by bumping capacitor versions, im on it.

1 Like

Hallo Lukas,

ich vermute, dass hier eine zirkuläre Abhängigkeit im Angular DI-System die Ursache ist – wahrscheinlich wird eine bisher unerkannte Abhängigkeit durch das Capacitor-Upgrade sichtbar. Zwei Ansätze können helfen:

Ansatz 1: Anpassung in app.module.ts

Trage den NavigationService explizit in das Provider-Array ein und entferne ihn aus den APP_INITIALIZER-Abhängigkeiten:

@NgModule({
  // ...andere Moduleinstellungen
  providers: [
    // weitere Provider
    NavigationService, // Hier eintragen
    {
      provide: APP_INITIALIZER,
      useFactory: initializeService,
      deps: [UserService], // NavigationService hier entfernen
      multi: true,
    },
  ],
})

Ansatz 2: Verwendung von providedIn: ‘root’

Alternativ kannst du den NavigationService in der Service-Datei so anpassen, dass er global (auf Root-Ebene) verfügbar ist:

// In navigation.service.ts
import { Injectable, WritableSignal, signal, effect } from "@angular/core";
// weitere Importe

@Injectable({ providedIn: 'root' })  // Statt @Directive()
export class NavigationService {
  // bisherige Implementierung
}

There is more discussion here:

1 Like

Ein kurzes Update von meiner Seite: das De-installieren der Modbus-App hat funktioniert; sie hat sich nach kurzer Zeit selbst wieder installiert, und danach kamen die Modbus-Werte wieder in HA an. Alles gut :ok_hand:

1 Like

Hi,

I have tried the following steps:

java -version
openjdk version “21.0.6” 2025-01-21 LTS
OpenJDK Runtime Environment Temurin-21.0.6+7 (build 21.0.6+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.6+7 (build 21.0.6+7-LTS, mixed mode, sharing)

java -jar openems-edge.jar

2025-04-03T13:19:33,011 [ogging])] INFO [ventAdminConfigurationNotifier] Sending Event Admin notification (configuration successful) to org/ops4j/pax/logging/Configuration
2025-04-03T13:19:33,023 [artLevel] INFO [enems.edge.application.EdgeApp] OpenEMS version [2025.4.0] started

I get an exception:

2025-04-03T13:19:41,444 [tchQueue] ERROR [Events.Framework ] FrameworkEvent ERROR
org.osgi.framework.ServiceException: Service factory exception: Could not obtain lock
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:354) ~[?:?]
at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:249) ~[?:?]
at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:362) ~[?:?]
at org.apache.felix.framework.Felix.getService(Felix.java:3984) ~[?:?]
at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:450) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:242) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:219) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getEnabledComponents(ComponentManagerImpl.java:178) ~[?:?]
at io.openems.edge.core.componentmanager.OsgiValidateWorker.findDefectiveComponents(OsgiValidateWorker.java:99) ~[?:?]
at io.openems.edge.core.componentmanager.OsgiValidateWorker.forever(OsgiValidateWorker.java:80) ~[?:?]
at io.openems.common.worker.AbstractWorker$1.run(AbstractWorker.java:155) ~[?:?]
Caused by: java.lang.IllegalStateException: Could not obtain lock
at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:242) ~[?:?]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainStateLock(AbstractComponentManager.java:289) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:908) ~[?:?]
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:349) ~[?:?]
… 10 more
2025-04-03T13:19:46,477 [tchQueue] ERROR [Events.Framework ] FrameworkEvent ERROR
org.osgi.framework.ServiceException: Service factory exception: Could not obtain lock
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:354) ~[?:?]
at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:249) ~[?:?]
at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:362) ~[?:?]
at org.apache.felix.framework.Felix.getService(Felix.java:3984) ~[?:?]
at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:450) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:242) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:219) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getAllComponents(ComponentManagerImpl.java:188) ~[?:?]
at io.openems.edge.core.componentmanager.EdgeConfigWorker.getChannels(EdgeConfigWorker.java:188) ~[?:?]
at io.openems.edge.core.componentmanager.EdgeConfigWorker.readConfigurations(EdgeConfigWorker.java:324) ~[?:?]
at io.openems.edge.core.componentmanager.EdgeConfigWorker.buildNewEdgeConfig(EdgeConfigWorker.java:151) ~[?:?]
at io.openems.edge.core.componentmanager.EdgeConfigWorker.getEdgeConfig(EdgeConfigWorker.java:99) ~[?:?]
at io.openems.edge.core.componentmanager.EdgeConfigWorker.forever(EdgeConfigWorker.java:73) ~[?:?]
at io.openems.common.worker.AbstractWorker$1.run(AbstractWorker.java:155) ~[?:?]
Caused by: java.lang.IllegalStateException: Could not obtain lock
at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:242) ~[?:?]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainStateLock(AbstractComponentManager.java:289) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:908) ~[?:?]
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:349) ~[?:?]
… 13 more

But it seems running, I have checked the Apache website:

http://localhost:8080/system/console/status-System%20Properties

native.encoding = Cp1250
openems.data.dir = c:/openems/data
org.apache.felix.eventadmin.Timeout = 0
org.ops4j.pax.logging.DefaultServiceLog.level = INFO
org.osgi.framework.startlevel.beginning = 18
org.osgi.service.http.port = 8080

I have downloaded the UI 2025.4 version and I have tried to run from Visual Sudio Code.

I have modified the edge-dev.ts file:

url: getWebsocketScheme() + location.hostname + “:8080”,

ng serve -c openems-edge-dev

Build at: 2025-04-03T11:13:56.893Z - Hash: 1e79e5caa00f0f24 - Time: 177075ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

In the browser there is just a blank page no login screen, nothing.

May I get some suggestions what am I doing wrong?

Thanks in advance!

Gabor

Hi,

I have downloaded the latest docker image and the blank page nothing else.

openems_docker

I also tried the gitpod, same result :frowning:

Gabor

Hi,

This is what I see in the browser: