1 Reply Latest reply on Jan 31, 2002 9:37 AM by ftg314159

    Deploy fails for session bean on remove()

    ftg314159

      I coded my first entity bean, and deployed it with no problem using 3.0.0 (current CVS as of today). Then I coded a session bean (stateless), and tried to add it to the ejb-jar. The deployment now fails because of a NoSuchMethodException looking for a remove() method.

      I know that the Home interfaces define remove() methods, but all of the examples I find (JBoss and otherwise) don't code them in the Local or Remote Home source files. Anyway, I tried coding them explicitly and it still failed the same way.

      Somebody else reported something very much like this on Dec. 12, but didn't get any response.

      The stacktrace below is from a 1.4 JVM. With 1.3.1_01, I either see the same failure (except the 1.3 exception doesn't include the name of the method it's looking for, and the 1.4 exception does), or the JVM crashes before I get that far.

      Im sure I've just overlooked something dumb. Any advice welcomed gratefully...

      16:32:29,790 ERROR [EJBDeployer] Could not deploy file:/home/jboss/jboss-3.0.0DR1/deploy/WebDataLog.jar
      java.lang.NoSuchMethodException: remove
      at java.lang.Class.getMethod0(Class.java:1742)
      at java.lang.Class.getMethod(Class.java:951)
      at org.jboss.ejb.StatelessSessionContainer.setUpBeanMappingImpl(StatelessSessionContainer.java:461)
      at org.jboss.ejb.StatelessSessionContainer.setupBeanMapping(StatelessSessionContainer.java:494)
      at org.jboss.ejb.StatelessSessionContainer.create(StatelessSessionContainer.java:161)
      at org.jboss.ejb.Application.start(Application.java:214)
      at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:429)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:376)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:348)
      at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:254)
      at org.jboss.deployment.MainDeployer.startService(MainDeployer.java:204)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:130)
      at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.system.Server.(Server.java:157)
      at org.jboss.Main.boot(Main.java:208)
      at org.jboss.Main.run(Main.java:44)
      at java.lang.Thread.run(Thread.java:536)

        • 1. Re: Deploy fails for session bean on remove()
          ftg314159

          Well, answering my own question, the problem was that the Session bean's Local interface was extending EJBObject and not EJBLocalObject.

          I finally figured this out from the server.log, which showed log.debug output from StatelessSessionContainer that first showed all of the bean methods getting mapped in setupBeanMappingImpl (including remove), and then showed them all getting mapped again. Of course, the first time was for the remote interface, and the second time was for the local interface.

          I'm not sure that this should be considered a bug or not, but it seems that since setupBeanMappingImpl() is catching a possible NoSuchMethodException when trying to see if the method is implemented by the container, it probably ought to be doing the same just above when it tries to see if the method is implemented by the bean.