-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: java.lang.NoSuchMethodError: shared.HibernateHelper.getMaxPr
PostPosted: Tue Oct 15, 2013 10:18 pm 
Newbie

Joined: Tue Oct 15, 2013 9:58 pm
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: java.lang.NoSuchMethodError: shared.HibernateHelper.getMaxPr
PostPosted: Tue Oct 22, 2013 10:03 am 
Newbie

Joined: Tue Oct 22, 2013 9:51 am
Posts: 1
The problem is due to lack of some hibernate Jars, refer to
http://codingkit.com/a/JAVA/2013/1022/2279.html


Top
 Profile  
 
 Post subject: Re: java.lang.NoSuchMethodError: shared.HibernateHelper.getMaxPr
PostPosted: Tue Oct 22, 2013 11:40 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
The above comment is misleading, as that link is about a different issue.

The stacktrace mentions a missing method which is not part of Hibernate, this is not an Hibernate problem but you have some mismatch across your own dependencies.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: java.lang.NoSuchMethodError: shared.HibernateHelper.getMaxPr
PostPosted: Tue Oct 22, 2013 9:42 pm 
Newbie

Joined: Tue Oct 15, 2013 9:58 pm
Posts: 2
Thanks Guys!!! The issue has been solved. It was because I did not compile the Java class the method is in. Thanks for your replies!!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.