I am running a fat jar packaged by quarkus with jvm param -Duser.language=en
but it seems , not accepted by quarkus. Any suggestion / hints for solving this problem?
java -jar MyApp.jar -Duser.language=en
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-03-11 09:57:38,910 INFO [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2021-03-11 09:57:38,914 INFO [org.apa.cam.qua.mai.CamelMainRuntime] (main) Starting camel-quarkus with args: [-Duser.language=en]
Unknown option: -Duser.language=en
Try java -Duser.language=en -jar MyApp.jar.
Arguments before -jar are handled by the JVM, while arguments after -jar are supposed to be handled by the application.
Related
I'm trying to run an AWS Lambda using Docker image build by paketobuildpacks/builder using spring-native + spring-cloud-function-aws, but it's not handling incoming values, justs starts and returns an error, did I missed something?
Log output:
START RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10 Version: $LATEST
2021-06-30 00:20:58.229 INFO 8 --- [ main] o.s.nativex.NativeListener : This application is bootstrapped with code generated with Spring AOT
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.1)
2021-06-30 00:20:58.251 INFO 8 --- [ main] o.s.boot.SpringApplication : Starting application using Java 11.0.11 on 169.254.41.117 with PID 8 (started by sbx_user1051 in /workspace)
2021-06-30 00:20:58.251 INFO 8 --- [ main] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default
2021-06-30 00:20:58.551 INFO 8 --- [ main] o.s.boot.SpringApplication : Started application in 0.42 seconds (JVM running for 0.421)
END RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10
REPORT RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10 Duration: 840.41 ms Billed Duration: 841 ms Memory Size: 128 MB Max Memory Used: 29 MB
RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10 Error: Runtime exited without providing a reason
Runtime.ExitError
Find my configs below:
Gradle Plugins:
kotlin("jvm")
kotlin("plugin.spring")
id("io.spring.dependency-management")
id("org.springframework.boot")
id("org.springframework.experimental.aot")
id("org.graalvm.buildtools.native")
Dependencies:
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.springframework.cloud:spring-cloud-function-adapter-aws")
implementation("com.amazonaws:aws-lambda-java-events:2.0.2")
implementation("com.amazonaws:aws-lambda-java-core:1.1.0")
GraalVM plugin config:
tasks.withType<BootBuildImage> {
builder = "paketobuildpacks/builder:tiny"
environment = mapOf("BP_NATIVE_IMAGE" to "true")
}
App sources:
#SpringBootApplication
class LinkGeneratorApplication: ApplicationContextInitializer<GenericApplicationContext> {
override fun initialize(applicationContext: GenericApplicationContext) {
applicationContext.registerBean(
"function",
FunctionRegistration::class.java,
{
FunctionRegistration(Function<Input, Result> { Result("Here") })
.type(
FunctionType
.from(Input::class.java)
.to(Result::class.java)
.type
)
}
)
}
}
data class Input(val sellerId: String, val ownerId: String, val market: String)
data class Result(val message: String)
fun main(args: Array<String>) {
runApplication<LinkGeneratorApplication>(*args)
}
I am trying to output following ascii character art every time my terminal loads:
__ __ _
/ / / /___ ____ _____ _(_)
/ / / / __ \/ __ / /
/ /_/ / / / / /_/ / /_/ / /
\____/_/ /_/\__,_/\__, /_/
/____/
So I added following at the end of .bashrc:
echo " __ __ _
/ / / /___ ____ _____ _(_)
/ / / / __ \/ __ `/ __ `/ /
/ /_/ / / / / /_/ / /_/ / /
\____/_/ /_/\__,_/\__, /_/
/____/ "
And it prints:
It seems that it is misinterpreting slash in ascii art as escape sequence, that why it is printing -bash: /: Is a directory. How can I get rid of it? If I add something simple to .bashrc, like echo "Hello World!!", it does not print this error message.
Use the single quote instead:
echo \
' __ __ _
/ / / /___ ____ _____ _(_)
/ / / / __ \/ __ `/ __ `/ /
/ /_/ / / / / /_/ / /_/ / /
\____/_/ /_/\__,_/\__, /_/
/____/
'
Try like this:
text=(
' __ __ _'
' / / / /___ ____ _____ _(_)'
' / / / / __ \/ __ `/ __ `/ /'
'/ /_/ / / / / /_/ / /_/ / /'
'\____/_/ /_/\__,_/\__, /_/'
' /____/'
)
printf '%s\n' "${text[#]}"
For a multi-line text literal, a HereDoc is very appropriate:
# Use a quoted heredoc 'marker' to disable expansion of backticks
cat <<'LOGO'
__ __ _
/ / / /___ ____ _____ _(_)
/ / / / __ \/ __ `/ __ `/ /
/ /_/ / / / / /_/ / /_/ / /
\____/_/ /_/\__,_/\__, /_/
/____/
LOGO
Un-quoted heredoc marker:
cat <<EOF
hello `echo world`
EOF
Output:
hello world
Quoted heredoc 'marker':
cat <<'EOF'
hello `echo world`
EOF
Output:
hello `echo world`
In CI part most of the times I prefer standard maven phases to execute build steps. In these cases I override application.properties e.g.: -Dlogging.level.root=OFF -Dspring.main.banner-mode=off to turn off debugging logs and save some precious build time.
In some pipelines I prefer to use maven release plugin and I noticed that these flags does not work there.
e.g.: mvn release:prepare -Dspring.main.banner-mode=off
[INFO]
[INFO] . ____ _ __ _ _
[INFO] /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
[INFO] ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[INFO] \\/ ___)| |_)| | | | | || (_| | ) ) ) )
[INFO] ' |____| .__|_| |_|_| |_\__, | / / / /
[INFO] =========|_|==============|___/=/_/_/_/
[INFO] :: Spring Boot :: (v2.1.4.RELEASE)
[INFO]
Still display spring banner
Any suggestion?
I am calling app.setBannerMode(Banner.Mode.OFF); in my application but I still get a banner.
My code:
SpringApplication app = new SpringApplication(MyApp.class);
app.setBannerMode(Banner.Mode.OFF);
app.setAdditionalProfiles("foobar");
Output:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.8.RELEASE)
Expected output:
(nothing)
What could be causing this?!
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.3.3.RELEASE)
(application stops after main class execution.)