Jon,
Here is the original forum post that I found that talks about the same error 
in a similar case:
http://main.jboss.org/forums/thread.jsp?forum=47&thread=11678

they talked about messing with the AutoCommit property of the oracle driver.  
I'm not sure if our problems are related to this or not, as I don't know the 
scope of this particular error message (although it seems sort of generic).

the bean that is having the problems has the following attributes in the 
<enterprise-beans> section of its dd:
        <entity>
                <ejb-name>CSRequestBean</ejb-name>
                ...
                <persistence-type>Container</persistence-type>
                <prim-key-class>java.lang.String</prim-key-class>
                <reentrant>False</reentrant>
                <cmp-version>2.x</cmp-version>
                <abstract-schema-name>CSRequest</abstract-schema-name>
                ...
        </entity>
and the following <container-transaction> section of its dd:
                <container-transaction>
                        <method>
                                <ejb-name>CSRequestBean</ejb-name>
                                <method-name>*</method-name>
                        </method>
                        <trans-attribute>Required</trans-attribute>
                </container-transaction>

the session bean that calls this entity bean does so in the following manner: 
(paraphrased for clarity, there is actually a subroutine that assigns all the 
properties of the bean to the view object inside the for loop)

        Collection c = csrHome.findAll();
        Collection result = new Vector();
        System.out.println("result size: " + c.size());
        for(Iterator i = c.iterator(); i.hasNext();) {
                LocalCSRequest csr = (LocalCSRequest)i.next();
                CSRViewObject vo = new CSRViewObject();
                vo.csRequestID = csr.getCSRequestID(); /* This line fails, see stack 
trace 
below ( $Proxy38.getCSRequestID ) */
                ...
                result.add(vo);
        }
        return result;


so basically once i get a reference to the bean and use the local interface to 
call one of the bean's get() methods, the transaction exception is thrown.  
this entity bean is actually very simple, nothing more than a few abstract 
accessors and the required ejb methods.  I'm not doing anything fancy here.

the stack trace is:

2002-05-17 14:29:34,491 INFO  [STDOUT] result size: 1
2002-05-17 14:29:34,736 ERROR [STDERR] 
java.lang.reflect.UndeclaredThrowableException: 
2002-05-17 14:29:34,743 ERROR [STDERR] java.rmi.ServerException: removing bean 
lock and it has tx set!; nested exception is: 
        java.lang.IllegalStateException: removing bean lock and it has tx set!
2002-05-17 14:29:34,749 ERROR [STDERR] java.lang.IllegalStateException: 
removing bean lock and it has tx set!
2002-05-17 14:29:34,755 ERROR [STDERR]  at 
org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBLock.java:469)
2002-05-17 14:29:34,761 ERROR [STDERR]  at 
org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:78)
2002-05-17 14:29:34,767 ERROR [STDERR]  at 
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:124)
2002-05-17 14:29:34,772 ERROR [STDERR]  at 
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
2002-05-17 14:29:34,778 ERROR [STDERR]  at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
2002-05-17 14:29:34,783 ERROR [STDERR]  at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
2002-05-17 14:29:34,789 ERROR [STDERR]  at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
2002-05-17 14:29:34,795 ERROR [STDERR]  at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
2002-05-17 14:29:34,800 ERROR [STDERR]  at 
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
2002-05-17 14:29:34,806 ERROR [STDERR]  at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:145)
2002-05-17 14:29:34,811 ERROR [STDERR]  at 
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:482)
2002-05-17 14:29:34,863 ERROR [STDERR]  at 
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:304)
2002-05-17 14:29:34,868 ERROR [STDERR]  at 
org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
2002-05-17 14:29:34,873 ERROR [STDERR]  at $Proxy38.getCSRequestID(Unknown 
Source)
2002-05-17 14:29:34,879 ERROR [STDERR]  at 
com.wavespring.cs.ejb.session.CSRequestManagerBean.createCSRViewFromEntity(CSRequestManagerBean.java:257)
2002-05-17 14:29:34,885 ERROR [STDERR]  at 
com.wavespring.cs.ejb.session.CSRequestManagerBean.getAllCSRs(CSRequestManagerBean.java:25)
2002-05-17 14:29:34,890 ERROR [STDERR]  at 
java.lang.reflect.Method.invoke(Native Method)
2002-05-17 14:29:34,895 ERROR [STDERR]  at 
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:606)

(etc)

A few things:
1) This works fine with postgres on the same machine as jboss.  I haven't 
tried postgres on a remote machine.
2) I'm using a remote mssql2k DB.
3) I'm in the process of setting up a test case to try to reproduce this 
problem but am currently stuck on another jboss problem (see my jboss-dev 
post entitled 'deploy error in scanner thread')
4) this is also project-halting issue for me as well ;)



> I am very interested to see the source where you have duplicated this
> issue. I would like you to also include your ejb-jar.xml sections.  If I
> can find the exact situation, I may be able to come up with a test case, a
> work around, or even delve into the JBoss code (the horror).  This is a
> dead stop issue for my project at the moment so I am eager to see what you
> have.
>
> >I am getting the very same error message in a very similar use case.  The
>
> only
>
> >difference I can see is that all the methods of the offending bean are set
>
> to
>
> >'Required' rather than 'RequiresNew'.  The error occurs when I try to call
> >the get methods of the bean through a local interface in a session bean.
> >  I lookup the bean with the findByPrimaryKey method like you do, but in
> > my
>
> case,
>
> >the record already exists in the DB.  Perhaps this problem is not related
> > to the tx setting, since yours did not fail with RequiresNew in a simple
> > case, and mine fails with Required in my case?
> >I am in the process of creating a simple test for this problem.  I'll post
>
> the
>
> >results here if/when I find out anything of potential use.


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to