IllegalArgumentException: Unable to convert url (jar:file:/app.jar!/BOOT-INF/classes!/) to file

坚强是说给别人听的谎言 提交于 2019-12-05 06:28:18

问题


Built spring boot 2.0.0.RC application with Google Dataflow and other services and deployed with following maven command mvn appengine:deploy. The build goes successful to AppEngine and an instance is created.

The problem is at the App Engine dashboard following error is displayed

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:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.RuntimeException: Failed to construct instance from factory method DataflowRunner#fromOptions(interface org.apache.beam.sdk.options.PipelineOptions)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod(InstanceBuilder.java:233)
at org.apache.beam.sdk.util.InstanceBuilder.build(InstanceBuilder.java:162)
at org.apache.beam.sdk.PipelineRunner.fromOptions(PipelineRunner.java:52)
at org.apache.beam.sdk.Pipeline.create(Pipeline.java:142)
at com.trackers.exlon.ExlonApplication.main(ExlonApplication.java:69)
... 8 more
Caused by: 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:498)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod(InstanceBuilder.java:222)
... 12 more
Caused by: java.lang.IllegalArgumentException: Unable to convert url (jar:file:/app.jar!/BOOT-INF/classes!/) to file.
at org.apache.beam.runners.dataflow.DataflowRunner.detectClassPathResourcesToStage(DataflowRunner.java:1375)
at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions(DataflowRunner.java:244)
... 17 more
Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.<init>(File.java:418)
at org.apache.beam.runners.dataflow.DataflowRunner.detectClassPathResourcesToStage(DataflowRunner.java:1371)
... 18 more

This is plugins i use

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>${appengine.maven.plugin}</version>
        </plugin>
    </plugins>
</build>

The Problem

It seems the java application cannot be found by dataflow runner DataflowRunner.detectClassPathResourcesToStage. What is wrong with my code or rather how am i required to build this application for it to be found by dataflow runner?

来源:https://stackoverflow.com/questions/48961440/illegalargumentexception-unable-to-convert-url-jarfile-app-jar-boot-inf-cla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!