Issue
I am amused to see this error suddenly appearing in a jenkins deployment jobs which was working more than few months. While I didn't change any tomcat configuration and the setup needed to build and move a war file
like tomcat-user setup was done long back and didnt see any issue there.
What could be the reason. If someone can provide insight.
20:52:11 ERROR: Build step failed with exception
20:52:11 org.codehaus.cargo.container.ContainerException: The [cargo.remote.username] and [cargo.remote.password] properties are mandatory and need to be defined in your configuration.
20:52:11 at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.createManager(AbstractTomcatManagerDeployer.java:318)
20:52:11 at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.getTomcatManager(AbstractTomcatManagerDeployer.java:83)
20:52:11 at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:173)
20:52:11 at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
Solution
Its my bad that I didn't see the configuration [username/password] in jenkins' for "Deploy war/ear to container" is muted.
Below image displays what has been missed
After setting correct username and password It is resolved.
Where to look for password:-> Path :- /apache-tomcat-7.0.39/conf/tomcat-users.xml Below line allows tomcatuser to depploy war file in webapps directory.
If this is not present in tomcat-users.xml then add one here, and verify if in unix/windows the user has proper access for file system of tomcat server.
Answered By - Vishy Anand
Answer Checked By - Mildred Charles (JavaFixing Admin)