Getting error on Varnish | Community
Skip to main content
September 2, 2021
Solved

Getting error on Varnish

  • September 2, 2021
  • 2 replies
  • 1194 views

Hi @1905403,
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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kiran_Vedantam

Hi @lone_ranger,

 

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.

2 replies

Asutosh_Jena_
Community Advisor
Community Advisor
September 2, 2021

Hi @lone_ranger 

 

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!

September 2, 2021

Hi @asutosh_jena_ 

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

i am reading properties like tags and locale

Kiran_Vedantam
Community Advisor
Kiran_VedantamCommunity AdvisorAccepted solution
Community Advisor
September 2, 2021

Hi @lone_ranger,

 

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.

September 3, 2021

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