Your using constants in the default value, have you tried replacing those with 
literals? I believe, as a compile time annotation, the constants aren't 
initialized.

- Jason

On Thu, May 17, 2018, at 1:43 PM, Daniel Klco wrote:
> Team,
> 
> I've been trying to figure this out and can't seem to crack it so I was
> hoping someone might have some insight.
> 
> I'm trying to update Sling Auth Forms to OSGi R6 as per:
> https://issues.apache.org/jira/browse/SLING-7671
> 
> I've got everything converted over and it works if I specify a
> configuration. However, with the Apache Felix SCR annotations this service
> registered immediately with a configuration with the default values, so
> there's clearly some difference I'm missing. I've tried changing everything
> I can think of to get the default values from the configuration to be
> registered when the component is starts, but every time I get something
> like this:
> 
> 17.05.2018 10:22:47.084 *INFO* [Background Update
> org.apache.sling.auth.form (84)] org.apache.sling.auth.form Service
> [org.apache.sling.auth.form.FormAuthenticationHandler,1169,
> [org.apache.sling.auth.core.spi.AuthenticationHandler]] ServiceEvent
> REGISTERED
> 17.05.2018 10:22:47.085 *DEBUG* [Background Update
> org.apache.sling.auth.form (84)]
> org.apache.sling.auth.form.impl.FormAuthenticationHandler Activating with
> configuration
> org.apache.sling.auth.form.impl.FormAuthenticationHandlerConfig :
> {jaas_realmName=null, form_onexpire_login=false, jaas_ranking=0,
> jaas_controlFlag=null, form_auth_storage=null, useInclude=false,
> annotationType=null, form_credentials_name=null, form_token_file=null,
> service_ranking=0, path=[Ljava.lang.String;@5b1b6745, form_login_form=null,
> form_token_fastseed=false, hashCode=0, equals=false, toString=null,
> form_auth_name=null, form_auth_timeout=0, form_default_cookie_domain=null}
> and properties {}
> 17.05.2018 10:22:47.085 *ERROR* [Background Update
> org.apache.sling.auth.form (84)] org.apache.sling.auth.form bundle
> org.apache.sling.auth.form:1.0.9.SNAPSHOT
> (84)[org.apache.sling.auth.form.FormAuthenticationHandler(316)] : The
> activate method has thrown an exception (java.lang.NullPointerException)
> 
> It seems like this should work based on other examples I've seen online,
> specifically:
> 
> https://github.com/nateyolles/aem-osgi-annotation-demo
> 
> So far I have tried:
> 
>    - Specifying the configuration pid
>    - Trying annotation defaultvalue vs method default
>    - Changing the start level of the bundle
>    - Changing to a single activate parameter
>    - Trying required / optional configuration binding
> 
> The only thing that did work was specifying a configuration node in the
> bundle content configuration, but this seems hacky.
> 
> I've checked the code in to Auth Form:
> https://github.com/apache/sling-org-apache-sling-auth-form
> 
> If anyone could take a few minutes to review or has any thoughts / ideas /
> suggestions I'd really appreciate it as I'm at a roadblock.
> 
> Thanks,
> Dan

Reply via email to