kennknowles opened a new issue, #18556:
URL: https://github.com/apache/beam/issues/18556

   The very simple Pipeline:
   
   public class PubsubTemplate {
    public interface PubsubTemplateOptions extends PipelineOptions
   
   { ValueProvider<String\> getSubscription(); void 
setSubscription(ValueProvider<String\> value); }
   
   public static void main(String[] args) throws IOException
   
   { PubsubTemplateOptions options = 
PipelineOptionsFactory.fromArgs(args).withValidation() 
.as(PubsubTemplateOptions.class); Pipeline p = Pipeline.create(options); 
p.apply(PubsubIO.readStrings(). fromSubscription(options.getSubscription())); 
p.run().waitUntilFinish(); }
   
   }
   
   Throws the exception when generating a Dataflow template:
   
   java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: Not called from a runtime context.
    at 
org.apache.beam.sdk.options.ValueProvider$RuntimeValueProvider.get(ValueProvider.java:223)
    at 
org.apache.beam.sdk.options.ValueProvider$NestedValueProvider.get(ValueProvider.java:131)
    at 
org.apache.beam.sdk.options.ValueProvider$NestedValueProvider.get(ValueProvider.java:131)
    at 
org.apache.beam.sdk.io.gcp.pubsub.PubsubUnboundedSource.getSubscription(PubsubUnboundedSource.java:1374)
    at 
org.apache.beam.sdk.io.gcp.pubsub.PubsubUnboundedSource$PubsubSource.<init\>(PubsubUnboundedSource.java:1103)
    at 
org.apache.beam.sdk.io.gcp.pubsub.PubsubUnboundedSource.expand(PubsubUnboundedSource.java:1407)
    at 
org.apache.beam.sdk.io.gcp.pubsub.PubsubUnboundedSource.expand(PubsubUnboundedSource.java:110)
    at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:514)
    at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:454)
    at org.apache.beam.sdk.values.PBegin.apply(PBegin.java:44)
    at org.apache.beam.sdk.io.gcp.pubsub.PubsubIO$Read.expand(PubsubIO.java:730)
    at org.apache.beam.sdk.io.gcp.pubsub.PubsubIO$Read.expand(PubsubIO.java:536)
    at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:514)
    at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:454)
    at org.apache.beam.sdk.values.PBegin.apply(PBegin.java:44)
    at org.apache.beam.sdk.Pipeline.apply(Pipeline.java:165)
    at com.google.pubsubtemplate.PubsubTemplate.main(PubsubTemplate.java:34)
    ... 6 more
   
   Imported from Jira 
[BEAM-2965](https://issues.apache.org/jira/browse/BEAM-2965). Original Jira may 
contain additional context.
   Reported by: bmenasha.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to