12 Replies Latest reply on Sep 11, 2018 8:12 AM by Tomaz Cerar

    Module referencing RT class?

    Nicklas Karlsson Master

      I must be googling wrong but I can't find how you're supposed to add a reference from a module to a non-exported JDK class. Worked OOTB in 11 but throws a ClassNotFoundException for the RT class in 14

       

      Thanks in advance,

        Nik

        • 1. Re: Module referencing RT class?
          Tomaz Cerar Master

          Did you have any special setting in your app to make it work in previous version?

           

          Did you also upgrade JDK to 9/10 as well?

          • 2. Re: Module referencing RT class?
            Nicklas Karlsson Master

            Nope, the modules were just a bunch of (Eclipse BIRT) jar:s bunched together. I'm running in a docker-container and the latest WF14 looks to be based on a JDK8 image.

            • 3. Re: Module referencing RT class?
              Tomaz Cerar Master

              What classes are missing? that might help understand what is going on.

              • 4. Re: Module referencing RT class?
                Nicklas Karlsson Master

                org.w3c.dom.css.CSSStyleDeclaration

                • 5. Re: Module referencing RT class?
                  Nicklas Karlsson Master

                  Is there any module for the RT that could be used in the same way as javax.api? Or is the RT supposed to be automagically available to all modules? At least I think the CSSStyleDeclaration referes to the one in the RT(?)

                  • 6. Re: Module referencing RT class?
                    Nicklas Karlsson Master

                    I tried adding a

                     

                        <dependencies>

                            <module name="sun.jdk" export="true" >

                                <imports>

                                    <include path="org/w3c/dom/css" />

                                </imports>

                            </module>

                        </dependencies>

                     

                    to the module but I still end up with the same CNFE

                    • 7. Re: Module referencing RT class?
                      Tomaz Cerar Master

                      can you paste the stacktrace, as from it, it can be seen where exactly it is trying to load it from

                      • 8. Re: Module referencing RT class?
                        Nicklas Karlsson Master
                        09:22:29,718 ERROR [<app>] (default task-3) javax.ejb.EJBException: <app>.Exception: Could not generate report
                        09:22:29,734 ERROR [<app>] (default task-2) org.w3c.dom.css.CSSValue from [Module "org.eclipse.birt" version 1.7+r608262 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/wildfly/modules,/opt/jboss/wildfly/modules/system/layers/base))]
                        09:22:29,737 ERROR [<app> (default task-2) Uncaught exception: javax.ws.rs.client.ResponseProcessingException: <app>: org.w3c.dom.css.CSSValue from [Module "org.eclipse.birt" version 1.7+r608262 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/wildfly/modules,/opt/jboss/wildfly/modules/system/layers/base))]
                                at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.filterResponse(ClientInvocation.java:627)
                                at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:440)
                                at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:470)
                                at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:231)
                                at <app>
                                at <app>
                                at <app>
                                at com.vaadin.server.StreamResource.getStream(StreamResource.java:143)
                                at com.vaadin.server.FileDownloader.handleConnectorRequest(FileDownloader.java:143)
                                at <app>.util.ui.OnDemandFileDownloader.handleConnectorRequest(OnDemandFileDownloader.java:33)
                                at com.vaadin.server.ConnectorResourceHandler.handleRequest(ConnectorResourceHandler.java:90)
                                at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1568)
                                at com.vaadin.cdi.server.VaadinCDIServletService.handleRequest(VaadinCDIServletService.java:92)
                                at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:381)
                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
                                at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
                                at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
                                at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:173)
                                at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                                at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                                at <app>
                                at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                                at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                                at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:55)
                                at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                                at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                                at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
                                at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
                                at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
                                at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
                                at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
                                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                                at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
                                at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
                                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                                at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
                                at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
                                at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
                                at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
                                at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
                                at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
                                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                                at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
                                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                                at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
                                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                                at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
                                at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
                                at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
                                at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
                                at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
                                at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
                                at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
                                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
                                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
                                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
                                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
                                at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
                                at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
                                at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
                                at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
                                at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
                                at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
                                at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
                                at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
                                at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
                                at java.lang.Thread.run(Thread.java:748)
                        Caused by: <app>: org.w3c.dom.css.CSSValue from [Module "org.eclipse.birt" version 1.7+r608262 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/wildfly/modules,/opt/jboss/wildfly/modules/system/layers/base))]
                                at <app>
                                at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.filterResponse(ClientInvocation.java:619)
                                ... 66 more
                        
                        • 9. Re: Module referencing RT class?
                          Nicklas Karlsson Master

                          And there is a

                          Caused by: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
                                  at org.eclipse.birt.report.engine.api.impl.EngineTask.handleFatalExceptions(EngineTask.java:2396)
                                  at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:191)
                                  at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
                                  <app>
                                  ... 141 more
                          Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/css/CSSValue
                                  at org.eclipse.birt.report.engine.parser.ReportParser.parse(ReportParser.java:177)
                                  at org.eclipse.birt.report.engine.executor.ExecutionContext.getReport(ExecutionContext.java:2229)
                                  at org.eclipse.birt.report.engine.executor.ReportExecutor.(ReportExecutor.java:86)
                                  at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:107)
                                  ... 143 more
                          Caused by: java.lang.ClassNotFoundException: org.w3c.dom.css.CSSValue from [Module "org.eclipse.birt" version 1.7+r608262 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/wildfly/modules,/opt/jboss/wildfly/modules/system/layers/base))]
                                  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
                                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
                                  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
                                  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
                                  ... 147 more

                           

                          before that. Strangely enough, now it appears to be org.w3c.dom.css.CSSValue but it's in the same package I tried to import in the module to solve the previous one...

                          • 10. Re: Module referencing RT class?
                            Tomaz Cerar Master

                            Looks like problem is only in your custom module "org.eclipse.brit"

                             

                            modify it and add dependency to jdk.xml.dom and it should work.

                             

                            this is a new thing in latest versions of Jboss Modules where it tries emulate names of internal JDK modules to those that are present in JDK9+

                            • 11. Re: Module referencing RT class?
                              Nicklas Karlsson Master

                              Cool, I’ll try it tomorrow. Is there a list of those ”virtual modules” in case I run into some other case?

                              • 12. Re: Module referencing RT class?
                                Tomaz Cerar Master

                                They mimic the modules that are found in JDK9+ so if you look for the class in jdk9/10/11 modules (jmod list ..) it would help.

                                 

                                but you can see the full list at jboss-modules/JDKModuleFinder.java at 1.x · jboss-modules/jboss-modules · GitHub