Я использую Eclipse для разработки и включил пакет в путь сборки, но все равно получаю эту ошибку.
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: ch/ethz/ssh2/Connection
Push_Individual_Engine.putFile(Push_Individual_Engine.java:107)
Push_Individual_Engine.doPost(Push_Individual_Engine.java:80)
Push_Individual_Engine.doGet(Push_Individual_Engine.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.ClassNotFoundException: ch.ethz.ssh2.Connection
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1493)
Push_Individual_Engine.putFile(Push_Individual_Engine.java:107)
Push_Individual_Engine.doPost(Push_Individual_Engine.java:80)
Push_Individual_Engine.doGet(Push_Individual_Engine.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.30 logs.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.30
Это код, который я использую,
private void putFile(File f){
Connection Conn = null;
try {
Conn = new Connection("servername");
ConnectionInfo info = Conn.connect();
Conn.authenticateWithPassword("username" , "password");
SCPClient SCP = new SCPClient(Conn);
SCP.put(f.toString(), "foldername", "0755");
Conn.close();
} catch (Exception e) {
try {
Conn.close();
} catch (Exception e1) {}
}
}
Есть идеи?