I get this error when i click on a button. Please I need help
//This is the method that cause the error. It is a class called HibernateHelper static public java.util.List getMaxPropertyValue(Class classBean, String strKey) { java.util.List result = new java.util.ArrayList(); Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction(); Criteria cr = session.createCriteria(classBean);
if (strKey != null) { cr.setProjection(Projections.max(strKey)); }
result = cr.list(); tx.commit(); session.close(); return result; }
//This is the method that calls the getMaxPropertyValue method. It is in a class called ControllerHelper @ButtonMethod(buttonName = "createGroupButton") public String createMethod() { java.util.List list = HibernateHelper.getMaxPropertyValue(data_3.getClass(), "group_id"); request.setAttribute("MaxGroupID", list); return jspLocation("group.jsp"); }
//This is the error Button Method Error java.lang.NoSuchMethodError: shared.HibernateHelper.getMaxPropertyValue(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/List;
java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at shared.HelperBaseCh4.invokeButtonMethod(HelperBaseCh4.java:155) at shared.HelperBaseCh4.executeButtonMethod(HelperBaseCh4.java:122) at shared.HelperBaseCh4.executeButtonMethod(HelperBaseCh4.java:93) at sdp.ControllerHelper.doPost(ControllerHelper.java:147) at sdp.Controller.doPost(Controller.java:37) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoSuchMethodError: shared.HibernateHelper.getMaxPropertyValue(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/List; at sdp.ControllerHelper.createMethod(ControllerHelper.java:92) ... 27 more
I am using Tomcat
Please can some one help me. Thanks in advance
|