title: How to create a http load balancer in GCP with the java SDK?
body: <p>I am trying to use the java SDK to create a Load Balancer but as of now i am getting scope mismatched error. I am new to GCP and not sure what mistake i am doing.</p>
  <p>I am getting the following exception:</p>
  <p><code>Scope mismatch between forwarding rule and backend service, forwarding rule scope: region us-east1, backend service scope: global</code>.</p>
  <pre><code>    Backend backend = new Backend().setGroup(&quot;&quot;);
      BackendService backendService = new BackendService()
              .setName(&quot;backendservice&quot;)
              .setPort(80)
              .setProtocol(&quot;TCP&quot;)
              .setPortName(&quot;http&quot;)
              .setTimeoutSec(30)
              .setBackends(Collections.singletonList(backend))
              .setHealthChecks(Collections.singletonList(&quot;&quot;));
      compute.backendServices()
              .insert(&quot;&quot;, backendService)
              .execute();
  
  
      ForwardingRule forwardingRule = new ForwardingRule()
              .setName(&quot;lb-forwarding-rule&quot;)
              .setPortRange(&quot;80-80&quot;)
              .setIPProtocol(&quot;TCP&quot;)
              .setIpVersion(&quot;IPv4&quot;)
              .setLoadBalancingScheme(&quot;EXTERNAL&quot;)
              .setBackendService(&quot;&quot;);
          
      compute.forwardingRules().insert(&quot;&quot;, &quot;us-east1&quot;, forwardingRule).execute();
  </code></pre>