Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: value null at org.simpleflatmapper.ow2asm.SymbolTable.addConstant(SymbolTable.java:515) #753

Open
cdxf opened this issue Jan 25, 2021 · 3 comments

Comments

@cdxf
Copy link

cdxf commented Jan 25, 2021

I'm using SFM v8.2.3 with Spring JDBC and Java 15 (hasn't tested with other JDK), for the first query I get this error message (even though everything works fine include the first query)
image
Am I missing something?

@ltkn
Copy link

ltkn commented Jan 31, 2021

No issues here, Spring boot 2.4.x, jdbcTemplate etc..

Not sure what your problem is though, but might not be related to JDK.

My jdk version (using debian):

openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment Zulu15.29+15-CA (build 15.0.2+7)
OpenJDK 64-Bit Server VM Zulu15.29+15-CA (build 15.0.2+7, mixed mode, sharing)

@cdxf
Copy link
Author

cdxf commented Feb 7, 2021

@ltkn
The error is at this line:

    private final RowMapper<Post> mapper =
            JdbcTemplateMapperFactory.newInstance()
                    .newRowMapper(Post.class);

If I set useAsm to false, it works without any errors

    private final RowMapper<Post> mapper =
            JdbcTemplateMapperFactory.newInstance()
                    .useAsm(false)
                    .newRowMapper(Post.class);


I use Zulu 15 too but this error also happens with other jvm (java 15)
image

@ltkn
Copy link

ltkn commented Feb 7, 2021

No idea unfortunately, but it could help to see your entity class, the query and any nested object ;)
Do you have some nested objects in Post entity? with "nestedId" present in Post class, and nested table named "nested" with "id" as primary key? sometimes I find this type of mapping ambiguous.

Also not sure if useAsm is failing with jdk15 because its an old ASM library version https://github.com/arnaudroger/SimpleFlatMapper/tree/master/ow2.asm and if upgrading it is just a matter of changing the version of if it'd come with breaking changes.

I don't think it's related but I'm using ResulsetExtractor instead of RowMapper

@Slf4j
@AllArgsConstructor
@Repository
public class RoleRepository {

    private final ResultSetExtractor<List<Role>> roleEntityRse =
            JdbcTemplateMapperFactory
                    .newInstance()
                    .ignorePropertyNotFound()
                    .unorderedJoin()
                    .addKeys("role_id")
                    .newResultSetExtractor(Role.class);

    private final JdbcTemplate jdbcTemplate;


    @Transactional(readOnly = true)
    public Role findByCode(final String code) {

        final String sql = """
                SELECT * from public.role where code= ?
                """;

        return DataAccessUtils.singleResult(jdbcTemplate.query(sql, roleEntityRse, code));
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants