I have successfully deploying the code in local. When it comes to dev environment my deployment team say they want clean install. I suggested to have profiles of each server in pom. But they are looking for clean install. I am getting connection refused error. Can some one help me in this?
I/O exception (java.net.ConnectException) caught when processing request: Connection refused: connect
[INFO] Retrying request
This is my ui-apps pom profiles
<profiles>
<profile>
<id>autoInstallPackage</id>
<build>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<id>install-content-package</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
<serviceURL>http://${aem.host}:${aem.port}/crx/packmgr/service.json</serviceURL>
<userId>${sling.user}</userId>
<username>${sling.user}</username>
<password>${sling.password}</password>
<relaxedSSLCheck>true</relaxedSSLCheck>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>autoInstallPackagePublish</id>
<build>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<id>install-content-package-publish</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<targetURL>http://${aem.publish.host}:${aem.publish.port}/crx/packmgr/service.jsp</targetURL>
<serviceURL>http://$aem.publish.host}:${aem.publish.port}/crx/packmgr/service/.json</serviceURL>
<username>${sling.user}</username>
<userId>${sling.user}</userId>
<password>${sling.password}</password>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
"Connection refused" means that on the specific combination of hostname and port no application is listening. Is the AEM instance started and ready? Are your variables "aem.host"/"aem.port" or "aem.publish.host"/"aem.publish.port" set correctly?
Kind regards,
Jörg
Aem Instance is started and it is ready.
Please find below variables.
<properties>
<aem.host>localhost</aem.host>
<aem.port>4502</aem.port>
<aem.publish.host>localhost</aem.publish.host>
<aem.publish.port>4503</aem.publish.port>
<sling.user>admin</sling.user>
<sling.password>admin</sling.password>
<vault.user>admin</vault.user>
<vault.password>admin</vault.password>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
Can you please also provide the complete error?
"Connection refused" in your case could mean, that the CI server tries to deploy to "localhost:4502", where very likely no AEM instance is running.
Jörg
As per your query
You are trying to deploy your code to DEV? The properties configured in your POM.xml point to your local. As Jörg Hoh said, when you are trying to run and deploying to server, it is actually trying to install to localhost . Try changing your dev details . There could be a possibility that your server firewall may restrict you from doing so.
One suggestion :- I will not recommend to add server specific details to your POM.xml because the code usually will be checked into some version control systems and the POM will be shared across. When you are going to deploy this to STAGE or QA , again you may have to change the details. Moreover this won't do any help unless you are doing a manual deployment. If your project has DEV ops in place, deployment to the exact servers should be handled internally.
you can specify -Daem.host=http://your-other-server and -Daem.port=4384 when running the maven command.
This also could happen when you have some communication issue with the AEM Instance or it's still down. Normally, this error appears when you are running your CI process(deployment) from Jenkins or other servers, it's resolved triggering one more time because you have too many job running concurrency.
Below Thre is a simple example to test this scenario; We only have to build and deploy thru maven our app with AEM down and result will be the image attached as you have it above.
I passing this command mvn -Daem.host=localhost -Daem.port=8080 clean install -PautoInstallPackage but the error says autoInstallPackage doesn't exist.
It got resolved and working fine now. I have run the command at parent level.
<profiles>
<profile>
<id>autoInstallBundle</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<executions>
<execution>
<id>install-bundle</id>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<modules>
<module>bundle</module>
<module>content</module>
</modules>
Instead of running a maven command how can we deploy code from build machine? Is there any use in main pom having this autoinstallBundle in parent?
Failed to execute goal com.day.jcr.vault:content-package-maven-plugin:0.0.24:install (install-content-package) on project amicacom.ui.apps: Execution install-content-package of goal com.day.jcr.vault:content-package-maven-plugin:0.0.24:install failed: Invalid uri '${crx.protocol}://${crx.host}:${crx.port}/crx/packmgr/service.jsp'
Views
Replies
Total Likes
do you have mentioned this protocol host and port in your pom.xml ?
<properties>
<aem.host>localhost</aem.host>
<aem.port>4502</aem.port>
<aem.publish.host>localhost</aem.publish.host>
<aem.publish.port>4503</aem.publish.port>
<sling.user>admin</sling.user>
<sling.password>admin</sling.password>
<vault.user>admin</vault.user>
<vault.password>admin</vault.password>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> Is this causing the issue?
<id>autoInstallPackage</id>
<build>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<id>install-content-package</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<targetURL>${crx.protocol}://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL>
<serviceURL>${crx.protocol}://${crx.host}:${crx.port}/crx/packmgr/service.json</serviceURL>
<userId>${crx.username}</userId>
<username>${crx.username}</username>
<password>${crx.password}</password>
<relaxedSSLCheck>true</relaxedSSLCheck>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
There is a mismatch in both. Is this really matters?My deployment team are not updating build profile names. We are upgrading from 5.6 to 6.3
If my understanding is correct here you have aem.host and in your autoinstall profile you are calling crx.host . I not sure though
It should be same correct. And which one is recommended?
try aem
You already have "crx.host" and "crx.port" in use; so if you want to modify only properties instead of dealing with the details of the POM, use the "crx.*" properties. If you are fine with writing POMs, rewrite the configuration of the content-package-maven-plugin and make it use the "aem.*" properties.
Jörg
Thanks Jorg and Veena for your help. Issue resolved.