Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable instance virtual display #1387

Open
hhansalesforce opened this issue Sep 27, 2019 · 11 comments
Open

enable instance virtual display #1387

hhansalesforce opened this issue Sep 27, 2019 · 11 comments
Labels
priority: p4 type: question Request for information or clarification. Not an issue.

Comments

@hhansalesforce
Copy link

Thanks for stopping by to let us know something could be better!

Need the api support for this feature when creating instance
https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display

@hhansalesforce
Copy link
Author

the feature should be added here -- com.google.api.services.compute.model.Instance

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Sep 28, 2019
@chingor13 chingor13 added the type: question Request for information or clarification. Not an issue. label Oct 1, 2019
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Oct 1, 2019
@chingor13
Copy link
Collaborator

This feature is already available in the google-api-services-compute library:

import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.compute.Compute;
import com.google.api.services.compute.model.DisplayDevice;
import com.google.api.services.compute.model.Instance;
import com.google.api.services.compute.model.Operation;

Compute compute = new Compute.Builder(new NetHttpTransport(), new JacksonFactory(), null)
    .setApplicationName("my application")
    .build();
DisplayDevice displayDevice = new DisplayDevice().setEnableDisplay(true);
Instance instance = new Instance().setDisplayDevice(displayDevice);
Compute.Instances.Insert insert = compute.instances()
    .insert("my-project-id", "zone", instance);
Operation operation = insert.execute();

@hhansalesforce
Copy link
Author

hhansalesforce commented Oct 1, 2019

Thanks for looking into. Can you confirm the maven setup for accessing the import class?

Here is what I have now which doesn't have the import available for me

 <version.gcp-api-client>1.30.4</version.gcp-api-client>
        <version.gcp-api-services-compute>v1-rev193-1.23.0</version.gcp-api-services-compute>

        <version.gcp-google-http-client>1.23.0</version.gcp-google-http-client>

<dependency>
            <groupId>com.google.api-client</groupId>
            <artifactId>google-api-client</artifactId>
            <version>${version.gcp-api-client}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava-jdk5</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.apis</groupId>
            <artifactId>google-api-services-compute</artifactId>
            <version>${version.gcp-api-services-compute}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${version.gson}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client</artifactId>
            <version>${version.gcp-google-http-client}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client-jackson2</artifactId>
            <version>${version.gcp-google-http-client}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

@chingor13
Copy link
Collaborator

Ah, you have a very old version of the compute API and the supporting libraries. google-http-client is on version 1.32.1, google-api-client is on 1.30.4, google-api-services-compute is at v1-rev20190825-1.30.3

Is there a reason you need to pin the dependencies so far back?

For the above, I would recommend:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>libraries-bom</artifactId>
      <version>2.5.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
<dependencies>
  <dependency>
    <groupId>com.google.api-client</groupId>
    <artifactId>google-api-client</artifactId>
  </dependency>
  <dependency>
    <groupId>com.google.apis</groupId>
    <artifactId>google-api-services-compute</artifactId>
    <version>${version.gcp-api-services-compute}</version>
  </dependency>
  <dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>${version.gson}</version>
  </dependency>
  <dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
  </dependency>
  <dependency>
    <groupId>com.google.http-client</groupId>
    <artifactId>google-http-client</artifactId>
  </dependency>
  <dependency>
    <groupId>com.google.http-client</groupId>
    <artifactId>google-http-client-jackson2</artifactId>
  </dependency>
</dependencies>

where version.gcp-api-services-compute is v1-rev20190825-1.30.3. The libraries-bom is a pom.xml we produce that contains a collection of dependency versions that are known to work together. It also contains more recent versions of these supporting libraries.

@chingor13 chingor13 reopened this Oct 1, 2019
@hhansalesforce
Copy link
Author

@chingor13 Thank for following up.
I think another dependency issue
I am getting following error:

java.lang.NoSuchMethodError: com.google.api.client.http.HttpRequest.setResponseReturnRawInputStream(Z)Lcom/google/api/client/http/HttpRequest;
java.lang.IllegalStateException: java.lang.NoSuchMethodError: com.google.api.client.http.HttpRequest.setResponseReturnRawInputStream(Z)Lcom/google/api/client/http/HttpRequest;
        at net.sfdc.ci.suava.util.RetryPolicyMethodInterceptor$1.call(RetryPolicyMethodInterceptor.java:68)
        at net.sfdc.ci.suava.util.AbstractRetryableCallable.call(AbstractRetryableCallable.java:71)
        at net.sfdc.ci.suava.util.RetryableCallable.call(RetryableCallable.java:169)
        at net.sfdc.ci.suava.util.RetryPolicyMethodInterceptor.invoke(RetryPolicyMethodInterceptor.java:73)
        at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
        at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)

@ajaaym
Copy link
Contributor

ajaaym commented Oct 11, 2019

@hhansalesforce Can you please make sure you using latest version of google-api-client? See here

@kiran-dongare-qp
Copy link

@chingor13 Can you please help me here?

java.lang.NoSuchMethodError: com.google.api.client.http.HttpRequest.setResponseReturnRawInputStream(Z)Lcom/google/api/client/http/HttpRequest;
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:435)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:542)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:475)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:592)
at com.surveyconsole.admin.screwdrive.activity.gmail.PushNotificationSubscriber.doService(PushNotificationSubscriber.java:45)
at com.bhaskaran.ui.ServletAdapter.doPost(ServletAdapter.java:162)
at com.bhaskaran.ui.ServletAdapter.doGet(ServletAdapter.java:82)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:97)

@rvaidya
Copy link

rvaidya commented Apr 2, 2020

I am also getting the above exception - google-api-client is up to date. These dependencies are explicitly defined in my pom.xml and I'm still getting the above error.

        <dependency>
            <groupId>com.google.api-client</groupId>
            <artifactId>google-api-client</artifactId>
            <version>1.30.9</version>
        </dependency>
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-core</artifactId>
            <version>1.93.3</version>
        </dependency>
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-storage</artifactId>
            <version>1.106.0</version>
        </dependency>

@myana-mahesh
Copy link

@chingor13 Can you please help me here?

java.lang.NoSuchMethodError: com.google.api.client.http.HttpRequest.setResponseReturnRawInputStream(Z)Lcom/google/api/client/http/HttpRequest;
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:435)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:542)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:475)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:592)
at com.surveyconsole.admin.screwdrive.activity.gmail.PushNotificationSubscriber.doService(PushNotificationSubscriber.java:45)
at com.bhaskaran.ui.ServletAdapter.doPost(ServletAdapter.java:162)
at com.bhaskaran.ui.ServletAdapter.doGet(ServletAdapter.java:82)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:97)

if you found solution of this problem then please let me know

@kiran-dongare-qp
Copy link

kiran-dongare-qp commented Feb 3, 2021 via email

@myana-mahesh
Copy link

It's because of the old or some other JAR conflicts. I have removed that JAR's from the project and then it's working fine. Kiran Dongare Software Engineer +91 7588195932 Join us live for Work@Life, your ultimate guide to the Employee Experience. Tuesday @ 1:00 PM ET Subscribe here! https://www.youtube.com/playlist?list=PLEskC-4J0V-_XyIksPlWtQrvK47y8uDgl Live with Dan shares his unfiltered thoughts on the world of market research every Friday @ 12:00 PM ET Subscribe here! https://www.youtube.com/playlist?list=PLEskC-4J0V-9xaL2i5euptHa3gIQVmFBm Never miss out on what's new with the customer experience by joining us every Wednesday on CX Forums. Sign up here! https://www.eventbrite.com/o/cx-forums-the-customer-experience-connection-31771064491 How am I doing? Take this 40 Second Survey http://feedback.questionpro.com/?c1=kiran.dongare The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.

On Wed, Feb 3, 2021 at 1:02 AM Mahesh Myana @.***> wrote: @chingor13 https://github.com/chingor13 Can you please help me here? java.lang.NoSuchMethodError: com.google.api.client.http.HttpRequest.setResponseReturnRawInputStream(Z)Lcom/google/api/client/http/HttpRequest; at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:435) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:542) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:475) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:592) at com.surveyconsole.admin.screwdrive.activity.gmail.PushNotificationSubscriber.doService(PushNotificationSubscriber.java:45) at com.bhaskaran.ui.ServletAdapter.doPost(ServletAdapter.java:162) at com.bhaskaran.ui.ServletAdapter.doGet(ServletAdapter.java:82) at javax.servlet.http.HttpServlet.service(HttpServlet.java:120) at javax.servlet.http.HttpServlet.service(HttpServlet.java:97) if you found solution of this problem then please let me know — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1387 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM6VLMS7NW3ESJPR3C2JLTS5BHNVANCNFSM4I3JMFMA .

thank you so much
i also had same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p4 type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

8 participants