java.lang.NoSuchMethodError: javax.persistence.EntityManager.getCriteriaBuilder()Ljavax/persistence/ [message #778596] |
Fri, 13 January 2012 13:24 |
Marvin Toll Messages: 34 Registered: July 2009 |
Member |
|
|
Any Ideas???
Using Tomcat and EclipseLink v. 2.3.2 and failing on the line of code "final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();" in the following method:
/**
* This method returns the number of records in the database.
*
* @param boClass
* @return boolean
*/
public <BO extends SjpBaseBO> Long countGM(final Class<BO> boClass) {
if (null == boClass) {
throw new SjpPersistenceSE("Unable to resolve the null value.");
}
final EntityManager entityManager = initializeEntityManager();
final CriteriaBuilder criteriaBuilder = entityManager
.getCriteriaBuilder();
final CriteriaQuery<Long> criteriaQuery = criteriaBuilder
.createQuery(Long.class);
criteriaQuery
.select(criteriaBuilder.count(criteriaQuery.from(boClass)));
// cq.where(//your stuff);
return entityManager.createQuery(criteriaQuery).getSingleResult();
}
java.lang.NoSuchMethodError: javax.persistence.EntityManager.getCriteriaBuilder()Ljavax/persistence/criteria/CriteriaBuilder;
at info.soaj.sjp.facade.SjpBasicRF.countGM(SjpBasicRF.java:550)
at info.soaj.sjp.testing.SjpIncontainerTC.countGM(SjpIncontainerTC.java:287)
at info.soaj.sjr.domain.entity.booking.BookingBoMultiThreadTest.queryRecursive(BookingBoMultiThreadTest.java:221)
at info.soaj.sjr.domain.entity.booking.BookingBoMultiThreadTest.testBookingBO_find(BookingBoMultiThreadTest.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:155)
at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:120)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:94)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:225)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java:1)
at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:102)
at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:225)
at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:1)
at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:73)
at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:225)
at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java:1)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:722)
Marvin Toll
CTO, Pattern Enabled Development
http://pedCentral.com
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03888 seconds