java.lang.NullPointerException

Hibernate JIRA | Patrick Twohig | 8 months ago
  1. 0

    {code} java.lang.NullPointerException at org.hibernate.engine.query.spi.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:125) at org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createNativeQuery(OgmSessionImpl.java:143) at org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createSQLQuery(OgmSessionImpl.java:127) at org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createSQLQuery(OgmSessionImpl.java:65) at org.hibernate.ogm.jpa.impl.OgmEntityManager.createNativeQuery(OgmEntityManager.java:497) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:344) at com.sun.proxy.$Proxy58.createNativeQuery(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:294) at com.sun.proxy.$Proxy58.createNativeQuery(Unknown Source) {code} The entirety of my code attempting to execute the query/statement. {code} @Override public void cullSecondMeasurementsBefore(Date date) { final String cql = "DELETE FROM second_measurement WHERE occurred_at < %(cutoff)"; final Query query = entityManager.createNativeQuery(cql); query.setParameter("cutoff", date); query.executeUpdate(); } {code} Snippet from my Spring configuration: {code} @Bean(name = Names.CASSANDRA_TRANSACTION_MANAGER) public JpaTransactionManager cassandraTransactionManager() { final JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(cassandraEntityManager().getObject()); transactionManager.setJpaDialect(new HibernateJpaDialect()); transactionManager.setPersistenceUnitName(Names.CASSANDRA_PERSISTENCE_UNIT_NAME); return transactionManager; } @Bean(name = Names.CASSANDRA_ENTITY_MANAGER) public LocalContainerEntityManagerFactoryBean cassandraEntityManager() { final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); entityManagerFactoryBean.setPersistenceUnitName(Names.CASSANDRA_PERSISTENCE_UNIT_NAME); entityManagerFactoryBean.setPackagesToScan(ENTITYMANAGER_PACKAGES_TO_SCAN_OGM); entityManagerFactoryBean.setPersistenceProviderClass(HibernateOgmPersistence.class); final Properties jpaProperties = new Properties(); jpaProperties.put(OgmProperties.DATABASE, environment.getRequiredProperty(OgmProperties.DATABASE)); jpaProperties.put(OgmProperties.HOST, environment.getRequiredProperty(OgmProperties.HOST)); jpaProperties.put(OgmProperties.DATASTORE_PROVIDER, CassandraDatastoreProvider.class); jpaProperties.put(OgmProperties.CREATE_DATABASE, true); entityManagerFactoryBean.setJpaProperties(jpaProperties); return entityManagerFactoryBean; } {code}

    Hibernate JIRA | 8 months ago | Patrick Twohig
    java.lang.NullPointerException
  2. 0

    {code} java.lang.NullPointerException at org.hibernate.engine.query.spi.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:125) at org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createNativeQuery(OgmSessionImpl.java:143) at org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createSQLQuery(OgmSessionImpl.java:127) at org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createSQLQuery(OgmSessionImpl.java:65) at org.hibernate.ogm.jpa.impl.OgmEntityManager.createNativeQuery(OgmEntityManager.java:497) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:344) at com.sun.proxy.$Proxy58.createNativeQuery(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:294) at com.sun.proxy.$Proxy58.createNativeQuery(Unknown Source) {code} The entirety of my code attempting to execute the query/statement. {code} @Override public void cullSecondMeasurementsBefore(Date date) { final String cql = "DELETE FROM second_measurement WHERE occurred_at < %(cutoff)"; final Query query = entityManager.createNativeQuery(cql); query.setParameter("cutoff", date); query.executeUpdate(); } {code} Snippet from my Spring configuration: {code} @Bean(name = Names.CASSANDRA_TRANSACTION_MANAGER) public JpaTransactionManager cassandraTransactionManager() { final JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(cassandraEntityManager().getObject()); transactionManager.setJpaDialect(new HibernateJpaDialect()); transactionManager.setPersistenceUnitName(Names.CASSANDRA_PERSISTENCE_UNIT_NAME); return transactionManager; } @Bean(name = Names.CASSANDRA_ENTITY_MANAGER) public LocalContainerEntityManagerFactoryBean cassandraEntityManager() { final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); entityManagerFactoryBean.setPersistenceUnitName(Names.CASSANDRA_PERSISTENCE_UNIT_NAME); entityManagerFactoryBean.setPackagesToScan(ENTITYMANAGER_PACKAGES_TO_SCAN_OGM); entityManagerFactoryBean.setPersistenceProviderClass(HibernateOgmPersistence.class); final Properties jpaProperties = new Properties(); jpaProperties.put(OgmProperties.DATABASE, environment.getRequiredProperty(OgmProperties.DATABASE)); jpaProperties.put(OgmProperties.HOST, environment.getRequiredProperty(OgmProperties.HOST)); jpaProperties.put(OgmProperties.DATASTORE_PROVIDER, CassandraDatastoreProvider.class); jpaProperties.put(OgmProperties.CREATE_DATABASE, true); entityManagerFactoryBean.setJpaProperties(jpaProperties); return entityManagerFactoryBean; } {code}

    Hibernate JIRA | 8 months ago | Patrick Twohig
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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.NullPointerException

      No message provided

      at org.hibernate.engine.query.spi.QueryPlanCache.getSQLParameterMetadata()
    2. Hibernate
      QueryPlanCache.getSQLParameterMetadata
      1. org.hibernate.engine.query.spi.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:125)
      1 frame
    3. Hibernate Object Grid Mapper
      OgmEntityManager.createNativeQuery
      1. org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createNativeQuery(OgmSessionImpl.java:143)
      2. org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createSQLQuery(OgmSessionImpl.java:127)
      3. org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.createSQLQuery(OgmSessionImpl.java:65)
      4. org.hibernate.ogm.jpa.impl.OgmEntityManager.createNativeQuery(OgmEntityManager.java:497)
      4 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    5. Spring ORM
      ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke
      1. org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:344)
      1 frame
    6. com.sun.proxy
      $Proxy58.createNativeQuery
      1. com.sun.proxy.$Proxy58.createNativeQuery(Unknown Source)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    8. Spring ORM
      SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke
      1. org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:294)
      1 frame
    9. com.sun.proxy
      $Proxy58.createNativeQuery
      1. com.sun.proxy.$Proxy58.createNativeQuery(Unknown Source)
      1 frame