3 Replies Latest reply on Sep 26, 2005 8:20 AM by Thomas Joseph

    Problem Servlet Communicating with Session Bean in JBoss (ne

    Thomas Joseph Newbie

      Hi,
      I am new to JBoss. I am quite conversant with using Sun's RI for J2EE 1.4.

      I have a small application in which a Servlet calles a session bean. I done packaged it for JBoss and verified it with Sun's Deploy tool to be OK (Even deployed the ear to Sun RI Server to be working fine). However I am getting error when deployed on the server.

      Here is the stack trace on the Server console:


      14:37:15,950 ERROR [LogInterceptor] EJBException in method: public abstract tutorial.interfaces.Fibo tutorial.interfaces.FiboHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException:
      javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract tutorial.interfaces.Fibo tutorial.interfaces.FiboHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:161)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
       at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
       at org.jboss.ejb.plugins.TxInterceptorBMT.invokeHome(TxInterceptorBMT.java:54)
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:81)
       at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
       at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
       at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
       at org.jboss.ejb.Container.invoke(Container.java:894)
       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:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
       at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
      
       at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
       at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
       at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
       at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
       at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
       at $Proxy91.create(Unknown Source)
       at tutorial.web.ComputeServlet.doPost(ComputeServlet.java:83)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:534)


      Here is my ejb-jar.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
       <display-name>Fibonacci EJB</display-name>
       <enterprise-beans>
       <session>
       <description>A bean that generates Fibonacci numbers</description>
       <display-name>Fibo</display-name>
       <ejb-name>Fibo</ejb-name>
       <home>tutorial.interfaces.FiboHome</home>
       <remote>tutorial.interfaces.Fibo</remote>
       <ejb-class>tutorial.ejb.FiboBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Bean</transaction-type>
       <security-identity>
       <use-caller-identity/>
       </security-identity>
       </session>
       </enterprise-beans>
      
       <assembly-descriptor>
       <method-permission>
       <unchecked/>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Home</method-intf>
       <method-name>remove</method-name>
       <method-params>
       <method-param>java.lang.Object</method-param>
       </method-params>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Remote</method-intf>
       <method-name>compute</method-name>
       <method-params>
       <method-param>int</method-param>
       </method-params>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Remote</method-intf>
       <method-name>isIdentical</method-name>
       <method-params>
       <method-param>javax.ejb.EJBObject</method-param>
       </method-params>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Home</method-intf>
       <method-name>remove</method-name>
       <method-params>
       <method-param>javax.ejb.Handle</method-param>
       </method-params>
       </method>
       </method-permission>
       <method-permission>
       <unchecked/>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Home</method-intf>
       <method-name>getHomeHandle</method-name>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Home</method-intf>
       <method-name>create</method-name>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Remote</method-intf>
       <method-name>getHandle</method-name>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Home</method-intf>
       <method-name>getEJBMetaData</method-name>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Remote</method-intf>
       <method-name>getPrimaryKey</method-name>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Remote</method-intf>
       <method-name>remove</method-name>
       </method>
       <method>
       <ejb-name>Fibo</ejb-name>
       <method-intf>Remote</method-intf>
       <method-name>getEJBHome</method-name>
       </method>
       </method-permission>
       </assembly-descriptor>
      </ejb-jar>


      Here is my jboss.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
      <!--<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "C:\eclipse\jboss-4.0.2\docs\dtd\jboss_4_0.dtd">-->
      
      
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>Fibo</ejb-name>
       <jndi-name>jboss/ejb/FiboHome</jndi-name> <!--If enabled would provide a name to the Fibo EJB components' home interface, which otherwise will be bound to the same name as the bean itself.-->
       </session>
       </enterprise-beans>
       <resource-managers>
       </resource-managers>
      </jboss>


      Thanks in advance!!!