glassfish
  1. glassfish
  2. GLASSFISH-12101

LocalBean with final method fails to deploy

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      12,101

      Description

      See the attached test case. It has a LocalBean which overrided toString() and
      marks it as final:

      @Stateless
      @LocalBean
      public class FooBean {
      public String test(String s)

      { return s.toUpperCase(); }

      @Override
      public final String toString()

      { return "FooBean"; }

      }

      It fails to deploy like this in latest glassfish:

      [#|2010-06-02T23:30:51.279+0530|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=64;_ThreadName=http-thread-pool-4848(3);|Exception
      while loading the app
      java.lang.RuntimeException: EJB Container initialization error
      at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:232)
      at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:207)
      at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:76)
      at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:176)
      at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:229)
      at
      com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:354)
      at
      com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:197)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:281)
      at
      com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:321)
      at
      com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:336)
      at
      com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:905)
      at
      com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:91)
      at
      com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1007)
      at
      com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:996)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113)
      at
      com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986)
      at
      com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178)
      at
      com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at
      com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      at
      com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.RuntimeException: Could not invoke defineClass!
      at
      com.sun.ejb.containers.EjbOptionalIntfGenerator.makeClass(EjbOptionalIntfGenerator.java:425)
      at
      com.sun.ejb.containers.EjbOptionalIntfGenerator.access$200(EjbOptionalIntfGenerator.java:66)
      at
      com.sun.ejb.containers.EjbOptionalIntfGenerator$1.run(EjbOptionalIntfGenerator.java:104)
      at java.security.AccessController.doPrivileged(Native Method)
      at
      com.sun.ejb.containers.EjbOptionalIntfGenerator.loadClass(EjbOptionalIntfGenerator.java:101)
      at
      com.sun.ejb.containers.BaseContainer.instantiateOptionalEJBLocalBusinessObjectImpl(BaseContainer.java:3815)
      at
      com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:248)
      at
      com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:162)
      at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:220)
      ... 32 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at
      com.sun.ejb.containers.EjbOptionalIntfGenerator.makeClass(EjbOptionalIntfGenerator.java:422)
      ... 40 more
      Caused by: java.lang.VerifyError: class
      sahoo.osgiejb3.service._EJB31_GeneratedFooBeanIntf__Bean_ overrides
      final method toString.()Ljava/lang/String;
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      ... 44 more

      #]

        Activity

        Hide
        Sanjeeb Sahoo added a comment -

        Created an attachment (id=4398)
        test

        Show
        Sanjeeb Sahoo added a comment - Created an attachment (id=4398) test
        Hide
        Sanjeeb Sahoo added a comment -

        Created an attachment (id=4399)
        test

        Show
        Sanjeeb Sahoo added a comment - Created an attachment (id=4399) test
        Hide
        marina vatkina added a comment -

        This is per spec: 4.9.8 Session Bean’s No-Interface View

        "All methods of the bean class and any superclasses must not be declared final."

        Show
        marina vatkina added a comment - This is per spec: 4.9.8 Session Bean’s No-Interface View "All methods of the bean class and any superclasses must not be declared final."

          People

          • Assignee:
            ksak
            Reporter:
            Sanjeeb Sahoo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: