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

Fixed getResourceAsStream #1303

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Fixed getResourceAsStream #1303

merged 1 commit into from
Oct 9, 2024

Conversation

christiangoerdes
Copy link
Collaborator

Membrane did not start when packaged in jar:

Membrane Router running...
16:09:03,482  INFO 1 main OpenAPIRecordFactory:83 - Parsing spec fruitshop-api.yml
org.springframework.context.ApplicationContextException: Failed to start bean 'router'
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:288)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:472)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:257)
	at org.springframework.context.support.DefaultLifecycleProcessor.start(DefaultLifecycleProcessor.java:170)
	at org.springframework.context.support.AbstractApplicationContext.start(AbstractApplicationContext.java:1530)
	at com.predic8.membrane.core.Router.init(Router.java:147)
	at com.predic8.membrane.core.RouterCLI.main(RouterCLI.java:39)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.predic8.membrane.core.Starter.main(Starter.java:47)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
	at com.predic8.membrane.core.Router.start(Router.java:316)
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:285)
	... 10 more
Caused by: java.lang.NullPointerException
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:144)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:106)
	at com.predic8.membrane.core.openapi.util.Utils.getResourceAsStream(Utils.java:230)
	at com.predic8.membrane.core.openapi.serviceproxy.OpenAPIPublisherInterceptor.createTemplate(OpenAPIPublisherInterceptor.java:72)
	at com.predic8.membrane.core.openapi.serviceproxy.OpenAPIPublisherInterceptor.<init>(OpenAPIPublisherInterceptor.java:66)
	at com.predic8.membrane.core.openapi.serviceproxy.APIProxy.initOpenAPI(APIProxy.java:96)
	at com.predic8.membrane.core.openapi.serviceproxy.APIProxy.init(APIProxy.java:82)
	at com.predic8.membrane.core.rules.AbstractProxy.init(AbstractProxy.java:163)
	at com.predic8.membrane.core.Router.initRemainingRules(Router.java:269)
	at com.predic8.membrane.core.Router.init(Router.java:263)
	at com.predic8.membrane.core.Router.start(Router.java:288)
	... 11 more

@membrane-ci-server
Copy link

This pull request needs "/ok-to-test" from an authorized committer.

@christiangoerdes
Copy link
Collaborator Author

/ok-to-test

@predic8 predic8 merged commit 1c32a0c into master Oct 9, 2024
2 of 3 checks passed
@predic8 predic8 deleted the resource-loading-fix branch October 9, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants