Error getting IDP metadata when deploying to jetty

Hi Support team,

I used Cuba Studio to integrate Saml Add-on to my app and everything worked well.
Now I deploy my app to Jetty using UberJar. After Jetty started, I go to SAML connection screen and try to access to the IDP by using the same url that I accessed successfully in Cuba Studio.

After click on button “Refresh” I had the error message on the screen: “Metadata view is not available. Error in IDP metadata: null”.
I also see the error message at the console as following:

java.lang.NullPointerException: null
at com.haulmont.addon.saml.web.security.saml.SamlCommunicationServiceBean.getIdpMetadata(SamlCommunicationServiceBean.java:280) ~[classes/:na]
at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$2$1.run(SamlConnectionEdit.java:172) [classes/:na]
at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$2$1.run(SamlConnectionEdit.java:166) [classes/:na]
at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:205) [classes/:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_192]

Attached image is taken at the IDP section on the screen.
error
Could you have any helps to fix this error?

Thanks,
Hung Vu

I had the similar error with SP section. The error on the screen is “Metadata view is not available. Error in SP metadata: null” and the error at console is

java.lang.NullPointerException: null
at com.haulmont.addon.saml.web.security.saml.SamlCommunicationServiceBean.getSpMetadata(SamlCommunicationServiceBean.java:265) ~[classes/:na]
at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$1$1.run(SamlConnectionEdit.java:124) [classes/:na]
at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$1$1.run(SamlConnectionEdit.java:118) [classes/:na]
at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:205) [classes/:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_192]

Do I need to do something relate to Saml Add-on when deploying with UberJar?

Thanks,
Hung Vu

Hi @hungvu,

We are working on this problem, thank you for your report.
I will let you know when when we find the solution.

Regards,
Mikhail

Hi Mikhail,
Do you have any update on the fix? please let us know if we need to find an alternative solution for this.

Best,
Duc Chu.

Hi @chutrongduc,

You could try out new version of the addon, the problem should be gone. Don’t forget re-create keystore when you build new uberJar.
0.2.1 - for cuba 7 release
0.1.2 - for cuba 6 release

Regards,
Mikhail

Excellent! thank you for the fast response. We will try with the new version today.

Best,
Duc Chu

Hello,

I am using CUBA 7.0.8 with the Saml addon 0.2.2 and I also get the error message “Metadata view is not available. Error in SP metadata: null” when clicking on “Refresh” in the SAML connection editor.

2019-09-17 15:48:14.341 ERROR [BackgroundTask-0-admin/aKSM/admin] com.haulmont.addon.saml.web.security.saml.SamlCommunicationServiceBean - Failed to get SP metadata
java.lang.NullPointerException: null
	at com.haulmont.addon.saml.web.security.saml.SamlCommunicationServiceBean.getSpMetadata(SamlCommunicationServiceBean.java:265) ~[saml-addon-web-0.2.2.jar:na]
	at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$1$1.run(SamlConnectionEdit.java:124) [saml-addon-web-0.2.2.jar:na]
	at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$1$1.run(SamlConnectionEdit.java:118) [saml-addon-web-0.2.2.jar:na]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:205) [cuba-web-7.0.8.jar:7.0.8]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_201]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.lambda$startExecution$1(WebBackgroundWorker.java:376) [cuba-web-7.0.8.jar:7.0.8]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_201]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_201]
2019-09-17 15:48:14.344 ERROR [BackgroundTask-0-admin/aKSM/admin] com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit - Failed to load sp metadata
java.lang.RuntimeException: Error in SP metadata: null
	at com.haulmont.addon.saml.web.security.saml.SamlCommunicationServiceBean.getSpMetadata(SamlCommunicationServiceBean.java:268) ~[saml-addon-web-0.2.2.jar:na]
	at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$1$1.run(SamlConnectionEdit.java:124) [saml-addon-web-0.2.2.jar:na]
	at com.haulmont.addon.saml.web.samlconnection.SamlConnectionEdit$1$1.run(SamlConnectionEdit.java:118) [saml-addon-web-0.2.2.jar:na]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:205) [cuba-web-7.0.8.jar:7.0.8]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_201]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.lambda$startExecution$1(WebBackgroundWorker.java:376) [cuba-web-7.0.8.jar:7.0.8]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_201]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_201]

Interestingly, this error only occurs if I created the application via “buildWar” and deployed it to the target server. Within CUBA Studio I don’t get this error message.

Greetings
Andreas

Hello again,

the error only occurs when building a single WAR for middleware and web client.

Greetings
Andreas

Hi @Andreas.Brueck,

Thank you for your report, we will check the problem and provide fix if needed.

Regards,
Mikhail

Hi @Andreas.Brueck,

We fixed issue related to error during application startup.
Try out 0.2.3 version of addon for 7.0.x cuba platform

Regards,
Mikhail

A post was split to a new topic: Problem with UberJar