servlet出现错误java.lang.NoSuchMethodError,是什么原因呢??
org.apache.catalina.core.StandardWrapperValveinvokeSEVERE:Servlet.service()forservlet...
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet PhoneServlet threw exception
java.lang.NoSuchMethodError: jdbcconn.sendData(Ljava/lang/String;[Ljava/lang/String;)Z
at PhoneServlet.doPost(PhoneServlet.java:192)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at filters.ExampleFilter.doFilter(ExampleFilter.java:102)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:636)
这是定义的 sendData(String user,String []data) 函数,然后在dopost方法中调用。
public static boolean sendData(String user,String []data) {
int idzc=-1;
String changedb="select id from jos_users where username='"+user+"'";
ResultSet rs = null;
ResultSet rsdb = null;
try {
rsdb=stmt.executeQuery(changedb);//查询jos_users中的id号
if(rsdb.next())
idzc=rsdb.getInt("id");
String weightqry="insert into jos_chronoforms_healthdata (cf_user_id,Temperature,oxygen,stature,weight,diastolic,systolic,sphygmus,recordtime,alert)" +
"values("+idzc+",'"+data[0]+"','"+data[1]+"','','','','','','"+getSystemTime()+"','"+data[2]+"')";
stmt.executeUpdate(weightqry);
} catch (SQLException e) {
... }
finally
{
.. }
catch(Exception ex) {
...
}
return true;
} 展开
SEVERE: Servlet.service() for servlet PhoneServlet threw exception
java.lang.NoSuchMethodError: jdbcconn.sendData(Ljava/lang/String;[Ljava/lang/String;)Z
at PhoneServlet.doPost(PhoneServlet.java:192)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at filters.ExampleFilter.doFilter(ExampleFilter.java:102)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:636)
这是定义的 sendData(String user,String []data) 函数,然后在dopost方法中调用。
public static boolean sendData(String user,String []data) {
int idzc=-1;
String changedb="select id from jos_users where username='"+user+"'";
ResultSet rs = null;
ResultSet rsdb = null;
try {
rsdb=stmt.executeQuery(changedb);//查询jos_users中的id号
if(rsdb.next())
idzc=rsdb.getInt("id");
String weightqry="insert into jos_chronoforms_healthdata (cf_user_id,Temperature,oxygen,stature,weight,diastolic,systolic,sphygmus,recordtime,alert)" +
"values("+idzc+",'"+data[0]+"','"+data[1]+"','','','','','','"+getSystemTime()+"','"+data[2]+"')";
stmt.executeUpdate(weightqry);
} catch (SQLException e) {
... }
finally
{
.. }
catch(Exception ex) {
...
}
return true;
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询