Spring in Docker via IntelliJIdeal - spring

I tried putting spring application into docker, but when dockerfile tries to run app.java it shows this error in lazydocker: missing class error. Tried executing java file in specified file, but still cannot find it
Command : java -cp ./src/main/java/com/example/backend BackendApplication.java
Files in VSCode : enter image description here
changing command path

Related

How to run java application automatically when EC2 instance starts without having to run it manually with java -jar file_name-SNAPSHOT.jar?

I tried the following steps but when I access my application in the browser using the url link, it returns a blank page. Here is what I did:
Copy My jar file to /home/ec2-user/
cp myApp-0.0.1-SNAPSHOT.jar /home/ec2-user
Next, I opened the rc.local in the VI editor and appended myApp-0.0.1-SNAPSHOT.jar
vi /etc/rc.local
#
#
#
#
touch /var/lock/subsys/local
//Append the below command:
java -jar /home/ec2-user/myapp-0.0.1-SNAPSHOT.jar
/:wq
Give permission to the symlink by running the following command:
chmod +X /etc/rc.d/rc.local
So I stopped my ec2 instance and after a while, I started it again to see if I was able to test my endpoints without having to manually run my appl with java -jar myApp-0.0.1-SNAPSHOT.jar But it did not succeed. I was told this way of doing is now obsolete. I also tried to follow the following link but the file naming was not obvious to me so I messed up some steps and got to the same result: failed Please can anyone direct me? Thanks! I tried the following steps but when I access my application in the browser using the url link, it returns blank page.

Docker - Unable to mv a file inside a container

I am trying to give a set of bash instruction to my docker container when it launch.
but when I try to launch this docker file everything works great until the 'mv' command as you can see here :
but when I try to move the file directly from the container (the exact same command as my docker file) it works :
does anyone has an idea why its not working with the docker file instruction but working fine when I run the command manually ?
The directory /fuseky/configuration does not exist.
In the container you are doing it the right way so just change the command in the dockerfile:
mv safetybimontology_reasoner.ttl /home/configuration
and you should be fine
I fixed the issue by adding the creation of the folder named /fuseki/configuration in the set of instruction. It works fine and I can see this log :
[2022-07-05 12:41:26] Config INFO Load configuration: file:///fuseki/configuration/safetybimontology_simple.ttl

Could not found run "docker image build" in context menu in spring

I'am trying to run a dockerfile in spring but i could not found the option in the context menu
Also when i try to create a dockerfile , i fount it like .txt filee not a docker file
When i try to run
docker compose up --build
i get this error : no configuration file provided: not found
Thanks

Debug springboot application by running .sh file using IntelliJ

I have a springboot application that has a local.sh file which contains some exports and mvn path, application jar paths. To run the application, i run this command in terminal './local.sh' (I use Mac).
I want to run my application in debug mode.
Tried with this approach, but application still running in run mode.
Added new Shell script configuration, gave the script path and in Script options entered 'set -x', gave the working directory. After this configuration, clicked on debug icon.
Is there any other way that i can run springboot application in debug mode by running .sh file?
Please let me know if you need more information.

Running iRods Rest in Tomcat 7

I'm trying to run iRods Rest in Tomcat 7. The only problem is that when I'm in the manager page, I have the list of application. All of them runs exept iRods Rest and if I try to push "start" I get:
FAIL - Application at context path /irods-rest could not be started
This is the steps that I had follow:
Installation of Tomcat 7 (https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get)
Installation of maven 3
git clone https://github.com/DICE-UNC/irods-rest.git
cd irods-rest
mvn package -Dmaven.test.skip=true
Upload of the .war file on the manager page host:8080
Tell me if you need more informations or the question is too specific.
I was getting the same error, but then I looked at the logs contained in /var/log/tomcat/localhost.x-x-x.log (CentOS 7):
java.io.FileNotFoundException: /etc/irods-ext/irods-rest.properties (No such file or directory)
So I created the directory and properties file:
mkdir /etc/irods-ext
vi /etc/irods-ext/irods-rest.properties
And added the following contents (found template in https://github.com/DICE-UNC/irods-rest/blob/master/docs/iRODSRESTAPIDocumentation.pdf):
irods.host=localhost
irods.port=1247
irods.zone=tempZone
utilize.packing.streams=true
auth.type=STANDARD
default.storage.resource=
web.interface.url=
cors.allow=true
Now everything seems to be working after I start the irods-rest application from the Tomcat manager page.

Resources