-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Cannot instantiate abstract class or interface exception
PostPosted: Thu Dec 28, 2006 7:32 pm 
Newbie

Joined: Thu Dec 28, 2006 7:10 pm
Posts: 3
Hi, I'm fairly new to hibernate, but am working on an existing app. I'm using hibernate in an Apache Axis web service.

I have a class A, which is associated with another class location. Location is abstract, sometimes instantiated as a point, sometimes a line. So, my program creates an object of type A and associates it with a point or a line and then does a saveOrUpdate on class A. I can go and check the database and see that all entries are there as expected, with the correct ids and attributes. But when I attempt to retrieve the object A, i get an exception:

- Error performing load command
org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: Location

Now here's the strange part. I have my tester program (test) set up to create an object associated with a point or a line, depending on the command line parameter sent in. So if i say

test point

it creates the object and associates it with a point.

test line

creates the object and associates it with a line.

I am finding that the first time I run it, there are no exceptions. Then I can run "test point" repeatedly and be successful, but when I switch to running "test line", I get the exception mentioned above.

If I restart the web service (all the hibernate code is in the web service), "test line" works again. It's somewhat unpredictable when I will see this exception, but one thing is consistent. If I restart the web service, the next time I run the program, there is no problem.

Each call to add the object to the database and to pull it out are separate sessions and transactions.

Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 29, 2006 6:45 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
Can you provide your mappings and code wich accesses objects?

_________________
Best Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.