WrongClassException while getting a graph

40 views
Skip to first unread message

Dave Butz

unread,
May 30, 2010, 7:55:47 AM5/30/10
to sarasvati-wf-users
Hi Paul

My steps:

1. Run HibExampleConsole with changed code to load a Graph (run just
once),
Session session = HibTestSetup.openSession();
Transaction t = session.beginTransaction();
HibEngine engine = new HibEngine( session );

File file = new File("common/test-wf/myTest.wf.xml");
engine.getLoader().load(file);

// Get the graph from the GraphRepository
HibGraph graph =
engine.getRepository().getLatestGraph( "MyTest" );

engine.addExecutionListener(LoggingExecutionListener.class,
ExecutionEventType.values());

//HibGraph graph = getGraph( engine );

HibGraphProcess process =
(HibGraphProcess)engine.startProcess( graph );

session.flush();
t.commit();
session.close();

The process starts and ended successfullly.

2. Run another time without loading the Graph again.
I run into the following exception:

Exception in thread "main" org.hibernate.WrongClassException: Object
with id: 9 was not of the specified subclass:
com.googlecode.sarasvati.hib.HibNode (Discriminator: null)
at org.hibernate.loader.Loader.getInstanceClass(Loader.java:1453)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1284)
at org.hibernate.loader.Loader.getRow(Loader.java:1206)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
at org.hibernate.loader.Loader.doQuery(Loader.java:701)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:
236)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
at
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:
36)
at
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:
565)
at
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:
63)
at
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:
1716)
at
org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:
454)
at
org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:
844)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:
241)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:
338)
at
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:
172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:
811)
at
com.googlecode.sarasvati.hib.HibGraphRepository.getLatestGraph(HibGraphRepository.java:
69)
at
com.googlecode.sarasvati.example.hib.HibExampleConsole.main(HibExampleConsole.java:
110)

Paul Lorenz

unread,
May 30, 2010, 11:15:57 AM5/30/10
to sarasvati...@googlegroups.com
Hmm, do you mind posting the process definition you were testing with? Or does this happen regardless of which one you use?

thanks,
Paul


--
You received this message because you are subscribed to the Google Groups "sarasvati-wf-users" group.
To post to this group, send email to sarasvati...@googlegroups.com.
To unsubscribe from this group, send email to sarasvati-wf-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sarasvati-wf-users?hl=en.


Dave Butz

unread,
May 30, 2010, 11:34:00 AM5/30/10
to sarasvati-wf-users
Happend also with "hello-world.wf.xml".
> > sarasvati-wf-us...@googlegroups.com<sarasvati-wf-users%2Bunsubs cr...@googlegroups.com>
> > .
Message has been deleted

Dave Butz

unread,
Jun 3, 2010, 2:37:42 PM6/3/10
to sarasvati-wf-users
Hi Paul
I had specified no node type in the process definition and so he
choosed "node" as default node type.
But the "node" was not defined in database (wf_node_type). The wf
engine tried to cast the node to a type which was not registered.
Thats all.

Paul Lorenz

unread,
Jun 15, 2010, 10:50:47 PM6/15/10
to sarasvati...@googlegroups.com
Hi Dave,
Sorry it's taken me so long to get back to you. Just moved and the
last two weeks have been taken up with moving and associated activity.

Why was "node" missing from wf_node_type? It should get added by the
DB scripts...

Paul

> To unsubscribe from this group, send email to sarasvati-wf-us...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages