{"record":{"id":"336e6589309ecdf0","repo":"hibernate/hibernate-orm","slug":"nullpointerexception-occurred-while-calling","errorCode":null,"errorMessage":"NullPointerException occurred while calling","messagePattern":"NullPointerException occurred while calling","errorType":"exception","errorClass":"PropertyAccessException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/property/access/spi/SetterMethodImpl.java","lineNumber":53,"sourceCode":"\t}\n\n\t@Override\n\tpublic void set(Object target, @Nullable Object value) {\n\t\ttry {\n\t\t\tsetterMethod.invoke( target, value );\n\t\t}\n\t\tcatch (NullPointerException npe) {\n\t\t\tif ( value == null && isPrimitive ) {\n\t\t\t\tthrow new PropertyAccessException(\n\t\t\t\t\t\tnpe,\n\t\t\t\t\t\t\"Null value was assigned to a property of primitive type\",\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tcontainerClass,\n\t\t\t\t\t\tpropertyName\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new PropertyAccessException(\n\t\t\t\t\t\tnpe,\n\t\t\t\t\t\t\"NullPointerException occurred while calling\",\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tcontainerClass,\n\t\t\t\t\t\tpropertyName\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tcatch (InvocationTargetException ite) {\n\t\t\tfinal var cause = ite.getCause();\n\t\t\tif ( cause instanceof Error error ) {\n\t\t\t\t// HHH-16403 Don't wrap Error\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tthrow new PropertyAccessException(\n\t\t\t\t\tcause,\n\t\t\t\t\t\"Exception occurred inside\",\n\t\t\t\t\ttrue,","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/property/access/spi/SetterMethodImpl.java#L35-L71","documentation":"Error \"NullPointerException occurred while calling\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate API is violated.","commonSituations":"Occurs when application code or configuration does not satisfy the documented contract of the API being called.","solutions":["Ensure the target object passed to the setter is non-null (initialize proxies/entities first).","Check for premature access on an uninitialized proxy."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}