gradle bootdebug: application fails to start and build fails - java

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"

Related

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

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)

gradlew genSource command in terminal is not working

I am trying to make a Minecraft mod but when I need to do
.\gradlew genSource it keeps showing this error:
Fabric Loom: 0.10.66
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain
Could not write standard input to Gradle Worker Daemon 3.
java.io.IOException: The pipe is being closed
at java.base/java.io.FileOutputStream.writeBytes(Native Method)
at java.base/java.io.FileOutputStream.write(FileOutputStream.java:349)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:68)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
at java.base/java.lang.Thread.run(Thread.java:833)
> Task :genSourcesWithCfr FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':genSourcesWithCfr'.
> Failed to stop decompile worker JVM
* 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 3s
2 actionable tasks: 1 executed, 1 up-to-date
and I have no idea how to fix it :(. I've tried other methods but still it does not work

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

Task :runners:google-cloud-dataflow-java:validatesRunnerLegacyWorkerTest FAILED

I am new to Apache beam, I have been following https://cloud.google.com/docs/authentication/getting-started#setting_the_environment_variable to run tests over Cloud Data flow.
When I execute ./gradlew :runners:google-cloud-dataflow-java:validatesRunnerLegacyWorkerTest --tests "org.apache.beam.sdk.transforms.ParDoTest$OnWindowExpirationTests" --scan
I have been getting
org.apache.beam.sdk.transforms.ParDoTest$OnWindowExpirationTests > testOnWindowExpirationSimpleBounded FAILED
java.lang.RuntimeException at ParDoTest.java:5544
Caused by: java.lang.reflect.InvocationTargetException at ParDoTest.java:5544
Caused by: java.lang.RuntimeException at ParDoTest.java:5544
Task :runners:google-cloud-dataflow-java:validatesRunnerLegacyWorkerTest FAILED
The problem was i did not set GOOGLE_APPLICATION_CREDENTIALS values. After setting the value properly, i worked for me.
export GOOGLE_APPLICATION_CREDENTIALS="/home/vend/Downloads/credentials.json"

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.

Categories

Resources