jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Archana Chinnaiah (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (JCLOUDS-1251) Swift removeBlob
Date Thu, 02 Mar 2017 03:50:45 GMT

    [ https://issues.apache.org/jira/browse/JCLOUDS-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15891578#comment-15891578
] 

Archana Chinnaiah edited comment on JCLOUDS-1251 at 3/2/17 3:49 AM:
--------------------------------------------------------------------

Code to reproduce the issue

public class App {	
    public static void main(String[] args) throws IOException
    {
        // TODO Auto-generated method stub
        Iterable<Module> modules = ImmutableSet.<Module> of(
                                                            new SLF4JLoggingModule());
        final String CONTAINER_NAME = "App20";
        final String OBJECT_NAME = "jclouds-example.txt1";
        BlobStoreContext context = ContextBuilder.newBuilder("openstack-swift")
                        .endpoint("http://x.xx.xx.xx:5000/v2.0")
                        .credentials("xx:xx", "xx")
                        .modules(modules)
                        // .overrides(overrides)
                        .buildView(BlobStoreContext.class);     

        PutOptions opt = new PutOptions();
        opt.multipart();
        BlobStore blobStore = context.getBlobStore();   
        blobStore.createContainerInLocation(null, CONTAINER_NAME);   
        File f = new File("/home/archupsg03/test_dir/sample2");
        ByteSource source = Files.asByteSource(f);
        Payload payload = Payloads.newByteSourcePayload(source);
        payload.getContentMetadata().setContentLength(f.length());
        String blobname = f.getName();
        long length = f.length();
        Blob blob = blobStore.blobBuilder(OBJECT_NAME)
                        .payload(payload)
                        .build();
        blobStore.putBlob(CONTAINER_NAME, blob, opt);
        blobStore.removeBlob(CONTAINER_NAME, OBJECT_NAME);
}
}


was (Author: archupsg03):
Code to reproduce the issue

public class App {	
    public static void main(String[] args) throws IOException
    {
        // TODO Auto-generated method stub
        Iterable<Module> modules = ImmutableSet.<Module> of(
                                                            new SLF4JLoggingModule());
        final String CONTAINER_NAME = "App20";
        final String OBJECT_NAME = "jclouds-example.txt1";
        BlobStoreContext context = ContextBuilder.newBuilder("openstack-swift")
                        .endpoint("http://x.xx.xx.xx:5000/v2.0")
                        .credentials("xx:xx", "xx")
                        .modules(modules)
                        // .overrides(overrides)
                        .buildView(BlobStoreContext.class);     

        PutOptions opt = new PutOptions();
        opt.multipart();
        BlobStore blobStore = context.getBlobStore();   
        blobStore.createContainerInLocation(null, CONTAINER_NAME);   
        File f = new File("/home/archupsg03/test_dir/sample2");
        ByteSource source = Files.asByteSource(f);
        Payload payload = Payloads.newByteSourcePayload(source);
        payload.getContentMetadata().setContentLength(f.length());
        String blobname = f.getName();
        long length = f.length();
        Blob blob = blobStore.blobBuilder(OBJECT_NAME)
                        .payload(payload)
                        .build();
        blobStore.putBlob(CONTAINER_NAME, blob, opt);
        blobStore.removeBlob(CONTAINER_NAME, OBJECT_NAME);
}
}

> Swift removeBlob
> ----------------
>
>                 Key: JCLOUDS-1251
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1251
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 2.0.0
>         Environment: RHEL 7
> Java 1.7
>            Reporter: Archana Chinnaiah
>            Assignee: Zack Shoylev
>            Priority: Blocker
>              Labels: openstack-swift
>
> RemoveBlob for swift is unsuccessful, and fails with the following error
> {code}
> Mar 01, 2017 12:08:50 PM org.jclouds.logging.jdk.JDKLogger logError
> SEVERE: Error parsing input: null
> java.lang.NullPointerException
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:60)
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:41)
> 	at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
> 	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
> 	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
> 	at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
> 	at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
> 	at com.sun.proxy.$Proxy73.delete(Unknown Source)
> 	at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.removeBlob(RegionScopedSwiftBlobStore.java:393)
> 	at main.java.s3_19.App.main(App.java:106)
> Exception in thread "main" org.jclouds.http.HttpResponseException: Error parsing input:
null
> {statusCode=204, message=No Content, headers={Date=[Wed, 01 Mar 2017 06:46:49 GMT], X-Trans-Id=[txa66b195a2b4b4723931ca-0058b66e59],
Connection=[keep-alive]}}
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:67)
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:41)
> 	at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
> 	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
> 	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
> 	at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
> 	at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
> 	at com.sun.proxy.$Proxy73.delete(Unknown Source)
> 	at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.removeBlob(RegionScopedSwiftBlobStore.java:393)
> 	at main.java.s3_19.App.main(App.java:106)
> Caused by: java.lang.NullPointerException
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:60)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message