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

Maty Grosz commented on JCLOUDS-273:
------------------------------------

Sorry, I don't get your point. My code runs across the constructor I described 
within the JClouds code itself.
I don't even get to the point I initiate a new Server instance using the 
Builder [2].
The exception I get happens during the parse phase of the response to server 
api.get(id) call. 
In my backend application, I don't set the metadata attribute to anything 
(leaving it to be NULL) in the response to the GET call
This is the exception I get on my client side using the JClouds server api:

java.lang.NullPointerException: metadata
        at 
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:208)
        at org.jclouds.openstack.nova.v2_0.domain.Server.<init>(Server.java:334)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at 
org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeWithParameterizedConstructorSerializeWithDelegate.newInstance(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:219)
        at 
org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeWithParameterizedConstructorSerializeWithDelegate.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:198)
        at com.google.gson.Gson.fromJson(Gson.java:791)
        at 
org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:81)
        at 
org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:48)
        at com.google.common.util.concurrent.Futures$3.apply(Futures.java:376)
        at 
com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:518)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

                
> JClouds OpenStack Nova v2.0 Server domian doesn't follow OpenStack formal 
> documentation
> ---------------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-273
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-273
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>            Reporter: Maty Grosz
>
> Using class org.jclouds.openstack.nova.v2_0.domain.Server – look at the 
> constructor “protected Server(… parameters)”:
> OpenStack formal documentation says that the metadata attribute is optional. 
> The constructor above calls to(checkNotNull(metadata, "metadata")) – and 
> fails.
> No need to check that in this case.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to