Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

com.jcraft.jsch -- Cannot be resolved , AEM as a Cloud

Avatar

Avatar
Validate 1
Level 7
Prince_Shivhare
Level 7

Likes

96 likes

Total Posts

377 posts

Correct Reply

61 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 1
Level 7
Prince_Shivhare
Level 7

Likes

96 likes

Total Posts

377 posts

Correct Reply

61 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 50
View profile
Prince_Shivhare
Level 7

17-04-2021

Hi All,

 

I have added this dependency in the POM file to work on the SFTP file transfer.

 

I am able to run this code using the main function. but when it comes to deploy it to AEM it is giving me an error.

 

17.04.2021 17:24:55.615 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle project.core [548]. Reason: {}. Will retry.
org.osgi.framework.BundleException: Unable to resolve project.core [548](R 548.21): missing requirement [project.core [548](R 548.21)] osgi.wiring.package; (osgi.wiring.package=com.jcraft.jsch) Unresolved requirements: [[project.core [548](R 548.21)] osgi.wiring.package; (osgi.wiring.package=com.jcraft.jsch)]

 

Prince_Shivhare_0-1618660847178.png

 

Parent POM - 

<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>

 

Core POM -

<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
</dependency>

 

One More Error i observed -

[ERROR] com.project:project.core:1.0.0-SNAPSHOT: Bundleproject.core:1.0.0-SNAPSHOT is importing package(s) com.jcraft.jsch in start level 20 but no bundle is exporting these for that start level.
[ERROR] Analyser detected errors on feature 'com.project:project.analyse:slingosgifeature:aggregated-author.stage:1.0.0-SNAPSHOT'. See log output for error messages.

 

Can anyone help me on it?

 

 

View Entire Topic

Avatar

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

414 likes

Total Posts

522 posts

Correct Reply

138 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

414 likes

Total Posts

522 posts

Correct Reply

138 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile
asutosh_jena
Level 10

17-04-2021

Hi @Prince_Shivhare 

 

This issue is due to AEM not able to resolve the external dependency with com.jcraft.

You need to wrap the dependent JAR into an OSGi bundle and that needs to be deployed into AEM.

 

Please include the below 2 dependency with version number in main pom.xml

<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jzlib</artifactId>
<version>1.1.3</version>
</dependency>

 Include the same 2 dependency in core pom.xml without version information:

<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jzlib</artifactId>
</dependency>

do an includeresource in core pom.xml for the above jars in bnd-maven-plugin as below:

-includeresource: jsch-[0-9.]*.jar;lib:=true,jzlib-[0-9.]*.jar;lib:=true

It will look something like below: (highlighted is the only change)

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<executions>
<execution>
<id>bnd-process</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<bnd><![CDATA[
Import-Package: javax.annotation;version=0.0.0,*
-includeresource: jsch-[0-9.]*.jar;lib:=true,jzlib-[0-9.]*.jar;lib:=true
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>

 Now embedd both the JAR on all.pom.xml (not same as main pom.xml) and deploy into the AEM along with all package. This is the same place where all the packages are embedded and getting deployed into AEM instance. This will be deployed to all AEM instance and does not require any manual deployment to each instance.

<embedded>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<type>jar</type>
<target>/apps/sample-packages/application/install</target>
</embedded>
<embedded>
<groupId>com.jcraft</groupId>
<artifactId>jzlib</artifactId>
<type>jar</type>
<target>/apps/sample-packages/application/install</target>
</embedded>

 

This will resolve the maven issue and you should be able to proceed with the deployment.

 

Hope this helps!

Thanks