You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In combination with IBM Open Liberty server, I've encountered two problems with Spring Modulith:
Application startup fails with org.springframework.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->class org.springframework.modulith.events.jdbc.JdbcEventPublicationRepository$$SpringCGLIB$$0 cannot access its superclass org.springframework.modulith.events.jdbc.JdbcEventPublicationRepository.
Uninitialized member variables in Service component with a @ApplicationModuleListener annotated method to consume events cause NullPointerException when accessing said member variables.
While problem 1 can be bypassed with a patched "spring-modulith-events-jdbc-1.3.5.jar" where JdbcEventPublicationRepository is declared public instead of package-private, I don't understand yet the cause for problem 2. It's also possible that this monkey patch even triggers problem 2.
Since Open Liberty is not as common as other servers, I've prepared a small demo project.
The demo application mainly consists of:
a Service EventProducer to publish events
a Service EventConsumer that consumes the events (using @ApplicationModuleListener)
a RestController EventController to trigger the event publication
Building the project with mvn verify will bundle Open Liberty as embedded server (instead of default Tomcat), so one does not require a standalone server installation. The README should hopefully contain enough details. Stack traces for both problems are also included.
I would like to emphasize that these issues only occur with Open Liberty as server runtime, but not with Tomcat. Open Liberty is known to do things differently thread-wise during bootstrapping than other servers (see Spring issue 34729).
Kind regards,
Thomas
The text was updated successfully, but these errors were encountered:
In combination with IBM Open Liberty server, I've encountered two problems with Spring Modulith:
org.springframework.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->class org.springframework.modulith.events.jdbc.JdbcEventPublicationRepository$$SpringCGLIB$$0 cannot access its superclass org.springframework.modulith.events.jdbc.JdbcEventPublicationRepository
.@ApplicationModuleListener
annotated method to consume events cause NullPointerException when accessing said member variables.While problem 1 can be bypassed with a patched "spring-modulith-events-jdbc-1.3.5.jar" where
JdbcEventPublicationRepository
is declared public instead of package-private, I don't understand yet the cause for problem 2. It's also possible that this monkey patch even triggers problem 2.Since Open Liberty is not as common as other servers, I've prepared a small demo project.
The demo application mainly consists of:
EventProducer
to publish eventsEventConsumer
that consumes the events (using@ApplicationModuleListener
)EventController
to trigger the event publicationBuilding the project with
mvn verify
will bundle Open Liberty as embedded server (instead of default Tomcat), so one does not require a standalone server installation. The README should hopefully contain enough details. Stack traces for both problems are also included.I would like to emphasize that these issues only occur with Open Liberty as server runtime, but not with Tomcat. Open Liberty is known to do things differently thread-wise during bootstrapping than other servers (see Spring issue 34729).
Kind regards,
Thomas
The text was updated successfully, but these errors were encountered: