-
1. Re: Exception initializing interceptors (EJB3InterceptorsFac
pdeshmuk Sep 5, 2008 2:52 PM (in response to pdeshmuk)The EJB i.e. TrainingWebServiceBean is a stateless session bean (2.0) and implements the javax.ejb.SessionBean interface.
-
2. Re: Exception initializing interceptors (EJB3InterceptorsFac
pdeshmuk Sep 5, 2008 3:28 PM (in response to pdeshmuk)Upon further digging, the root cause seems to be the PostConstruct annotated method not liking the ejbCreate method signature (the fact that it throws checked exceptions):
Caused by: java.lang.RuntimeException: @javax.annotation.PostConstruct annotated method has the wrong signature - public void com.creativesolutions.ems.prsbtaxtracking.ejb.PRSBTaxTrackingControllerBean.ejbCreate() throws javax.ejb.CreateException,java.rmi.RemoteException,javax.naming.NamingException at org.jboss.ejb3.interceptor.InterceptorInfoRepository$ContainerInitialiser.resolveLifecycleMethod(InterceptorInfoRepository.java:782) at org.jboss.ejb3.interceptor.InterceptorInfoRepository$AnnotationInitialiser.resolvePostConstruct(InterceptorInfoRepository.java:714) at org.jboss.ejb3.interceptor.InterceptorInfoRepository$AnnotationInitialiser.getInfo(InterceptorInfoRepository.java:688) at org.jboss.ejb3.interceptor.InterceptorInfoRepository.initialiseFromAnnotations(InterceptorInfoRepository.java:481) at org.jboss.ejb3.interceptor.InterceptorInfoRepository.getOrInitialiseFromAnnotations(InterceptorInfoRepository.java:466) at org.jboss.ejb3.interceptor.InterceptorInfoRepository.getBeanClassInterceptors(InterceptorInfoRepository.java:161) at org.jboss.ejb3.interceptor.InterceptorInfoRepository.getBeanClassAroundInvokes(InterceptorInfoRepository.java:136) at org.jboss.ejb3.interceptor.EJB3InterceptorsFactory.createPerJoinpoint(EJB3InterceptorsFactory.java:101) ... 148 more
Any thoughts? -
3. Re: Exception initializing interceptors (EJB3InterceptorsFac
jaikiran Sep 7, 2008 4:11 AM (in response to pdeshmuk)"pdeshmuk" wrote:
Upon further digging, the root cause seems to be the PostConstruct annotated method not liking the ejbCreate method signature (the fact that it throws checked exceptions):
Any thoughts?
As per section 12.4 of EJB3 spec,Lifecycle callback interceptor methods defined on a bean class have the following signature:
void <METHOD>()
So your ejbCreate method, which you have annotated with @PostConstruct does not follow this rule. -
4. Re: Exception initializing interceptors (EJB3InterceptorsFac
pdeshmuk Sep 7, 2008 3:08 PM (in response to pdeshmuk)Thanks Jaikiran - I figured that was the problem and removed the exceptions from the throws clause of ejbCreate(). I am able to deploy the beans now.
Please note that these are NOT EJB 3.0 beans but EJB 2.0 beans that we are trying to package with other EJB 3.0 beans in the same JAR. Looks like the container will treat all my EJB 2.0 beans as EJB 3.0 beans because they have been packaged under the EJB 3.0 deployment descriptor. I am wondering if there are any other gotchas that we will run into as we perform more tests on the EJB 2.0 and EJB 3.0 beans that have been packaged together. I am really interested in knowing if anyone else has tried this approach (packaging EJB 2.0 and EJB 3.0 beans in the same JAR) and run into similar problems. -
5. Re: Exception initializing interceptors - Entity beans
pdeshmuk Sep 8, 2008 9:54 AM (in response to pdeshmuk)We are now able to access Session EJBs, but having issues accessing our (EJB 2.0) Entity EJBs. The container does not bind them to the JNDI namespace (I checked on the JMXConsole) and I am getting a NameNotFoundException. I think it treats EJB 2.0 Entities as EJB 3.0 Entities which do not need to get bound to the JNDI namespace. Here is part of the exception trace:
09:40:55,941 ERROR [ContactCompositeBean] javax.naming.NameNotFoundException: PasswordHistory not bound
com.creativesolutions.ems.EJBUtil.EJBLoaderException: javax.naming.NameNotFoundException: PasswordHistory not bound
at com.creativesolutions.ems.EJBUtil.EJBLoader.getPasswordHistoryHome(EJBLoader.java:4334)
at com.creativesolutions.ems.compositeBean.ContactCompositeBean.savePasswordHistory(ContactCompositeBean.java:1778)
at com.creativesolutions.ems.compositeBean.ContactCompositeBean.changeUserPassword(ContactCompositeBean.java:586)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)