[JBoss JIRA] Created: (EJBTHREE-1154) 2.1 Home create() implementation returns wrong type
by Andrew Lee Rubinger (JIRA)
2.1 Home create() implementation returns wrong type
---------------------------------------------------
Key: EJBTHREE-1154
URL: http://jira.jboss.com/jira/browse/EJBTHREE-1154
Project: EJB 3.0
Issue Type: Bug
Reporter: Andrew Lee Rubinger
Assigned To: Andrew Lee Rubinger
Priority: Critical
Fix For: AS 5.0.0.Beta3
EJB3 Mirror issue of JBAS-5036.
Local home (and presumably remote, too) implementation for EJB 3 sessions creates an object that is an instance of the local *business* interface of the EJB 3 session, and returns that. This is contrary to EJB 3 specification, which says that local home create methods must return an instance of the local interface of the EJB 3 session (as in: not local business interface).
The type of the local interface is apparently deduced from the return type of the create method in the local home interface (there is no annotation for it).
For beans that follow the specification, this causes a class cast exception when create() is called: the local home interface is specified to return an instance of local interface, but the implementation JBoss supplies creates a instance of local business interface (I presume so, because changing local home to return that works), and then we end up with class cast exception.
There is no workaround other than going against specification in code: define local home interface to return instance of local business interface.
This simple session, which as far as I can see is exactly according to EJB 3 spec, illustrates the problem, and does not work on JBoss 4.2.1.GA:
--
@javax.ejb.Stateless(name="Stateless")
@javax.ejb.LocalHome(StatelessHome.class)
@javax.ejb.Local({StatelessLocal.class})
public class StatelessBean implements StatelessLocal { public void ejbCreate() {} }
--
public interface StatelessLocal {}
--
public interface StatelessHome extends javax.ejb.EJBLocalHome
{ public StatelessLocal21 create() throws javax.ejb.CreateException;}
--
public interface StatelessLocal21 extends javax.ejb.EJBLocalObject, StatelessLocal {}
--
When home is looked up, and create is called, the result is:
java.lang.ClassCastException: $Proxy271 cannot be cast to StatelessLocal21
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 11 months
[JBoss JIRA] Created: (EJBTHREE-1147) private ejbCreate is used as an Init method
by Carlo de Wolf (JIRA)
private ejbCreate is used as an Init method
-------------------------------------------
Key: EJBTHREE-1147
URL: http://jira.jboss.com/jira/browse/EJBTHREE-1147
Project: EJB 3.0
Issue Type: Bug
Reporter: Carlo de Wolf
Assigned To: Carlo de Wolf
Fix For: AS 5.0.0.Beta3
10:32:46,882 ERROR [STDERR] java.lang.RuntimeException: java.lang.IllegalAccessException: Class org.jboss.ejb3.stateful.StatefulContainer can not access a member of class com.sun.ts.tests.ejb30.bb.session.stateful.callback.method.annotated.SessionBeanCallbackBean with modifiers "private"
10:32:46,882 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.invokeInit(StatefulContainer.java:501)
10:32:46,882 ERROR [STDERR] at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:121)
10:32:46,882 ERROR [STDERR] at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
10:32:46,883 ERROR [STDERR] at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:58)
10:32:46,883 ERROR [STDERR] at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:113)
10:32:46,883 ERROR [STDERR] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:351)
10:32:46,883 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:362)
10:32:46,883 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
10:32:46,883 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
10:32:46,884 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:771)
10:32:46,884 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
10:32:46,884 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
10:32:46,884 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
10:32:46,884 ERROR [STDERR] Caused by: java.lang.IllegalAccessException: Class org.jboss.ejb3.stateful.StatefulContainer can not access a member of class com.sun.ts.tests.ejb30.bb.session.stateful.callback.method.annotated.SessionBeanCallbackBean with modifiers "private"
10:32:46,884 ERROR [STDERR] at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
10:32:46,885 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:578)
10:32:46,885 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.invokeInit(StatefulContainer.java:494)
10:32:46,885 ERROR [STDERR] ... 12 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 11 months
[JBoss JIRA] Created: (EJBTHREE-1149) Unable to create annotation on private methods
by Carlo de Wolf (JIRA)
Unable to create annotation on private methods
----------------------------------------------
Key: EJBTHREE-1149
URL: http://jira.jboss.com/jira/browse/EJBTHREE-1149
Project: EJB 3.0
Issue Type: Bug
Reporter: Carlo de Wolf
Assigned To: Carlo de Wolf
Priority: Critical
Fix For: AS 5.0.0.Beta3
java.lang.RuntimeException: Unable to create annotation from method/field cleanup for EJB lTestEJB
at org.jboss.ejb3.Ejb3DescriptorHandler.addAnnotations(Ejb3DescriptorHandler.java:2153)
at org.jboss.ejb3.Ejb3DescriptorHandler.addAnnotations(Ejb3DescriptorHandler.java:2159)
at org.jboss.ejb3.Ejb3DescriptorHandler.addRemoveAnnotations(Ejb3DescriptorHandler.java:1044)
at org.jboss.ejb3.Ejb3DescriptorHandler.addAssemblyAnnotations(Ejb3DescriptorHandler.java:1000)
at org.jboss.ejb3.Ejb3DescriptorHandler.addDescriptorAnnotations(Ejb3DescriptorHandler.java:913)
at org.jboss.ejb3.Ejb3DescriptorHandler.getStatefulContainer(Ejb3DescriptorHandler.java:461)
at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:149)
at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:525)
at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:485)
at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:467)
at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:433)
at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:375)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:163)
... 65 more
Caused by: java.lang.NoSuchMethodException: com.sun.ts.tests.ejb30.sec.stateful.common.lTestEJB.cleanup(com.sun.ts.tests.ejb30.sec.stateful.common.SecTestLocal)
at java.lang.Class.getMethod(Class.java:1581)
at org.jboss.ejb3.Ejb3DescriptorHandler.addAnnotations(Ejb3DescriptorHandler.java:2141)
... 77 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 11 months
[JBoss JIRA] Created: (EJBTHREE-1142) MessageInflowLocalProxy is retaining previous transaction
by Carlo de Wolf (JIRA)
MessageInflowLocalProxy is retaining previous transaction
---------------------------------------------------------
Key: EJBTHREE-1142
URL: http://jira.jboss.com/jira/browse/EJBTHREE-1142
Project: EJB 3.0
Issue Type: Bug
Reporter: Carlo de Wolf
Assigned To: Carlo de Wolf
Priority: Critical
Fix For: AS 5.0.0.Beta3
2007-12-03 14:30:29,240 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:362] MessageEndpoint CallbackBean started transaction=TransactionImple < ac, BasicAction: 7f000101:843b:475404ae:d2 status: ActionStatus.RUNNING >2007-12-03 14:30:29,241 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:369] MessageEndpoint CallbackBean enlisted=MessagingXAResource[r1-7wfi1r9f-1-7nxg1r9f-fmwhy2-110j3]2007-12-03 14:30:29,241 TRACE [org.jboss.ejb3.pool.StrictMaxPool:116] Get instance org.jboss.ejb3.pool.StrictMaxPool@7c6b1066#1#class com.sun.ts.tests.ejb30.bb.mdb.callback.listener.annotated.CallbackBean2007-12-03 14:30:29,241 TRACE [org.jboss.ejb3.pool.StrictMaxPool:123] Acquired(true) strictMaxSize semaphore, remaining=29
2007-12-03 14:30:29,241 TRACE [org.jboss.ejb3.pool.StrictMaxPool:198] 0/30 Free instance:org.jboss.ejb3.pool.StrictMaxPool@7c6b1066#class com.sun.ts.tests.ejb30.bb.mdb.callback.listener.annotated.CallbackBean
2007-12-03 14:30:29,241 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:431] MessageEndpoint CallbackBean commit
2007-12-03 14:30:29,242 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:492] MessageEndpoint CallbackBean no longer in use by Thread[WorkManager(3)-1,5,JBoss Pooled Threads] 2007-12-03 14:30:29,242 TRACE [org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory:137] Created endpoint com.sun.ts.tests.ejb30.bb.mdb.callback.listener.annotated.CallbackBean@79826b7a from org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory@2960f0e{ resourceAdapter=jms-ra.rar, messagingType=interface javax.jms.MessageListener, ejbName=CallbackBean, activationConfig=[ActivationConfigProperty(destination=MDB_QUEUE), ActivationConfigProperty(destinationType=javax.jms.Queue), ActivationConfigProperty(subscriptionDurability=false)], activationSpec=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@615ece16(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)6807299a destination=MDB_QUEUE isTopic=false tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)}
2007-12-03 14:30:31,389 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:118] MessageEndpoint CallbackBean in use by public abstract void javax.resource.spi.endpoint.MessageEndpoint.beforeDelivery(java.lang.reflect.Method) throws java.lang.NoSuchMethodException,javax.resource.ResourceException Thread[WorkManager(3)-2,5,JBoss Pooled Threads]
2007-12-03 14:30:31,389 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:188] MessageEndpoint CallbackBean before
2007-12-03 14:30:31,404 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:194] MessageEndpoint CallbackBean set context classloader to org.jboss.mx.loading.UnifiedClassLoader3@674e5e21{ url=vfsfile:/home/carlo/work/jboss-head/build/output/jboss-5.0.0.Beta3/server/cts/tmp/jsr88/mdb_callback_listener_annotated.ear ,addedOrder=44}2007-12-03 14:30:31,408 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:344] MessageEndpoint CallbackBean beforeDelivery method=public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message) xaResource=MessagingXAResource[r1-7wfi1r9f-1-7nxg1r9f-fmwhy2-110j3] transacted=true2007-12-03 14:30:31,409 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:351] MessageEndpoint CallbackBean beforeDelivery currentTx=TransactionImple < ac, BasicAction: 7f000101:843b:475404ae:da status: ActionStatus.RUNNING >2007-12-03 14:30:31,409 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:383] MessageEndpoint CallbackBean transaction=null already active, IGNORED=MessagingXAResource[r1-7wfi1r9f-1-7nxg1r9f-fmwhy2-110j3]
2007-12-03 14:30:31,409 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:118] MessageEndpoint CallbackBean in use by public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message) Thread[WorkManager(3)-2,5,JBoss Pooled Threads]2007-12-03 14:30:31,409 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:249] MessageEndpoint CallbackBean delivering2007-12-03 14:30:31,409 TRACE [org.jboss.ejb3.pool.StrictMaxPool:116] Get instance org.jboss.ejb3.pool.StrictMaxPool@7c6b1066#1#class com.sun.ts.tests.ejb30.bb.mdb.callback.listener.annotated.CallbackBean2007-12-03 14:30:31,410 TRACE [org.jboss.ejb3.pool.StrictMaxPool:123] Acquired(true) strictMaxSize semaphore, remaining=29
2007-12-03 14:30:31,410 INFO [STDOUT:151] isInjectionDone() in onMessage returns: true
2007-12-03 14:30:31,875 INFO [STDOUT:151] Status message (true) sent for test isInjectionDoneTest. Reason:isInjectionDone() in onMessage returns: true
2007-12-03 14:30:31,877 TRACE [org.jboss.ejb3.pool.StrictMaxPool:198] 0/30 Free instance:org.jboss.ejb3.pool.StrictMaxPool@7c6b1066#class com.sun.ts.tests.ejb30.bb.mdb.callback.listener.annotated.CallbackBean2007-12-03 14:30:31,877 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:118] MessageEndpoint CallbackBean in use by public abstract void javax.resource.spi.endpoint.MessageEndpoint.afterDelivery() throws javax.resource.ResourceException Thread[WorkManager(3)-2,5,JBoss Pooled Threads]
2007-12-03 14:30:31,878 WARN [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:411] Current transaction TransactionImple < ac, BasicAction: 7f000101:843b:475404ae:da status: ActionStatus.RUNNING > is not the expected transaction.
2007-12-03 14:30:31,878 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:431] MessageEndpoint CallbackBean commit
2007-12-03 14:30:31,878 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N:1746] [com.arjuna.ats.arjuna.coordinator.BasicAction_34] - End called on already committed atomic action 7f000101:843b:475404ae:d2
2007-12-03 14:30:31,878 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:479] MessageEndpoint CallbackBean reset classloader org.jboss.mx.loading.UnifiedClassLoader3@76e5f3d2{ url=vfsfile:/home/carlo/work/jboss-head/build/output/jboss-5.0.0.Beta3/server/cts/deploy/jms-ra.rar ,addedOrder=39}
2007-12-03 14:30:31,879 TRACE [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy:492] MessageEndpoint CallbackBean no longer in use by Thread[WorkManager(3)-2,5,JBoss Pooled Threads]
2007-12-03 14:30:31,879 ERROR [org.jboss.resource.adapter.jms.inflow.JmsServerSession:191] Unexpected error delivering message delegator->JBossMessage[24576]:PERSISTENT, deliveryId=1
javax.resource.ResourceException: java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active! at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.after(MessageInflowLocalProxy.java:231) at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:133) at $Proxy77.afterDelivery(Unknown Source) at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:182)
at org.jboss.jms.client.container.ClientConsumer.callOnMessage(ClientConsumer.java:157) at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:802)
at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleRun_1418002208.invoke(SessionAspect_z_handleRun_1418002208.java)
at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:106)
at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:234)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1378)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.endTransaction(MessageInflowLocalProxy.java:432)
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.finish(MessageInflowLocalProxy.java:311)
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.after(MessageInflowLocalProxy.java:227)
... 18 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 11 months