Hi, I am trying to setup a CAS (6.5.0-SNAPSHOT) server with PAC4j and Okta. 
When I try to start the server (boorRun / war in a tomcat webapp) I get the 
following error

[[33m2022-01-28 17:59:41,315 WARN 
[org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext]
 
- <Exception encountered during context initialization - cancelling refresh 
attempt: org.springframework.beans.factory.BeanCreationException: *Error 
creating bean with name 'casServletWebServerFactory'* defined in class path 
resource 
[org/apereo/cas/config/CasEmbeddedContainerTomcatConfiguration.class]: Bean 
instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory]:
 
Factory method 'casServletWebServerFactory' threw exception; *nested 
exception is java.lang.NullPointerException*>^[[m

Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'casServletWebServerFactory' defined in class path 
resource 
[org/apereo/cas/config/CasEmbeddedContainerTomcatConfiguration.class]: Bean 
instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory]:
 
Factory method 'casServletWebServerFactory' threw exception; nested 
exception is java.lang.NullPointerException

I have no idea why this is happening, any help would be awesome as I am 
stuck,

My implementation
1) I downloaded the Cas Overlay
2) I add this implementation to my build.gradle file

implementation "org.apereo.cas:cas-server-support-json-service-registry"
implementation "org.apereo.cas:cas-server-support-pac4j-webflow"

3) Added the following properties to cas.properties

cas.authn.pac4j.saml[0].keystorePassword=<password>
cas.authn.pac4j.saml[0].privateKeyPassword=<password>
cas.authn.pac4j.saml[0].serviceProviderEntityId=https://localhost:8443
cas.authn.pac4j.saml[0].keystorePath=<path to samlKeystore.jks>
cas.authn.pac4j.saml[0].serviceProviderMetadataPath=<path to 
cas_metadata.xml>
cas.authn.pac4j.saml[0].identityProviderMetadataPath=<path to 
okta-metadata.xml>
cas.authn.pac4j.saml[0].clientName=<client name>
cas.authn.pac4j.saml[0].destinationBinding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST

4) this is my json configuration file

{

  "@class" : *"org.apereo.cas.services.RegexRegisteredService"*,

  "serviceId" : *"^(https?|imaps?|http?)://.*"*,

  "name" : *"<application_name>"*,

  "id" : 1,

  "evaluationOrder" : 1,

  "logo" : *"logo url"*,

  "accessStrategy" : {

    "@class" : 
*"org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy"*,

    "delegatedAuthenticationPolicy" : {

      "@class" : 
*"org.apereo.cas.services.DefaultRegisteredServiceDelegatedAuthenticationPolicy"*
,

      "allowedProviders" : [ *"java.util.ArrayList"*, [ *"app-saml"* ] ]

    }

  }

}


-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/4bbd50be-54b7-49dd-8922-69293a2ceb26n%40apereo.org.

Reply via email to