{"record":{"id":"43fe73f1fcf9c091","repo":"theonedev/onedev","slug":"error-accessing-member-fieldname-of-class-cla","errorCode":null,"errorMessage":"Error accessing member: {fieldName} of class: {className}","messagePattern":"Error accessing member: (.+?) of class: (.+?)","errorType":"exception","errorClass":"org.apache.wicket.WicketRuntimeException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/org/apache/wicket/guice/GuiceProxyTargetLocator.java","lineNumber":99,"sourceCode":"\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn injector.getInstance(key);\n\t}\n\n\tprivate Key<?> newGuiceKey()\n\t{\n\t\tfinal Type type;\n\t\ttry\n\t\t{\n\t\t\tClass<?> clazz = WicketObjects.resolveClass(className);\n\t\t\tfinal Field field = clazz.getDeclaredField(fieldName);\n\t\t\ttype = field.getGenericType();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new WicketRuntimeException(\"Error accessing member: \" + fieldName +\n\t\t\t\t\" of class: \" + className, e);\n\t\t}\n\n\t\t// using TypeLiteral to retrieve the key gives us automatic support for\n\t\t// Providers and other injectable TypeLiterals\n\t\tif (bindingAnnotation == null)\n\t\t{\n\t\t\treturn Key.get(TypeLiteral.get(type));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Key.get(TypeLiteral.get(type), bindingAnnotation);\n\t\t}\n\t}\n\n\tpublic boolean isSingletonScope()\n\t{\n\t\tif (isSingletonCache == null)","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/guice/GuiceProxyTargetLocator.java#L81-L117","documentation":"GuiceProxyTargetLocator.newGuiceKey() rebuilds the Guice Key for a proxied injected member from serialized class/field names; if resolving the class or its declared field fails, it wraps the exception in a WicketRuntimeException. This typically means the serialized injection point no longer matches the deployed classes.","triggerScenarios":"Deserializing a page/ компонent whose proxy target references a field renamed or removed from its class; WicketObjects.resolveClass(className) throwing ClassNotFoundException; getDeclaredField(fieldName) throwing NoSuchFieldException after refactoring.","commonSituations":"Deploying new jar versions while old serialized pages exist in the session/page store; renaming an @Inject-ed field without invalidating sessions; class moved to another package across versions.","solutions":["Invalidate sessions/page stores after redeploying changed classes (secondary exception to keep clean)","Restore the field/class names matching the serialized page, or keep a serialVersionUID-compatible migration path","Check the cause chain: ClassNotFoundException vs NoSuchFieldException tells you which side mismatched","Restart server and clear the page store / disk-based page manager data directory"],"exampleFix":"// before\n@Inject private UserService userService; // renamed in new deploy, old session still references old field\n// after\n// keep field name stable across deploys, or bump serialVersionUID and clear the page store on upgrade","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    deserializePage(session, pageId);\n} catch (WicketRuntimeException e) {\n    if (e.getCause() instanceof ClassNotFoundException || e.getCause() instanceof NoSuchFieldException) {\n        session.invalidate(); // force fresh pages after refactor/redeploy\n    }\n}","preventionTips":["Invalidate sessions/page stores after deploying changed classes","Keep @Inject-ed field names stable across versions","Clear the disk page store directory on upgrades"],"tags":["wicket","guice","deserialization"],"backgroundTag":"class-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}