Menu

#650 Can't deliver purchase products

0.9.4-beta
closed-fixed
5
2008-07-23
2008-07-23
jfirechief
No

DO NOT EDIT OR ANSWER THIS ISSUE. SEE THE ORIGINAL ISSUE INSTEAD:
https://www.jfire.org/modules/bugs/view.php?id=752
ORIGINAL REPORTER: alex

Create a purchase order, select 'Pay and deliver all...'.

This is the only exception that is visible in the server and client:

javax.ejb.EJBException: RuntimeException
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:417)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:209)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy332.deliverRollback(Unknown Source)
at org.nightlabs.jfire.store.StoreManagerBean._deliverEnd(StoreManagerBean.java:1479)
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.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:404)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy329._deliverEnd(Unknown Source)
at org.nightlabs.jfire.store.StoreManagerBean.deliverEnd(StoreManagerBean.java:1254)
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.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:231)
at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288)
at $Proxy16.invoke(Unknown Source)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:387)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
Caused by: java.lang.IllegalStateException: Delivery "chezfrancois.jfire.org/a0h" is not pending! Cannot rollback!
at org.nightlabs.jfire.store.Store.deliverRollback(Store.java:1770)
at org.nightlabs.jfire.store.deliver.DeliveryHelperBean.deliverRollback(DeliveryHelperBean.java:530)
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.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:404)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
... 68 more

Discussion

  • jfirechief

    jfirechief - 2008-07-23
    • labels: --> JFireTrade
    • milestone: --> 0.9.4-beta
    • assigned_to: nobody --> nlmarco
    • summary: Can't deliver purchase products --> Can't deliver purchase products
    • status: open --> closed-fixed
     
  • jfirechief

    jfirechief - 2008-07-23

    Logged In: YES
    user_id=1828570
    Originator: YES

    ORIGINAL COMMENT BY alex, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=752

    I think the problem is this message:

    Caused by: java.lang.IllegalArgumentException: Can not finalize an deliveryNote where mandator is not vendor of this deliveryNote!
    at org.nightlabs.jfire.store.jbpm.ActionHandlerFinalizeDeliveryNote.doExecute(ActionHandlerFinalizeDeliveryNote.java:60)
    at org.nightlabs.jfire.jbpm.graph.def.AbstractActionHandler.execute(AbstractActionHandler.java:121)
    at org.jbpm.graph.def.Action.execute(Action.java:123)
    at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:235)

     
  • jfirechief

    jfirechief - 2008-07-23

    Logged In: YES
    user_id=1828570
    Originator: YES

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=752

    > Caused by: java.lang.IllegalArgumentException: Can not finalize an
    > deliveryNote where mandator is not vendor of this deliveryNote!

    I just fixed this problem and it still does not work. When scrolling a bit back in the log I saw this:

    18:51:15,571 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract java.io.Serializable org.nightlabs.jfire.asyncinvoke.AsyncInvokerDelegateLocal.doInvocation(org.nightlabs.jfire.asyncinvoke.AsyncInvokeEnvelope) throws java.lang.Exception, causedBy:
    java.lang.IllegalStateException: Product "chezfrancois.jfire.org/a00" is currently in a different inside repository ("chezfrancois.jfire.org/Repository/home#org.nightlabs.jfire.simpletrade.store.SimpleProductType") than the transfer chain starts ("chezfrancois.jfire.org/Repository/outside#anchorOutside.manual#chezfrancois.jfire.org#LegalEntity#alexandra.kessler")!
    at org.nightlabs.jfire.store.Store.consolidateProductReferences(Store.java:1343)
    at org.nightlabs.jfire.store.deliver.DeliveryHelperBean$ConsolidateProductReferencesInvocation.invoke(DeliveryHelperBean.java:359)
    at org.nightlabs.jfire.asyncinvoke.AsyncInvokerDelegateBean.doInvocation(AsyncInvokerDelegateBean.java:113)
    at sun.reflect.GeneratedMethodAccessor228.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    at org.jboss.ejb.Container.invoke(Container.java:960)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
    at $Proxy239.doInvocation(Unknown Source)
    at org.nightlabs.jfire.asyncinvoke.AsyncInvokerInvocationBean.doInvoke(AsyncInvokerInvocationBean.java:55)
    at org.nightlabs.jfire.asyncinvoke.AsyncInvokerBaseBean.onMessage(AsyncInvokerBaseBean.java:205)
    at sun.reflect.GeneratedMethodAccessor206.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
    at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
    at org.jboss.ejb.Container.invoke(Container.java:960)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
    at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
    at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
    at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
    at org.jboss.mq.SpySession.run(SpySession.java:323)
    at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:761)
    at java.lang.Thread.run(Thread.java:619)

     
  • jfirechief

    jfirechief - 2008-07-23

    Logged In: YES
    user_id=1828570
    Originator: YES

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=752

    As can be seen in the exception, the products are created in the wrong repository. Since they have a different vendor than the local organisation, they have to be purchased (that's what we tried when getting the exception) and therefore have to be initially located in the outside-repository of the corresponding vendor.

     
  • jfirechief

    jfirechief - 2008-07-23

    Logged In: YES
    user_id=1828570
    Originator: YES

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=752

    I fixed these issues (quite a few comparisons of organisation-ids instead of vendor/mandator) and was just able to manually go through the workflow of a purchase, but the direct deliver-all still fails. I saw that the problem seems to be the fact that the DeliveryNote is still in status "created" and has not been finalized.

    When taking a look at this, we should check whether these are the correct workflows anyway. I assume that the wrong workflow might be assigned (sale instead of purchase).

    Actually, it should be well thought about what workflow we choose. Maybe we should add a third one for each ArticleContainer, because purchasing from another organisation is different from purchasing manually from an external vendor. In the latter case, for example, we create the ArticleContainers locally while they are sent to us from the other organisation if we purchase within the JFire network.

     
  • jfirechief

    jfirechief - 2008-07-23

    Logged In: YES
    user_id=1828570
    Originator: YES

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=752

    I just started with the new workflows. Offer already has "customerLocal" and "customerCrossOrganisation" instead of just "customer".

     
  • jfirechief

    jfirechief - 2008-07-23

    Logged In: YES
    user_id=1828570
    Originator: YES

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=752

    I've split the workflows into customer-local and customer-crossorganisation and I've extended the Store.bookDeliveryNoteImplicitely(DeliveryNote deliveryNote) method to check whether booking implicitely and if so, do it. This way I can call it during "begin" and "end" stage and both is allowed: first deliver then book as well as first book and then deliver.

     

Log in to post a comment.