Problems with HibNodeRef

19 views
Skip to first unread message

Simon

unread,
Aug 1, 2010, 12:05:35 PM8/1/10
to sarasvati-wf-users
Hi all

I'd like to add a new workflow defintion with the HibGraphFactory.
Adding the graph itselfs and also adding nodes works fine but if try
to add an arc I get an exception.

The call is as follows:
engine.getFactory().newArc(graph, startNode, endNode, name);

Which yields the following exception:

java.lang.RuntimeException:
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract ch.wd.client.command.IReturn
ch.wd.client.command.RPCService.execute(ch.wd.client.command.IRemoteProcedure)'
threw an unexpected exception: java.lang.RuntimeException:
org.hibernate.PropertyAccessException: could not get a field value by
reflection getter of com.googlecode.sarasvati.hib.HibNodeRef.id
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleExporterProcessingException(GWTRPCServiceExporter.java:
384)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:
353)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
224)
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
62)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest(GWTRPCServiceExporter.java:
407)
at
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:
49)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:
771)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:
716)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:
644)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:
560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1097)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:
109)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:
83)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at
ch.wd.server.security.GWTExceptionTranslationFilter.doFilter(GWTExceptionTranslationFilter.java:
93)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:
188)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:
79)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:
149)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:
237)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:
167)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1088)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at
org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:
49)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
395)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:488)
Caused by: com.google.gwt.user.server.rpc.UnexpectedException: Service
method 'public abstract ch.wd.client.command.IReturn
ch.wd.client.command.RPCService.execute(ch.wd.client.command.IRemoteProcedure)'
threw an unexpected exception: java.lang.RuntimeException:
org.hibernate.PropertyAccessException: could not get a field value by
reflection getter of com.googlecode.sarasvati.hib.HibNodeRef.id
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
378)
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
361)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.encodeResponseForFailure(GWTRPCServiceExporter.java:
223)
at
org.gwtwidgets.server.spring.gilead.GileadRPCServiceExporter.encodeResponseForFailure(GileadRPCServiceExporter.java:
169)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleInvocationTargetException(GWTRPCServiceExporter.java:
256)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:
344)
... 42 more
Caused by: java.lang.RuntimeException:
org.hibernate.PropertyAccessException: could not get a field value by
reflection getter of com.googlecode.sarasvati.hib.HibNodeRef.id
at ch.wd.server.rpcservice.RPCServiceImpl.execute(RPCServiceImpl.java:
57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.gwtwidgets.server.spring.gilead.GileadRPCServiceExporter.invokeMethodOnService(GileadRPCServiceExporter.java:
149)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:
338)
... 42 more
Caused by: org.hibernate.PropertyAccessException: could not get a
field value by reflection getter of
com.googlecode.sarasvati.hib.HibNodeRef.id
at org.hibernate.property.DirectPropertyAccessor
$DirectGetter.get(DirectPropertyAccessor.java:62)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:
230)
at
org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:
3852)
at
org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:
3560)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:204)
at org.hibernate.engine.ForeignKeys
$Nullifier.isNullifiable(ForeignKeys.java:160)
at org.hibernate.engine.ForeignKeys
$Nullifier.nullifyTransientReferences(ForeignKeys.java:92)
at org.hibernate.engine.ForeignKeys
$Nullifier.nullifyTransientReferences(ForeignKeys.java:70)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:
311)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:
204)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:
130)
at
org.hibernate.ejb.event.EJB3SaveEventListener.saveWithGeneratedId(EJB3SaveEventListener.java:
62)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:
210)
at
org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:
56)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:
195)
at
org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:
50)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:
93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:705)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:693)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:689)
at
com.googlecode.sarasvati.hib.HibGraphFactory.newArc(HibGraphFactory.java:
79)
at
ch.wd.server.procedure.wf.SaveGraphProcedure.go(SaveGraphProcedure.java:
109)
at
ch.wd.server.procedure.wf.SaveGraphProcedure.go(SaveGraphProcedure.java:
1)
at ch.wd.server.rpcservice.RPCServiceImpl.execute(RPCServiceImpl.java:
54)
... 48 more
Caused by: java.lang.IllegalArgumentException: Can not set
java.lang.Long field com.googlecode.sarasvati.hib.HibNodeRef.id to
com.googlecode.sarasvati.hib.HibNode
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:
146)
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:
150)
at
sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:
37)
at
sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:
18)
at java.lang.reflect.Field.get(Field.java:358)
at org.hibernate.property.DirectPropertyAccessor
$DirectGetter.get(DirectPropertyAccessor.java:59)
... 71 more


I'd very much appreciate a hint pointing me in the right direction!

Thanks & cheers
Simon

Paul Lorenz

unread,
Aug 1, 2010, 9:32:41 PM8/1/10
to sarasvati...@googlegroups.com
Hi Simon,
I'm guessing a little here, since I'm just going off the stacktrace,
but I wonder if you're sending in instances of HibNode, instead of
HibNodeRef to newArc? Can you check this (maybe put a breakpoint in
newArc, and see what types you're getting). Otherwise, if you have a
reproducible test case, I can definitely track it down. Either way,
let me know what the results are, and if that's not the right fix, I
can ponder some more. If that is the right fix, I'll add a type check
to new arc, to make the error more visible.

Cheers,
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.
>
>

Simon

unread,
Aug 2, 2010, 2:47:25 AM8/2/10
to sarasvati-wf-users
Hi Paul

You guessed absolutely right! I indeed sent HibNodes instead of
HibNodeRefs (I missunderstood the concept here).
After correcting this it's working perfectly now.

Thanks for the excellent help!

Cheers,
Simon

Paul Lorenz

unread,
Aug 2, 2010, 8:09:27 AM8/2/10
to sarasvati...@googlegroups.com

Glad I could help. I'll add a fast fail check there, with a more informative message.
If you don't mind me asking, why are you using the graph factory directly, over the graph loader, which should have a friendlier and simpler API?

Cheers,
Paul

Simon

--
You received this message because you are subscribed to the Google Groups "sarasvati-wf-u...

Reply all
Reply to author
Forward
0 new messages