• Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction Rolledback LocalException while accessing CMP from session in jboss

 
Sam Tom
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hava an CMP entity bean and a stateless session bean. I am accessing CMP entity bean from session bean using Local interface. I am using EJB-QL to retrive data. A method findByVehType(Integer x) is declared which returns a Collection object.

If I use the first query it returns a Collection of Local interface objects and I am able to access the value of dept_code by using its getter method.
Query 1 :
<ejb-ql>
SELECT r.dept_code FROM Fmdvehreq AS r WHERE r.veh_type=?1
</ejb-ql>

-----------

If I use the second query, It returns a collection of local interface objects. However if I try to access the fields like dept_code using their respective getter methods, It get the exception as follows: "TransactionRolledbackLocalException in method: public abstract java.lang.Integer fmd.FmdVehReqLocal.getDept_code(), causedBy:
java.lang.NullPointerException"

Query 2 :
<ejb-ql>
SELECT OBJECT(R) FROM Fmdvehreq AS r WHERE r.veh_type=?1
</ejb-ql>

Please help me in resolving the above problem. Thanks in advance.

Sxt
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!