java - 来自类加载器层次结构的警告 : Failed to scan <>. jar。 FileNotFoundException异常

标签 java google-app-engine build maven-3 dependency-management

所以我有我的项目: https://github.com/Leejjon/Blindpool

当我尝试从 IntelliJ 中的 Google App Engine 部署运行配置将它发布到 App Engine 时,它​​运行良好并且部署也很好。

但是我收到了很多警告(这只是一个):

Deploying '[2017-07-27 23:15:04] Maven build: Blindpool. Project: blindepoule. Version: 6'...
Created temporary staging directory: C:\Users\Leejjon\AppData\Local\Temp\gae-staging-blindepoule684
Reading application configuration data...
jul 27, 2017 11:15:06 PM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
INFO: Successfully processed C:\Users\Leejjon\IdeaProjects\Blindpool\target\blindpool-1.0-SNAPSHOT\WEB-INF\appengine-generated\datastore-indexes-auto.xml


Beginning interaction for module default...
0% Scanning for jsp files.
0% Compiling jsp files.
jul 27, 2017 11:15:07 PM org.apache.tomcat.util.scan.StandardJarScanner scan
WARNING: Failed to scan [file:/C:/Users/Leejjon/AppData/Local/Google/Cloud%2520SDK/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib/impl/appengine-api-labs.jar] from classloader hierarchy
java.io.FileNotFoundException: C:\Users\Leejjon\AppData\Local\Google\Cloud%20SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\java\lib\impl\appengine-api-labs.jar (The system cannot find the path specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:109)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89)
at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:47)
at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:36)
at org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan(TldScanner.java:301)
at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:313)
at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:245)
at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262)
at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:106)
at org.apache.jasper.JspC.initServletContext(JspC.java:1535)
at org.apache.jasper.JspC.execute(JspC.java:1378)
at com.google.appengine.tools.admin.LocalJspC.main(LocalJspC.java:33)

然后很多其他 jar 也会出现同样的异常,例如 javax.annotation-api-1.2.jar、asm-commons-5.0.1.jar、asm-5.0.1.jar、javax.transaction-api-1.2 .jar、javax.mail.glassfish-1.4.1.v201005082020.jar、org.apache.taglibs.taglibs-standard-spec-1.2.5.jar、org.apache.taglibs.taglibs-standard-impl-1.2.5 .jar 和其他大约 30 个。

但部署只是继续:

jul 27, 2017 11:15:08 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
jul 27, 2017 11:15:08 PM org.apache.jasper.JspC processFile
INFO: Built File: \index.jsp
2017-07-27 23:15:10.115:INFO::main: Logging initialized @175ms
2017-07-27 23:15:11.051:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=501ms
0% Generated git repository information file.
Success.
Temporary staging for module default directory left in C:\Users\Leejjon\AppData\Local\Temp\gae-staging-blindepoule684
Services to deploy:

descriptor:      [C:\Users\Leejjon\AppData\Local\Temp\gae-staging-blindepoule684\app.yaml]
source:          [C:\Users\Leejjon\AppData\Local\Temp\gae-staging-blindepoule684]
target project:  [blindepoule]
target service:  [default]
target version:  [6]
target url:      [https://blindepoule.appspot.com]


Beginning deployment of service [default]...
Some files were skipped. Pass `--verbosity=info` to see which ones.
You may also view the gcloud log file, found at
[C:\Users\Leejjon\AppData\Roaming\gcloud\logs\2017.07.27\23.15.12.062000.log].
#============================================================#
#= Uploading 4 files to Google Cloud Storage                =#
#============================================================#
File upload done.
Updating service [default]...
..............done.
Updating service [default]...
.Waiting for operation [apps/blindepoule/operations/5106d598-f760-4079-a358-4b2148c622cf] to complete...
..done.
done.
Deployed service [default] to [https://blindepoule.appspot.com]

You can stream logs from the command line by running:
  $ gcloud app logs tail -s default

To view your application in the web browser run:
  $ gcloud app browse
'[2017-07-27 23:15:04] Maven build: Blindpool. Project: blindepoule. Version: 6' has been deployed successfully.

如您所见,它完成得很好,我是否应该担心删除警告?

更新:发现谷歌要我们搬去使用云工具appengine maven插件: https://cloud.google.com/appengine/docs/standard/java/tools/migrate-maven

如果我使用推荐的设置并运行 gcloud appengine:deploy,我会得到与我之前在 IntelliJ 中得到的完全相同的错误。因此,使用旧的 appengine maven 插件是可行的,但它违背了 Google 的建议。

最佳答案

看来您需要在 pom.xml 中正确管理版本。某些插件在指定版本下不再可用。

我试过:

    <plugins>
    ...
        <plugin>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <!--<version>${appengine.target.version}</version>-->
            <version>1.8.3</version>
            <configuration>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <!--<version>${jetty.maven.plugin}</version>-->
            <version>9.4.0.v20161208</version>
        </plugin>
    </plugins>

而且我已经毫无问题地启动了服务器。


插件和依赖版本可能不同(因为转移版本或清理存储库)。您可以使用我指定的插件版本,或者如果您想对依赖项和插件使用相同的版本,则可以使用更多版本。


Connected to the target VM, address: '127.0.0.1:64711', transport: 'socket'
Jul 28, 2017 1:06:54 AM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Connected to server
Jul 27, 2017 10:06:54 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: jetty-6.1.x
Jul 27, 2017 10:06:55 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Started SelectChannelConnector@localhost:8080
Jul 27, 2017 10:06:55 PM com.google.appengine.tools.development.AbstractModule startup
INFO: Module instance default is running at http://localhost:8080/
Jul 27, 2017 10:06:55 PM com.google.appengine.tools.development.AbstractModule startup
INFO: The admin console is running at http://localhost:8080/_ah/admin
Jul 28, 2017 1:06:55 AM com.google.appengine.tools.development.DevAppServerImpl doStart
INFO: Dev App Server is now running

关于java - 来自类加载器层次结构的警告 : Failed to scan <>. jar。 FileNotFoundException异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45361491/

相关文章:

java - GWT 地点和 Activity - 获取重复的 UI

java - 我正在编译一个电子商务应用程序,但我在 gradle 控制台中收到以下错误

android - 尝试为 Android 构建 Xerces-C++

android - Android-构建失败,出现异常

swift - 如何创建具有不同 'Product Module Name' 和 'Product Name' 的项目并将其模块导入另一个项目?

java - 不知道如何迭代 forEach ArrayList 对象(购物车)中提供的 "items"

python - Google App Engine (Python) 中的简单 Facebook 连接

google-app-engine - GAE Cron Job 会等待之前的 Cron Job 完成后再运行吗?

google-app-engine - os.Open 在 AppEngine 上使用 Go

java - 服务器和浏览器的时间差