Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Getting error on Varnish

Avatar

Level 4

Hi @All,
i have developed 1 component which fetches documents on basis of selected tags...i have used Query Builder.

The code is working fine in Author and Publisher Environment. throwing error on varnish URL

Model cannot be correctly instantiated by the Use API

why it only visible in varnish URL

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @saurabh_kumar_02,

 

Queries:

  1. How are you getting the session object?
    1. If its via service-user, does the user trying to access jcr have all the required permissions?
  2. Did you put cache=true is your model
    1. If yes please remove it
  3. What all cache clearance you did here?

Also as per the error, there could be some null pointer error here. Can you please share/check the log where it says at which line number it is getting a null pointer?

Also, what you can do is try any other existing services that are using Query builder API and check if it is working fine.

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @saurabh_kumar_02 

 

If it works fine on Publish instance then it should work everywhere. When you say you are using a component, are you trying to use the Query Builder using a Sling Model or using any servlet?

 

If it's a Model, your page will be cached and if it has any error already cached at the Varnish URL you might be getting the same error.

 

Thanks!

Hi @Asutosh_Jena_ 

i am using sling model and already cleared cache....

i am reading properties like tags and locale

Avatar

Correct answer by
Community Advisor

Hi @saurabh_kumar_02,

 

Queries:

  1. How are you getting the session object?
    1. If its via service-user, does the user trying to access jcr have all the required permissions?
  2. Did you put cache=true is your model
    1. If yes please remove it
  3. What all cache clearance you did here?

Also as per the error, there could be some null pointer error here. Can you please share/check the log where it says at which line number it is getting a null pointer?

Also, what you can do is try any other existing services that are using Query builder API and check if it is working fine.

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

thanks was null pointer....but why the same is working on publisher?