WrongClassException while getting a graph

已查看 39 次
跳至第一个未读帖子

Dave Butz

未读,
2010年5月30日 07:55:472010/5/30
收件人 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

未读,
2010年5月30日 11:15:572010/5/30
收件人 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

未读,
2010年5月30日 11:34:002010/5/30
收件人 sarasvati-wf-users
Happend also with "hello-world.wf.xml".
> > sarasvati-wf-us...@googlegroups.com<sarasvati-wf-users%2Bunsubs cr...@googlegroups.com>
> > .
已删除帖子

Dave Butz

未读,
2010年6月3日 14:37:422010/6/3
收件人 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

未读,
2010年6月15日 22:50:472010/6/15
收件人 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.

回复全部
回复作者
转发
0 个新帖子