Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

ClassNotFoundException Caused by Missing Separator between Package and Class #524

@library233

Description

@library233

Description

It is trying to get a fully qualified class name, using the package (PKG) joined by (+) the simple class name (clazz.getSimpleName()) as below.

String classInternalName = PKG + clazz.getSimpleName() + CLASS_LABEL + counter.getAndIncrement();

However, there is no separator, i.e. slash (/) between the package and the class.

Furthermore, there is also no trailing slash (/) for the package which is defined as below.

private static final String PKG = "org/springextensions/gef/serialization";

Eventually, the result like org/springextensions/gef/serializationCommandResponseInstantiator$Synthetic2, is incorrect.

Note there is supposed to be a slash (/) between serialization and Command actually.

Expected result would be like org/springextensions/gef/serialization/CommandResponseInstantiator$Synthetic2 instead.

Next, it will replace all of the slashes (/) by dots (.) and then try to load the class by the string, which leads to ClassNotFoundException further.

Example error message

The message below was generated by a simple project powered by spring-boot-starter-web, spring-data-geode and geode-core which does nothing other than just starting up.

InstantiatorRecoveryTask - Error ClassNotFoundException: org.springextensions.gef.serializationCommandResponseInstantiator$Synthetic2

Test case

Currently the test case is just simply checking for the symbol of inner class ($) as below, with no further validation.

@Test
public void testGeneratedClassName() throws Exception {
Instantiator instantiator = asmFactory.getInstantiator(SomeClass.class, 100);
assertTrue(instantiator.getClass().getName().contains("$"));
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions