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

Add tests to demo use of module-info #4872

Open
arjav-desai opened this issue Sep 13, 2022 · 1 comment
Open

Add tests to demo use of module-info #4872

arjav-desai opened this issue Sep 13, 2022 · 1 comment

Comments

@arjav-desai
Copy link
Member

We currently have a few examples which has module-info specified for JPMS. However, in some cases this file is not fully updated which causes issue when those examples are used directly in IntelliJ IDEA, see #4847

We should add tests which verifies module-info via doing build using module-path, to show case how it should/can be used and also gate/verify its usage.

@sdyura
Copy link

sdyura commented Sep 13, 2023

i have a project that throws the error:

java.lang.reflect.InaccessibleObjectException: Unable to make field private io.helidon.security.integration.jersey.FeatureConfig io.helidon.security.integration.jersey.SecurityFilterCommon.featureConfig accessible: module io.helidon.security.integration.jersey does not "opens io.helidon.security.integration.jersey" to unnamed module @43df23d3
	at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:387)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:363)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:311)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:181)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:175)
	at org.glassfish.hk2.utilities.reflection.ReflectionHelper$3.run(ReflectionHelper.java:1329)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
	at org.glassfish.hk2.utilities.reflection.ReflectionHelper.setAccessible(ReflectionHelper.java:1325)
	at org.glassfish.hk2.utilities.reflection.ReflectionHelper.setField(ReflectionHelper.java:1228)
	at org.jvnet.hk2.internal.Utilities.justInject(Utilities.java:992)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.inject(ServiceLocatorImpl.java:1014)
	at [email protected]/org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.inject(AbstractHk2InjectionManager.java:212)
	at [email protected]/org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.inject(ImmediateHk2InjectionManager.java:30)
	at org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider$InjectionManagerInjectedCdiTarget.inject(CdiComponentProvider.java:782)
	at org.glassfish.jersey.ext.cdi1x.internal.AbstractCdiBeanSupplier$2.getInstance(AbstractCdiBeanSupplier.java:98)
	at org.glassfish.jersey.ext.cdi1x.internal.AbstractCdiBeanSupplier._provide(AbstractCdiBeanSupplier.java:124)
	at org.glassfish.jersey.ext.cdi1x.internal.GenericCdiBeanSupplier.get(GenericCdiBeanSupplier.java:42)
	at [email protected]/org.glassfish.jersey.inject.hk2.InstanceSupplierFactoryBridge.provide(InstanceSupplierFactoryBridge.java:53)
	at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:129)
	at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:466)
	at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:46)
	at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2109)
	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
	at [email protected]/org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.lambda$getAllServiceHolders$0(AbstractHk2InjectionManager.java:136)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1242)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at [email protected]/org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:140)
	at [email protected]/org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllServiceHolders(ImmediateHk2InjectionManager.java:30)
	at [email protected]/org.glassfish.jersey.internal.inject.Providers.getServiceHolders(Providers.java:299)
	at [email protected]/org.glassfish.jersey.internal.inject.Providers.getAllRankedProviders(Providers.java:182)
	at [email protected]/org.glassfish.jersey.server.ProcessingProvidersConfigurator.postInit(ProcessingProvidersConfigurator.java:89)
	at [email protected]/org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$2(ApplicationHandler.java:353)
	at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4204)
	at [email protected]/org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:353)
	at [email protected]/org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:297)
	at [email protected]/org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at [email protected]/org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at [email protected]/org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
	at [email protected]/org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:296)
	at [email protected]/org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:261)
	at [email protected]/io.helidon.webserver.jersey.JerseySupport.<init>(JerseySupport.java:160)
	at [email protected]/io.helidon.webserver.jersey.JerseySupport$Builder.build(JerseySupport.java:532)
	at [email protected]/io.helidon.microprofile.server.JaxRsCdiExtension.toJerseySupport(JaxRsCdiExtension.java:283)
	at [email protected]/io.helidon.microprofile.server.ServerCdiExtension.addApplication(ServerCdiExtension.java:383)
	at [email protected]/io.helidon.microprofile.server.ServerCdiExtension.lambda$registerJaxRsApplications$11(ServerCdiExtension.java:264)
	at [email protected]/io.helidon.common.context.Contexts.runInContext(Contexts.java:117)
	at [email protected]/io.helidon.microprofile.server.ServerCdiExtension.lambda$registerJaxRsApplications$12(ServerCdiExtension.java:264)
	at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
	at [email protected]/io.helidon.microprofile.server.ServerCdiExtension.lambda$registerJaxRsApplications$14(ServerCdiExtension.java:260)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at [email protected]/io.helidon.microprofile.server.ServerCdiExtension.registerJaxRsApplications(ServerCdiExtension.java:258)
	at [email protected]/io.helidon.microprofile.server.ServerCdiExtension.startServer(ServerCdiExtension.java:192)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at [email protected]/org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
	at [email protected]/org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:187)
	at [email protected]/org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
	at [email protected]/org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:123)
	at [email protected]/org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
	at [email protected]/org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
	at [email protected]/jakarta.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:125)
	at [email protected]/org.jboss.weld.util.Observers.notify(Observers.java:166)
	at [email protected]/org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
	at [email protected]/org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
	at [email protected]/org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
	at [email protected]/io.helidon.microprofile.cdi.HelidonContainerImpl.doStart(HelidonContainerImpl.java:340)
	at [email protected]/io.helidon.common.context.Contexts.runInContext(Contexts.java:137)
	at [email protected]/io.helidon.microprofile.cdi.HelidonContainerImpl.start(HelidonContainerImpl.java:250)
	at [email protected]/io.helidon.microprofile.server.ServerImpl.start(ServerImpl.java:76)

when i try and run it from intellij,
on command line it runs fine.
(i am using helidon-mp 3.2.2)

but i NEED to run it in intellij, so i need a solution for this, removing the 'module-info.java' is not an option for me.
how do i fix this?

@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Normal priority in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Normal priority
Development

No branches or pull requests

3 participants