Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial application add-on fails contextLoads test #3071

Closed
Flaurite opened this issue Mar 29, 2024 · 1 comment
Closed

Initial application add-on fails contextLoads test #3071

Flaurite opened this issue Mar 29, 2024 · 1 comment

Comments

@Flaurite
Copy link
Contributor

Environment

Jmix version: 2.2.x

Bug Description

See RU support forum: topic.

The problem occurs in SecurityContextHolderAtmosphereInterceptor. The default test configuration with @SpringBootTest takes Vaadin configuration from FlowuiConfiugration. It leads to starting up Vaadin too, but add-on does not have flowui-test-assist dependency to correctly handle Vaadin.

There are a few solutions:

  1. Add flowui-test-assist to add-on template
  2. Rework code in SecurityContextHolderAtmosphereInterceptor to handle NPE

Steps To Reproduce

  1. Create application add-on
  2. Create Data store
  3. Run default test

Current Behavior

Cannot invoke "org.atmosphere.cpr.AtmosphereFramework.interceptor(org.atmosphere.cpr.AtmosphereInterceptor)" because the return value of "org.atmosphere.cpr.Universe.framework()" is null
java.lang.NullPointerException: Cannot invoke "org.atmosphere.cpr.AtmosphereFramework.interceptor(org.atmosphere.cpr.AtmosphereInterceptor)" because the return value of "org.atmosphere.cpr.Universe.framework()" is null
	at io.jmix.flowui.sys.vaadin.SecurityContextHolderAtmosphereInterceptor.onReady(SecurityContextHolderAtmosphereInterceptor.java:18)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:365)
	at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:237)
	at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:168)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:149)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384)
	at org.springframework.boot.context.event.EventPublishingRunListener.ready(EventPublishingRunListener.java:109)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$ready$6(SpringApplicationRunListeners.java:80)
@Flaurite Flaurite added type: bug Something isn't working triage Issue is waiting for triage labels Mar 29, 2024
@gorbunkov gorbunkov added size: M in: templates and removed triage Issue is waiting for triage labels Apr 5, 2024
@gorbunkov
Copy link
Contributor

SecurityContextHolderAtmosphereInterceptor has been disabled while working on #3226.
The current issue doesn't appear since then.

@gorbunkov gorbunkov closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants