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

adding jsonb to core project has killed all slingServlets.

Avatar

Avatar
Validate 10
Level 4
TB3dock
Level 4

Likes

23 likes

Total Posts

170 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 4
TB3dock
Level 4

Likes

23 likes

Total Posts

170 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
TB3dock
Level 4

06-04-2021

In order to convert between json and objects in an Adobe AEM project, I added the following to the core modules pom.xml file:

<dependency>
  <groupId>javax.json.bind</groupId>
  <artifactId>javax.json.bind-api</artifactId>
  <version>1.0</version>
</dependency>

<dependency>
  <groupId>org.eclipse</groupId>
  <artifactId>yasson</artifactId>
  <version>1.0</version>
  <scope>runtime</scope>
</dependency>

I added them right below this dependency:

 

<artifactId>slf4j-test</artifactId>

 

If I then add the following line:

    Jsonb jsonb = JsonbBuilder.create();

to any sling servlet (and the import), it complies without error, but when I try to hit any servlet I get the below error.  If I remove the line, it works again.  Could it be I have added the dependency to the wrong pom.xml, or in the wrong place, or need to add it somewhere else also?

Resource at '/bin/demo/querybuilder' not found: No resource found
Cannot serve request to /bin/demo/querybuilder in BundledScriptServlet (/libs/sling/servlet/errorhandler/404.jsp)

Request Progress:
      0 TIMER_START{Request Processing}
     21 COMMENT timer_end format is {<elapsed microseconds>,<timer name>} <optional message>
     43 LOG Method=GET, PathInfo=null
     58 TIMER_START{handleSecurity}
   3285 TIMER_END{3224,handleSecurity} authenticator org.apache.sling.auth.core.impl.SlingAuthenticator@bd75a69 returns true
   4676 TIMER_START{ResourceResolution}
   5588 TIMER_END{910,ResourceResolution} URI=/bin/demo/querybuilder resolves to Resource=NonExistingResource, path=/bin/demo/querybuilder
   5601 LOG Resource Path Info: SlingRequestPathInfo: path='/bin/demo/querybuilder', selectorString='null', extension='null', suffix='null'
   5601 TIMER_START{ServletResolution}
   5615 TIMER_START{resolveServlet(/bin/demo/querybuilder)}


 

View Entire Topic

Avatar

Avatar
Validate 1
Level 6
KiranVedantam1992
Level 6

Likes

150 likes

Total Posts

155 posts

Correct Reply

44 solutions
Top badges earned
Validate 1
Establish
Give Back 3
Give Back
Boost 50
View profile

Avatar
Validate 1
Level 6
KiranVedantam1992
Level 6

Likes

150 likes

Total Posts

155 posts

Correct Reply

44 solutions
Top badges earned
Validate 1
Establish
Give Back 3
Give Back
Boost 50
View profile
KiranVedantam1992
Level 6

06-04-2021

Hi @TB3dock,

 

First, check if the bundle is active. If not try changing the scope to provided. If that did not help, try adding the bundle in the Embedded section.

 

To know how to add it in the embedded section, check my post here.

 

If nothing works, please share the log.

 

Hope this helps.

 

Thanks,

Kiran Vedantam