eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
387 stars 144 forks source link

Coding error in codegen library causes assert failure #611

Closed glassfishrobot closed 17 years ago

glassfishrobot commented 18 years ago

One of the components of the ORB code in glassfish is a dynamic ByteCode generation library (codegen) that provides a java API for generating classes at runtime, using ASM to generate the actual class files. The class

com.sun.corba.ee.impl.codegen.ASMSetupVisitor

contains the method preVariable, which causes an assertion failure when assertions are enabled. This is due to a small coding error in the method: the last case in a switch statement is missing a break statement, so the last case falls through to the an

assert false ;

statement, causing the error when assertions are enabled. The fix is simple: add the missing break statement.

Environment

Operating System: All Platform: All

Affected Versions

[9.1pe]

glassfishrobot commented 6 years ago
glassfishrobot commented 18 years ago

@glassfishrobot Commented cf126330 said: Users are reporting the same problem with Glassfish v2, build 20 21. I was able to reproduce it in appserv-tests/devtests/ejb/clientview/core, when turning -ea on in bin/appclient

glassfishrobot commented 18 years ago

@glassfishrobot Commented cf126330 said: More details including stacktrace are available at the forum topic: http://forums.java.net/jive/thread.jspa?threadID=19155&tstart=0

glassfishrobot commented 18 years ago

@glassfishrobot Commented robertdw said: FWIW, this happens with 9.0.1 as well.

glassfishrobot commented 17 years ago

@glassfishrobot Commented sherryshen said: Will this issue be fixed for 9.1?

In SQE test environment for 9.1pe_b25, assertions were enabled with adding

-ea

in AS domain.xml. A lot of EJB3.0 tests failed in this test environment. I checked the inherit test suite, in which has AssertionError is shown in server.log during deployment, e.g.

Any suggestion how to further look at if the AssertionError in EJB 3.0 inherit test suite? Thanks for the help!

Sherry

PS: My test ear file and source code are in /home/sherrys/public_html/tests/ejb/b25/inherit

To reproduce the issue, set jdbc resource, deploy ejb30-inheritApp.ear and then see error in server.log

[#|2006-11-20T15:31:22.950-0800|WARNING|sun-appserver-ee9.1| javax.enterprise.system.stream.err|_ThreadID=20;_ThreadName= httpWorkerThread-4848-2; _RequestID=f81449b7-d017-44ee-94b9-61ea225c872a;| java.lang.AssertionError at com.sun.corba.ee.impl.codegen.ASMSetupVisitor.preVariable(Unknown Source) at com.sun.corba.ee.impl.codegen.TreeWalker.visitVariable(Unknown Source) at com.sun.corba.ee.impl.codegen.VariableImpl.accept(Unknown Source) at com.sun.corba.ee.impl.codegen.TreeWalker.visitDefinitionStatement(Unknown Source) at com.sun.corba.ee.impl.codegen.DefinitionStatement.accept(Unknown Source) at com.sun.corba.ee.impl.codegen.TreeWalker.visitBlockStatement(Unknown Source) at com.sun.corba.ee.impl.codegen.BlockStatement.accept(Unknown Source) at com.sun.corba.ee.impl.codegen.TreeWalker.visitTryStatement(Unknown Source) at com.sun.corba.ee.impl.codegen.TryStatement.accept(Unknown Source) at com.sun.corba.ee.impl.codegen.TreeWalker.visitBlockStatement(Unknown Source) at com.sun.corba.ee.impl.codegen.BlockStatement.accept(Unknown Source) at com.sun.corba.ee.impl.codegen.TreeWalker.visitMethodGenerator(Unknown Source) at com.sun.corba.ee.impl.codegen.MethodGenerator.accept(Unknown Source) at com.sun.corba.ee.impl.codegen.TreeWalker.visitClassGenerator(Unknown Source) at com.sun.corba.ee.impl.codegen.ClassGenerator.accept(Unknown Source) at com.sun.corba.ee.impl.codegen.ASMUtil.generate(Unknown Source) at com.sun.corba.ee.impl.codegen.CodeGenerator.generateBytecode(Unknown Source) at com.sun.corba.ee.spi.codegen.Wrapper._generate(Unknown Source) at com.sun.ejb.EJBUtils$2.run(EJBUtils.java:507) at java.security.AccessController.doPrivileged(Native Method) at com.sun.ejb.EJBUtils.generateAndLoad(EJBUtils.java:504) at com.sun.ejb.EJBUtils.loadGeneratedRemoteBusinessClasses(EJBUtils.java:419) at com.sun.ejb.containers.BaseContainer.(BaseContainer.java:489) at com.sun.ejb.containers.StatelessSessionContainer.(StatelessSessionContainer.java:163) at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:257) at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:484) at com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:183) at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:113) at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:322) at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:196) at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:633) at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:903) at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:887) at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:445) at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:160) at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:295) at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:200) at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:285) at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:119) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871) at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:544) at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:588) at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:722) 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) at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:353) at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:336) at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:448) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:77) at $Proxy1.invoke(Unknown Source) at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:297) at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:56) at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:142) at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:109) at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:180) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1029) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1029) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:249) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:790) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:332) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:254) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)

| #] |

[#|2006-11-20T15:31:22.977-0800|WARNING|sun-appserver-ee9.1|javax.enterprise.system.tools.admin|_ThreadID=20;_ThreadName=httpWorkerThread-4848-2;_RequestID=f81449b7-d017-44ee-94b9-61ea225c872a;|ADM5603:Event listener error [null]|#]

[#|2006-11-20T15:31:23.806-0800|INFO|sun-appserver-ee9.1|javax.enterprise.system.tools.admin|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;/data/AS91B25P/domains/domain1/generated/xml/j2ee-apps/ejb30-inheritApp/ejb30-inheritAppClient.jar;|ADM1040:Client-jar location:[/data/AS91B25P/domains/domain1/generated/xml/j2ee-apps/ejb30-inheritApp/ejb30-inheritAppClient.jar]|#]

glassfishrobot commented 17 years ago

@glassfishrobot Commented gfbugbridge said:

glassfishrobot commented 17 years ago

@glassfishrobot Commented kcavanaugh said: The fix is trivial. I thought I fixed it previously, but apparently not, so I'll try again.

glassfishrobot commented 17 years ago

@glassfishrobot Commented kcavanaugh said: Fixed in GFv2 b40.

glassfishrobot commented 18 years ago

@glassfishrobot Commented Was assigned to kcavanaugh

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-611

glassfishrobot commented 18 years ago

@glassfishrobot Commented Reported by kcavanaugh

glassfishrobot commented 17 years ago

@glassfishrobot Commented Marked as fixed on Thursday, March 22nd 2007, 3:26:13 am