java.lang.NumberFormatException

Stack Overflow | Lynx | 4 months ago
  1. 0

    NumberFormatException

    GitHub | 3 years ago | leventov
    java.lang.NumberFormatException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    GitHub comment 447#190843781

    GitHub | 9 months ago | aleshkanet
    java.lang.Exception: §4Этого набора не существует или не определены настройки.
  4. 0

    Calling {code} roleRepository.findAll(Arrays.asList(1, 2)); {code} results in {code} Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: org.h2.jdbc.JdbcSQLException: Datenumwandlungsfehler beim Umwandeln von "(1, 2)" Data conversion error converting "(1, 2)"; SQL statement: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) [22018-192] Error Code: 22018 Call: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) bind => [1, 2] Query: ReadAllQuery(referenceClass=RoleEntity sql="SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN (?))") at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:684) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:560) at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2056) at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2740) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2693) at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:559) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1175) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904) at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1134) at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:460) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1222) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804) at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258) ... 59 more Caused by: org.h2.jdbc.JdbcSQLException: Datenumwandlungsfehler beim Umwandeln von "(1, 2)" Data conversion error converting "(1, 2)"; SQL statement: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) [22018-192] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:168) at org.h2.value.Value.convertTo(Value.java:1011) at org.h2.mvstore.db.MVSecondaryIndex.convertToKey(MVSecondaryIndex.java:322) at org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:258) at org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:254) at org.h2.index.BaseIndex.find(BaseIndex.java:128) at org.h2.index.IndexCursor.find(IndexCursor.java:169) at org.h2.table.TableFilter.next(TableFilter.java:466) at org.h2.command.dml.Select.queryFlat(Select.java:541) at org.h2.command.dml.Select.queryWithoutCache(Select.java:654) at org.h2.command.dml.Query.query(Query.java:341) at org.h2.command.dml.Query.query(Query.java:309) at org.h2.command.dml.Query.query(Query.java:36) at org.h2.command.CommandContainer.query(CommandContainer.java:110) at org.h2.command.Command.executeQuery(Command.java:201) at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:110) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1009) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644) ... 79 more Caused by: java.lang.NumberFormatException at java.math.BigDecimal.<init>(BigDecimal.java:494) at java.math.BigDecimal.<init>(BigDecimal.java:383) at java.math.BigDecimal.<init>(BigDecimal.java:806) at org.h2.value.Value.convertTo(Value.java:961) ... 95 more {code} The same exception is thrown if you try to declare the following repository method: {code} List<RoleEntity> findByIdIsIn(List<Integer> ids); {code} The problem is with Spring Data building the query. EclipseLink expects {{e.id IN ?}} but String Data does {{e.id IN ((?, ?))}}, which itself is incorrect as it should be {{e.id IN (?, ?)}} (only one pair of parenthesis). --------------- Current workaround is: {code} @Query("select r from RoleEntity r where r.id in :ids") List<RoleEntity> findByIds(@Param("ids") List<Integer> ids); {code}

    Spring JIRA | 4 months ago | Igor Mukhin
    org.h2.jdbc.JdbcSQLException: Datenumwandlungsfehler beim Umwandeln von "(1, 2)" Data conversion error converting "(1, 2)"; SQL statement: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) [22018-192] Error Code: 22018 Call: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) bind => [1, 2] Query: ReadAllQuery(referenceClass=RoleEntity sql="SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN (?))")

  1. marcbouvierdav 1 times, last 2 months ago
  2. Jaytee 7 times, last 6 months ago
16 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NumberFormatException

    No message provided

    at java.math.BigDecimal.<init>()
  2. Java RT
    BigDecimal.<init>
    1. java.math.BigDecimal.<init>(BigDecimal.java:494)
    2. java.math.BigDecimal.<init>(BigDecimal.java:383)
    3. java.math.BigDecimal.<init>(BigDecimal.java:806)
    3 frames
  3. Oracle jdbc
    OraclePreparedStatementWrapper.setObject
    1. oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:9153)
    2. oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8954)
    3. oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:9557)
    4. oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:6090)
    5. oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:249)
    5 frames
  4. Spring Framework
    SimpleJdbcCall.execute
    1. org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:364)
    2. org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:235)
    3. org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:150)
    4. org.springframework.jdbc.core.CallableStatementCreatorFactory$CallableStatementCreatorImpl.createCallableStatement(CallableStatementCreatorFactory.java:213)
    5. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1077)
    6. org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1135)
    7. org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:405)
    8. org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:365)
    9. org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:198)
    9 frames
  5. com.eisima.spring
    Main.main
    1. com.eisima.spring.Main.getUserByLogin(Main.java:39)
    2. com.eisima.spring.Main.main(Main.java:20)
    2 frames
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  7. IDEA
    AppMain.main
    1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
    1 frame