Expand my Community achievements bar.

SOLVED

[ERROR] Failed to execute goal com.day.jcr.vault:content-package-maven-plugin:1.0.4:install (install-package) on project dotcom.bootstrap: Connection reset -> [Help 1]

Avatar

Level 2

I'm able to access the AEM instance at http://localhost:4502 however, when I try to build my AEM project, I get the following error.

I'm running the following command which from what I understand, builds and runs the AEM project on port 4502 and adds the project to the AEM sites.

mvn clean install -s settings.xml -Daem.port=4502 -PautoInstallPackage -DskipTests

This is where it tries to pickup the AEM port

[INFO] --- content-package:1.0.4:install (install-package) @ dotcom.bootstrap ---
[INFO] Installing dotcom.bootstrap (/Users/juniol/Documents/work/dotcom/bootstrap/target/dotcom.bootstrap-1.0-SNAPSHOT.zip) to http://localhost:4502/crx/packmgr/service.jsp
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset
[INFO] Retrying request
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset
[INFO] Retrying request
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset
[INFO] Retrying request
[INFO] ------------------------------------------------------------------------
...

The error that I'm getting which leads me to think that the AEM project cannot connect to the AEM instance on 4502.

[ERROR] Failed to execute goal com.day.jcr.vault:content-package-maven-plugin:1.0.4:install (install-package) on project dotcom.bootstrap: Connection reset -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.day.jcr.vault:content-package-maven-plugin:1.0.4:install (install-package) on project dotcom.bootstrap: Connection reset
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.MojoExecutionException: Connection reset
at com.day.jcr.vault.maven.mgr.AbstractPackageManagerMojo.postRequest (AbstractPackageManagerMojo.java:265)
at com.day.jcr.vault.maven.mgr.PackageInstallMojo.uploadPackage (PackageInstallMojo.java:322)
at com.day.jcr.vault.maven.mgr.PackageInstallMojo.execute (PackageInstallMojo.java:210)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read (SocketInputStream.java:186)
at java.net.SocketInputStream.read (SocketInputStream.java:140)
at java.io.BufferedInputStream.fill (BufferedInputStream.java:252)
at java.io.BufferedInputStream.read (BufferedInputStream.java:271)
at org.apache.commons.httpclient.HttpParser.readRawLine (HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine (HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine (HttpConnection.java:1116)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine (HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest (HttpMethodBase.java:2082)
at org.apache.commons.httpclient.HttpMethodBase.execute (HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry (HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod (HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod (HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod (HttpClient.java:323)
at com.day.jcr.vault.maven.mgr.AbstractPackageManagerMojo.postRequest (AbstractPackageManagerMojo.java:232)
at com.day.jcr.vault.maven.mgr.PackageInstallMojo.uploadPackage (PackageInstallMojo.java:322)
at com.day.jcr.vault.maven.mgr.PackageInstallMojo.execute (PackageInstallMojo.java:210)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :dotcom.bootstrap

 

1 Accepted Solution

Avatar

Correct answer by
Level 2

On my end, I found the solution. The debug script was using the same port 4502 so AEM isn't able to receive the project package when I run `mvn clean install`.

View solution in original post

12 Replies

Avatar

Community Advisor

@leanjunio 

 

When executing maven command, look for a message like this

 

[INFO] --- content-package:1.0.2:install (install-package) @ aemcs.ui.content ---
[INFO] Installing aemcs.ui.content (C:\aemcs-apps\ui.content\target\aemcs-.ui.content-1.0.0-SNAPSHOT.zip) to http://localhost:4502/crx/packmgr/service.jsp

 

This would confirm the AEM port that is being picked up.

 

Also, where are you specifying the credentials to connect AEM? Could you possibly share the details?


Aanchal Sikka

Avatar

Level 2

I set the sling.user and sling.password in the pom.xml file's properties, aside from that I usually supply the credentials after running the build on localhost:4502

leanjunio_0-1704542093622.png

Avatar

Community Advisor

@leanjunio 

 

As suggested, please verify the logs generated by maven command. It should tell the host and port where its trying to install

 

[INFO] --- content-package:1.0.2:install (install-package) @ aemcs.ui.content ---
[INFO] Installing aemcs.ui.content (C:\aemcs-apps\ui.content\target\aemcs-.ui.content-1.0.0-SNAPSHOT.zip) to http://localhost:4502/crx/packmgr/service.jsp

Aanchal Sikka

Avatar

Community Advisor

Have you defined vault.user and vault.password in your parent Pom.xml which should be same as your aem credentials and if it’s done and install is still failing with maven command try adding <useProxy>false</useProxy> for content-package-maven-plugin in your main Pom.xml

Avatar

Level 2

Yeah, vault user and password are defined in the pom.xml file with the same aem credentials, also tried the `useProxy` just now but still getting the same error.

Avatar

Community Advisor

Hi @leanjunio 

Can you validate the below points:

- AEM is running on the 4502 port which is also mentioned in your maven command.
- AEM is working properly which means /system/console/bundle should have all bundles active.

If not please fix these before running maven command.

Regards,
Arpit Varshney

Avatar

Level 2

@ArpitVarshney I can confirm that AEM is running on port 4502. As for the bundles, almost all the bundles are active besides a few that are listed as fragment

leanjunio_0-1704725105110.png

 

Avatar

Community Advisor

@leanjunio Its clear message that your project package is not able to connect to localhost:4502. You can check your parent pom.xml file with below 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>

 

If you still feel that every thing is correct from your end. Try installing below package manually to package manager and see if you are still facing any issue

/Users/juniol/Documents/work/dotcom/bootstrap/target/dotcom.bootstrap-1.0-SNAPSHOT.zip

 

Avatar

Level 2

I tried installing the below package and uploaded it but my site still doesn't show on the AEM Sites list.

Avatar

Administrator

@leanjunio  Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 2

Still experiencing the same error @kautuk_sahni more information would be appreciated

Avatar

Correct answer by
Level 2

On my end, I found the solution. The debug script was using the same port 4502 so AEM isn't able to receive the project package when I run `mvn clean install`.