You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log snippet: Caused by: java.lang.NullPointerException at io.jans.orm.model.base.CustomObjectAttribute.getDisplayValue(CustomObjectAttribute.java:92) at jdk.internal.reflect.GeneratedMethodAccessor1136.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689) at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
Log snippet: Caused by: java.lang.NullPointerException at io.jans.orm.model.base.LocalizedString.getLanguageTags(LocalizedString.java:77) at io.jans.orm.ldap.impl.LdapEntryManager.getAttributeDataListFromLocalizedString(LdapEntryManager.java:641) at io.jans.orm.ldap.impl.LdapEntryManager.addAttributeDataFromLocalizedString(LdapEntryManager.java:995) at io.jans.orm.impl.BaseEntryManager.getAttributesListForPersist(BaseEntryManager.java:1574) at io.jans.orm.impl.BaseEntryManager.persist(BaseEntryManager.java:107) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Screenshot:
The text was updated successfully, but these errors were encountered:
pujavs
changed the title
fix(jans): added null check to avoid NullPointerException
fix(jans): add null check to avoid NullPointerException
Nov 24, 2022
Describe the bug
Getting NullPointerException is two cases
1) CustomObjectAttribute:
URL: GET https://jenkins-build.jans.io/jans-config-api/mgt/configuser?limit=3
Logs:
config-api-CustomObjectAttribute-6028.log
Log snippet:
Caused by: java.lang.NullPointerException at io.jans.orm.model.base.CustomObjectAttribute.getDisplayValue(CustomObjectAttribute.java:92) at jdk.internal.reflect.GeneratedMethodAccessor1136.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689) at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
Screenshot:
2) LocalizedString
URL: POST http://localhost:8080/jans-config-api/api/v1/openid/clients
JSON:
{ "dn": null, "expirationDate": null, "deletable": true, "clientSecret": "password", "frontChannelLogoutUri": null, "frontChannelLogoutSessionRequired": true, "registrationAccessToken": null, "clientIdIssuedAt": null, "clientSecretExpiresAt": null, "redirectUris": ["https://myserver.com"], "claimRedirectUris": [], "responseTypes": [], "grantTypes": [], "applicationType": "native", "contacts": [], "idTokenTokenBindingCnf": null, "clientName": "clientName-test1", "logoUri": null, "clientUri": null, "policyUri": null, "tosUri": null, "clientNameLocalized": { "values": null, "value": null, "languageTags": [] }, "logoUriLocalized": { "values": null, "value": "https://myserver.com/logoUriLocalized", "languageTags": [] }, "clientUriLocalized": { "values": null, "value": "https://myserver.com/clientUriLocalized", "languageTags": [] }, "policyUriLocalized": { "values": null, "value": "https://myserver.com/policyUriLocalized", "languageTags": [] }, "tosUriLocalized": { "values": null, "value": "https://myserver.com/tosUriLocalized", "languageTags": [] }, "jwksUri": null, "jwks": null, "sectorIdentifierUri": null, "subjectType": "public", "idTokenSignedResponseAlg": null, "idTokenEncryptedResponseAlg": null, "idTokenEncryptedResponseEnc": null, "userInfoSignedResponseAlg": null, "userInfoEncryptedResponseAlg": null, "userInfoEncryptedResponseEnc": null, "requestObjectSigningAlg": null, "requestObjectEncryptionAlg": null, "requestObjectEncryptionEnc": null, "tokenEndpointAuthMethod": null, "tokenEndpointAuthSigningAlg": null, "defaultMaxAge": null, "defaultAcrValues": [], "initiateLoginUri": null, "postLogoutRedirectUris": [], "requestUris": [], "scopes": [], "claims": [], "trustedClient": true, "lastAccessTime": null, "lastLogonTime": null, "persistClientAuthorizations": true, "includeClaimsInIdToken": true, "refreshTokenLifetime": null, "accessTokenLifetime": null, "customAttributes": [{ "name": "displayName", "multiValued": false, "values": ["Jans Role Based Client"], "value": "Jans Role Based Client", "displayValue": "Jans Role Based Client" }], "customObjectClasses": [], "rptAsJwt": true, "accessTokenAsJwt": true, "accessTokenSigningAlg": null, "disabled": true, "authorizedOrigins": [], "softwareId": null, "softwareVersion": null, "softwareStatement": null, "attributes": { "tlsClientAuthSubjectDn": null, "runIntrospectionScriptBeforeJwtCreation": false, "keepClientAuthorizationAfterExpiration": true, "allowSpontaneousScopes": true, "spontaneousScopes": [], "spontaneousScopeScriptDns": [], "updateTokenScriptDns": [], "backchannelLogoutUri": [], "backchannelLogoutSessionRequired": true, "additionalAudience": [], "postAuthnScripts": [], "consentGatheringScripts": [], "introspectionScripts": [], "rptClaimsScripts": [], "ropcScripts": [], "parLifetime": null, "requirePar": false, "jansAuthSignedRespAlg": null, "jansAuthEncRespAlg": null, "jansAuthEncRespEnc": null, "jansSubAttr": null, "redirectUrisRegex": null, "jansAuthorizedAcr": [], "jansDefaultPromptLogin": true, "idTokenLifetime": null }, "backchannelTokenDeliveryMode": "poll", "backchannelClientNotificationEndpoint": null, "backchannelAuthenticationRequestSigningAlg": "PS384", "backchannelUserCodeParameter": true, "description": null, "organization": null, "groups": [], "ttl": null, "displayName": null, "tokenBindingSupported": false, "authenticationMethod": "client_secret_jwt", "baseDn": null, "inum": null }
Logs:
config-api-LocalizedString-2022_11_24.jetty.log
Log snippet:
Caused by: java.lang.NullPointerException at io.jans.orm.model.base.LocalizedString.getLanguageTags(LocalizedString.java:77) at io.jans.orm.ldap.impl.LdapEntryManager.getAttributeDataListFromLocalizedString(LdapEntryManager.java:641) at io.jans.orm.ldap.impl.LdapEntryManager.addAttributeDataFromLocalizedString(LdapEntryManager.java:995) at io.jans.orm.impl.BaseEntryManager.getAttributesListForPersist(BaseEntryManager.java:1574) at io.jans.orm.impl.BaseEntryManager.persist(BaseEntryManager.java:107) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Screenshot:
The text was updated successfully, but these errors were encountered: