Open arjav-desai opened 2 years ago
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 jersey.hk2@3.0.8/org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.inject(AbstractHk2InjectionManager.java:212)
at jersey.hk2@3.0.8/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 jersey.hk2@3.0.8/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 jersey.hk2@3.0.8/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 jersey.hk2@3.0.8/org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:140)
at jersey.hk2@3.0.8/org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllServiceHolders(ImmediateHk2InjectionManager.java:30)
at jersey.common@3.0.8/org.glassfish.jersey.internal.inject.Providers.getServiceHolders(Providers.java:299)
at jersey.common@3.0.8/org.glassfish.jersey.internal.inject.Providers.getAllRankedProviders(Providers.java:182)
at jersey.server@3.0.8/org.glassfish.jersey.server.ProcessingProvidersConfigurator.postInit(ProcessingProvidersConfigurator.java:89)
at jersey.server@3.0.8/org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$2(ApplicationHandler.java:353)
at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4204)
at jersey.server@3.0.8/org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:353)
at jersey.server@3.0.8/org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:297)
at jersey.common@3.0.8/org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at jersey.common@3.0.8/org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at jersey.common@3.0.8/org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
at jersey.server@3.0.8/org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:296)
at jersey.server@3.0.8/org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:261)
at io.helidon.webserver.jersey@3.1.0/io.helidon.webserver.jersey.JerseySupport.<init>(JerseySupport.java:160)
at io.helidon.webserver.jersey@3.1.0/io.helidon.webserver.jersey.JerseySupport$Builder.build(JerseySupport.java:532)
at io.helidon.microprofile.server@3.1.0/io.helidon.microprofile.server.JaxRsCdiExtension.toJerseySupport(JaxRsCdiExtension.java:283)
at io.helidon.microprofile.server@3.1.0/io.helidon.microprofile.server.ServerCdiExtension.addApplication(ServerCdiExtension.java:383)
at io.helidon.microprofile.server@3.1.0/io.helidon.microprofile.server.ServerCdiExtension.lambda$registerJaxRsApplications$11(ServerCdiExtension.java:264)
at io.helidon.common.context@3.1.0/io.helidon.common.context.Contexts.runInContext(Contexts.java:117)
at io.helidon.microprofile.server@3.1.0/io.helidon.microprofile.server.ServerCdiExtension.lambda$registerJaxRsApplications$12(ServerCdiExtension.java:264)
at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
at io.helidon.microprofile.server@3.1.0/io.helidon.microprofile.server.ServerCdiExtension.lambda$registerJaxRsApplications$14(ServerCdiExtension.java:260)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at io.helidon.microprofile.server@3.1.0/io.helidon.microprofile.server.ServerCdiExtension.registerJaxRsApplications(ServerCdiExtension.java:258)
at io.helidon.microprofile.server@3.1.0/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 weld.core.impl@3.1.0/org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
at weld.core.impl@3.1.0/org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:187)
at weld.core.impl@3.1.0/org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
at weld.core.impl@3.1.0/org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:123)
at weld.core.impl@3.1.0/org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
at weld.core.impl@3.1.0/org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
at jakarta.cdi@3.0.0/jakarta.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:125)
at weld.core.impl@3.1.0/org.jboss.weld.util.Observers.notify(Observers.java:166)
at weld.core.impl@3.1.0/org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at weld.core.impl@3.1.0/org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at weld.core.impl@3.1.0/org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at io.helidon.microprofile.cdi@3.1.0/io.helidon.microprofile.cdi.HelidonContainerImpl.doStart(HelidonContainerImpl.java:340)
at io.helidon.common.context@3.1.0/io.helidon.common.context.Contexts.runInContext(Contexts.java:137)
at io.helidon.microprofile.cdi@3.1.0/io.helidon.microprofile.cdi.HelidonContainerImpl.start(HelidonContainerImpl.java:250)
at io.helidon.microprofile.server@3.1.0/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?
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.