phoss-smp icon indicating copy to clipboard operation
phoss-smp copied to clipboard

NullPointerException with MongoDB backend when updating to 7.1.x

Open phax opened this issue 1 year ago • 3 comments

I was able to update Phoss SMP from lower versions to 7.0.5. The problem is now when we try to update to the next ones (7.1.0 or 7.1.2).

The deploy runs without errors, I can login on PhossSMP page, but then when selecting some menus, I start to receive “Internal Errors”:

[2024-04-30T17:33:10,548] [SMP-SERVER] [ERROR] [http-nio-80-exec-4] handleInternalError internal-error-560 -- com.helger.photon.core.interror.InternalErrorHandler.handleInternalError(InternalErrorHandler.java:584)
java.lang.NullPointerException: The value of 'DocumentTypeIdentifier' may not be null!
[2024-04-30T17:33:10,597] [SMP-SERVER] [WARN ] [http-nio-80-exec-4] Not sending internal error mail, because 'sender' is not set! -- com.helger.photon.core.interror.InternalErrorHandler._sendInternalErrorMailToVendor(InternalErrorHandler.java:190)
[2024-04-30T17:33:21,923] [SMP-SERVER] [ERROR] [http-nio-80-exec-6] handleInternalError internal-error-561 -- com.helger.photon.core.interror.InternalErrorHandler.handleInternalError(InternalErrorHandler.java:584)
java.lang.NullPointerException: The value of 'DocumentTypeIdentifier' may not be null!
        at com.helger.commons.ValueEnforcer.notNull(ValueEnforcer.java:276) ~[ph-commons-11.1.6.jar:11.1.6]
        at com.helger.phoss.smp.domain.serviceinfo.SMPServiceInformation.setDocumentTypeIdentifier(SMPServiceInformation.java:106) ~[phoss-smp-backend-7.1.2.jar:7.1.2]
        at com.helger.phoss.smp.domain.serviceinfo.SMPServiceInformation.<init>(SMPServiceInformation.java:77) ~[phoss-smp-backend-7.1.2.jar:7.1.2]
        at com.helger.phoss.smp.backend.mongodb.mgr.SMPServiceInformationManagerMongoDB.toServiceInformation(SMPServiceInformationManagerMongoDB.java:229) ~[phoss-smp-backend-mongodb-7.1.2.jar:7.1.2]
        at com.helger.phoss.smp.backend.mongodb.mgr.SMPServiceInformationManagerMongoDB.lambda$getAllSMPServiceInformationOfServiceGroup$6(SMPServiceInformationManagerMongoDB.java:452) ~[phoss-smp-backend-mongodb-7.1.2.jar:7.1.2]
        at com.mongodb.client.internal.MongoIterableImpl.forEach(MongoIterableImpl.java:118) ~[mongodb-driver-sync-5.0.1.jar:?]
        at com.helger.phoss.smp.backend.mongodb.mgr.SMPServiceInformationManagerMongoDB.getAllSMPServiceInformationOfServiceGroup(SMPServiceInformationManagerMongoDB.java:452) ~[phoss-smp-backend-mongodb-7.1.2.jar:7.1.2]
        at com.helger.phoss.smp.ui.secure.PageSecureTasksProblems.fillContent(PageSecureTasksProblems.java:460) ~[phoss-smp-webapp-7.1.2.jar:7.1.2]
        at com.helger.phoss.smp.ui.secure.PageSecureTasksProblems.fillContent(PageSecureTasksProblems.java:75) ~[phoss-smp-webapp-7.1.2.jar:7.1.2]
        at com.helger.photon.uicore.page.AbstractWebPage.getContent(AbstractWebPage.java:162) ~[ph-oton-uicore-9.2.3.jar:9.2.3]
        at com.helger.photon.bootstrap4.uictrls.ext.BootstrapPageRenderer.getPageContent(BootstrapPageRenderer.java:133) ~[ph-oton-bootstrap4-uictrls-9.2.3.jar:9.2.3]
        at com.helger.photon.bootstrap4.uictrls.ext.BootstrapPageRenderer.getPageContent(BootstrapPageRenderer.java:160) ~[ph-oton-bootstrap4-uictrls-9.2.3.jar:9.2.3]
        at com.helger.phoss.smp.ui.secure.SMPRendererSecure.getContent(SMPRendererSecure.java:227) ~[phoss-smp-webapp-7.1.2.jar:7.1.2]
        at com.helger.phoss.smp.ui.SMPLayoutHTMLProvider.fillBody(SMPLayoutHTMLProvider.java:70) [phoss-smp-webapp-7.1.2.jar:7.1.2]
        at com.helger.photon.core.html.AbstractSWECHTMLProvider.fillHeadAndBody(AbstractSWECHTMLProvider.java:106) [ph-oton-core-9.2.3.jar:9.2.3]
        at com.helger.photon.core.html.AbstractHTMLProvider.createHTML(AbstractHTMLProvider.java:164) [ph-oton-core-9.2.3.jar:9.2.3]
        at com.helger.photon.app.html.PhotonHTMLHelper.createHTMLResponse(PhotonHTMLHelper.java:117) [ph-oton-app-9.2.3.jar:9.2.3]
        at com.helger.photon.core.servlet.AbstractApplicationXServletHandler.handleRequest(AbstractApplicationXServletHandler.java:102) [ph-oton-core-9.2.3.jar:9.2.3]
        at com.helger.phoss.smp.servlet.SMPApplicationXServletHandler.handleRequest(SMPApplicationXServletHandler.java:81) [phoss-smp-webapp-7.1.2.jar:7.1.2]
        at com.helger.xservlet.handler.simple.XServletHandlerToSimpleHandler.onRequest(XServletHandlerToSimpleHandler.java:241) [ph-xservlet-10.1.8.jar:10.1.8]
        at com.helger.xservlet.AbstractXServlet._invokeHandler(AbstractXServlet.java:355) [ph-xservlet-10.1.8.jar:10.1.8]
        at com.helger.xservlet.AbstractXServlet.service(AbstractXServlet.java:540) [ph-xservlet-10.1.8.jar:10.1.8]
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) [servlet-api.jar:6.0]
        at com.helger.xservlet.AbstractXServlet.service(AbstractXServlet.java:596) [ph-xservlet-10.1.8.jar:10.1.8]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) [catalina.jar:10.1.18]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) [catalina.jar:10.1.18]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat-websocket.jar:10.1.18]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) [catalina.jar:10.1.18]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) [catalina.jar:10.1.18]
        at com.helger.web.servlets.scope.AbstractScopeAwareFilter.doHttpFilter(AbstractScopeAwareFilter.java:82) [ph-web-10.1.8.jar:10.1.8]
        at com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66) [ph-servlet-10.1.8.jar:10.1.8]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) [catalina.jar:10.1.18]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) [catalina.jar:10.1.18]
        at com.helger.xservlet.AbstractXFilter.doHttpFilter(AbstractXFilter.java:190) [ph-xservlet-10.1.8.jar:10.1.8]
        at com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66) [ph-servlet-10.1.8.jar:10.1.8]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) [catalina.jar:10.1.18]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) [catalina.jar:10.1.18]
        at com.helger.servlet.filter.CharacterEncodingFilter.doHttpFilter(CharacterEncodingFilter.java:184) [ph-servlet-10.1.8.jar:10.1.8]
        at com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66) [ph-servlet-10.1.8.jar:10.1.8]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) [catalina.jar:10.1.18]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) [catalina.jar:10.1.18]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) [catalina.jar:10.1.18]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) [catalina.jar:10.1.18]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) [catalina.jar:10.1.18]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) [catalina.jar:10.1.18]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) [catalina.jar:10.1.18]
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673) [catalina.jar:10.1.18]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:10.1.18]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) [catalina.jar:10.1.18]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) [tomcat-coyote.jar:10.1.18]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) [tomcat-coyote.jar:10.1.18]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) [tomcat-coyote.jar:10.1.18]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) [tomcat-coyote.jar:10.1.18]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) [tomcat-coyote.jar:10.1.18]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-util.jar:10.1.18]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-util.jar:10.1.18]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:10.1.18]
        at java.base/java.lang.Thread.run(Thread.java:829) [?:?]
[2024-04-30T17:33:21,930] [SMP-SERVER] [WARN ] [http-nio-80-exec-6] Not sending internal error mail, because 'sender' is not set! -- com.helger.photon.core.interror.InternalErrorHandler._sendInternalErrorMailToVendor(InternalErrorHandler.java:190)

phax avatar May 14 '24 19:05 phax

Is it possible, that you eventually changed the configuration when updating the version?

Or are you using non-standard document type identifiers inside of your SMP?

phax avatar May 16 '24 18:05 phax

Sorry for such a late reply here. I've lost track of this topic!

So, to deploy new versions I take note of the /WEB-INF/classes/application.properties file and then, after deploy a new version, I just shutdown tomcat, replace all configs with the old ones and start it up again. I'm almost sure that I did not change nothing during the deployment. Not sure how to answer you that second question, but I can see this default value on the config file "smp.identifiertype=peppol".

Thanks,

Tiago Martins

tiagojmmartins avatar Jun 03 '24 11:06 tiagojmmartins

Okay, with version 7.1.2 In introduced the identifier type peppol-lax (see #275). There was an additional fix for that in v7.1.3. So can you please update to the latest version (7.1.3 at the time of writing) and use this peppol-lax identifier type - that should solve your issue I assume.

phax avatar Jun 12 '24 06:06 phax

@tiagojmmartins can you please give me a short update, if changing to peppol-lax helped? Thanks

phax avatar Aug 12 '24 20:08 phax

I am getting this exact error after update från 7.1.* to 7.2.4

How can I determine what causes the error?

java.lang.NullPointerException: The value of 'DocumentTypeIdentifier' may not be null! 1.: com.helger.commons.ValueEnforcer.notNull(ValueEnforcer.java:276) 2.: com.helger.phoss.smp.domain.serviceinfo.SMPServiceInformation.setDocumentTypeIdentifier(SMPServiceInformation.java:115) 3.: com.helger.phoss.smp.domain.serviceinfo.SMPServiceInformation.<init>(SMPServiceInformation.java:79) 4.: com.helger.phoss.smp.backend.mongodb.mgr.SMPServiceInformationManagerMongoDB.toServiceInformation(SMPServiceInformationManagerMongoDB.java:224) 5.: com.helger.phoss.smp.backend.mongodb.mgr.SMPServiceInformationManagerMongoDB.lambda$forEachSMPServiceInformation$5(SMPServiceInformationManagerMongoDB.java:436) 6.: com.mongodb.client.internal.MongoIterableImpl.forEach(MongoIterableImpl.java:144) 7.: com.helger.phoss.smp.backend.mongodb.mgr.SMPServiceInformationManagerMongoDB.forEachSMPServiceInformation(SMPServiceInformationManagerMongoDB.java:436) 8.: com.helger.phoss.smp.ui.secure.PageSecureEndpointChangeURL.fillContent(PageSecureEndpointChangeURL.java:239) 9.: com.helger.phoss.smp.ui.secure.PageSecureEndpointChangeURL.fillContent(PageSecureEndpointChangeURL.java:86) 10.: com.helger.photon.uicore.page.AbstractWebPage.getContent(AbstractWebPage.java:162) 11.: com.helger.photon.bootstrap4.uictrls.ext.BootstrapPageRenderer.getPageContent(BootstrapPageRenderer.java:133) 12.: com.helger.photon.bootstrap4.uictrls.ext.BootstrapPageRenderer.getPageContent(BootstrapPageRenderer.java:160) 13.: com.helger.phoss.smp.ui.secure.SMPRendererSecure.getContent(SMPRendererSecure.java:227) 14.: com.helger.phoss.smp.ui.SMPLayoutHTMLProvider.fillBody(SMPLayoutHTMLProvider.java:70) 15.: com.helger.photon.core.html.AbstractSWECHTMLProvider.fillHeadAndBody(AbstractSWECHTMLProvider.java:106) 16.: com.helger.photon.core.html.AbstractHTMLProvider.createHTML(AbstractHTMLProvider.java:166) 17.: com.helger.photon.app.html.PhotonHTMLHelper.createHTMLResponse(PhotonHTMLHelper.java:160) 18.: com.helger.photon.core.servlet.AbstractApplicationXServletHandler.handleRequest(AbstractApplicationXServletHandler.java:102) 19.: com.helger.phoss.smp.servlet.SMPApplicationXServletHandler.handleRequest(SMPApplicationXServletHandler.java:91) 20.: com.helger.xservlet.handler.simple.XServletHandlerToSimpleHandler.onRequest(XServletHandlerToSimpleHandler.java:241) 21.: com.helger.xservlet.AbstractXServlet._invokeHandler(AbstractXServlet.java:355) 22.: com.helger.xservlet.AbstractXServlet.service(AbstractXServlet.java:540) 23.: jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) 24.: com.helger.xservlet.AbstractXServlet.service(AbstractXServlet.java:596) 25.: org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) 26.: org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) 27.: org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) 28.: org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) 29.: org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) 30.: com.helger.web.servlets.scope.AbstractScopeAwareFilter.doHttpFilter(AbstractScopeAwareFilter.java:82) 31.: com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66) 32.: org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) 33.: org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) 34.: com.helger.xservlet.AbstractXFilter.doHttpFilter(AbstractXFilter.java:190) 35.: com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66) 36.: org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) 37.: org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) 38.: com.helger.servlet.filter.CharacterEncodingFilter.doHttpFilter(CharacterEncodingFilter.java:184) 39.: com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66) 40.: org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) 41.: org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) 42.: org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) 43.: org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) 44.: org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) 45.: org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:116) 46.: org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) 47.: org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) 48.: org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) 49.: org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:398) 50.: org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) 51.: org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) 52.: org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1740) 53.: org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) 54.: org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1189) 55.: org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:658) 56.: org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) 57.: java.base/java.lang.Thread.run(Thread.java:840)

jjtilly avatar Apr 28 '25 11:04 jjtilly

When changing to peppol-lax it did not produce internal error. Now it just starts working for almost a minute and then fails

Image

Same as before the update. Was hoping that the improvements to listing endoints would fix our issue.

We have 54.500 endpoints,

jjtilly avatar Apr 28 '25 12:04 jjtilly

@jjtilly Sorry, that improvement was basically only for the SQL version. Please create a new issue for that - thanks

Edit: Just did it: #333

phax avatar Apr 28 '25 16:04 phax