IntelliJ running a program with Gradle, "failed at task :Run" error - java

Here is the error that I am getting whenever I try to run my program with Gradle. (I am on a linux ubuntu system, if that matters) I am using a JDK 11 version to run this.
Execution failed for task ':run'.
> Process 'command '/home/dex/Downloads/jdk-11.0.13/bin/java'' finished with non-zero exit value 1
Exception -
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':run'
Caused by: org.gradle.process.internal.ExecException: Process 'command '/home/dex/Downloads/jdk-11.0.13/bin/java'' finished with non-zero exit value 1
UPDATED (./gradlew run command)
> Configure project :
Project : => no module-info.java found
> Task :compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :run FAILED
Redirected Output: logs/master_log_3_9_2022_10_38_38.txt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/usr/lib/jvm/java-11-openjdk-amd64/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
5 actionable tasks: 3 executed, 2 up-to-date
From --debug(Only posted info that was in red)
2022-03-09T13:01:57.117-0500 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 4s
2022-03-09T13:01:57.116-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2022-03-09T13:01:56.807-0500 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :run FAILED
2022-03-09T13:01:57.116-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process 'command '/usr/lib/jvm/java-11-openjdk-amd64/bin/java'' finished with non-zero exit value 1
From log master file
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at Main.main(Main.java:210)
at KioskApp.main(KioskApp.java:5)

Related

CAS could not starting from cas-overlay-template

I am trying to install apereo CAS 7 from cas-overlay-template on my localhost I already install jdk 17 and already follow instructions there and generating thekeystores and cert files but no file named cas.properites created and when I'm trying to run the project this errer thrown
> Task :run FAILED
Error: Could not find or load main class Files\dotnet\;C:\Program
Caused by: java.lang.ClassNotFoundException: Files\dotnet\;C:\Program
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\lenovo\Desktop\cas\cas-overlay-template\gradle\tasks.gradle' line: 28
* What went wrong:
Execution failed for task ':run'.
> Process 'command 'C:\Program Files\Java\jdk-17\bin\java.exe'' finished with non-zero exit value 1

Jenkins Build failing after integration with Selenium tests

Am trying to integrate our Testng Selenium tests into the Jenkins build queue using Build Gradle Test, currently failing with unreachable exception error. Its a freestyle build, with Invoke Gradle Script as the build step. Please find the console output in the below:
Build Gradle file:
**
Build Failure Logs:
**
[Gradle] - Launching build.
[QaAutomationWeb] $ /var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/Gradle_6.5.1/bin/gradle test
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
Task :compileJava UP-TO-DATE
Task :processResources NO-SOURCE
Task :classes UP-TO-DATE
Task :compileTestJava
Task :processTestResources UP-TO-DATE
Task :testClasses
Task :test
FBMS-Modernization Tests > Regression Tests > com.fbms.test.LoginTest > getDriver FAILED
org.openqa.selenium.remote.UnreachableBrowserException at RemoteWebDriver.java:589
Caused by: org.openqa.selenium.WebDriverException at DriverService.java:165
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException at UrlChecker.java:104
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException at SimpleTimeLimiter.java:143
Caused by: java.util.concurrent.TimeoutException at FutureTask.java:205
5 tests completed, 1 failed, 4 skipped
Task :test FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':test'.
There were failing tests. See the report at: file:///var/jenkins_home/workspace/QaAutomationWeb/build/reports/tests/test/index.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 38s
4 actionable tasks: 2 executed, 2 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE

Execution failed for task ':compileGroovy'. org.springframework.security.authentication.encoding.PasswordEncoder

I have an issue with starting my project after the upgrade of IDEA.
Current error is the following:
CONFIGURE SUCCESSFUL in 2s
|Running application...
> Task :compileJava NO-SOURCE
startup failed:
General error during semantic analysis: java.lang.NoClassDefFoundError: org.springframework.security.authentication.encoding.PasswordEncoder
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.springframework.security.authentication.encoding.PasswordEncoder
at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1118)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1098)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:645)
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileGroovy'.
> Task :compileGroovy FAILED
Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:207)
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
If I try to clean and run-app I get the following:
| Running application...
<-------------> 0% WAITING
IDLE
startup failed:
General error during semantic analysis: java.lang.NoClassDefFoundError: org.springframework.security.authentication.encoding.PasswordEncoder
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileGroovy'.
Compilation failed; see the compiler error output for details.
Tried everything I know, project settings, clean cache, invalidate cache and restart... nothing is helping.
I have found a solution:
grails.plugin.springsecurity.authentication.encoding.BCryptPasswordEncoder - using deprecated classes
class CryptoEncoderWrapper implements org.springframework.security.authentication.encoding.PasswordEncoder
you need to change build.gradle to:
compile 'org.grails.plugins:spring-security-core:4.0.0'
BCrypt now has this import
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
Now, this issue is resolved but leads to other issues.

"bootRun" task in Gradle - FAILURE: Build failed with an exeption

I am follwoing this tutorial
https://auth0.com/blog/integrating-spring-data-jpa-postgresql-liquibase/
at the moment.
But I have some problems with Gradle... Everytime when I try to run the project with "./gradlew bootRun" it returns an error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command 'C:\Program Files\Java\jdk-10.0.2\bin\java.exe'' finished wit
h non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 44s
4 actionable tasks: 2 executed, 2 up-to-date
I'm running Java 10.0.2 and Gradle 4.10.1.
I appreciate any kind of help!

gradle bootdebug: application fails to start and build fails

I am trying to run my backend project to invoke an API to get the data of a patient within our HOMOL environment
Unfortunately when in try to run the command "gradle bootrun/bootdebug/runapp", my gradle throws up the following error.
This is bugging me from a week now and still i am clueless as of what i am missing here.
Any help to solve this?
"Exception:
C:\Java\Projects\process tasy\tasy-tws\tasy-tws-backend\tws-backend\philips-ms-exam>gradle runapp
:philips-ms-commons:compileJava UP-TO-DATE
:philips-ms-commons:processResources UP-TO-DATE
:philips-ms-commons:classes UP-TO-DATE
:philips-ms-commons:jar
:philips-ms-app-boot:compileJava
:philips-ms-app-boot:processResources UP-TO-DATE`enter code here`
:philips-ms-app-boot:classes
:philips-ms-app-boot:jar
:philips-ms-exam:compileBootJava UP-TO-DATE
:philips-ms-exam:processBootResources UP-TO-DATE
:philips-ms-exam:bootClasses UP-TO-DATE
:philips-ms-exam:compileJava
:philips-ms-exam:processResources UP-TO-DATE
:philips-ms-exam:classes
:philips-ms-exam:pathingJar
:philips-ms-exam:bootRun
Exception in thread "main" com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error instantiating application
1 error
at com.philips.app.boot.PhilipsBoot.main(PhilipsBoot.java:33)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error instantiating main module
1 error
at com.philips.app.boot.PhilipsInjector.loadMainModule(PhilipsInjector.java:174)
at com.philips.app.boot.PhilipsInjector.<init>(PhilipsInjector.java:35)
at com.philips.app.boot.PhilipsInjector.fromParams(PhilipsInjector.java:45)
at com.philips.app.boot.PhilipsBoot.main(PhilipsBoot.java:29)
Caused by: java.lang.ClassNotFoundException: com.philips.tws.boot.GuiceModule
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.philips.app.boot.PhilipsInjector.loadMainModule(PhilipsInjector.java:170)
... 3 more
:philips-ms-exam:bootRun FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':philips-ms-exam:bootRun'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 1
* 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: 45.38 secs"

Categories

Resources