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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 12.0.0.Dev05
    • 12.0.0.Dev04
    • 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"

    Description

      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"

      Attachments

        Activity

          People

            gfernand@redhat.com Gustavo Fernandes (Inactive)
            gfernand@redhat.com Gustavo Fernandes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: