Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld >> Enterprise Java

Pages: 1
krishnaprasadG
stranger


Reged: 03/08/07
Posts: 4
class cast exception during ejbLoad()
      #178234 - 08/07/08 03:59 AM

ClassCastException is thrown inside ejbLoad() in entity bean.
code that threw the exception:
Occupation occupation= (Occupation)ctx.getPrimaryKey()

Occupation is primary key class(occupationId is an int field).

when i replaced Occupation with Integer, as below, no exception was thrown.

Integer id = (Integer)ctx.getPrimaryKey()

1.why getPrimaryKey() is not returning primary key class?
2.what getPrimaryKey() actually does?

--------------------

have a great day,
krishna prasad g


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 3102

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5