cargo-maven3-plugin stopped running - deployment

I had a working project, but suddenly it stopped running
I'm launching the TomCat 9.0.60 via cargo plugin version 1.10.1.
After "mvn clean package cargo:run" an exception occurs when restarting:
"org.codehaus.cargo.container.ContainerException: Failed to create a Tomcat 9.x standalone configuration: Invalid configuration dir [/target/cargo/configurations/tomcat9x]. When using standalone configurations, the configuration dir must point to an empty directory - Except if the configuration was created by Cargo."
I not understand what happends.
Why it occurred and what needs to be done to fix it.

In our project, we used another plugin (sass-maven-plugin) to create a file in the target/load/configuration/tomcat9x
As a result
, sass-maven-plugin created a file inside "target/cargo/configuration/tomcat9x". cargo-maven3-plugin thought that the "target/cargo/configuration/tomcat9x" directory was already configured by him and did not add the necessary files. Appeared "org.codehouse.cargo.container.ContainerException: Failed to create a Tomcat 9.x standalone configuration".
variants to fix:
create a file in ".cargo" in "target/cargo/configuration/tomcat9x"
do not create files in target/cargo/configuration before the container starts. After the container starts, you can create files

Related

How can I run a specific SAPUI5 control sample from Demo Kit locally?

I am looking up the sample for the sap.m.UploadCollection control. I've downloaded and run the sample package locally using the following commands:
npm install
and then
ui5 serve -o index.html
I get the following error in console when navigating to http://localhost:8080/index.html:
2022-08-15 16:56:35.802600 Failed to load component for container container - ModuleError: Failed to resolve dependencies of 'sap/m/sample/UploadCollection/Page.controller.js'
-> 'sap/m/MessageToast.js': failed to load 'sap/m/MessageToast.js' from ./resources/sap/m/MessageToast.js: script load error
ModuleError: Failed to resolve dependencies of 'sap/m/sample/UploadCollection/Page.controller.js'
If I move the Page.contoller.js to a newly created controller folder and move the Page.view.xml to the newly created view folder, then a different error occurs.
How can the downloaded sample project run locally?
Make sure that the downloaded project has the UI5 Tooling part is correctly configured according to the documentation https://sap.github.io/ui5-tooling/pages/Configuration
In your case, the control sap.m.UploadCollection is deprecated since UI5 1.88. So download one of the sap.m.upload.UploadSet samples instead. When downloaded, see which settings are missing in the ui5.yaml config file. E.g. run the below UI5 Tooling commands to add the missing settings:
ui5 use openui5#latest
ui5 add sap.ui.core sap.m sap.ui.layout sap.ui.unified themelib_sap_fiori_3 themelib_sap_horizon
This will at least allow the application to start.

FAIL - Failed to deploy application at context path

Before I explain the problem, I just want to point out that I am completely new to NetBeans and Tomcat and I am doing a school project. That being said, the problem is exactly what the title says. Here is the output when I try to run a simple Hello World jsp:
In-place deployment at
C:\Users\lostl\OneDrive\Documents\NetBeansProjects\Project3\build\web
Deployment is in progress...
deploy?config=file%3A%2FC%3A%2FUsers%2Flostl%2FAppData%2FLocal%2FTemp%2Fcontext7180600714574256491.xml&path=/Project3
FAIL - Failed to deploy application at context path [/Project3]
C:\Users\lostl\OneDrive\Documents\NetBeansProjects\Project3\nbproject\build-impl.xml:1058: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 0 seconds)
I am using Apache NetBeans 11.2 and Tomcat 9 if it is relevant.
Here is what I tried:
I checked the server log and it displays absolutely nothing.
I tried setting the context path directly to Project3 (i.e. including the -C:/... before Project3) in the context.xml file under META-INF folder.
I tried restarting NetBeans and cleaning and building the project.
I tried running NetBeans under admin privileges.
I might seem like such an idiot for not knowing how to fix this since no one else seems to have this problem, but please help me out.
If you have installed the Apache Tomcat appart from Netbeans, maybe your apache service is already running and it conflicts with Netbeans. You may stop the apache service and then run the application in Netbeans.
Because Netbeans start the apache service in a diffent way, so you don´t need to install the aplication on apache´s folder.
Check out the Windows Services (Services App) and stop the Apache Tomcat if running, then from Netbeans menu select Run->Run Project. Netbean will start Tomcat and deploy your web app onto the Tomcat server.
I fixed it. All I had to do was restart my computer. I feel so dumb.
clean your project if clean project failed to delete some file then,
Just check there must be a java process running at background.
If you are using windows 10 then follow these steps
open command prompt and type below commands
tasklist | findstr java (hit enter now you can see a task list with pid number )
taskkill /F /PID "PID_OF_JAVA_PROCESS" (where PID_OF_JAVA_PROCESS--> task pid hit enter)
now run the project again
I faced this problem and found a solution. It is very simple. All you need to do is stop the Tomcat services or restart your computer and run your program.

system variable in spring boot yml

I'm running STS on a mac (10.11.5 El Capitan).
I created a basic Spring Boot application which needs to read an external log4j.properties file on my file system.
I created a folder on my machine, set a system variable (LOG_CONFIG_HOME) in ~/.bash_profile and when i 'echo $LOG_CONFI_HOME', i see the correct path.
In the Boot application.yml file, i have this:
...
logging:
config: ${LOG_CONFIG_HOME}/log4j.properties
...
When I run this as a Spring Boot application, i get
'Could not resolve placeholder 'LOG_CONFIG_HOME' in string value "${LOG_CONFIG_HOME}/log4j.properties".
I searched stack & googled trying to solve this.
One suggestion was to restart eclipse. I did that but still the error persists.
Another was to run 'eclipse' from the command line b/c otherwise, it doesn't have access to system variables (???). Doesn't seem legit - i tried to do this but in the STS folder, all i have is STS.app so no clue how to run this from the command line.
I even restarted my machine.
What do i have to do to fix this? This application (with the externalized log config) has to also run on windows as well, so any mac-specific tricks won't work.

WAR doesn't get redeployed in Glassfish from autodeploy

I was able to deploy my WAR the first time I placed it under domains/domain1/autodeploy dir. However, after making some changes and redeploying the WAR to the autodeploy dir, the changes were not picked up. I even deleted domains/domain1/applications/myapp (where myapp corresponds to the myapp.jar being deployed) but the WAR was not redeployed. The server was started and stopped via asadmin:
asadmin start-domain
asadmin stop-domain
What am I doing wrong so that the app does not get redeployed?
UPDATE: I tried manually (re)deploying (also using --force option) the WAR but got the following error in server.log:
[#|2013-03-17T20:47:36.177-0400|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=72;_ThreadName=Thread-2;|Application with name myprojectname is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name|#]
I do not know how to unregister/undeploy an app that's been once deployed. I tried removing all the references to my app in domain.xml but it didn't work. This seems like a very basic bug in the software.
I know this was answered long ago, but in case anyone else gets here via google like I did, I have another possible answer ...
After encountering this same issue, I found the following ... the autodeploy/.autodeploystatus directory still had a file referencing the application I was trying to redeploy by copying the war into the autodeploy directory. I had to delete the file in the autodeploy/.autodeploystatus directory, then my application was deployed when the war was copied into the autodeploy directory.
Hope that helps.
NOTE: Apparently, it is obvious to others who use glassfish that you have to delete all this stuff from the hidden .autodeploystatus directory to get your re-deploys to work. Why is it obvious to them? We may never know.
You can undeploy via asadamin with:
asadmin undeploy yourapplication
You can also visit the glassfish admin console http://localhost:4848 and undeploy via the graphical interface (look at Applications).
In general the re-autodeployment should work, but I would recommend using the normal deploy method or an incremental redeployment by some IDE like NetBeans...
Exactly the same problem reappears for an application running to be deployed in Payara 5.2021.10 (perhaps for other recent versions > 5.193) within a docker container.
The problem happens every time the docker container restarts - the deployment fails with a message:
Application with name {applicationName} is already registered. Either
specify that redeployment must be forced, or redeploy the application.
Or if this is a new deployment, pick a different name
The problem can be fixed by a forced redeploy. Place something like this into a Dockerfile of the application image:
ENV DEPLOY_PROPS="--force=true"
This environment variable allows to set custom parameters to asadmin's deploy command. How exactly is it applied can be seen in the script that generates the deploy commands, that is being run from within the container's entrypoint.

Eclipse (Blackberry JDE 4.6.1) fails deploying the application on the simulator

this is the message I receive when I try to build my applicaion.
..\HBB\HBB.rapc -sourceroot=C:\ws\HBB\src #HBB_build.files
I/O Error: C:\ws\HBB\HBB.cod (The system cannot find the file specified)
rapc executed for the project HBB
the project is currently set as "Active for Blackberry" and all the other option are set as defined here here
why the .cod file is not created?
It appears that sometimes eclipse (or the blackberry plugin) becomes out-of-sync with the filesystem so it appears to eclipse that the file is there, but in actuality it's not. My workaround for this issue is to delete the output directory and compile again. This seems to force the file to be rebuilt before it is referenced in the build process.