0

I'm a noob here.

On Appengine my servlet gives me a 500 error caused by this:

try{
classifiedTweet = SentAnalysis.classifytext("en", "I am happy");
}catch(MashapeClientException mce){
mce.printStackTrace();
}

When I comment it out it works, but I want to see why this is not working.

Help please

Update 1

I found something similar here

Just that the solution doesn't work for me

Community
  • 1
  • 1
Farouk
  • 154
  • 5
  • 2
    Comment out what? The whole thing? – adarshr Jan 20 '12 at 10:17
  • I found something similar [here](http://stackoverflow.com/questions/4653040/cant-run-restlet-tutorial-2-0-first-server) Just that the solution doesn't work for me – Farouk Jan 20 '12 at 16:33

2 Answers2

2

May be the method is trowing some other exception. Try catching a broader Exception.

try{
    classifiedTweet = SentAnalysis.classifytext("en", "I am happy");
} catch(MashapeClientException mce) {
    mce.printStackTrace();
} catch(Exception e) {
    e.printStackTrace();
}
adarshr
  • 61,315
  • 23
  • 138
  • 167
2

You should see your stacktrace on the console itself. If you are uploading the app to appspot.com then you can go to appengine.google.com than to your application than go to logs. There you will find your stacktrace under the tag error.

Shadow
  • 6,161
  • 3
  • 20
  • 14
  • I checked the logs and found this Error for /CbTest java.lang.NoClassDefFoundError:org/apache/http/conn/scheme/SchemeSocketFactory at maptwit.SentimentAnalysisFree.classifytext(SentimentAnalysisFree.java:46) I added the httpclient jar to the lib folder in war but no change Help please – Farouk Jan 20 '12 at 11:01
  • This is odd try to clean the project and try again. Go to project -> clean project. Also check your build path if by mistake you have 2 different versions of httpclient – Shadow Jan 20 '12 at 11:20
  • I found something similar [here](http://stackoverflow.com/questions/4653040/cant-run-restlet-tutorial-2-0-first-server) Just that the solution doesn't work for me – Farouk Jan 20 '12 at 16:35