I built a test: https://github.com/apache/tomee/pull/467, and tried the PR
with
the SystemInstance.get().setProperty("openejb.cxf-rs.cache-application",
"false"); line removed. The PR fixes the test (great). Removing the
property looks like it potentially has other impacts - at least one test in
OpenAPI, and a handful of tests across health and metrics, which I'm
looking in to.

Jon

On Wed, May 15, 2019 at 2:43 PM Jonathan Gallimore <
[email protected]> wrote:

> Thanks. That helps a lot. Definitely different to what we're seeing with
> the .war file that the TCK uses. I'll take a look at that with a debugger.
>
> Jon
>
> On Wed, May 15, 2019 at 1:58 PM Ivan Junckes Filho <[email protected]>
> wrote:
>
>> Jon, thank you for helping out with this.
>>
>> I created a sample project with the description of the issue and how to
>> reproduce it.
>>
>> See here: https://github.com/ivanjunckes/openapi_sample
>>
>> On Wed, May 15, 2019 at 6:54 AM Jonathan Gallimore <
>> [email protected]> wrote:
>>
>> > I built master (without this PR), and deployed the .war file that the
>> > openapi-tck creates, which includes this class:
>> >
>> https://github.com/eclipse/microprofile-open-api/blob/master/tck/src/main/java/org/eclipse/microprofile/openapi/apps/airlines/JAXRSApp.java
>> (.war
>> > file attached - not sure if it'll make it through to the mailing list or
>> > not).
>> >
>> > Here's the full output for a call to /openapi:
>> > https://gist.github.com/jgallimore/f04ea487b326bc525a950fec5bd938c6
>> >
>> > Note under "info" I get:
>> >
>> > -------
>> > info:
>> >   version: "1.0"
>> >   description: ""
>> >   license:
>> >     name: "Apache 2.0"
>> >     url: "http://www.apache.org/licenses/LICENSE-2.0.html";
>> >   contact:
>> >     name: "AirlinesRatingApp API Support"
>> >     email: "[email protected]"
>> >     url: "http://exampleurl.com/contact";
>> >   termsOfService: "http://airlinesratingapp.com/terms";
>> >   title: "AirlinesRatingApp API"
>> > security:
>> > - airlinesRatingApp_auth: []
>> > tags:
>> > - name: "user"
>> >   description: "Operations about user"
>> > -------
>> >
>> > At this point, I'm not sure what the PR fixes. It looks like its working
>> > ok out of the box. I think we need more detail on the actual error. If
>> you
>> > can't include a test in the PR, perhaps you could provide a sample app
>> that
>> > reproduces the problem, along with the expected and actual output on
>> both
>> > master and 8.0.0-M2. I'd be happy to help troubleshoot that.
>> >
>> > I did try 8.0.0-M2 with same app from the TCK, which gives a deployment
>> > error and a HTTP 500 error at runtime. Not a great result, but an
>> entirely
>> > different error I think. Full exception below.
>> >
>> > Jon
>> >
>> > 15-May-2019 10:48:24.459 INFO [main]
>> > org.apache.openejb.cdi.CdiScanner.handleBda Using annotated mode for
>> >
>> file:/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/lib/microprofile-rest-client-api-1.1.jar
>> > looking all classes to find CDI beans, maybe think to add a beans.xml if
>> > not there or add the jar to exclusions.list
>> > 15-May-2019 10:48:25.352 INFO [main]
>> > org.apache.webbeans.config.BeansDeployer.validateInjectionPoints All
>> > injection points were validated successfully.
>> > 15-May-2019 10:48:25.377 INFO [main]
>> > org.apache.openejb.cdi.OpenEJBLifecycle.startApplication OpenWebBeans
>> > Container has started, it took 1114 ms.
>> > 15-May-2019 10:48:25.387 INFO [main]
>> > org.apache.openejb.assembler.classic.Assembler.createApplication
>> Deployed
>> >
>> Application(path=/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/webapps/test)
>> > 15-May-2019 10:48:25.511 INFO [main]
>> > org.apache.myfaces.ee.MyFacesContainerInitializer.onStartup Using
>> > org.apache.myfaces.ee.MyFacesContainerInitializer
>> > 15-May-2019 10:48:25.530 INFO [main]
>> > org.apache.myfaces.ee.MyFacesContainerInitializer.onStartup Added
>> > FacesServlet with mappings=[/faces/*, *.jsf, *.faces, *.xhtml]
>> > 15-May-2019 10:48:25.542 INFO [main]
>> > org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was
>> scanned
>> > for TLDs yet contained no TLDs. Enable debug logging for this logger
>> for a
>> > complete list of JARs that were scanned but no TLDs were found in them.
>> > Skipping unneeded JARs during scanning can improve startup time and JSP
>> > compilation time.
>> > 15-May-2019 10:48:25.547 INFO [main]
>> > org.apache.tomee.myfaces.TomEEMyFacesContainerInitializer.addListener
>> > Installing
>> >
>> <listener>org.apache.myfaces.webapp.StartupServletContextListener</listener>
>> > 15-May-2019 10:48:25.599 INFO [main]
>> >
>> org.apache.myfaces.config.DefaultFacesConfigurationProvider.getStandardFacesConfig
>> > Reading standard config META-INF/standard-faces-config.xml
>> > 15-May-2019 10:48:25.773 INFO [main]
>> >
>> org.apache.myfaces.config.DefaultFacesConfigurationProvider.getClassloaderFacesConfig
>> > Reading config :
>> >
>> jar:file:/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/lib/openwebbeans-jsf-2.0.9.jar!/META-INF/faces-config.xml
>> > 15-May-2019 10:48:25.775 INFO [main]
>> >
>> org.apache.myfaces.config.DefaultFacesConfigurationProvider.getClassloaderFacesConfig
>> > Reading config :
>> >
>> jar:file:/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/lib/openwebbeans-el22-2.0.9.jar!/META-INF/faces-config.xml
>> > 15-May-2019 10:48:25.860 INFO [main]
>> > org.apache.myfaces.config.LogMetaInfUtils.logArtifact Artifact
>> > 'myfaces-api' was found in version '2.3.2' from path
>> >
>> 'file:/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/lib/myfaces-api-2.3.2.jar'
>> > 15-May-2019 10:48:25.860 INFO [main]
>> > org.apache.myfaces.config.LogMetaInfUtils.logArtifact Artifact
>> > 'myfaces-impl' was found in version '2.3.2' from path
>> >
>> 'file:/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/lib/myfaces-impl-2.3.2.jar'
>> > 15-May-2019 10:48:25.868 INFO [main]
>> > org.apache.myfaces.util.ExternalSpecifications.isCDIAvailable MyFaces
>> CDI
>> > support enabled
>> > 15-May-2019 10:48:25.869 INFO [main]
>> >
>> org.apache.myfaces.spi.impl.DefaultInjectionProviderFactory.getInjectionProvider
>> > Using InjectionProvider
>> > org.apache.myfaces.spi.impl.CDIAnnotationDelegateInjectionProvider
>> > 15-May-2019 10:48:25.909 INFO [main]
>> > org.apache.myfaces.util.ExternalSpecifications.isBeanValidationAvailable
>> > MyFaces Bean Validation support enabled
>> > 15-May-2019 10:48:25.946 INFO [main]
>> > org.apache.myfaces.application.ApplicationImpl.getProjectStage Couldn't
>> > discover the current project stage, using Production
>> > 15-May-2019 10:48:25.947 INFO [main]
>> > org.apache.myfaces.config.FacesConfigurator.handleSerialFactory
>> > Serialization provider : class
>> > org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
>> > 15-May-2019 10:48:25.951 INFO [main]
>> >
>> org.apache.myfaces.config.annotation.DefaultLifecycleProviderFactory.getLifecycleProvider
>> > Using LifecycleProvider
>> > org.apache.myfaces.config.annotation.Tomcat7AnnotationLifecycleProvider
>> > 15-May-2019 10:48:25.972 INFO [main]
>> > org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces
>> ServletContext
>> > initialized.
>> > 15-May-2019 10:48:25.977 INFO [main]
>> > org.apache.myfaces.view.facelets.ViewPoolProcessor.initialize
>> > org.apache.myfaces.CACHE_EL_EXPRESSIONS web config parameter is set to
>> > "noCache". To enable view pooling this param must be set to
>> > "alwaysRecompile". View Pooling disabled.
>> > 15-May-2019 10:48:25.990 INFO [main]
>> >
>> org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized
>> > MyFaces Core has started, it took [439] ms.
>> > java.util.logging.ErrorManager: 5
>> > java.lang.NullPointerException
>> > at
>> >
>> java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:166)
>> > at java.util.ResourceBundle.getObject(ResourceBundle.java:441)
>> > at java.util.ResourceBundle.getString(ResourceBundle.java:407)
>> > at java.util.logging.Formatter.formatMessage(Formatter.java:118)
>> > at org.apache.juli.OneLineFormatter.format(OneLineFormatter.java:140)
>> > at org.apache.juli.FileHandler.publish(FileHandler.java:282)
>> > at
>> >
>> org.apache.juli.AsyncFileHandler.publishInternal(AsyncFileHandler.java:146)
>> > at
>> >
>> org.apache.juli.AsyncFileHandler$LogEntry.flush(AsyncFileHandler.java:185)
>> > at
>> >
>> org.apache.juli.AsyncFileHandler$LoggerThread.run(AsyncFileHandler.java:161)
>> > java.util.logging.ErrorManager: 5
>> > java.lang.NullPointerException
>> > at
>> >
>> java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:166)
>> > at java.util.ResourceBundle.getObject(ResourceBundle.java:441)
>> > at java.util.ResourceBundle.getString(ResourceBundle.java:407)
>> > at java.util.logging.Formatter.formatMessage(Formatter.java:118)
>> > at org.apache.juli.OneLineFormatter.format(OneLineFormatter.java:140)
>> > at java.util.logging.StreamHandler.publish(StreamHandler.java:211)
>> > at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:116)
>> > at
>> >
>> org.apache.tomee.jul.formatter.AsyncConsoleHandler.publishInternal(AsyncConsoleHandler.java:37)
>> > at
>> >
>> org.apache.juli.AsyncFileHandler$LogEntry.flush(AsyncFileHandler.java:185)
>> > at
>> >
>> org.apache.juli.AsyncFileHandler$LoggerThread.run(AsyncFileHandler.java:161)
>> > 15-May-2019 10:48:26.318 SEVERE [main]
>> > org.apache.cxf.jaxrs.utils.InjectionUtils.reportServerError Method
>> > setApplication can not be accessed due to security manager restrictions
>> > 15-May-2019 10:48:26.326 SEVERE [main]
>> > org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke
>> error
>> > invoking org.apache.tomee.webservices.TomeeJaxRsService@37e547da
>> >  org.apache.cxf.service.factory.ServiceConstructionException
>> > at
>> >
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:225)
>> > at
>> >
>> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:638)
>> > at
>> >
>> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:490)
>> > at
>> >
>> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:250)
>> > at
>> >
>> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:53)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> > at
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> > at java.lang.reflect.Method.invoke(Method.java:498)
>> > at
>> >
>> org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke(ObserverManager.java:402)
>> > at
>> >
>> org.apache.openejb.observer.ObserverManager.doFire(ObserverManager.java:111)
>> > at
>> >
>> org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:100)
>> > at
>> >
>> org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:134)
>> > at
>> >
>> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1783)
>> > at
>> >
>> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:117)
>> > at
>> >
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
>> > at
>> >
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
>> > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:193)
>> > at
>> >
>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
>> > at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
>> > at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
>> > at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
>> > at
>> >
>> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
>> > at
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>> > at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> > at
>> >
>> org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>> > at
>> >
>> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
>> > at
>> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
>> > at
>> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
>> > at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
>> > at
>> >
>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
>> > at
>> >
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
>> > at
>> >
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
>> > at
>> org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
>> > at
>> >
>> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:969)
>> > at
>> >
>> org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
>> > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>> > at
>> >
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
>> > at
>> >
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
>> > at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> > at
>> >
>> org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>> > at
>> >
>> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
>> > at
>> >
>> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
>> > at
>> >
>> org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
>> > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>> > at
>> >
>> org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
>> > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>> > at
>> >
>> org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
>> > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>> > at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> > at
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> > at java.lang.reflect.Method.invoke(Method.java:498)
>> > at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
>> > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
>> > Caused by: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal
>> > Server Error
>> > at
>> >
>> org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:79)
>> > at
>> >
>> org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:111)
>> > at
>> >
>> org.apache.cxf.jaxrs.utils.InjectionUtils.reportServerError(InjectionUtils.java:554)
>> > at
>> >
>> org.apache.cxf.jaxrs.utils.InjectionUtils.reportServerError(InjectionUtils.java:540)
>> > at
>> >
>> org.apache.cxf.jaxrs.utils.InjectionUtils.injectThroughMethod(InjectionUtils.java:376)
>> > at
>> >
>> org.apache.cxf.jaxrs.utils.InjectionUtils.injectThroughMethod(InjectionUtils.java:357)
>> > at
>> >
>> org.apache.cxf.jaxrs.utils.InjectionUtils.injectContextProxiesAndApplication(InjectionUtils.java:1152)
>> > at
>> >
>> org.apache.cxf.jaxrs.provider.ProviderFactory.injectContextProxiesIntoProvider(ProviderFactory.java:655)
>> > at
>> >
>> org.apache.cxf.jaxrs.provider.ServerProviderFactory.injectContextProxiesIntoProvider(ServerProviderFactory.java:310)
>> > at
>> >
>> org.apache.cxf.jaxrs.provider.ProviderFactory.injectContextProxies(ProviderFactory.java:644)
>> > at
>> >
>> org.apache.cxf.jaxrs.provider.ServerProviderFactory.setProviders(ServerProviderFactory.java:275)
>> > at
>> >
>> org.apache.cxf.jaxrs.provider.ProviderFactory.setUserProviders(ProviderFactory.java:789)
>> > at
>> >
>> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:332)
>> > at
>> >
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setupFactory(JAXRSServerFactoryBean.java:243)
>> > at
>> >
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:182)
>> > ... 55 more
>> >
>> > 15-May-2019 10:48:26.346 INFO [main]
>> > sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web
>> > application archive
>> >
>> [/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/webapps/test.war]
>> > has finished in [2,878] ms
>> > 15-May-2019 10:48:26.347 INFO [main]
>> > sun.reflect.DelegatingMethodAccessorImpl.invoke Deploying web
>> application
>> > directory
>> > [/Users/jgallimore/srv/apache-tomee-microprofile-8.0.0-M2/webapps/ROOT]
>> > 15-May-2019 10:48:26.347 INFO [main]
>> > org.apache.tomee.catalina.TomcatWebAppBuilder.init
>> > ------------------------- localhost -> /
>> > 15-May-201
>> >
>> > On Tue, May 14, 2019 at 11:15 PM Jonathan Gallimore <
>> > [email protected]> wrote:
>> >
>> >> I'll see if I can help you add a test so we have a better understanding
>> >> of what's going on, and help get this PR over the line.
>> >>
>> >> Jon
>> >>
>> >> On Tue, 14 May 2019, 18:56 Ivan Junckes Filho, <[email protected]>
>> >> wrote:
>> >>
>> >>> David, I will try to create a good description of the problem tomorrow
>> >>> morning.
>> >>>
>> >>> Adding openejb.cxf-rs.cache-application=false to system.properties in
>> M2
>> >>> doesn't fix the issue.
>> >>>
>> >>>
>> >>>
>> >>> On Tue, May 14, 2019 at 1:37 PM Roberto Cortez
>> >>> <[email protected]>
>> >>> wrote:
>> >>>
>> >>> > It is. We added it here:
>> >>> >
>> >>> >
>> >>> >
>> >>>
>> https://github.com/apache/tomee/blob/a21d73afca6d7842333a5fb0e0c1a3eff653f983/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileListener.java#L93
>> >>> > <
>> >>> >
>> >>>
>> https://github.com/apache/tomee/blob/a21d73afca6d7842333a5fb0e0c1a3eff653f983/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileListener.java#L93
>> >>> > >
>> >>> >
>> >>> > I believe this was only added on that big PR with all the MP
>> >>> integrations
>> >>> > for M3, but it was not present on M2.
>> >>> >
>> >>> > Cheers,
>> >>> > Roberto
>> >>> >
>> >>> > > On 14 May 2019, at 17:01, David Blevins <[email protected]>
>> >>> wrote:
>> >>> > >
>> >>> > >> On May 15, 2019, at 12:55 AM, David Blevins <
>> >>> [email protected]>
>> >>> > wrote:
>> >>> > >>
>> >>> > >> Side note to everyone on TCKs and system properties: we have to
>> pass
>> >>> > TCKs with the default settings we ship.  If we have to
>> disable/enable
>> >>> > features to pass a TCK, we haven't passed the TCK.
>> >>> > >
>> >>> > > On this topic:
>> >>> > >
>> >>> > > - what is the flag we enabled to pass the OpenAPI TCK?
>> >>> > > - why couldn't we ship that setting on/off by default?
>> >>> > >
>> >>> > > We can ship milestones like this, but we'll definitely need to
>> ship
>> >>> with
>> >>> > compliant defaults for our final.
>> >>> > >
>> >>> > >
>> >>> > > -David
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> >
>> >>> >
>> >>>
>> >>
>>
>

Reply via email to