Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Release Branch 09.04
    • Fix Version/s: 14.12.01, 12.04.06, 13.07.02
    • Component/s: product
    • Labels:
      None
    • Environment:

      OFBiz 9.04.781707

      Description

      Here https://localhost:8443/catalog/control/quickCreateVirtualWithVariants is occured this:

      2009-06-04 14:23:56,055 (http-0.0.0.0-8443-3) [ ControlServlet.java:299:INFO ] [[[ApplyFeaturesToProduct] Request Done- total:1.456,since last([ApplyFeaturesToP...):1.456]]
      2009-06-04 14:24:02,304 (http-0.0.0.0-8443-4) [ ControlServlet.java:130:INFO ] [[[quickCreateVirtualWithVariants] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
      2009-06-04 14:24:02,309 (http-0.0.0.0-8443-4) [ GenericDelegator.java:398:ERROR]
      ---- exception report ----------------------------------------------------------
      Error getting entity definition from model
      Exception: org.ofbiz.entity.GenericModelException
      Message: Could not find definition for entity name VirtualProduct
      ---- stack trace ---------------------------------------------------------------

      EDIT:
      Stack trace ...

      org.ofbiz.entity.GenericModelException: Could not find definition for entity name VirtualProduct
      org.ofbiz.entity.model.ModelReader.getModelEntity(ModelReader.java:451)
      org.ofbiz.entity.GenericDelegator.getModelEntity(GenericDelegator.java:396)
      org.ofbiz.entity.GenericDelegator.getNextSeqIdLong(GenericDelegator.java:3166)
      org.ofbiz.entity.GenericDelegator.getNextSeqId(GenericDelegator.java:3119)
      org.ofbiz.entity.GenericDelegator.getNextSeqId(GenericDelegator.java:3109)
      org.ofbiz.product.product.ProductServices.quickCreateVirtualWithVariants(ProductServices.java:743)

        Activity

        Hide
        bjfreeman BJ Freeman added a comment -

        there is no VirtualProduct. that is the correct.

        the line refered to
        productId = "VP" + delegator.getNextSeqId("VirtualProduct");
        so not sure why the message that there is no entity.

        Show
        bjfreeman BJ Freeman added a comment - there is no VirtualProduct. that is the correct. the line refered to productId = "VP" + delegator.getNextSeqId("VirtualProduct"); so not sure why the message that there is no entity.
        Hide
        yanick Jan Valkovic added a comment -

        Problem is here:
        org.ofbiz.entity.GenericDelegator.getNextSeqIdLong(GenericDelegator.java:3166)

        public Long getNextSeqIdLong(String seqName, long staggerMax) {
        (....)
        // might be null, but will usually match the entity name
        ModelEntity seqModelEntity = this.getModelEntity(seqName);
        (....)

        ModelEntity for entity "VirtualProduct" does not exists, because there is no entity "VirtualProduct"

        Show
        yanick Jan Valkovic added a comment - Problem is here: org.ofbiz.entity.GenericDelegator.getNextSeqIdLong(GenericDelegator.java:3166) public Long getNextSeqIdLong(String seqName, long staggerMax) { (....) // might be null, but will usually match the entity name ModelEntity seqModelEntity = this.getModelEntity(seqName); (....) ModelEntity for entity "VirtualProduct" does not exists, because there is no entity "VirtualProduct"
        Hide
        bjfreeman BJ Freeman added a comment -

        Ok suggest a patch to make it a warning instead of an error

        Show
        bjfreeman BJ Freeman added a comment - Ok suggest a patch to make it a warning instead of an error
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Could you please explain

        1. What you did (including detailed steps to reproduce)
        2. What you expected to happen
        3. What actually happened (including exact quotes of error messages, etc)

        It seems that you already filled completly only 3d point

        Thanks

        Show
        jacques.le.roux Jacques Le Roux added a comment - Could you please explain What you did (including detailed steps to reproduce) What you expected to happen What actually happened (including exact quotes of error messages, etc) It seems that you already filled completly only 3d point Thanks
        Hide
        lektran Scott Gray added a comment -

        Fixed in trunk r782799 and 9.04 r782805

        Thanks for the report Jan

        Show
        lektran Scott Gray added a comment - Fixed in trunk r782799 and 9.04 r782805 Thanks for the report Jan
        Hide
        bjfreeman BJ Freeman added a comment - - edited

        Scott
        the code says it can be null but it throws and error. That seems a bug to me.
        also since the string is preappended as VP would it not use it own counter?
        Does every counter need to be tied to a entity?

        Show
        bjfreeman BJ Freeman added a comment - - edited Scott the code says it can be null but it throws and error. That seems a bug to me. also since the string is preappended as VP would it not use it own counter? Does every counter need to be tied to a entity?
        Hide
        lektran Scott Gray added a comment -

        You're quite right BJ, there is an additional bug in there that should be fixed because a sequence does not need to be tied to an entity. I haven't got time right now to fix it so I'll reopen the issue. All that is need is a try catch block around the getModelEntity method call.

        Show
        lektran Scott Gray added a comment - You're quite right BJ, there is an additional bug in there that should be fixed because a sequence does not need to be tied to an entity. I haven't got time right now to fix it so I'll reopen the issue. All that is need is a try catch block around the getModelEntity method call.
        Hide
        bjfreeman BJ Freeman added a comment -

        May be David can give some guidance.
        I think that the getModelEntity should give a debug.info that a entity was not found and return a null.
        ad the comments suggest.
        or mabe use a different method to check for the entity.

        Show
        bjfreeman BJ Freeman added a comment - May be David can give some guidance. I think that the getModelEntity should give a debug.info that a entity was not found and return a null. ad the comments suggest. or mabe use a different method to check for the entity.
        Hide
        vclark Vince Clark added a comment -

        I'm a bit confused. Have never seen or heard of a "VirtualProduct" entity.

        Show
        vclark Vince Clark added a comment - I'm a bit confused. Have never seen or heard of a "VirtualProduct" entity.
        Hide
        lektran Scott Gray added a comment -

        Yeah there is no VirtualProduct entity that was why in the commit I changed the sequence name to Product, BJ is just pointing out that using VirtualProduct as a sequence name shouldn't have been invalid because a sequence doesn't necessarily have to be tied to an entity name.

        Show
        lektran Scott Gray added a comment - Yeah there is no VirtualProduct entity that was why in the commit I changed the sequence name to Product, BJ is just pointing out that using VirtualProduct as a sequence name shouldn't have been invalid because a sequence doesn't necessarily have to be tied to an entity name.
        Hide
        hansbak Hans Bakker added a comment -

        You may want to update the http://docs.ofbiz.org/display/OFBTECH/Revisions+Requiring+Data+Migration document because of this change the numbering in existing installations will start new again

        Show
        hansbak Hans Bakker added a comment - You may want to update the http://docs.ofbiz.org/display/OFBTECH/Revisions+Requiring+Data+Migration document because of this change the numbering in existing installations will start new again
        Hide
        bjfreeman BJ Freeman added a comment -

        I would recommend reverting trunk r782799 and 9.04 r782805
        force the real fix.

        Show
        bjfreeman BJ Freeman added a comment - I would recommend reverting trunk r782799 and 9.04 r782805 force the real fix.
        Hide
        lektran Scott Gray added a comment -

        Hans, is there a good reason for this enforced VP prefixed naming strategy? My preference would be to remove the prefix and that would remove the need for data migration.

        BJ, I fail to see why virtual products should require their own sequence over and above the Product sequence, do you have any thoughts on this?

        Show
        lektran Scott Gray added a comment - Hans, is there a good reason for this enforced VP prefixed naming strategy? My preference would be to remove the prefix and that would remove the need for data migration. BJ, I fail to see why virtual products should require their own sequence over and above the Product sequence, do you have any thoughts on this?
        Hide
        hansbak Hans Bakker added a comment -

        Scott i agree with you, should not have a special numbering. If it is now going to use the already used numbering for product then there is no migration required.

        Show
        hansbak Hans Bakker added a comment - Scott i agree with you, should not have a special numbering. If it is now going to use the already used numbering for product then there is no migration required.
        Hide
        bjfreeman BJ Freeman added a comment - - edited

        Scott before I answer let me go through the history and code and see how and why it was used.
        I was not the one that orginated the VirtualProduct
        if we decide not to use it then all reference to VirtualProduct need to be changed.

        Show
        bjfreeman BJ Freeman added a comment - - edited Scott before I answer let me go through the history and code and see how and why it was used. I was not the one that orginated the VirtualProduct if we decide not to use it then all reference to VirtualProduct need to be changed.
        Hide
        yanick Jan Valkovic added a comment -

        @ Jacques Le Roux

        This error occure when i was try create virtual product from "normal"(not-virtual, not-variant) product and variant/virtual product.
        Steps to reproduce:

        • create virtual and/or variant product with id "test"
        • create second product, non-virtual non-variant product with id "test1"
        • go https://localhost:8443/catalog/control/main and find products witt keyword "test"
        • check both products and click on "Create Virtual Product"

        I did some research about variant/virtual products and i was try to understand how it works. I didn't expect anything

        Show
        yanick Jan Valkovic added a comment - @ Jacques Le Roux This error occure when i was try create virtual product from "normal"(not-virtual, not-variant) product and variant/virtual product. Steps to reproduce: create virtual and/or variant product with id "test" create second product, non-virtual non-variant product with id "test1" go https://localhost:8443/catalog/control/main and find products witt keyword "test" check both products and click on "Create Virtual Product" I did some research about variant/virtual products and i was try to understand how it works. I didn't expect anything
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Jan, I think we are on the way to fix it now

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Jan, I think we are on the way to fix it now
        Hide
        soledad Nicolas Malin added a comment -

        The problem came from an analyse in GenericDelegotor.java:3049 on trunk :
        // might be null, but will usually match the entity name
        ModelEntity seqModelEntity = this.getModelEntity(seqName);

        The gextNextSeqId check if seqName is an Entity and throw an exception.

        Show
        soledad Nicolas Malin added a comment - The problem came from an analyse in GenericDelegotor.java:3049 on trunk : // might be null, but will usually match the entity name ModelEntity seqModelEntity = this.getModelEntity(seqName); The gextNextSeqId check if seqName is an Entity and throw an exception.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Scott, Hans, BJ,

        I'd like to close this issue by removing the "VP" and enclose the lines
        / might be null, but will usually match the entity name
        ModelEntity seqModelEntity = this.getModelEntity(seqName);
        in a try catch block, nothing has been done since, right?

        Show
        jacques.le.roux Jacques Le Roux added a comment - Scott, Hans, BJ, I'd like to close this issue by removing the "VP" and enclose the lines / might be null, but will usually match the entity name ModelEntity seqModelEntity = this.getModelEntity(seqName); in a try catch block, nothing has been done since, right?
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Hi Jacques,

        I think we can close this issue. GenericDelegator has been refined by Adrian and added try/catch block at r#1629391

        http://svn.apache.org/viewvc?view=revision&revision=r1629391

        Show
        deepak.dixit Deepak Dixit added a comment - Hi Jacques, I think we can close this issue. GenericDelegator has been refined by Adrian and added try/catch block at r#1629391 http://svn.apache.org/viewvc?view=revision&revision=r1629391
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Here is the patch to remove the VP from virtual product sequence id.

        Show
        deepak.dixit Deepak Dixit added a comment - Here is the patch to remove the VP from virtual product sequence id.
        Hide
        toashishvijay Ashish Vijaywargiya added a comment -

        Thanks Jan Valkovic for reporting the issue, Thanks Deepak for providing the patch for the same, changes are committed in trunk at r1639846.

        Show
        toashishvijay Ashish Vijaywargiya added a comment - Thanks Jan Valkovic for reporting the issue, Thanks Deepak for providing the patch for the same, changes are committed in trunk at r1639846.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        R13.07 r1639923
        R12.04 r1639924

        Show
        jacques.le.roux Jacques Le Roux added a comment - R13.07 r1639923 R12.04 r1639924
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        I backported r1629391 in R12.04 at r1639932 for this to be complete

        Show
        jacques.le.roux Jacques Le Roux added a comment - I backported r1629391 in R12.04 at r1639932 for this to be complete

          People

          • Assignee:
            toashishvijay Ashish Vijaywargiya
            Reporter:
            yanick Jan Valkovic
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development