1
votes

I checked out this sample Jetty-gradle bases server app, https://github.com/rominirani/GradleWebAppSample on my raspberry pi, in hope to get a java server running. However the build fails with below error:

pi@raspberrypi:~/projects/ixrobotserver2.0 $ gradle build :utils:compileJava UP-TO-DATE :utils:processResources UP-TO-DATE :utils:classes UP-TO-DATE :utils:jar FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':utils:jar'.

    Could not add file '/home/pi/projects/ixrobotserver2.0/utils/build/classes/main/com' to ZIP '/home/pi/projects/ixrobotserver2.0/utils/build/libs/utils.jar'.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 59.558 secs

  • I have confirmed that it's not a permission issue. chmod-ed 777 to entire workspace and it still doesn't work.

  • I have confirmed that the directory (/home/pi/projects/ixrobotserver2.0/utils/build/classes/main/com) and file (/home/pi/projects/ixrobotserver2.0/utils/build/libs/utils.jar) both exist.

  • I have confirmed that the build succeeds on my mac.

Complete Stack trace (in debug mode): Available at http://www.heypasteit.com/clip/0IIKXC

Truncated stack trace:

22:35:22.774 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on task artifact state cache (/home/pi/projects/ixrobotserver2.0/.gradle/1.5/taskArtifacts).
22:35:22.789 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
22:35:22.802 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':utils:jar'
22:35:22.815 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :utils:jar FAILED
22:35:22.864 [ERROR] [org.gradle.BuildExceptionReporter]
22:35:22.880 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:35:22.895 [ERROR] [org.gradle.BuildExceptionReporter]
22:35:22.905 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
22:35:22.917 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':utils:jar'.
22:35:22.929 [ERROR] [org.gradle.BuildExceptionReporter] > Could not add file '/home/pi/projects/ixrobotserver2.0/utils/build/classes/main/com' to ZIP '/home/pi/projects/ixrobotserver2.0/utils/build/libs/utils.jar'.
22:35:22.967 [ERROR] [org.gradle.BuildExceptionReporter]
22:35:22.977 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
22:35:23.011 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':utils:jar'.
22:35:23.022 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:72)
22:35:23.034 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:49)
22:35:23.046 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute
....
22:35:23.717 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.GradleException: Could not add file '/home/pi/projects/ixrobotserver2.0/utils/build/classes/main/com' to ZIP '/home/pi/projects/ixrobotserver2.0/utils/build/libs/utils.jar'.
22:35:23.730 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.file.archive.ZipCopySpecVisitor.visitDir(ZipCopySpecVisitor.java:74)
22:35:23.742 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.file.copy.NormalizingCopySpecVisitor.maybeVisit(NormalizingCopySpecVisitor.java:65)
22:35:24.037 [ERROR] [org.gradle.BuildExceptionReporter]    ... 57 more
22:35:24.046 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.UnsupportedOperationException: No such file or directory - /home/pi/projects/ixrobotserver2.0/utils/build/classes/main/com
22:35:24.057 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.PosixUtil$POSIXHandlerImpl.error(PosixUtil.java:38)
22:35:24.067 [ERROR] [org.gradle.BuildExceptionReporter]    at org.jruby.ext.posix.JavaLibCHelper.stat(JavaLibCHelper.java:186)
22:35:24.076 [ERROR] [org.gradle.BuildExceptionReporter]    at org.jruby.ext.posix.JavaPOSIX.stat(JavaPOSIX.java:223)
22:35:24.085 [ERROR] [org.gradle.BuildExceptionReporter]    at org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:227)
22:35:24.095 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.LibCStat.getUnixMode(LibCStat.java:41)
22:35:24.104 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.GenericFileSystem.getUnixMode(GenericFileSystem.java:62)
22:35:24.114 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.file.DefaultFileTreeElement.getMode(DefaultFileTreeElement.java:66)
22:35:24.124 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.file.copy.MappingCopySpecVisitor$FileVisitDetailsImpl.getMode(MappingCopySpecVisitor.java:164)
22:35:24.134 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.file.archive.ZipCopySpecVisitor.visitDir(ZipCopySpecVisitor.java:70)
22:35:24.144 [ERROR] [org.gradle.BuildExceptionReporter]    ... 82 more
22:35:24.153 [ERROR] [org.gradle.BuildExceptionReporter]
22:35:24.161 [LIFECYCLE] [org.gradle.BuildResultLogger]
22:35:24.170 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
22:35:24.180 [LIFECYCLE] [org.gradle.BuildResultLogger]
22:35:24.189 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 1 mins 3.162 secs
22:35:24.211 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on task artifact state cache (/home/pi/projects/ixrobotserver2.0/.gradle/1.5/taskArtifacts).
...
22:35:24.384 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@1e02678, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@fdc382, org.gradle.logging.internal.JavaUtilLoggingConfigurer@2e9485]
1
Did you try running with --stacktrace as the output suggests? A stacktrace will contain the exact error that is occurring, and will help both you and us. Try running with that option and post the output there.BackSlash
@BackSlash Though I've found the issue and posted an answer, I've added the stacktrace in the question for completeness. Thanks for the suggestion.Sanjay Verma

1 Answers

0
votes

I upgraded my gradle to 3.5 (from 1.5) and the error is gone. The problem happened because Raspbian's apt-get installs the gradle 1.5 version by default.