CenturyLinkCloud / clc-java-sdk

Apache License 2.0
6 stars 4 forks source link

Possible error with JSON serialization #128

Closed idrabenia closed 9 years ago

idrabenia commented 9 years ago
Now I have gotten past the class loading errors only to be hit by runtime errors: 
Exception in thread "main" com.google.common.util.concurrent.UncheckedExecutionException: javax.ws.rs.ProcessingException: Unable to invoke request
       at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203)
       at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
       at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
       at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
       at com.centurylink.cloud.sdk.base.services.client.DataCentersClient.findAllDataCenters(DataCentersClient.java:96)
       at com.centurylink.cloud.sdk.base.services.dsl.DataCenterService.findAll(DataCenterService.java:50)
       at com.centurylink.cloud.sdk.base.services.dsl.DataCenterService.findLazy(DataCenterService.java:46)
       at com.centurylink.cloud.sdk.server.services.dsl.TemplateService.lambda$findLazy$58(TemplateService.java:54)
       at com.centurylink.cloud.sdk.server.services.dsl.TemplateService$$Lambda$23/349420578.apply(Unknown Source)
       at com.centurylink.cloud.sdk.core.services.filter.evaluation.SingleFilterEvaluation.applyFindLazy(SingleFilterEvaluation.java:37)
       at com.centurylink.cloud.sdk.core.services.filter.AbstractResourceFilter.applyFindLazy(AbstractResourceFilter.java:40)
       at com.centurylink.cloud.sdk.server.services.dsl.TemplateService.findLazy(TemplateService.java:52)
       at com.centurylink.cloud.sdk.server.services.dsl.TemplateService.findLazy(TemplateService.java:34)
       at com.centurylink.cloud.sdk.core.services.filter.FilterService.find(FilterService.java:38)
       at com.centurylink.cloud.sdk.core.services.QueryService.findByRef(QueryService.java:45)
       at com.centurylink.cloud.sdk.server.services.dsl.domain.server.ServerConverter.buildCreateServerRequest(ServerConverter.java:53)
       at com.centurylink.cloud.sdk.server.services.dsl.ServerService.create(ServerService.java:91)
       at com.ko.na.CLC.exec(CLC.java:35)
       at com.ko.na.CLC.main(CLC.java:63)
Caused by: javax.ws.rs.ProcessingException: Unable to invoke request
       at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:287)
       at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:407)
       at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:195)
       at com.centurylink.cloud.sdk.core.auth.client.LoginClient.login(LoginClient.java:41)
       at com.centurylink.cloud.sdk.core.auth.services.BearerAuthentication.requestNewSessionCredentials(BearerAuthentication.java:72)
       at com.centurylink.cloud.sdk.core.auth.services.BearerAuthentication.requestSessionCredentialsIfNeeded(BearerAuthentication.java:56)
       at com.centurylink.cloud.sdk.core.auth.services.BearerAuthentication.getAccountAlias(BearerAuthentication.java:92)
       at com.centurylink.cloud.sdk.core.client.AuthenticatedSdkHttpClient.client(AuthenticatedSdkHttpClient.java:45)
       at com.centurylink.cloud.sdk.base.services.client.DataCentersClient.loadAllDataCenters(DataCentersClient.java:104)
       at com.centurylink.cloud.sdk.base.services.client.DataCentersClient.access$100(DataCentersClient.java:36)
       at com.centurylink.cloud.sdk.base.services.client.DataCentersClient$2.load(DataCentersClient.java:89)
       at com.centurylink.cloud.sdk.base.services.client.DataCentersClient$2.load(DataCentersClient.java:86)
       at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
       at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
       at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
       at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
       ... 18 more
Caused by: javax.ws.rs.ProcessingException: could not find writer for content-type application/json type: com.centurylink.cloud.sdk.core.auth.client.domain.LoginRequest
       at org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40)
       at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:138)
       at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:117)
       at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:100)
       at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:122)
       at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:341)
       at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:558)
       at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524)
       at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.loadHttpMethod(ApacheHttpClient4Engine.java:423)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:281)
markramach commented 9 years ago

could not find writer for content-type application/json type

Typically this means there is no serialization provider for the media type on the classpath. I would verify that a supported JSON serialization provider like Jackson is present in the dependency hierarchy.

drcreager commented 9 years ago

I have three Jackson jars in my path as shown below: image

Is there some other Jackson library that I require.

idrabenia commented 9 years ago

Hi @drcreager,

Yep, I think it would be great also add this library. It contains adapters of Jackson JSON to REST Easy Converters.

idrabenia commented 9 years ago

If you will require some other help, or maybe you will have some adhoc questions about installation and usage - feel free to contact me.

My contacts is

Email: ilya.drabenia(at)altoros.com

drcreager commented 9 years ago

I fixed my JAVA_HOME (Ilya advised that it has to point to the JDK not the JRE) and that got me past the build errors. Now I'm trying to get started, but the user guide is all .md files that my system doesn't recognize. Can you advise as to what .md files are, so I can download a reader.

push1st1k commented 9 years ago

Hi @drcreager,

There is markdown file format. You may open .md file in any text editor, copy the content from file and paste it here http://dillinger.io/

or you may just find information here

drcreager commented 9 years ago

Thank you

That was very helpful.

Daniel R Creager [C-I-T-logo-vrt-glow] The Coca-Cola Company voice: +1 404-676-6129 Mobile: +1 404-803-1794 fax: +1 404-598-6129 dcreager@coca-cola.commailto:dcreager@coca-cola.com

From: Aliaksandr Krasitski [mailto:notifications@github.com] Sent: Tuesday, July 14, 2015 3:09 PM To: CenturyLinkCloud/clc-java-sdk Cc: Dan Creager Subject: Re: [clc-java-sdk] Possible error with JSON serialization (#128)

Hi @drcreagerhttp://t.strk01.email/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XZs2zGDJRW3LyXFg5wLZhsVQsxsT56dL9_f6nS64s02?t=https%3a%2f%2fgithub.com%2fdrcreager&si=5229364759756800&pi=ace7a9e2-5b05-4993-b3e9-fd3d2ccd51d2,

There is markdown file format. You may open .md file in any text editor, copy the content from file and paste it here http://dillinger.io/

or you may just find information herehttp://t.strk01.email/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XZs2zGDJRW3LyXFg5wLZhsVQsxsT56dL9_f6nS64s02?t=https%3a%2f%2fgithub.com%2fCenturyLinkCloud%2fclc-java-sdk%2fwiki&si=5229364759756800&pi=ace7a9e2-5b05-4993-b3e9-fd3d2ccd51d2

Reply to this email directly or view it on GitHubhttp://t.strk01.email/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XZs2zGDJRW3LyXFg5wLZhsVQsxsT56dL9_f6nS64s02?t=https%3a%2f%2fgithub.com%2fCenturyLinkCloud%2fclc-java-sdk%2fissues%2f128%23issuecomment-121344817&si=5229364759756800&pi=ace7a9e2-5b05-4993-b3e9-fd3d2ccd51d2.


CONFIDENTIALITY NOTICE NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.