Not able to import a class in aem component jsp

Avatar

Avatar
Validate 1
Level 2
ajinkayk6258253
Level 2

Likes

10 likes

Total Posts

39 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
ajinkayk6258253
Level 2

Likes

10 likes

Total Posts

39 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
ajinkayk6258253
Level 2

06-04-2020

Hi All,

 

I'm want to use an api for encoding in my component's jsp and in my servlet which consist some backend logic. i have added dependency in my core,ui,parent's pom file. i'm able to import the class in the servlet and other java classes. but importing same class in component jsp is giving error only a type can be imported. i have tried giving package name in exported-packages and made other possible changes. any help? 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
Employee
surabhikatiyar
Employee

Likes

68 likes

Total Posts

46 posts

Correct reply

18 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Boost 50
Employee
surabhikatiyar
Employee

Likes

68 likes

Total Posts

46 posts

Correct reply

18 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile
surabhikatiyar
Employee

07-04-2020

This error is usually because that package is not exported (or the bundle exporting it is not active), so not available to the JSP compiler.

Can you please check below points:

  1. Make sure that all bundles are active
  2. Make sure that a bundle actually exports this class
  3. Can you try:
  • rebuild clientlibs http://host:port/libs/granite/ui/content/dumplibs.rebuild.html
  • recompile JSP via http://host:port/system/console/slingjsp

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile
ArpitVarshney
MVP

07-04-2020

@ajinkayk6258253 Please verify first whether your bundle is in resolved state in OSGi console.If no then please make sure that it should be resolved in OSGi and then try to use.

 

If you are not able to figure out then provide detailed information of your issue.