Unable to load config data from '--spring.profiles.active=local' - spring

I am running the below command to run by SPring boot application.How can i resolve it.I have the necessary files present in /path/config/.
mvn spring-boot:run
-Dspring-boot.run.arguments="--spring.config.location=../path/config/,--spring.profiles.active=local,
--spring.active.profiles=local"
But i am getting the below error
13:51:14.064 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Unable to load config data from '--spring.profiles.active=local'
at org.springframework.boot.context.config.StandardConfigDataLocationResolver.getReferences(StandardConfigDataLocationResolver.java:128)

Related

Heroku not setting property $PORT when deploying executable jar

I have a Gradle-Kotlin project that is a Spring boot project, and it runs a server on port 8080 by default.
When I compile and generate a jar with command ./gradlew bootJar, I can set up the server justing by executing this jar. I wanted to run this server remotely, so I used Heroku (heroku deploy:jar) to upload the .jar. I could upload the jar and start the server with Heroku and it detected the buildback as heroku/jvm. With command heroku logs --tail I could verify that the server compiled and was up and running... but on port 8080. That is, I could't reach the server using heroku's public app url (ex https://radiant-crag-94685.herokuapp.com/my-end-point)
Reading some docs, I came to the PORT configuration. So I created a file called application.yml and put it in src/main/resources folder. This .yml file contained the following:
server:
port: $PORT
I generated the .jar file and uploaded to Heroku once more. But this time, the app crashed on its main class, with the message:
Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value '$PORT'; nested exception is java.lang.NumberFormatException: For input string: "$PORT"
The exception was thrown here:
#SpringBootApplication
open class AutomatedTestsApplication
fun main(args: Array<String>) {
runApplication<AutomatedTestsApplication>(*args)
}
How can I solve this problem?
You can use the variable in your application.yml like you have doing this:
server:
port: ${PORT}
Alternatively, as you mentioned in your comment, I think it would be better to override via startup command using something like:
java -jar service.jar --server.port=${PORT}

Error while creating docker image from STS 4

While creating image from STS4 with maven goal spring-boot:build-image -DskipTests ,I am getting error
"Execution default-cli of goal
org.springframework.boot:spring-boot-maven-plugin:2.4.2:build-image
failed: Connection to the Docker daemon at 'localhost' failed with
error "\.\pipe\docker_engine"; ensure the Docker daemon is running
and accessible.." Exception arising : I/O exception
(java.nio.file.NoSuchFileException) caught when processing request to
{}->docker://localhost:2376: \.\pipe\docker_engine Though I am
able to create image from docker quick start terminal CLI but I am
confused why it is facing error while creating from STS. Will you
please help me to solve this 🙂. Note: I am using Environment:
Windows 8.1 , Docker Toolbox(Not Docker Desktop as I don't have
windows 10), STS 4 IDE. Docker Hosts at http://192.168.99.100/

Laravel on AWS ElasticBeanstalk: running artisan migration command on deployment using .ebextensions in failing

I am deploying the Laravel application to the ElasticBeanstalk. I am running migration command using .ebextensions config on deployment.
I created a .extensions/01-migration.config file under the project root folder with the following content.
container_commands:
01_cd_html:
command: "cd /var/www/html"
02_php_artisan_migrate:
command: "php artisan migrate --force"
Then I deploy my application by running the following command.
eb deploy
Then I got the following error.
2020-07-13 11:51:59 INFO Environment update is starting.
2020-07-13 11:52:39 INFO Deploying new version to instance(s).
2020-07-13 11:52:49 ERROR [Instance: i-0a461ffb24bc26f52] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
2020-07-13 11:52:49 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-07-13 11:52:49 ERROR Unsuccessful command execution on instance id(s) 'i-0a461ffb24bc26f52'. Aborting the operation.
2020-07-13 11:52:50 ERROR Failed to deploy application.
I could SSH into the server and run the command successfully. But it is just not working on deployment. What is wrong with my configuration and how can I fix it?
I solved the issue. I need to set the environment variables required by the commands in the option_settings. The command I am trying to run is migration command and it is using database credentials. So I specified the env variables for the database. That is weird, it should just work with ones specified in the ElasticBeanstalk console.

Karate-Jenkins- ERROR com.intuit.karate - . getting this error only when i run from jenkins

iam running my karate code from Jenkins. where ia, getting below error.
ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: ReferenceError: "karate" is not defined .
karate config file keeps on running.
iam using mvn test command to run the job.. even I have tried in Jenkins machine and mvn command works. only in through Jenkins iam getting issue.
Try to upgrade java version in Jenkins server.

Unable to Deploy EAR into websphere through jython script

While am deploying ear through jython script to WebSphere application in Dev environment.I got the below error.
ERROR:
ADMA5017I: Uninstallation of appname started.
ADMA5104I: The server index entry for WebSphere:cell=dza1001Cell80,node=dza1001Node80 is updated successfully.
ADMA5102I: The configuration data for appname from the configuration repository is deleted successfully.
ADMA5011I: The cleanup of the temp directory for application appname is complete.
ADMA5106I: Application appname uninstalled successfully.
ADMA5016I: Installation of appname started.
ADMA5060E: Resource validation for application appname failed due to unexpected exception java.lang.NullPointerException
ADMA5011I: The cleanup of the temp directory for application appname is complete.
ADMA5069E: The installation of application appname failed. This application was in the middle of a full update and therefore is uninstalled from the configuration session. Discard your current configuration session immediately to recover the application. Do not save changes to the WebSphere Application Server configuration repository. The application is not uninstalled from this repository. Until the current configuration session is discarded you do not see this application in the current session.
WASX7017E: Exception received while running file "/data/scripts/deployAppQA.py"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7418E: Application update for appname failed: see previous messages for details.
WASX7341W: No "save" was performed before the interactive scripting session exited; configuration changes will not be saved.
Error encountered while deploying the app

Resources