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

Cannot resolve imported package in servlet bundle

Avatar

Avatar
Validate 1
Level 1
chrisd62525856
Level 1

Like

1 like

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
chrisd62525856
Level 1

Like

1 like

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile
chrisd62525856
Level 1

15-10-2015

I am trying to use a 3rd party project (Jsoup) in my servlet. I have gone through the steps to build and deploy a bundle fragment plugin as outlined here:

https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

This part works fine, I deploy it successfully via web console bundles and it has an "active" status. In my servlet's pom.xml I then include the dependency as such:

<dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.8.1</version>
</dependency>

I then build my servlet, do the maven clean install and deploy the servlet via the web console bundles. However, under imported packages I keep getting this error :

org.jsoup,version=[1.8,2) -- Cannot be resolved
org.jsoup.safety,version=[1.8,2) -- Cannot be resolved

Can anybody please help me out, its driving me nuts! Any advice would be appreciated

View Entire Topic

Avatar

Avatar
Validate 1
Level 1
ykumarreddy
Level 1

Like

1 like

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ykumarreddy
Level 1

Like

1 like

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ykumarreddy
Level 1

22-02-2017

HI,

 

I followed exactly same as you specified in the  document. But I still getting below error.  In my bundle I added dependency as 

 

         <dependency>
            <!-- jsoup HTML parser library @ http://jsoup.org/ -->
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.7.3</version>
        </dependency>

 

When I ran the maven command In menifest file I am seeing import and 

The Import-package section is have the version number as below.  Could you please help how can I fix this issue.

 

Import-Package: com.adobe.cq.sightly;version="[2.5,3)",com.day.cq.i18n;v
 ersion="[5.4,6)",com.day.cq.wcm.api;version="[1.17,2)",com.day.cq.wcm.a
 pi.designer;version="[5.8,6)",com.day.cq.wcm.msm.api;version="[5.9,6)",
 com.delltechnologies.constants,com.delltechnologies.service,javax.injec
 t;version=1,javax.jcr;version="[2.0,3)",javax.jcr.observation;version="
 [2.0,3)",javax.servlet,org.apache.commons.lang3;version="[3.0,4)",org.a
 pache.commons.lang3.builder;version="[3.0,4)",org.apache.sling.api;vers
 ion="[2.3,3)",org.apache.sling.api.request;version="[2.4,3)",org.apache
 .sling.api.resource;version="[2.9,3)",org.apache.sling.api.scripting;ve
 rsion="[2.2,3)",org.apache.sling.commons.json;version="[2.0,3)",org.apa
 che.sling.commons.osgi;version="[2.4,3)",org.apache.sling.jcr.api;versi
 on="[2.3,3)",org.jsoup;version="[1.7,2)",org.jsoup.nodes;version="[1.7,
 2)",org.jsoup.select;version="[1.7,2)
",org.osgi.service.component;versi
 on="[1.1,2)",org.slf4j;version="[1.5,2)"

g.jsoup,version=[1.7,2) -- Cannot be resolved
org.jsoup.safety,version=[1.7,2) -- Cannot be resolved