Vaadin + springBoot:Build上的IllegalStateException

时间:2016-01-18 10:30:50

标签: java gradle spring-boot vaadin spring-boot-gradle-plugin

我正在开发一个使用springBoot引导的Vaadin应用程序。 当我今天早上尝试构建应用程序时(自上次成功构建以来没有执行任何更改),我得到了以下stacktrace:

Using Gradle Vaadin Plugin 0.10.5
:compileJava UP-TO-DATE
:vaadinUpdateWidgetset FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':vaadinUpdateWidgetset'.
> String index out of range: 1

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task     ':vaadinUpdateWidgetset'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
...
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1
    at java_lang_String$replaceAll$2.call(Unknown Source)
    at fi.jasoft.plugin.tasks.UpdateWidgetsetTask.ensureWidgetPresent(UpdateWidgetsetTask.groovy:60)
    at fi.jasoft.plugin.tasks.UpdateWidgetsetTask.ensureWidgetPresent(UpdateWidgetsetTask.groovy)
    at fi.jasoft.plugin.tasks.UpdateWidgetsetTask$ensureWidgetPresent.callStatic(Unknown Source)
    at fi.jasoft.plugin.tasks.UpdateWidgetsetTask.run(UpdateWidgetsetTask.groovy:46)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)

BUILD FAILED

Total time: 9.743 secs
Exception in thread "Thread-3" java.lang.IllegalStateException: Shutdown in progress
    at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82)
    at java.lang.Runtime.removeShutdownHook(Runtime.java:237)
    at java_lang_Runtime$removeShutdownHook$2.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at fi.jasoft.plugin.tasks.SuperDevModeTask$_closure1.doCall(SuperDevModeTask.groovy:44)
    at fi.jasoft.plugin.tasks.SuperDevModeTask$_closure1.doCall(SuperDevModeTask.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
    at groovy.lang.Closure.call(Closure.java:426)
    at groovy.lang.Closure.call(Closure.java:420)
    at groovy.lang.Closure.run(Closure.java:507)
    at java.lang.Thread.run(Thread.java:722)

这种行为的原因是什么?我已经尝试删除build和widgetset文件夹,结果相同。 这可能是与最近的依赖关系更新有关的问题吗? 提前谢谢!

2 个答案:

答案 0 :(得分:2)

我是一个maven用户,因此gradle不是我的 forte 。尽管如此,堆栈跟踪& sources表示生成widgetset文件名时gradle-vaadin-plugin失败。

我可以{昨天发布see that a new version of the plugin,并且(也许我错了)它可能是the fix for issue #218引入的回归。我怀疑你可能会盲目地继承昨天发布的最新版本0.10.5,包括上面提到的修复,因此如果可能的话,我建议:

  • 强制使用旧版本的插件,例如0.10.4
  • 尝试在tracker上打开一个问题,包括有关您环境和环境的详细信息。配置(也许是这个问题的链接)

注意:这可能更适合作为评论,但它不适合一个

答案 1 :(得分:0)

这是由gradle-vaadin-plugin中的0.10.5中的错误引起的。

此问题已在https://github.com/johndevs/gradle-vaadin-plugin/issues/225中报告,并将在0.10.6中修复。

如果您遇到这种情况,只需在build.gradle中使用以下网址降级到0.10.4

server {
  listen 80;

  server_name my.server.com;

  root /u/apps/my_client_production/current;
  index index.html;

  # ~2 seconds is often enough for most folks to parse HTML/CSS and
  # retrieve needed images/icons/frames, connections are cheap in
  # nginx so increasing this is generally safe...
  keepalive_timeout 10;
  client_max_body_size 100M;

  access_log /u/apps/my_client_production/shared/log/nginx.access.log;
  error_log /u/apps/my_client_production/shared/log/nginx.error.log info;

  location / {
    try_files $uri $uri/ =404;

    gzip_static on;
    expires max;
    add_header  Cache-Control public;

  }

  # Error pages
  error_page 500 502 503 504 /500.html;
}