-1

I have a problem in getting list of users using $resource.

I am making a webservice call using $resource to get list of users. It works most of the time, but when ever the response takes some time I am getting 500 internal server error.

The code I am using to call the webservice:

$resource("user/referral/getUserList", {}, {
            query: {
                method: 'GET'
            }
        })

I will be grateful for your help.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Raja
  • 1
  • What is the exact error your are receiving, what's the full error response? – mindparse Apr 29 '16 at 08:43
  • It's a problem on your server. We can't help you unless you find out what the error is, it is not related to the code above. – Patrick Apr 29 '16 at 08:58
  • It looks like the request is timed out before the response from the server. Do i need to set any request time like that? – Raja May 02 '16 at 11:21

2 Answers2

0

It looks like you are missing a "/" at the left.

user/referral/getUserList

Please keep this as well if you want to have the result as an array.

'query':  {method:'GET', isArray:true}
erolkaya84
  • 1,769
  • 21
  • 28
0

I had the same problem in Glassfish. It's a bug in Glassfish 4.1.1 https://java.net/jira/browse/JERSEY-2888

I was able to fix it in this way:

In glassfish/modules/org.eclipse.persistence.moxy.jar fix META-INF/MANIFEST.MF Just append the following to Import-Package:

,org.xml.sax.helpers,javax.xml.parsers;resolution:=optional,javax.naming;resolution:=optional

in 72 line and restart GF