-
1. Re: local entities mapping incorrectly between ejb container
adrian.brock Aug 21, 2003 5:07 AM (in response to kivilahti)Post your jboss.xml, it sounds like it is not being
read correctly.
Regards,
Adrian -
2. Re: local entities mapping incorrectly between ejb container
kivilahti Aug 22, 2003 6:26 AM (in response to kivilahti)Descriptors are generated with XDoclet. I cropped examples of one entity and one session bean in each descriptor.
Read-write container's jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
<enterprise-beans>
<ejb-name>fe/data/FooBar</ejb-name>
<local-jndi-name>fe/data/FooBar</local-jndi-name>
<configuration-name>Standard BMP EntityBean</configuration-name>
<ejb-name>fe/EventProcessor</ejb-name>
<jndi-name>fe/EventProcessor</jndi-name>
</enterprise-beans>
<resource-managers>
</resource-managers>
And read-only container's jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
<enterprise-beans>
<ejb-name>fe/data/FooBar</ejb-name>
<local-jndi-name>fe/ro/FooBar</local-jndi-name>
<configuration-name>Instance Per Transaction BMP EntityBean</configuration-name>
<ejb-name>fe/FooBarLookupService</ejb-name>
<jndi-name>fe/FooBarLookupService</jndi-name>
</enterprise-beans>
<resource-managers>
</resource-managers> -
3. Re: local entities mapping incorrectly between ejb container
adrian.brock Aug 23, 2003 9:46 AM (in response to kivilahti)Instance per transaction is not "read-only".
Can you post the stacktrace of the error message? Since this
is BMP and a don't see a <read-only> declaration in jboss.xml
I suspect you are generating this message?
Regards,
Adrian -
4. Re: local entities mapping incorrectly between ejb container
kivilahti Aug 24, 2003 5:37 AM (in response to kivilahti)We're using MVCSoft to generate the BMP beans. Read-write entity beans are generated with CommitOptionA and read-only entity beans with read-only. These beans are the ones that throw the final rollback exceptions.
I'll post the stack trace as soon as I'm back in the office. -
5. Re: local entities mapping incorrectly between ejb container
kivilahti Aug 25, 2003 4:54 AM (in response to kivilahti)Ok, here's what I think is the relevant part of the stack trace. After this, a TransactionRolledbackException is thrown with an identical stack trace.
13:34:32,383 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedBy:
java.lang.IllegalStateException: Read only entity.
at com.quartal.fe.mvc.lookup.fe_data_FooBar106180154697473451499.setEndTime(fe_data_FooBar106180154697473451499.java:153)
at com.quartal.fe.ejb.AbstractFooBarBean.setEndTime(AbstractFooBarBean.java:81)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1194)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:303)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:90)
at org.jboss.ejb.plugins.EntityMultiInstanceInterceptor.invoke(EntityMultiInstanceInterceptor.java:112)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
at $Proxy338.setEndTime(Unknown Source)
at com.quartal.fe.storage.ejb.FooEventProcessorImpl.updateFooBar(FooEventProcessorImpl.java:340)
at com.quartal.fe.storage.ejb.FooEventProcessorImpl.processFooEvent(FooEventProcessorImpl.java:131)
at com.quartal.fe.storage.ejb.FooEventProcessor.processFooEvent(FooEventProcessor.java:50)
at com.quartal.fe.storage.ejb.EventProcessorBean.processFooEvent(EventProcessorBean.java:226)
at com.quartal.fe.storage.ejb.EventProcessorBean.processEvent(EventProcessorBean.java:163)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:738)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:99)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy332.processEvent(Unknown Source)
at com.quartal.fe.storage.ejb.EventProcessorImpl.processEvent(EventProcessorImpl.java:125)
at com.quartal.fe.event.EventProvider.processEvent(EventProvider.java:163)
at com.quartal.fe.event.EventProvider.onMessage(EventProvider.java:148)
at com.quartal.fe.event.EventProvider.receive(EventProvider.java:116)
at com.quartal.fe.event.EventProvider.access$500(EventProvider.java:40)
at com.quartal.fe.event.EventProvider$ReceiverThread.run(EventProvider.java:275) -
6. Re: local entities mapping incorrectly between ejb container
adrian.brock Aug 25, 2003 7:22 AM (in response to kivilahti)And where is this class deployed when it goes wrong?
This isn't metadata, it is in this generated class.
com.quartal.fe.mvc.lookup.fe_data_FooBar106180154697473451499
Is it the correct class?
Regards,
Adrian -
7. Re: local entities mapping incorrectly between ejb container
kivilahti Aug 25, 2003 8:42 AM (in response to kivilahti)Yes, that class throws the exception. It should be deployed in the read-only container. At least its class and descriptors are in the read-only container's jar. The EventProcessor session bean is in the read-write container and should only have access to read-write entity beans. So where does the mix-up between these two containers happen, is my concern.
When I look the at jmx-console, under "jboss.management.single" I see two sets of deployed entities within the ear, each in its respective EJBModule. Likewise, I see two sets of entities under "jboss.j2ee". But I haven't noticed any way to find out the mappings between these two, ie. what ejb-names are mapped to what jndi-names in runtime. So I don't know how to answer your question except by saying "should be in the read-only container". I may be missing something obvious here.
Jmx-console views are exactly the same when the application throws rollbacks and when it doesn't.
Is placing the bean classes and xml descriptors in separate jars really enough to place them in separate ejb containers?
The stack trace made me think first that this was an MVCSoft problem, but since then I have been in contact with MVCSoft and it seems that the generated classes and descriptors are ok. So (to my limited knowledge) this looks like some kind of naming context problem. I was hoping this was some kind of an easy JBoss configuration issue, which I've just failed to notice.
Whether or not this must eventually be solved by refactoring the ejb containers into one just to get forward with the project, I must thank you for your patience. I'd really hate to lose JBoss as our development and production platform, so I appreciate all help. -
8. Re: local entities mapping incorrectly between ejb container
adrian.brock Aug 26, 2003 12:12 AM (in response to kivilahti)Why would it be a naming problem?
You mapped the ejbs to different jndi names and each
jar has its own ENC.
How are you retrieving the beans, global jndi or java:comp?
I really need to see more information. I don't recognise
any the symptoms.
You should be able to see the jndiname inside jboss if you ask
the entity context for the EJBObject and toString() it.
You can also then do getClass().toString()
I would doubt it is a naming problem unless the descriptors
are wrong. Which would suggest a packaging problem
(i.e. wrong descriptor in the wrong jar) if they are autogenerated.
Regards,
Adrian