0

I am trying to login the my application, I am getting the below error in my glassfish console.

javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.AbstractMethodError at com.sun.ejb.containers.EJBContainerTransactionManager.checkExceptionClientTx(EJBContainerTransactionManager.java:665)
 at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:507) at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4475)
 at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2009)
 at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1979)
 at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
 at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
 at com.sun.proxy.$Proxy435.find(Unknown Source)
 at myservername.server.facade.__EJB31_Generated__UsersFacade__Intf____Bean__.find(Unknown Source)  at myservername.server.rest.AuthenticatorResource.getAuthenticatedUser(AuthenticatorResource.java:89)
 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:606)
 at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
 at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
 at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4695)
 at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:630)
 at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
 at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
 at myservername.server.rest.ResourceAuditor.audit(ResourceAuditor.java:37) 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:606)
 at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
 at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
 at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
 at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
 at sun.reflect.GeneratedMethodAccessor549.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
 at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
 at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
 at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
 at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
 at sun.reflect.GeneratedMethodAccessor552.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
 at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
 at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
 at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4667)
 at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4655)
 at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
 at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
 at com.sun.proxy.$Proxy434.getAuthenticatedUser(Unknown Source)
 at myservername.server.rest.__EJB31_Generated__AuthenticatorResource__Intf____Bean__.getAuthenticatedUser(Unknown Source)
 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:606)
 at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
 at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
 at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
 at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
 at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
 at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
Kalle Richter
  • 8,008
  • 26
  • 77
  • 177

1 Answers1

0

GlassFish v4 is an implementation of Java EE 7, whereas v3 is of Java EE 6, so there is a big difference in APIs. The error you get results most likely from changes within those APIs, where a method is now abstract which was not at compile time of your application. So you might want to check for migration guides, such as this.

And check out this post, which might be the same case.

Community
  • 1
  • 1
Alexander Rühl
  • 6,769
  • 9
  • 53
  • 96
  • As per your guidance i am using hibernate 4.3.4.final with jpa 2.1 though i am getting same error, Please Guide me if i was missing anything wrong. – Ubaidulla Azeem Jun 26 '14 at 10:05
  • It's hard to tell without your code, so you should post the part where the exception happens. – Alexander Rühl Jun 26 '14 at 10:42
  • I got the Exception when calling the below facade method, **bold**`public T find(Object id) { return getEntityManager().find(entityClass, id); }` – Ubaidulla Azeem Jun 26 '14 at 13:35
  • Below is the Exception, **bold** `Caused by: java.lang.AbstractMethodError at com.sun.enterprise.container.common.impl.EntityManagerWrapper._getDelegate(EntityManagerWrapper.java:197) at com.sun.enterprise.container.common.impl.EntityManagerWrapper.find(EntityManagerWrapper.java:341) at com.server.facade.AbstractFacade.find(AbstractFacade.java:33)` – Ubaidulla Azeem Jun 26 '14 at 13:39
  • If I understand it correctly, in your own code you are just calling find(...) on EntityManager, which should not cause any problem. If it happens within glassfish code, then it's beyond my ability to help. Maybe you have still things from glassfish 3 somehow bundled in your application? Or it has to do with using Hibernate, which when you google for it in combination with glassfish 4 shows some problems. Does it have to be Hibernate? Otherwise, it seems a good idea to use everything provided from Glassfish if possible. – Alexander Rühl Jun 26 '14 at 14:14
  • @UbaidullaAzeem: So what was the problem and how did you solve it? Maybe it's helpful for others to mention it here. – Alexander Rühl Jun 27 '14 at 06:04
  • Yes. As you said I have missed to add the latest version of libraries (hibernate-core-4.3.5.Final.jar, hibernate-entitymanager-4.3.5.Final.jar, hibernate-jpa-2.1-api-1.0.0.Final.jar, javaee-api-7.0.jar, jboss-logging-3.1.3.GA.jar, jboss-logging-annotations-1.2.0.Beta1.jar and jboss-transaction-api_1.2_spec-1.0.0.Final.jar) to the Glassfish-4.0/glassfish/lib directory. After I added those libraries restarted the GF and It's working fine. – Ubaidulla Azeem Jun 27 '14 at 09:32
  • Also I added the below config in persistence.xml. with help of [this forum link](http://kyryloholodnov.wordpress.com/2013/08/19/hibernate-4-2-4-and-jpa-2-1/) – Ubaidulla Azeem Jun 27 '14 at 09:35
  • @UbaidullaAzeem: Although it might work, be careful about adding libs from the standard Java EE API, since they are the base of the GlassFish installation. Only add additional libs and preferably within your deployed WAR/EAR file instead of the GlassFish lib folder. – Alexander Rühl Jun 27 '14 at 11:07
  • @UbaidullaAzeem: As you are new to StackOverflow, just the information that if an answer was helpful, considering voting it up and accepting it. – Alexander Rühl Jun 27 '14 at 11:08