Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6068

Upload video content for category causes exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk, 14.12.01
    • Fix Version/s: 14.12.01, 16.11.01
    • Component/s: content
    • Labels:
      None

      Description

      Using Demo data.
      In https://localhost:8443/catalog/control/EditCategoryContent?productCategoryId=CATALOG1_BEST_SELL
      When upload a video for the content, an exception occurs.

      Console output...

      2015-02-10 17:55:21,787 |ttp-bio-8443-exec-14 |GenericDelegator |E| Failure in create operation for entity [VideoDataResource]: java.lang.ClassCastException: java.nio.HeapByteBuffer cannot be cast to java.sql.Blob. Rolling back transaction.
      2015-02-10 17:55:21,789 |ttp-bio-8443-exec-14 |TransactionUtil |W| Calling transaction setRollbackOnly; this stack trace shows where this is happening:
      java.lang.Exception: Failure in create operation for entity [VideoDataResource]: java.lang.ClassCastException: java.nio.HeapByteBuffer cannot be cast to java.sql.Blob. Rolling back transaction.
      at org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:360) [ofbiz-entity.jar:?]
      at org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:301) [ofbiz-entity.jar:?]
      at org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:925) [ofbiz-entity.jar:?]
      at org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:770) [ofbiz-entity.jar:?]
      at org.ofbiz.minilang.method.entityops.CreateValue.exec(CreateValue.java:73) [ofbiz-minilang.jar:?]
      at org.ofbiz.minilang.SimpleMethod.runSubOps(SimpleMethod.java:305) [ofbiz-minilang.jar:?]
      at org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:452) [ofbiz-minilang.jar:?]
      at org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:269) [ofbiz-minilang.jar:?]
      at org.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:288) [ofbiz-minilang.jar:?]
      at org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.java:79) [ofbiz-minilang.jar:?]
      at org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:48) [ofbiz-minilang.jar:?]

      1. OFBIZ-6068.patch
        5 kB
        Rohit Koushal

        Activity

        Hide
        deepak.dixit Deepak Dixit added a comment - - edited

        This issues exists for 14.12 a well.
        Need to backport fixes to 14.12 as well.

        Show
        deepak.dixit Deepak Dixit added a comment - - edited This issues exists for 14.12 a well. Need to backport fixes to 14.12 as well.
        Hide
        jacques.le.roux Jacques Le Roux added a comment - - edited

        Thanks Deepak, done.

        BTW maybe more than R14 but also R13 and R12, to be checked when fixed...

        Show
        jacques.le.roux Jacques Le Roux added a comment - - edited Thanks Deepak, done. BTW maybe more than R14 but also R13 and R12, to be checked when fixed...
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Jacques, But we don't need to worry about R13 and R12 because changes done at r1553890 throws class cast exception for blob and byte-array field.

        Date: Sat Dec 28 19:15:58 2013
        New Revision: 1553890
        
        URL: http://svn.apache.org/r1553890
        
        Log:
        A small code cleanup in the entity engine - remove deprecated functionality. Originally, the "blob" field type was used as a catch-all for java.sql.Blob, byte[], and java.lang.Object. Now each Java type has its own field type - so you must specify the correct one.
        
        IMPORTANT: This commit might break some applications. If you get ClassCastExceptions, then you need to change the field type in your entity from blob to either byte-array or object. The change will have no effect on your database - because they are all persisted as BLOB SQL types.
        
        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Jacques, But we don't need to worry about R13 and R12 because changes done at r1553890 throws class cast exception for blob and byte-array field. Date: Sat Dec 28 19:15:58 2013 New Revision: 1553890 URL: http: //svn.apache.org/r1553890 Log: A small code cleanup in the entity engine - remove deprecated functionality. Originally, the "blob" field type was used as a catch -all for java.sql.Blob, byte [], and java.lang. Object . Now each Java type has its own field type - so you must specify the correct one. IMPORTANT: This commit might break some applications. If you get ClassCastExceptions, then you need to change the field type in your entity from blob to either byte -array or object. The change will have no effect on your database - because they are all persisted as BLOB SQL types.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Deepak!

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Deepak!
        Hide
        jacopoc Jacopo Cappellato added a comment -

        can we close this ticket now?

        Show
        jacopoc Jacopo Cappellato added a comment - can we close this ticket now?
        Hide
        jacopoc Jacopo Cappellato added a comment -

        oh, sorry, when I have read Jacques' comment I had the impression he already applied the patch.

        Show
        jacopoc Jacopo Cappellato added a comment - oh, sorry, when I have read Jacques' comment I had the impression he already applied the patch.
        Hide
        jacopoc Jacopo Cappellato added a comment -

        Thanks Rohit and Deepak: I have applied Rohit's patch in rev. 1660053 and back ported to 14.12 in rev. 1660055

        Show
        jacopoc Jacopo Cappellato added a comment - Thanks Rohit and Deepak: I have applied Rohit's patch in rev. 1660053 and back ported to 14.12 in rev. 1660055
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Jacopo.

        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Jacopo.

          People

          • Assignee:
            jacopoc Jacopo Cappellato
            Reporter:
            wt Wai
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development