0
我試圖用這個代碼來獲得谷歌驅動器的授權用戶名:谷歌雲端硬盤API的Java用戶類
public class list extends HttpServlet{
private DbxClient client;
String token;
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{
try{
DbxRequestConfig requestConfig = new
DbxRequestConfig("JavaDropBoxTutorial/1.0",Locale.getDefault().toString());
HttpSession session = req.getSession();
token = session.getAttribute("access_token").toString();
client = new DbxClient(requestConfig, token);
session.setAttribute("dropuser",client.getAccountInfo().displayName);
User u = new User();
System.out.print(u.getDisplayName());
res.sendRedirect("listdetails.jsp");
}
catch(Exception e){
}
}
}
但我得到這個錯誤: -
HTTP Status 500 - Servlet execution threw an exception
隨着例外
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
根源
java.lang.NoClassDefFoundError: com/google/common/base/Preconditions
m試圖獲取谷歌驅動器授權用戶的名字 –
請考慮將您的代碼示例縮小爲[最小,完整且可驗證的示例](http://stackoverflow.com/help/m cve)並改進格式以使其更具可讀性。 –