ubergrape / pyspotlight

A thin wrapper around the DBPedia Spotlight REST API
BSD 2-Clause "Simplified" License
58 stars 25 forks source link

Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)) #16

Closed waheedabro closed 7 years ago

waheedabro commented 7 years ago

Hello,

Thanks for writing nice wrapper. I am unable to establish a new connection.

Traceback (most recent call last): File "C:\Users\HP PC\pycoreNLP\NLTK_Examples\nltk_examples\dbpedia_Spotter.py", line 9, in annotations = spotlight.annotate('http://localhost/rest/annotate','Your test text', confidence=0.4, support=20) File "C:\Users\HP PC\AppData\Local\Programs\Python\Python35\lib\site-packages\spotlight__init.py", line 189, in annotate pydict = _post_request(address, payload, filters, headers) File "C:\Users\HP PC\AppData\Local\Programs\Python\Python35\lib\site-packages\spotlight\init__.py", line 48, in _post_request response = requests.post(address, data=payload, headers=reqheaders) File "C:\Users\HP PC\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\api.py", line 112, in post return request('post', url, data=data, json=json, kwargs) File "C:\Users\HP PC\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, kwargs) File "C:\Users\HP PC\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\sessions.py", line 513, in request resp = self.send(prep, send_kwargs) File "C:\Users\HP PC\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\sessions.py", line 623, in send r = adapter.send(request, kwargs) File "C:\Users\HP PC\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\adapters.py", line 504, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /rest/annotate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002917F6D2668>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))

waheedabro commented 7 years ago

Closing this because it seems to be server side issue i am facing server side issue.

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

originell commented 7 years ago

Yes, I'm pretty sure this is the problem.

Remember to raise the allowed memory that java may allocate. Maybe this helps: https://github.com/dbpedia-spotlight/dbpedia-spotlight/wiki/Troubleshooting#memory-error