Getting error on Varnish | Community
Skip to main content
Level 4
Sep 2, 2021 8:42 AM UTC
Solved

Getting error on Varnish

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.
Kiran_Vedantam
Kiran_VedantamAccepted solution
New Participant
Sep 2, 2021 12:12 PM UTC

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.

4 replies

Kiran_Vedantam
Kiran_VedantamAccepted solution
New Participant
Sep 2, 2021 12:12 PM UTC

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.

Translate
Level 4
Sep 3, 2021 12:12 PM UTC

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

 

Translate
Asutosh_Jena_
New Participant
Sep 2, 2021 9:06 AM UTC

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!

Translate
Level 4
Sep 2, 2021 9:47 AM UTC

Hi @asutosh_jena_ 

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

i am reading properties like tags and locale

Translate