You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User user = new User();
user.setUserId(1);
user.setUserName("John");
entityManager().persist(user);
4. and the phenomenon is like this: I can connect to zookeeper server and HMaster, and create a table in hbase, but I can not persist any entity.
5. the exception log like this:
java.lang.IllegalArgumentException: Can not set int field com.zju.edu.entity.User.userId to com.zju.edu.entity.User
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[na:1.8.0_65]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[na:1.8.0_65]
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58) ~[na:1.8.0_65]
at sun.reflect.UnsafeIntegerFieldAccessorImpl.getInt(UnsafeIntegerFieldAccessorImpl.java:56) ~[na:1.8.0_65]
at sun.reflect.UnsafeIntegerFieldAccessorImpl.get(UnsafeIntegerFieldAccessorImpl.java:36) ~[na:1.8.0_65]
at java.lang.reflect.Field.get(Field.java:393) ~[na:1.8.0_65]
at com.impetus.kundera.property.PropertyAccessorHelper.getObject(PropertyAccessorHelper.java:140) ~[kundera-core-3.13.jar:na]
at com.impetus.kundera.property.PropertyAccessorHelper.getId(PropertyAccessorHelper.java:245) ~[kundera-core-3.13.jar:na]
at com.impetus.kundera.graph.GraphGenerator.onPreChecks(GraphGenerator.java:223) ~[kundera-core-3.13.jar:na]
at com.impetus.kundera.graph.GraphGenerator.generate(GraphGenerator.java:127) ~[kundera-core-3.13.jar:na]
at com.impetus.kundera.graph.GraphGenerator.generateGraph(GraphGenerator.java:78) ~[kundera-core-3.13.jar:na]
at com.impetus.kundera.persistence.PersistenceDelegator.persist(PersistenceDelegator.java:130) ~[kundera-core-3.13.jar:na]
at com.impetus.kundera.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:174) ~[kundera-core-3.13.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350) ~[spring-orm-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at com.sun.proxy.$Proxy88.persist(Unknown Source) ~[na:na]
6. something else that can be helpful
I found the error always appear about the field which is annotated by @id, I hope it can be helpful.
The text was updated successfully, but these errors were encountered:
@devender-yadav yes, it works with the examples. But, I want to use it in spring framework. And I follow the tutorial about integration with spring step by step, so the exception appears.
And the Kundera version is the latest version 3.13, and I use spring boot 2.0, the related configuration like this:
@Configuration
public class KunderaConfig {
@Bean
public LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean() {
LocalContainerEntityManagerFactoryBean entityMF = new LocalContainerEntityManagerFactoryBean();
entityMF.setPersistenceUnitName("hbase_pu");
entityMF.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver());
return entityMF;
}
@Bean
public PersistenceAnnotationBeanPostProcessor persistenceAnnotationBeanPostProcessor() {
return new PersistenceAnnotationBeanPostProcessor();
}
@Bean
public DefaultPersistenceUnitManager defaultPersistenceUnitManager() {
DefaultPersistenceUnitManager persistenceUM = new DefaultPersistenceUnitManager();
persistenceUM.setPersistenceXmlLocation("classpath*:META-INF/persistence-temp.xml");
return persistenceUM;
}
}
and the client code is like this:
@Resource
@PersistenceContext(unitName = "hbase_pu", type = PersistenceContextType.EXTENDED)
public EntityManager em;
public void persist(){
User user = new User();
user.setUserId(1);
user.setUserName("John");
em.persist(user);
em.close();
}
by the way, my hbase server is running in standalone mode.
hello, when I use it in hbase, some exception has appeared as title issued.
1. First, my entity class like this:
2. and my persistence like this:
3. my persist code is like this:
4. and the phenomenon is like this: I can connect to zookeeper server and HMaster, and create a table in hbase, but I can not persist any entity.
5. the exception log like this:
6. something else that can be helpful
I found the error always appear about the field which is annotated by @id, I hope it can be helpful.
The text was updated successfully, but these errors were encountered: