posted 12 years ago
Hello all,
I have a table (BaseInfo) which has four fields called Id(primary key), Name, Age and Type. In this, "Type" field is Bigint datatype and it can hold 1 or 2 or null as value.
I have some another table (AdInfo) which refers the BaseInfo's Type field.
I inserted a record in BaseInfo table with the values (1, x, 28, (null)).
I can get the BaseInfo object by finding a record with the primary key "1" with the statement (em.find(BaseInfo.class, 1)).
And also i can print the values of that object except the "Type's value".
System.out.print(BaseInfoObj.getName()); --- Prints the value
System.out.print(BaseInfoObj.getAge()); ---- Prints the value
System.out.print(BaseInfoObj.getType()); ---- prints
javax.ejb.EJBException: java.lang.NullPointerException
ERROR [STDERR] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
Any idea regarding this?
Thank you!