Deploy Jhipster on clevercloud - maven

I'm deploying a Jhipster application on Clevercloud.
I have set up some configuration:
war.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"goal": "package -Pprod -DskipTests",
"container": "TOMCAT8",
"war": [
{
"file": "target/myapp-1.0.0.war"
}
]
}
}
maven.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"goal": "package -Pprod -DskipTests"
}
}
I have modified the application-prod.yml to include the url/username/password of the db add-on.
When I deploy, the deployment is successfull but the application is not running.
On the application page I have 404 error.
The DB is correctly initialised.
In the logs I have the following messages that I don't understand or I'm not able to solve:
multiple times this message
2017-09-18T09:21:22.701Z: 09:21:21.483 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.exception-conversion-word]
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.exception-conversion-word] not found - trying original name [logging.exception-conversion-word]. javax.naming.NameNotFoundException: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.exception-conversion-word]
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiPropertySource - JNDI lookup for name [logging.exception-conversion-word] threw NamingException with message: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].. Returning null.
then:
2017-09-18T09:21:22.777Z: [09:21:12.705][debug][talledLocalContainer] Connection attempt with socket Socket[unconnected], current time is 1505726472705
2017-09-18T09:21:22.778Z: [09:21:12.705][debug][talledLocalContainer] Socket Socket[unconnected] for port 8009 closed
2017-09-18T09:21:22.778Z: [09:21:13.068][debug][talledLocalContainer] Executing '/usr/x86_64-pc-linux-gnu/lib/icedtea8/jre/bin/java' with arguments:
2017-09-18T09:21:22.778Z: '-version'
2017-09-18T09:21:22.778Z: The ' characters around the executable and arguments are
2017-09-18T09:21:22.778Z: not part of the command.
2017-09-18T09:21:22.779Z: [09:21:13.085][debug][talledLocalContainer] Output appended to /tmp/cargo-jvm-version-4176730048875251522.txt
2017-09-18T09:21:22.779Z: [09:21:13.085][debug][talledLocalContainer] Error appended to /tmp/cargo-jvm-version-4176730048875251522.txt
2017-09-18T09:21:22.779Z: [09:21:13.086][debug][talledLocalContainer] Project base dir set to: /home/bas/app_4b724c3b-6703-474e-9ec4-65d775cd0013
2017-09-18T09:21:22.779Z: [09:21:13.086][debug][talledLocalContainer] Execute:Java13CommandLauncher: Executing '/usr/x86_64-pc-linux-gnu/lib/icedtea8/jre/bin/java' with arguments:
2017-09-18T09:21:22.779Z: '-version'
2017-09-18T09:21:22.779Z: The ' characters around the executable and arguments are
2017-09-18T09:21:22.779Z: not part of the command.
And multiples times:
2017-09-18T09:21:22.793Z: [09:21:13.416][debug][URLDeployableMonitor] Checking URL [http://localhost:8080/cargocpc/index.html] for status using a timeout of [120000] ms...
2017-09-18T09:21:22.794Z: [09:21:13.452][debug][URLDeployableMonitor] URL [http://localhost:8080/cargocpc/index.html] is not responding: -1 java.net.ConnectException: Connection refused (Connection refused)
2017-09-18T09:21:22.794Z: [09:21:13.452][debug][URLDeployableMonitor] Notifying monitor listener [org.codehaus.cargo.container.spi.deployer.DeployerWatchdog#7bd4937b]
Ending with:
2017-09-18T09:21:32.710Z: 2017-09-18 09:21:28.724 INFO 2232 --- [ost-startStop-1] com.bbs.dm.config.WebConfigurer : Web application configuration, using profiles: prod
2017-09-18T09:21:32.711Z: 2017-09-18 09:21:28.735 INFO 2232 --- [ost-startStop-1] com.bbs.dm.config.WebConfigurer : Web application fully configured
2017-09-18T09:21:32.711Z: 2017-09-18 09:21:28.994 DEBUG 2232 --- [ost-startStop-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Starting Liquibase synchronously
2017-09-18T09:21:36.985Z: Nothing listening on 8080. Please update your configuration and redeploy
2017-09-18T09:21:52.730Z: 2017-09-18 09:21:47.492 DEBUG 2232 --- [ost-startStop-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Started Liquibase in 18498 ms
2017-09-18T09:21:57.985Z: Application start successful
2017-09-18T09:21:57.985Z: No cron to setup
2017-09-18T09:21:57.986Z: Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agentd.service → /usr/x86_64-pc-linux-gnu/lib/systemd/system/zabbix-agentd.service.
I have done nothing else except following Clevercloud documentation to deploy
Have I miss something in the configuration?
(For info, the application is deploying well on other platform like Heroku or Pivotal)

To deploy a jhipster application on Clevercloud.
Here is what worked for me.
I have followed the indications given to create an application and deploy it using the CLI
Configuration files:
clevercloud/war.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"jarName": "target/myapp-1.0.0.war"
}
}
clevercloud/maven.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"goal": "package -Pprod -DskipTests"
}
}
I modified my application-prod.yml to link the db.

Related

IntelliJ Idea command line code inspection fails

I am trying to set up command line code inspection with IntelliJ Idea, but the program seems to crash. The project builds with Gradle.
I get the following errors (full stack trace below)
2022-11-11 09:17:13,214 [ 15890] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - Gradle resolve failure <unnamed>:0
com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
It is not clear which directory it is trying to access, and I have not been able to reproduce this error by calling Gradle directly. This error also appears when I run Idea graphically, and it seems to work just fine so it might be a red herring. But in that case I have no idea what's wrong.
Any help pointing me in the right direction would be very welcome!
build.gradle:
plugins {
id 'application'
id 'java-library'
}
repositories {
maven {
url '/opt/java-deps'
}
}
dependencies {
implementation 'org.apache.commons:commons-csv:1.8'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.junit.jupiter:junit-jupiter:5.7.2'
}
sourceSets {
main {
java {
srcDirs = ['src', 'generated']
}
resources {
srcDirs = ['src']
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Werror" << "-Xlint:all"
}
tasks.withType(Javadoc) {
options {
showAll()
// https://github.com/gradle/gradle/issues/2354
addStringOption("Xwerror", "-quiet")
}
}
}
test {
useJUnitPlatform()
}
application {
mainClass = 'tests.Main'
}
settings.gradle:
rootProject.name = 'vt'
Stack trace (some of the stack traces are trimmed due to post size limits):
vkl#debian:~/*$ idea inspect . .idea/inspections/Project_Default.xml inspection
2022-11-11 09:16:59,517 [ 2193] WARN - #c.i.n.i.NotificationGroupManagerImpl - Notification group CodeWithMe is already registered (group=com.intellij.notification.NotificationGroup#52ca8e3). Plugin descriptor: PluginDescriptor(name=Code With Me, id=com.jetbrains.codeWithMe, descriptorPath=plugin.xml, path=/opt/intellij_idea/plugins/cwm-plugin, version=221.5591.52, package=null, isBundled=true)
Info | RdCoroutineScope | 10:JobScheduler FJ pool 0/4 | RdCoroutineHost overridden
2022-11-11 09:17:09,115 [ 11791] SEVERE - #c.i.o.a.i.FlushQueue - null
java.awt.HeadlessException
at java.desktop/javax.swing.JTree.checkDragEnabled(JTree.java:1222)
at java.desktop/javax.swing.JTree.setDragEnabled(JTree.java:1216)
at com.intellij.openapi.vcs.changes.ui.ChangesListView.<init>(ChangesListView.java:59)
at com.intellij.openapi.vcs.changes.ChangesViewPanel$MyChangesListView.<init>(ChangesViewPanel.kt:89)
at com.intellij.openapi.vcs.changes.ChangesViewPanel.<init>(ChangesViewPanel.kt:30)
at com.intellij.openapi.vcs.changes.ChangesViewManager$ChangesViewToolWindowPanel.<init>(ChangesViewManager.java:353)
at com.intellij.openapi.vcs.changes.ChangesViewManager.initToolWindowPanel(ChangesViewManager.java:179)
at com.intellij.openapi.vcs.changes.ChangesViewManager.updateCommitWorkflow(ChangesViewManager.java:272)
at com.intellij.openapi.vcs.changes.ChangesViewManager.lambda$new$0(ChangesViewManager.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:639)
at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:621)
at com.intellij.util.messages.impl.MessageBusImpl.access$300(MessageBusImpl.java:34)
at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.executeOrAddToQueue(MessageBusImpl.java:209)
at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl.access$scheduleWithinConstraints$s1153900543(BaseExpirableExecutorMixinImpl.kt:12)
at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl$scheduleWithinConstraints$$inlined$Runnable$1.run(Runnable.kt:19)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
at
...
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2022-11-11 09:17:09,137 [ 11813] SEVERE - #c.i.o.a.i.FlushQueue - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:09,139 [ 11815] SEVERE - #c.i.o.a.i.FlushQueue - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:09,141 [ 11817] SEVERE - #c.i.o.a.i.FlushQueue - OS: Linux
2022-11-11 09:17:09,671 [ 12347] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,675 [ 12351] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,676 [ 12352] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,677 [ 12353] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,679 [ 12355] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,680 [ 12356] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,682 [ 12358] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,685 [ 12361] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,700 [ 12376] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,719 [ 12395] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored files under another root: 48 files total
2022-11-11 09:17:12,825 [ 15501] WARN - #c.a.t.i.g.p.s.i.SyncIssueUsageReporterImpl - Multiple sync failures reported. Discarding: SDK_BUILD_TOOLS_TOO_LOW
2022-11-11 09:17:13,214 [ 15890] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - Gradle resolve failure <unnamed>:0
com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionErrorHandler.createUserFriendlyError(GradleExecutionErrorHandler.java:197)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:46)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.doGetUserFriendlyError(BaseProjectImportErrorHandler.java:167)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:48)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.checkErrorsWithoutQuickFixes(BaseProjectImportErrorHandler.java:62)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.getUserFriendlyError(GradleProjectResolver.java:877)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:806)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:775)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$0(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.maybeFixSystemProperties(GradleExecutionHelper.java:165)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$1(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.GradleConnectorService$Companion.withGradleConnection(GradleConnectorService.kt:181)
at org.jetbrains.plugins.gradle.GradleConnectorService.withGradleConnection(GradleConnectorService.kt)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:130)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:154)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:74)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:43)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:36)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:48)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:115)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:135)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:491)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$0(ExternalSystemUtil.java:327)
at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:190)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:327)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressInCurrentThread$10(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressInCurrentThread(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:381)
at com.intellij.openapi.progress.Task.queue(Task.java:119)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:616)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:282)
at com.intellij.openapi.externalSystem.service.project.autoimport.ProjectAware.reloadProject(ProjectAware.kt:62)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.reloadProject(AutoImportProjectTracker.kt:141)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.access$reloadProject(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:76)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:103)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.update.PriorityEatUpdate$Companion$invoke$1.run(PriorityEatUpdate.kt:15)
at com.intellij.util.ui.update.MergingUpdateQueue.queue(MergingUpdateQueue.java:347)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.schedule(AutoImportProjectTracker.kt:98)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.scheduleProjectRefresh(AutoImportProjectTracker.kt:76)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.importProjects(GradleCommandLineProjectConfigurator.kt:95)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:75)
at com.intellij.codeInspection.InspectionApplicationBase.configureProject(InspectionApplicationBase.java:462)
at com.intellij.codeInspection.InspectionApplicationBase.lambda$runUnderProgress$22(InspectionApplicationBase.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.codeInspection.InspectionApplicationBase.runUnderProgress(InspectionApplicationBase.java:697)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysis(InspectionApplicationBase.java:492)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysisOnScope(InspectionApplicationBase.java:449)
at ...
2022-11-11 09:17:13,227 [ 15903] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:13,228 [ 15904] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:13,229 [ 15905] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - OS: Linux
2022-11-11 09:17:13,266 [ 15942] WARN - #c.a.t.i.g.p.s.GradleSyncState - Gradle sync failed in 2 s 236 ms. The project directory does not exist!
2022-11-11 09:17:15,351 [ 18027] SEVERE - #c.i.c.InspectionApplicationBase - java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator$StateNotificationListener.waitForImportEnd(GradleCommandLineProjectConfigurator.kt:196)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:76)
at com.intellij.codeInspection.InspectionApplicationBase.configureProject(InspectionApplicationBase.java:462)
at com.intellij.codeInspection.InspectionApplicationBase.lambda$runUnderProgress$22(InspectionApplicationBase.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.codeInspection.InspectionApplicationBase.runUnderProgress(InspectionApplicationBase.java:697)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysis(InspectionApplicationBase.java:492)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysisOnScope(InspectionApplicationBase.java:449)
at com.intellij.codeInspection.InspectionApplicationBase.run(InspectionApplicationBase.java:221)
at com.intellij.codeInspection.InspectionApplicationBase.execute(InspectionApplicationBase.java:159)
at com.intellij.codeInspection.InspectionApplicationBase.startup(InspectionApplicationBase.java:123)
at com.intellij.codeInspection.InspectionMain.main(InspectionMain.java:115)
at com.intellij.openapi.application.ApplicationStarter.main(ApplicationStarter.java:52)
at com.intellij.idea.ApplicationLoader$initApplication$4.accept(ApplicationLoader.kt:176)
at com.intellij.idea.ApplicationLoader$initApplication$4.accept(ApplicationLoader.kt)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1742)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator$StateNotificationListener.onFailure(GradleCommandLineProjectConfigurator.kt:179)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$TaskListenerWrapper.onFailure(ExternalSystemProgressNotificationManagerImpl.kt:106)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:120)
at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:85)
at com.sun.proxy.$Proxy120.onFailure(Unknown Source)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$onFailure$1.invoke(ExternalSystemProgressNotificationManagerImpl.kt:65)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$onFailure$1.invoke(ExternalSystemProgressNotificationManagerImpl.kt:17)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl.forEachListener(ExternalSystemProgressNotificationManagerImpl.kt:90)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl.onFailure(ExternalSystemProgressNotificationManagerImpl.kt:65)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:56)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:115)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:135)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:491)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$0(ExternalSystemUtil.java:327)
at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:190)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:327)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressInCurrentThread$10(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressInCurrentThread(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:381)
at com.intellij.openapi.progress.Task.queue(Task.java:119)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:616)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:282)
at com.intellij.openapi.externalSystem.service.project.autoimport.ProjectAware.reloadProject(ProjectAware.kt:62)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.reloadProject(AutoImportProjectTracker.kt:141)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.access$reloadProject(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:76)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:103)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.update.PriorityEatUpdate$Companion$invoke$1.run(PriorityEatUpdate.kt:15)
at com.intellij.util.ui.update.MergingUpdateQueue.queue(MergingUpdateQueue.java:347)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.schedule(AutoImportProjectTracker.kt:98)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.scheduleProjectRefresh(AutoImportProjectTracker.kt:76)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.importProjects(GradleCommandLineProjectConfigurator.kt:95)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:75)
... 28 more
Caused by: com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionErrorHandler.createUserFriendlyError(GradleExecutionErrorHandler.java:197)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:46)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.doGetUserFriendlyError(BaseProjectImportErrorHandler.java:167)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:48)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.checkErrorsWithoutQuickFixes(BaseProjectImportErrorHandler.java:62)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.getUserFriendlyError(GradleProjectResolver.java:877)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:806)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:775)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$0(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.maybeFixSystemProperties(GradleExecutionHelper.java:165)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$1(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.GradleConnectorService$Companion.withGradleConnection(GradleConnectorService.kt:181)
at ...
2022-11-11 09:17:15,378 [ 18054] SEVERE - #c.i.c.InspectionApplicationBase - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:15,380 [ 18056] SEVERE - #c.i.c.InspectionApplicationBase - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:15,382 [ 18058] SEVERE - #c.i.c.InspectionApplicationBase - OS: Linux
java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
vkl#debian:~/*$ echo $?
1
vkl#debian:~/*$ ls inspection/

Quickfix/j doesn't attempt to connect to the specified socket

I am using QuickFix/J 2.3.1 (same results with 2.3.0). I have a rather straightforward spring boot application, where a FIX service is one of the beans. It creates an initiator. Until recently everything worked fine. Suddenly I stumbled into the following issue - quickfix doesn't seem to even attempt to open a connection to the specified host:port. I do suspect that this can be something to do with my code, but so far I don't have a clue on how to figure out what is going on.
Here is the initialisation code (Kotlin):
#PostConstruct
override fun start() {
logger.info("Using config file {}", config.tradingServiceConfig.quickFixConfigFile)
val sessionSettings = SessionSettings(config.tradingServiceConfig.quickFixConfigFile)
val messageStoreFactory = FileStoreFactory(sessionSettings)
val messageFactory = DefaultMessageFactory()
initiator = SocketInitiator(
this,
messageStoreFactory,
sessionSettings,
SLF4JLogFactory(sessionSettings),
messageFactory
)
logger.info("Calling initiator start")
initiator?.start()
logger.info("Initiator startup finished")
}
Here is the corresponding piece of log:
2021-12-12 22:20:48.962 INFO 94182 --- [ restartedMain] i.s.trading.gateway.service.FixService : Calling initiator start
2021-12-12 22:20:49.157 INFO 94182 --- [ restartedMain] quickfix.DefaultSessionSchedule : [FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT] daily, 08:00:00-UTC - 08:45:00-UTC
2021-12-12 22:20:49.180 INFO 94182 --- [ restartedMain] quickfixj.event : FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT: Session FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT schedule is daily, 08:00:00-UTC - 08:45:00-UTC
2021-12-12 22:20:49.181 INFO 94182 --- [ restartedMain] quickfixj.event : FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT: Session state is not current; resetting FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT
2021-12-12 22:20:49.185 INFO 94182 --- [ restartedMain] quickfixj.event : FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT: Created session: FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT
2021-12-12 22:20:49.186 INFO 94182 --- [ restartedMain] i.s.t.gateway.service.FixServiceBase : New session started: FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT}
2021-12-12 22:20:49.193 INFO 94182 --- [ restartedMain] quickfix.mina.NetworkingOptions : Socket option: SocketTcpNoDelay=true
2021-12-12 22:20:49.194 INFO 94182 --- [ restartedMain] quickfix.mina.NetworkingOptions : Socket option: SocketSynchronousWrites=false
2021-12-12 22:20:49.194 INFO 94182 --- [ restartedMain] quickfix.mina.NetworkingOptions : Socket option: SocketSynchronousWriteTimeout=30000
2021-12-12 22:20:49.276 INFO 94182 --- [ restartedMain] quickfixj.event : FIX.4.2:XXX_STAGE_UAT->YYY_XXX_STAGE_UAT: Configured socket addresses for session: [localhost/127.0.0.1:10669]
2021-12-12 22:20:49.277 INFO 94182 --- [ restartedMain] quickfix.SocketInitiator : SessionTimer started
2021-12-12 22:20:49.280 INFO 94182 --- [ restartedMain] i.s.trading.gateway.service.FixService : Initiator startup finished
2021-12-12 22:20:49.280 INFO 94182 --- [ssage Processor] quickfix.SocketInitiator : Started QFJ Message Processor
No other FIX, including quickfix, messages appear in the log. And I can see via netstat that not even an attempt is made to connect to the specified socket. I tried stopping the process in debugger to see what was going on, but couldn't see anything obvious.
As I said before, this used to work just fine a week or so ago when I last tried, that's why I'm so puzzled.
Any thoughts on how to debug the issue?
You seem to have configured the initiator to connect to the acceptor on a daily basis, between 08:00:00-UTC and 08:45:00-UTC.
Try increasing the date range (i. e. 08:00:00 to 18:00:00) and see if you get connected.
PS: If you're using quickfixj and Spring, have a look at QuickFixJ Spring Boot starter in Github https://github.com/esanchezros/quickfixj-spring-boot-starter

Azure Spring Cloud AppConfiguration refresh is not working

im having some problems refreshing anything, be it #ConfigurationProperties or #Value, using the
implementation("com.azure.spring:azure-spring-cloud-appconfiguration-config:2.1.1")
library. From what i could find and debug, the inner AppConfigurationRefresh class is called and the RefreshEvent is created reacting correctly to changes done in Azure Config Server. Problem is that, when context is updated, there also should be new values recognized by the ContextRefresher, which is not the case for me.
Spring Boot ContextRefresher
public synchronized Set<String> refreshEnvironment() {
Map<String, Object> before = extract(this.context.getEnvironment().getPropertySources());
updateEnvironment();
Set<String> keys = changes(before, extract(this.context.getEnvironment().getPropertySources())).keySet();
this.context.publishEvent(new EnvironmentChangeEvent(this.context, keys));
return keys;
}
The result of that refresh method is always empty, which means no changes were found.
Logs generated by the refresh event:
2021-11-29 19:53:03.543 INFO [] 34820 --- [ task-2] c.a.s.c.config.AppConfigurationRefresh : Configuration Refresh Event triggered by /myprefix/my.config.value
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.719 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : The following profiles are active: messaging,db,dev
2021-11-29 19:53:53.736 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : Started application in 3.347 seconds (JVM running for 158.594)
2021-11-29 19:54:01.265 INFO [] 34820 --- [ task-2] o.s.c.e.event.RefreshEventListener : Refresh keys changed: []
2021-11-29 19:54:03.553 INFO [] 34820 --- [ scheduling-1] d.l.d.a.s.c.AppConfigurationUpdater : All configurations were refreshed.
bootstrap.yml
spring:
cloud:
azure:
appconfiguration:
stores:
- connection-string: ${connection-string}
selects:
- key-filter: '/myprefix/'
label-filter: dev
monitoring:
enabled: true
refresh-interval: 1s
triggers:
-
label: dev
key: /myprefix/my.config.value
I only noticed one thing that could be relevant to this, looking at log from start of the application (where everything is loaded properly) and at the point of refresh:
2021-11-29 19:51:31.578 INFO [] 34820 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/myprefix/https://my-config-store-stage.azconfig.io/dev'}, BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
It seems that when refreshing, the Spring is not able to locate all BootstrapPropertySources and maybe thats why there are no changes found. Am i missing some configuration somewhere to specify these or does anyone know whats the problem here. Thanks
The Problem
The changed values in azure appconfig store are triggering refresh event (either automaticaly using "web" version of library or through manual call to AppConfigurationRefresh.refreshConfigurations) and you can see it in the logs like this:
2021-11-29 19:53:03.543 INFO [] 34820 --- [ task-2] c.a.s.c.config.AppConfigurationRefresh : Configuration Refresh Event triggered by /myprefix/my.config.value
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.719 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : The following profiles are active: messaging,db,dev
2021-11-29 19:53:53.736 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : Started application in 3.347 seconds (JVM running for 158.594)
2021-11-29 19:54:01.265 INFO [] 34820 --- [ task-2] o.s.c.e.event.RefreshEventListener : Refresh keys changed: []
However the Spring Boot is unable to locate any changes in PropertySources as is evident from:
2021-11-29 19:54:01.265 INFO [] 34820 --- [ task-2] o.s.c.e.event.RefreshEventListener : Refresh keys changed: []
The Research
What actually was deciding factor for me to find the issue, was indeed the difference between the found BootstrapPropertySources at the start of the application and at the refresh.
2021-11-29 19:51:31.578 INFO [] 34820 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/myprefix/https://my-config-store-stage.azconfig.io/dev'}, BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
The culprit for the not found changes is indeed the missing BootstrapPropertySource at the update. From my testing its evident, that all configuration properties are dependant on the name of the PropertySource they came from and if its missing, they will retain their original old value.
The problem is in the way the appconfig library is locating/creating the BootstrapPropertySources and does not differentiate between startup and update.
The following code is from appconfiguration library and i only took the part that is causing the bug.
public final class AppConfigurationPropertySourceLocator implements PropertySourceLocator {
...
#Override
public PropertySource<?> locate(Environment environment) {
...
String applicationName = this.properties.getName();
if (!StringUtils.hasText(applicationName)) {
applicationName = env.getProperty(SPRING_APP_NAME_PROP);
}
...
}
...
}
The problem here is that env.getProperty(SPRING_APP_NAME_PROP); is filled with "spring.application.name" during startup, because spring loads all .yml files at once, but is not available during update. Also the AppConfigurationProperties properties.name is never mentioned in any documentation from azure, but is crutial to overcome this problem.
The Solution
If you are using custom spring.application.name include some name also into the bootstrap.yml like this:
spring:
cloud:
azure:
appconfiguration:
name: your-name #any value will work
stores:
- connection-string: ${connection-string}
selects:
- key-filter: '/myprefix/'
label-filter: dev
monitoring:
enabled: true
refresh-interval: 1s
triggers:
-
label: dev
key: /myprefix/my.config.value
This will make the library use the properties name value at all times and avoid usage of the problematic spring.application.name value.
You should be using "com.azure.spring:azure-spring-cloud-appconfiguration-config-web:2.1.1" if you want to enable auto refresh. Otherwise you have to manually trigger refresh using AzureCloudConfigRefresh's refreshConfiguration. See: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/appconfiguration/azure-spring-cloud-starter-appconfiguration-config#configuration-refresh
As for the ContextRefresher, is it inside of the refresh scope? If not then the values are unable to be changed.
Though looking at your logs you don't seem to be picking up the changes. Can you take a look at this demo?
https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/appconfiguration/azure-appconfiguration-refresh-sample
The instructions to run it are here https://github.com/Azure-Samples/azure-spring-boot-samples/pull/106/files

jhipster Project won't build for prod profile : gradlew -Pprod bootWar fails on taks webpack

ISSUE SOLVED see below for infos
after searching for a solutions for 2 days now i give up. I coudn't find a similar issue on the web and i don't know what to do.
Hope somebody can help there...
Issue
The application is building and running fine with gradlew -Pdev bootWar jibDockerBuild
However, the build won't work when selecting the prod profile:
gradlew -Pprod bootWar jibDockerBuild
Reference Exception
ERROR in Illegal State: referring to a type without a variable
{"filePath":"D:/dev/myApp/node_modules/#angular/forms/forms.d.ts",
"name":"FormGroupDirective","members":[]}
FULL EXCEPTION
The following is printed on execution:
D:\dev\myApp>gradlew -Pprod bootWar jibDockerBuild
> Task :yarn_install
yarn install v1.9.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents#1.2.4: The platform "win32" is incompatible with this module.
info "fsevents#1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > bootstrap#4.1.3" has unmet peer dependency "jquery#1.9.1 - 3".
warning " > bootstrap#4.1.3" has unmet peer dependency "popper.js#^1.14.3".
warning " > ngx-webstorage#2.0.1" has incorrect peer dependency "#angular/core#^5.0.0".
[5/5] Building fresh packages...
Done in 97.47s.
> Task :webpack
yarn run v1.9.4
$ yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www
$ rimraf build/{aot,www}
$ yarn run webpack --config webpack/webpack.prod.js --profile
$ node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config webpack/webpack.prod.js --profile
(node:28256) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
Hash: 6aab3d14e434ee333c51
Version: webpack 4.8.0
Time: 8812ms
Built at: 2018-10-07 18:52:03
6 assets
Entrypoint polyfills = app/polyfills.6aab3d14e434ee333c51.bundle.js
Entrypoint global = global.1e92ecdbfdaf2bb32590.css app/global.6aab3d14e434ee333c51.bundle.js
Entrypoint main = app/main.6aab3d14e434ee333c51.bundle.js
[0] ./src/main/webapp/app/app.main.ts 0 bytes {0} [built]
factory:4638ms building:3545ms = 8183ms
[2] ./src/main/webapp/content/css/global.css 39 bytes {1} [built]
factory:4639ms building:2778ms = 7417ms
[3] ./src/main/webapp/app/polyfills.ts 0 bytes {2} [built]
factory:4638ms building:3540ms = 8178ms
+ 1 hidden module
ERROR in Illegal State: referring to a type without a variable {"filePath":"D:/dev/myApp/node_modules/#angular/forms/forms.d.ts","name":"FormGroupDirective","members":[]}
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
> Task :webpack FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':webpack'.
> Process 'command 'yarn.cmd'' 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 58s
5 actionable tasks: 3 executed, 2 up-to-date
ENVIRONMENT
Windows 10
Using JHipster version installed locally in current project's node_modules
Executing jhipster:info
Options: from-cli: true
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
myApp#0.0.0 D:\dev\myApp
`-- generator-jhipster#5.4.1
JHipster configuration, a .yo-rc.json file generated in the root folder
<details>
<summary>.yo-rc.json file</summary>
<pre>
{
"generator-jhipster": {
"promptValues": {
"packageName": "de.myApp.myApp",
"nativeLanguage": "de"
},
"jhipsterVersion": "5.4.1",
"applicationType": "monolith",
"baseName": "myApp",
"packageName": "de.myApp.myApp",
"packageFolder": "de/myApp/myApp",
"serverPort": "8080",
"authenticationType": "session",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "mysql",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "gradle",
"enableSwaggerCodegen": false,
"rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
"clientFramework": "angularX",
"useSass": false,
"clientPackageManager": "yarn",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "de",
"languages": [
"de",
"en",
"fr"
],
"appsFolders": [
"myApp"
],
"directoryPath": "../",
"monitoring": "elk",
"consoleOptions": [
"curator"
],
"jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons"
}
}
</pre>
</details>
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
SKIPPED
Environment and Tools
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
git version 1.8.4.msysgit.0
node: v8.11.3
npm: 5.6.0
yarn: 1.9.4
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.22.0, build f46880fe
I found the cause of the issue:
I obviously placed the ReactiveFormModul imports at the wrong place. I had it in a module "upwards", but actually, I had to place it into the module where I actually have the components defining the form. To be honest ... I don't understand exactly why this is an issue, maybe someone can clarify.
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '#angular/core';
import { RouterModule } from '#angular/router';
import { ReactiveFormsModule } from '#angular/forms';
*** other imports
#NgModule({
imports: [***, ReactiveFormsModule, *** ROUTER stuff,
declarations: [MyReactiveFormComponent],
schemas: [***]
})
export class MyReactiveFormModule {}
After this, I found also other issues that was working fine in the dev-build (again ... don't understand the reason. I guess that has to do with a stricter "compile" configuration):
The variable referencing the formGroup was declared "private". Therefore I got a compile Error on the prod profile. I had to change it so that it can be accessed by the html template.
Variables accessed in html must be public (or accessible by means of a getter method)
Accessing Form Controls in subsequent html elements must be "public"
Code-Example:
MyReactiveComponent.ts:
this.myForm = this.fb.group({
id: [this.myObject.id],
date: [this.myObject.date, Validators.required],
number: [this.myObject.number, [Validators.required, Validators.min(2), Validators.max(100)]],
dynamicOptions: this.fb.array([]),
prefilledOptions: [this.prefilledOptions, Validators.required]
});
MyReactiveComponent.html:
<div class="row justify-content-center">
<div class="col-8">
<form [formGroup]="myForm" id="myFormId" novalidate (ngSubmit)="save()" #editForm="ngForm">
<h2>Create or edit a Play</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group">
<input type="number" class="form-control" formControlName="number" (blur)="updateNumber()" id="field_number" required min="2" jhiMin="2" max="100" jhiMax="100"/>
<div [hidden]="!(number?.dirty && number?.invalid)">
<small class="form-text text-danger"
[hidden]="!number?.errors?.required">
This field is required.
</small>
...
Accessing number in "number?.dirty" for example requires to have a getter-method to be able to access it:
get number() {
return this.myForm.get('number') as FormControl;
}
Hope that helps other when struggling...

how to use secure docker registry(by CA) for mesos container?

In DCOS, I want to deploy a mesos container with a self-defined image which stored in a local secure docker registry, and it has been secured by CA (not username and password!)
The json is
{
"id": "/gpu-tflinker",
"cmd": "while [ true ] ; do nvidia-smi; sleep 5; done",
"cpus": 0.1,
"mem": 1024,
"gpus": 1,
"instances": 1,
"constraints": [
[
"hostname",
"CLUSTER",
"10.140.0.22"
]
],
"container": {
"type": "MESOS",
"docker": {
"image": "tflinker:test-gpu",
"credential": null
}
}
}
The above json failed to run on marathon, and there is no content on mesos's stderr and stdout file, on mesos-agent log, the error message is :
E0721 05:01:57.726367 22498 slave.cpp:3976] Container 'e2c68720-0fb7-41bc-9d3b-a2b5e4793816' for executor 'gpu-t
flinker.b6f96725-6dd1-11e7-ba5d-0242b2c758c0' of framework 1079aaea-6dde-4dc1-8990-d926a895de78-0000 failed to s
tart: Unexpected HTTP response '401 Unauthorized' when trying to get the manifest
W0721 05:01:57.726478 22497 composing.cpp:541] Container 'e2c68720-0fb7-41bc-9d3b-a2b5e4793816' is already destr
oyed
I0721 05:01:57.726583 22497 slave.cpp:4082] Executor 'gpu-tflinker.b6f96725-6dd1-11e7-ba5d-0242b2c758c0' of fram
ework 1079aaea-6dde-4dc1-8990-d926a895de78-0000 has terminated with unknown status
I0721 05:01:57.726603 22497 slave.cpp:4193] Cleaning up executor 'gpu-tflinker.b6f96725-6dd1-11e7-ba5d-0242b2c75
8c0' of framework 1079aaea-6dde-4dc1-8990-d926a895de78-0000
I0721 05:01:57.726794 22497 slave.cpp:4281] Cleaning up framework 1079aaea-6dde-4dc1-8990-d926a895de78-0000
so it seems mesos failed to fetch the docker image. I've configed CA file for dockerd(move ca files to /etc/docker/certs.d/), so I can 'docker pull' the image to local machine, but I am not sure how to config CA file for mesos~
in mesos-agent configurations, there exist a item --docker_config=VALUE, but it seems this item can only be used for username/password secured registry, I don't know how to config for CA secured registry.
anybody can help me out?! thanks!
I think CA file is just for encryption. you will need username and password in ca file way I think.
In my way, I put auth file into the container to authorize my private registry.
I wrote a web service for downloading the auth file
xxx.tar.gz(format: .docker/config.json in the tar.gz)
in the config.json, {"auths": {"test.com:6999": {"auth": "(username:password) [base64 encode]"}}} like {"auths": {"test.com:6999": {"auth": "Y2NjOjEyMw=="}}}
use Mesos uris to download auth files prepared into the containers. then, it would authorized.
"uris": [
"http:your download url"
]

Resources