18 Replies Latest reply on Sep 18, 2017 12:04 PM by gowthamv39516821

    AEM6.3 POM related Deployment issues

    gowthamv39516821 Level 1

      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>

        • 1. Re: AEM6.3 POM related Deployment issues
          Jörg Hoh Adobe Employee

          "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

          • 2. Re: AEM6.3 POM related Deployment issues
            Diego Fontan Level 2

            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.

            Screen Shot 2017-09-11 at 5.55.21 PM.png

            • 3. Re: AEM6.3 POM related Deployment issues
              gowthamv39516821 Level 1

              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>

              • 4. Re: AEM6.3 POM related Deployment issues
                Jörg Hoh Adobe Employee

                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

                1 person found this helpful
                • 5. Re: AEM6.3 POM related Deployment issues
                  Veena_07 Level 3

                  As per your query

                  I have successfully deploying the code in local. When it comes to dev environment my deployment team say they want clean install.

                  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.

                  1 person found this helpful
                  • 6. Re: AEM6.3 POM related Deployment issues
                    Feike Visser Adobe Employee

                    you can specify -Daem.host=http://your-other-server and -Daem.port=4384 when running the maven command.

                    1 person found this helpful
                    • 7. Re: AEM6.3 POM related Deployment issues
                      gowthamv39516821 Level 1

                      I passing this command mvn -Daem.host=localhost -Daem.port=8080 clean install -PautoInstallPackage but the error says autoInstallPackage doesn't exist.

                      • 8. Re: AEM6.3 POM related Deployment issues
                        gowthamv39516821 Level 1

                        <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?

                        • 9. Re: AEM6.3 POM related Deployment issues
                          gowthamv39516821 Level 1

                          It got resolved and working fine now. I have run the command at parent level.

                          • 10. Re: AEM6.3 POM related Deployment issues
                            gowthamv39516821 Level 1

                            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'

                            • 11. Re: AEM6.3 POM related Deployment issues
                              Veena_07 Level 3

                              do you have mentioned this protocol host and port in your pom.xml ?

                              • 12. Re: AEM6.3 POM related Deployment issues
                                gowthamv39516821 Level 1

                                <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?

                                • 13. Re: AEM6.3 POM related Deployment issues
                                  gowthamv39516821 Level 1

                                  <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</serviceUR L>

                                                                      <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

                                  • 14. Re: AEM6.3 POM related Deployment issues
                                    Veena_07 Level 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

                                    • 15. Re: AEM6.3 POM related Deployment issues
                                      gowthamv39516821 Level 1

                                      It should be same correct. And which one is recommended?

                                      • 17. Re: AEM6.3 POM related Deployment issues
                                        Jörg Hoh Adobe Employee

                                        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

                                        1 person found this helpful
                                        • 18. Re: AEM6.3 POM related Deployment issues
                                          gowthamv39516821 Level 1

                                          Thanks Jorg and Veena for your help. Issue resolved.