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

TagAttributeException in logs, containing "#{empty DatasetPage.croissant}" despite croissant exporter not used by the installation #10848

Open
okaradeniz opened this issue Sep 17, 2024 · 3 comments
Labels
Type: Bug a defect

Comments

@okaradeniz
Copy link
Contributor

What steps does it take to reproduce the issue?
The exception is discovered in the logs of the Dataverse installation, therefore it is not known how to reproduce it.

  • When does this issue occur?
    The exception is logged in seemingly random times during the day.

  • Which page(s) does it occurs on?
    N/A

  • What happens?
    A TagAttributeException occurs. The exception contains test="#{empty DatasetPage.croissant}" even though the installation does not use a Croissant exporter:

 [#|2024-09-17T13:18:23.367+0200|SEVERE|Payara 6.2024.6|jakarta.enterprise.resource.webcontainer.faces.context|_ThreadID=101;_ThreadName=http-thread-pool::jk-connector(4);_TimeMillis=1726571903367;_LevelValue=1000;|
   jakarta.faces.view.facelets.TagAttributeException: /dataset.xhtml @74,75 test="#{empty DatasetPage.croissant}" /dataset.xhtml @74,75 test="#{empty DatasetPage.croissant}": java.lang.NullPointerException
 jakarta.faces.view.facelets.TagAttributeException: /dataset.xhtml @74,75 test="#{empty DatasetPage.croissant}" /dataset.xhtml @74,75 test="#{empty DatasetPage.croissant}": java.lang.NullPointerException
        at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:291)
        at com.sun.faces.facelets.tag.TagAttributeImpl.getBoolean(TagAttributeImpl.java:107)
        at com.sun.faces.facelets.tag.jstl.core.ChooseWhenHandler.isTestTrue(ChooseWhenHandler.java:46)
        at com.sun.faces.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:63)
        at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:57)
        at jakarta.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:163)
        at com.sun.faces.facelets.tag.faces.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:177)
        at jakarta.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:139)
        at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:63)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)
        at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:358)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:329)
        at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:69)
        at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:57)
        at com.sun.faces.facelets.tag.faces.core.FacetHandler.apply(FacetHandler.java:61)
        at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:57)
        at jakarta.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:163)
        at com.sun.faces.facelets.tag.faces.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:177)
        at jakarta.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:139)
        at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:57)
        at com.sun.faces.facelets.tag.faces.core.ViewHandler.apply(ViewHandler.java:172)
        at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:57)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:52)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:46)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:264)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:314)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:297)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:154)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:134)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:52)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:46)
        at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:131)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:330)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:251)
        at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:128)
        at jakarta.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:96)
        at jakarta.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:96)
        at jakarta.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:96)
        at org.omnifaces.viewhandler.OmniViewHandler.restoreView(OmniViewHandler.java:113)
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:161)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:72)
        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:95)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:159)
        at jakarta.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:691)
        at jakarta.faces.webapp.FacesServlet.service(FacesServlet.java:449)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1554)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:331)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
        at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:83)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
        at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:757)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:158)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:372)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:239)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:174)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:153)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:196)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:88)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:246)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:178)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:118)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:96)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:51)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:510)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:82)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:83)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:101)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
        at java.base/java.lang.Thread.run(Unknown Source)
 Caused by: jakarta.el.ELException: /dataset.xhtml @74,75 test="#{empty DatasetPage.croissant}": java.lang.NullPointerException
        at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:77)
        at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:289)
        ... 79 more
 Caused by: jakarta.el.ELException: java.lang.NullPointerException
        at jakarta.el.BeanELResolver.getValue(BeanELResolver.java:351)
        at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:139)
        at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:164)
        at org.glassfish.expressly.parser.AstValue.getValue(AstValue.java:302)
        at org.glassfish.expressly.parser.AstValue.getValue(AstValue.java:144)
        at org.glassfish.expressly.parser.AstEmpty.getValue(AstEmpty.java:44)
        at org.glassfish.expressly.ValueExpressionImpl.getValue(ValueExpressionImpl.java:138)
        at org.jboss.weld.module.web.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
        at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73)
        ... 80 more
 Caused by: java.lang.NullPointerException
 |#]
  • To whom does it occur (all users, curators, superusers)?
    N/A

  • What did you expect to happen?
    N/A

Which version of Dataverse are you using?
6.3

@okaradeniz okaradeniz added the Type: Bug a defect label Sep 17, 2024
@qqmyers
Copy link
Member

qqmyers commented Sep 17, 2024

FWIW: At QDR I've added https://github.com/QualitativeDataRepository/dataverse/blob/5f7db5fc288e677d7dab57adc2abe48fb4dea164/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java#L5880-L5884 to avoid the stack trace, but I haven't discovered under what circumstances the workingversion is null. I do know that the problem also existed before croissant - with the getJsonLd lookup which calls the same method to see if the latestpublishedversion is being viewed.

@pdurbin
Copy link
Member

pdurbin commented Sep 17, 2024

Huh, so it may be pre-existing, unrelated to #10382 where we added that check for Croissant. 🤔

Given a NullPointerException from <c:when test="#{empty DatasetPage.croissant}"> (code) perhaps the isThisLatestReleasedVersion logic is faulty, especially since Jim had to add a null check. Here's the getCroissant code:

public String getCroissant() {
    if (isThisLatestReleasedVersion()) {
        final String CROISSANT_SCHEMA_NAME = "croissant";
        ExportService instance = ExportService.getInstance();
        String croissant = instance.getExportAsString(dataset, CROISSANT_SCHEMA_NAME);
        if (croissant != null && !croissant.isEmpty()) {
            logger.fine("Returning cached CROISSANT.");
            return croissant;
        } 
    }
    return null;
}

@okaradeniz if you can narrow down when this happens we'd appreciate it! Thanks for reporting this!

@okaradeniz
Copy link
Contributor Author

Thanks! We saw it several times in the logs, but we don't know how to reproduce it yet. I'll let you know once we know more about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug a defect
Projects
None yet
Development

No branches or pull requests

3 participants