trouble using java-twitter in web application

12 views
Skip to first unread message

method8

unread,
Jul 27, 2009, 3:58:04 AM7/27/09
to java-twitter
hi,

I managed to overcome most of the beginner issues (I think) by using
JRE1.6 and creating DescriptorProtos. I started building some twitter
oriented java applications, however I can't create a simple web
application that does the same.

I'm using Tomcat 5.5 on JRE 1.6.

It builds successfully but I get:

javax.servlet.ServletException: Could not initialize class
net.unto.twitter.Api
org.apache.jasper.runtime.PageContextImpl.doHandlePageException
(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:774)
org.apache.jsp.index_jsp._jspService(index_jsp.java:65)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause

java.lang.NoClassDefFoundError: Could not initialize class
net.unto.twitter.Api
org.apache.jsp.index_jsp._jspService(index_jsp.java:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

as soon as I run this simple jsp:

<%@page import="net.unto.twitter.Api" %>
<%@page import="net.unto.twitter.TwitterProtos.Status" %>
<html>
<head></head>
<body>
<%
String message = request.getParameter("m");
if (message != null){
Api api = Api.builder().username("myusername").password
("mypassword").build();
api.updateStatus(message).build().post();
}
%>
</body>
</html>

Any ideas please?

Thanks,

William.

P.S. All libraries (dependencies) are in place as I double checked that

Nigel

unread,
Aug 20, 2009, 3:42:59 AM8/20/09
to java-twitter
Hello

I have just started to install java-twitter and am still having
difficulty with what seems to be a 'beginner issue', the runtime
FileDescriptor error when running the example. I am using JDK 1.6,
have all the libraries in place, sorted the protobuf compilation; so
am at a loss as to what to do next. I am not aware of having created
DescriptorProtos can you advise me on how to sort this or point me to
a link that describes what's next.

Many thanks for your help

Nigel
Reply all
Reply to author
Forward
0 new messages