Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12315

REST server can't handle entry changes with value encoded as java primitives

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 12.0.0.Final
    • 12.0.0.Final
    • Server
    • None
    • Hide

      Create a protostream cache:

      curl -u user:user -H "Content-Type: application/json" -d '{"distributed-cache":{"mode":"SYNC","encoding":{"key":{"media-type":"application/x-protostream"},"value":{"media-type":"application/x-protostream"}}}}' http://127.0.0.1:11222/rest/v2/caches/myCache
       

      Insert K and V as java.lang.Integer:

      curl -XPUT -v -u user:user -H "Key-Content-Type: application/x-java-object; type=java.lang.Integer" -H "Content-Type: application/x-java-object; type=java.lang.Integer" -d '1' "http://localhost:11222/rest/v2/caches/myCache/1"  
      

      Change the existing value under the same key to another integer value:

      curl -XPUT -v -u user:user -H "Key-Content-Type: application/x-java-object; type=java.lang.Integer" -H "Content-Type: application/x-java-object; type=java.lang.Integer" -d '2' "http://localhost:11222/rest/v2/caches/myCache/1"
      
      Show
      Create a protostream cache: curl -u user:user -H "Content-Type: application/json" -d '{"distributed-cache":{"mode":"SYNC","encoding":{"key":{"media-type":"application/x-protostream"},"value":{"media-type":"application/x-protostream"}}}}' http://127.0.0.1:11222/rest/v2/caches/myCache Insert K and V as java.lang.Integer : curl -XPUT -v -u user:user -H "Key-Content-Type: application/x-java-object; type=java.lang.Integer" -H "Content-Type: application/x-java-object; type=java.lang.Integer" -d '1' "http://localhost:11222/rest/v2/caches/myCache/1" Change the existing value under the same key to another integer value: curl -XPUT -v -u user:user -H "Key-Content-Type: application/x-java-object; type=java.lang.Integer" -H "Content-Type: application/x-java-object; type=java.lang.Integer" -d '2' "http://localhost:11222/rest/v2/caches/myCache/1"

      It is possible to insert K/V via REST using media types representing java primitives (such as application/x-java-object; type=java.lang.Integer) but changing the existing entries throws an error "No marshaller registered for Java type java.lang.Integer"

              gfernand@redhat.com Gustavo Fernandes (Inactive)
              gfernand@redhat.com Gustavo Fernandes (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: