Hi All,
At present, I am trying my hand in integrating Ejb 3.0 with Spring 2.5. I am using jboss 4.2.2 GA.
I am starting my server and deploying my ear file through Eclipse.
I am getting the following exception while deploying the ejb jar along with the ear file. ( after removing this ejb jar , the deployment is fine )
09:40:38,674 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=demoear.ear,jar=demoejb.jar,name=Ma sterdataEJB,service=EJB3 with dependencies:
09:40:38,721 INFO [EJBContainer] STARTED EJB: com.demo.MasterdataEJB ejbName: MasterdataEJB
09:40:38,799 INFO [EJBContainer] STOPPED EJB: com.demo.MasterdataEJB ejbName: MasterdataEJB
09:40:38,799 WARN [ServiceController] Problem starting service jboss.j2ee:ear=demoear.ear,jar=demoejb.jar,name=Ma sterdataEJB,service=EJB3
java.lang.ClassCastException: $Proxy81
at org.jboss.util.naming.Util.createSubcontext(Util.j ava:69)
at org.jboss.util.naming.Util.rebind(Util.java:125)
at org.jboss.util.naming.Util.rebind(Util.java:113)
at org.jboss.ejb3.stateless.StatelessRemoteProxyFacto ry.start(StatelessRemoteProxyFactory.java:128)
at org.jboss.ejb3.ProxyDeployer.start(ProxyDeployer.j ava:83)
at org.jboss.ejb3.SessionContainer.start(SessionConta iner.java:157)
at org.jboss.ejb3.stateless.StatelessContainer.start( StatelessContainer.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.ejb3.ServiceDelegateWrapper.startService (ServiceDelegateWrapper.java:103)
at org.jboss.system.ServiceMBeanSupport.jbossInternal Start(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternal Lifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation .java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:264)
I am not sure where the mistake is.
below are the files.
Files inside META-INF
ejb-jar.xml
jboss.xmlCode:<enterprise-beans> <session> <ejb-name>MasterdataEJB</ejb-name> <home>com.demo.MasterdataEJB</home> <remote>com.demo.MasterdataRemote</remote> <ejb-class>com.demo.MasterdataEJB</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <env-entry> <env-entry-name>ejb/BeanFactoryPath</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>service.xml</env-entry-value> </env-entry> </session> </enterprise-beans> </ejb-jar>
service.xml ( availabe in the root folder of the classpath )Code:<?xml version="1.0" encoding="UTF-8"?> <jboss> <enterprise-beans> <session> <ejb-name>MasterdataEJB</ejb-name> <local-jndi-name>ejb/masterdataejb</local-jndi-name> </session> </enterprise-beans> </jboss>
Java Classes ( have not used the at-the-rate symbol for annotations while posting , as im not permitted to post it. )Code:<?xml version="1.0" encoding="UTF-8"?> <beans> <!-- ========= DAO DECLARATIONS============== --> <bean id="rootService" class="com.demo.WorkService"> </bean> </beans>
As of now, there are no methods. I am not getting why, I am getting this exp while deploying an ejb with spring.Code:Stateless(name = "MasterdataEJB") public class MasterdataEJB extends AbstractStatelessSessionBean implements MasterdataService { } Local public interface MasterdataHome extends EJBHome { public MasterdataRemote create() throws CreateException, RemoteException; } Remote public interface MasterdataRemote extends MasterdataService, EJBObject { } public interface MasterdataService { }
Thanx in Advance.
Vasu


Reply With Quote
