Binay Kumar
Binay Kumar

Reputation: 1

The server encountered an internal error that prevented it from fulfilling this request

In the last month i have done one project ,everything it was running properly .But today i was trying to run that project ,but i am not able to see the output of the project . I am getting the following error.

type Exception report

message http://search.twitter.com/search.json?q=name

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.io.FileNotFoundException: showing the above link sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1610) com.zol.tst.search_by_keyword.doGet(search_by_keyword.java:60) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.37 logs.

I checked this URL(above link) also but but i am getting the one message {"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}

Some sample code i want to show

if(request.getParameter("search1")!=null)
        {

        PrintWriter writer  = response.getWriter();

            String urlstr = "http://search.twitter.com/search.json?q="+name;  
            StringBuffer buff = new StringBuffer();       

            URL url = new URL(urlstr);  
            BufferedReader br = new BufferedReader(  
                                        new InputStreamReader(  
                                        url.openConnection().getInputStream()));  
            int c;  

In the fourth line i have used that URL for that only i am not getting the output of my project .Can anyone help me.

Upvotes: 0

Views: 9958

Answers (2)

Nanne
Nanne

Reputation: 64419

The root cause of your problem is very clear: the url your are trying to reach doens't exist anymore: you are getting a 410: gone result back.

The reason is in the error you pasted:

The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.

You should read the docs linked there, and migrate to the v1.1 of the API

Upvotes: 1

Juned Ahsan
Juned Ahsan

Reputation: 68715

The problem is in the server code. It seems to be accessing some file to create the response but that file is missing and hence it is throwing "FileNotFoundException". It may happen that the file used by the server was present earlier but not now. So check your server code to see which file it is trying to load and whether it is present at the desired location or not.

Upvotes: 0

Related Questions