You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use the @QuarkusMain annotation with main method, the application fails to start with a NPE mentioning that the app is null.
Below is our class:
@QuarkusMainpublicclassMainimplementsQuarkusApplication {
staticLoggerlogger = Logger.getLogger(FlinkTestJob.class.getName());
@InjectFlinkTestJobflinkTestJob;
publicstaticvoidmain(String[] args) throwsException {
Quarkus.run(Main.class, args);
}
publicvoidrun() throwsException {
logger.info("Going to run method with FlinkTestJob: "+flinkTestJob);
flinkTestJob.run();
}
@Overridepublicintrun(String... args) throwsException {
logger.info("Going to run method with FlinkTestJob Quarkus Run: "+flinkTestJob);
flinkTestJob.run();
Quarkus.waitForExit();
return0;
}
}
When I run this application, I get the below error:
Exception:
Exception in thread "Shutdown thread" java.lang.NullPointerException: Cannot invoke "io.quarkus.runtime.Application.isStarted()" because "app" is null
at io.quarkus.runtime.ApplicationLifecycleManager$ShutdownHookThread.run(ApplicationLifecycleManager.java:455)
How are we running it:
We are creating a package using mvn clean install, then then using flink to run this class. Will that have an impact on the app being null?
Expected behavior
We'd be able to run the application without any problems. As we are inject FlinkTestJob in the Main class, we'd be able to call FlinkTestJob::run method.
Actual behavior
The application fails to start with exception:
Exception in thread "Shutdown thread" java.lang.NullPointerException: Cannot invoke "io.quarkus.runtime.Application.isStarted()" because "app" is null
at io.quarkus.runtime.ApplicationLifecycleManager$ShutdownHookThread.run(ApplicationLifecycleManager.java:455)
How to Reproduce?
No response
Output of uname -a or ver
No response
Output of java -version
openjdk version "21.0.4" 2024-07-16
OpenJDK Runtime Environment Homebrew (build 21.0.4)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.4, mixed mode, sharing)
Quarkus version or git rev
3.13.3
Build tool (ie. output of mvnw --version or gradlew --version)
mvn --version:
Maven home: /opt/homebrew/Cellar/maven/3.9.9/libexec
Java version: 21.0.4
OS name: "mac os x", version: "14.5", arch: "aarch64", family: "mac"
Additional information
We are trying to run the created jar with flink application.
Command used: ./flink run -c com.flink.Main -d flink/target/flink-stream-processor-1.0.0-SNAPSHOT-runner.jar
The text was updated successfully, but these errors were encountered:
Yeah, looks similar. Maybe we can close this one as a duplicate. I see that the ticket is merged into 3.14 and 3.13 main. But is it released, or will that take some more time?
Describe the bug
When trying to use the @QuarkusMain annotation with main method, the application fails to start with a NPE mentioning that the app is null.
Below is our class:
When I run this application, I get the below error:
Exception:
How are we running it:
We are creating a package using mvn clean install, then then using flink to run this class. Will that have an impact on the app being null?
Expected behavior
We'd be able to run the application without any problems. As we are inject FlinkTestJob in the Main class, we'd be able to call FlinkTestJob::run method.
Actual behavior
The application fails to start with exception:
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
Quarkus version or git rev
3.13.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn --version:
Additional information
We are trying to run the created jar with flink application.
Command used:
./flink run -c com.flink.Main -d flink/target/flink-stream-processor-1.0.0-SNAPSHOT-runner.jar
The text was updated successfully, but these errors were encountered: