Thank you for respond.
I'm using Castor(0.9.3.19final+jboss3plugin) construction- OrderStore
object as master element and ElementStore as dependent,OrderStore contains
elements collection but no problem with that.OrderStore/ElementStore are
persistent objects for castor.
Problem is -when I call setElement/1 method that calls in turns
setElement_x/2 method throws xaRes Exception in moment of invocation
setElement_x-
I mean 2 method dosen't have a chance to run...JBoss executing no line of
code for nested method invocation.
//ClientStackTrace for Exception:
Caused by: java.rmi.ServerException: disconnect(ManagedConnection mc: null,
Object c: org.jboss.resource.adapter.jdbc.local.LocalConnection@4f79cb)
called with unknown managed connection; nested exception is:
java.lang.IllegalArgumentException: disconnect(ManagedConnection mc: null,
Object c: org.jboss.resource.adapter.jdbc.local.LocalConnection@4f79cb)
called with unknown managed connection
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.java:119)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:242)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12
9)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav
a:313)
at org.jboss.ejb.Container.invoke(Container.java:705)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.IllegalArgumentException: disconnect(ManagedConnection
mc: null, Object c:
org.jboss.resource.adapter.jdbc.local.LocalConnection@4f79cb) called with
unknown managed connection
at
org.jboss.resource.connectionmanager.BaseConnectionManager2.unregisterAssoci
ation(BaseConnectionManager2.java:661)
at
org.jboss.resource.connectionmanager.BaseConnectionManager2.disconnect(BaseC
onnectionManager2.java:619)
etc.
//Code============================================
//Client test case
//xxxStore is Castor persistent objects
InitialContext ic= new InitialContext();
PeoHome h1= (PeoHome)PortableRemoteObject.narrow(ic.lookup( "test/Peo"),
PeoHome.class);
Peo p= h1.create();
//following line throws Exception
ElementInfo ei = p.getElement( 1111);//simply value object for exchange
ei.setQty(55);
p.setElement(ei); //this place xaRes Exception happens
//Bean==========================================================
//such a construction caused by unavalibility to get Oracle9/Castor
generated PKey(DB sequence)
//First method======================================================
public int setElement( ElementInfo info) throws PeoException{
int e_sno= 0;
Database db= null;
try{
((Peo)ctx.getEJBObject()).setElement_x(info);
if (info.getCreated()){
e_sno=
((Peo)ctx.getEJBObject()).getElement_sno(info.getOrder_sno(),info.getElement
(),info.getEquip(),info.getDec_no());
} else e_sno=info.getElement_sno();
}catch( Exception re){
re.printStackTrace();
throw new PeoException( re.getMessage());
}
return e_sno;
}
//Second method===================================================
public void setElement_x( ElementInfo info) throws Exception{
Database db= null;
try{
db= jdo.getDatabase();
com.ezan.Ord.OrderStore cs=
((com.ezan.Ord.OrderStore)db.load( com.ezan.Ord.OrderStore.class, new
Integer( info.getOrder_sno())));
if( !info.getCreated()){
int sno= info.getElement_sno();
ArrayList al= cs.getElements();
for( int i= 0; i< al.size(); i++){
com.ezan.Ord.ElementStore ss= (com.ezan.Ord.ElementStore)al.get( i);
if( ss.getElement_sno()== sno){
if (ss.getKolv()!= info.getKolv()) {
ArrayList plans= ss.getPlans();
int pl_summ= 0;
for (int j=0; j< plans.size(); j++){
pl_summ+= ((com.ezan.Ord.PlanStore)plans.get(j)).getKolv();
}
if (info.getKolv()<pl_summ) throw new PeoException("incorrect qty
(<plan.qty) !");
}
ss.setInfo( info);
break;
}
}
}else{
com.ezan.Ord.ElementStore ss= cs.createElement();
ss.setInfo( info);
cs.addElement( ss);
}
}catch( org.exolab.castor.jdo.ObjectNotFoundException onf){
throw new PeoException( "Not found order_sno:"+info.getOrder_sno()+" !");
}catch( Throwable e){
e.printStackTrace();
throw new PeoException( e.getMessage());
}finally{
try{
if( db!= null) db.close();
}catch( PersistenceException pe){ throw new EJBException( pe);}
}
}
//test support(for "get" element )
method===========================================
public ElementInfo getElement( int sno) throws PeoException{
ElementInfo info= null;
Database db= null;
try{
db= jdo.getDatabase();
if( sno> 0){
OQLQuery oq=
db.getOQLQuery("select p from com.ezan.Ord.OrderStore p"+
" where p.elements.element_sno=$1");
oq.bind( sno);
QueryResults qr= oq.execute();
com.ezan.Ord.OrderStore cs=null;
if( qr.hasMore()) cs = (com.ezan.Ord.OrderStore)qr.next();
else throw new PeoException( "Not found order !");
ArrayList al= cs.getElements();
for( int i= 0; i< al.size(); i++){
com.ezan.Ord.ElementStore ss= (com.ezan.Ord.ElementStore)al.get( i);
if( ss.getElement_sno()== sno){
info= ss.getInfo();
info.setOrder_kod(cs.getOrder_kod());
break;
}
}
}else{
info= new ElementInfo();
info.setCreated( true);
}
}catch( org.exolab.castor.jdo.ObjectNotFoundException onf){
throw new PeoException( "Not found element !");
}catch( PersistenceException e){ throw new EJBException( e);
}finally{
try{
if( db!= null) db.close();
}catch( PersistenceException pe){ throw new EJBException( pe);}
}
return info;
}
Regards.
----- Original Message -----
From: "David Jencks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 4:01 PM
Subject: Re: [JBoss-user] xaRes not enlisted-Nested Ttransaction
processing(JBoss3.0Final BUG?)
> Could you show your code that is failing?
>
> thanks
> david jencks
>
> On 2002.06.11 06:43:31 -0400 Andrew wrote:
> > Hi, I'm using SessionContext.getObject() for internal transaction
> > creation in my stateless session bean.
> > Thirst method with <trans-attribute>Never</trans-attribute> invokes
> > second
> > method of the same bean through SessionContext.getObject()
> > that trans-attribute is "Required". The operation throws exception:
> >
> > 14:18:44,466 ERROR [STDERR] java.rmi.ServerException: xaRes not
enlisted;
> > nested
> > exception is:
> > java.lang.IllegalArgumentException: xaRes not enlisted
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.ejb.plugins.AbstractTxInterceptor.i
> > nvokeNext(AbstractTxInterceptor.java:119)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.ejb.plugins.TxInterceptorCMT.runWit
> > hTransactions(TxInterceptorCMT.java:242)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.ejb.plugins.TxInterceptorCMT.invoke
> > (TxInterceptorCMT.java:61)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.ejb.plugins.SecurityInterceptor.inv
> > oke(SecurityInterceptor.java:129)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.ejb.plugins.LogInterceptor.invoke(L
> > ogInterceptor.java:166)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.ejb.StatelessSessionContainer.invok
> > e(StatelessSessionContainer.java:313)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.ejb.Container.invoke(Container.java
> > :705)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.mx.server.MBeanServerImpl.invoke(MB
> > eanServerImpl.java:491)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.invocation.local.LocalInvoker.invok
> > e(LocalInvoker.java:98)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.invocation.InvokerInterceptor.invok
> > e(InvokerInterceptor.java:102)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.proxy.TransactionInterceptor.invoke
> > (TransactionInterceptor.java:73)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.proxy.SecurityInterceptor.invoke(Se
> > curityInterceptor.java:76)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.proxy.ejb.StatelessSessionIntercept
> > or.invoke(StatelessSessionInterceptor.java:111)
> > 14:18:44,466 ERROR [STDERR] at
> > org.jboss.proxy.ClientContainer.invoke(Client
> > Container.java:76)
> > 14:18:44,466 ERROR [STDERR] at $Proxy153.setElement_x(Unknown
Source)
> > //Second method--------------
> > 14:18:44,476 ERROR [STDERR] at
> > com.ezan.Session.PeoBean.setElement(PeoBean.j // First
> > method--------------
> > ava:680)
> > 14:18:44,476 ERROR [STDERR] at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(
> > Native Method)
> > 14:18:44,476 ERROR [STDERR] at
> > sun.reflect.NativeMethodAccessorImpl.invoke(N
> > ativeMethodAccessorImpl.java:39)
> > 14:18:44,476 ERROR [STDERR] at
> > sun.reflect.DelegatingMethodAccessorImpl.invo
> > ke(DelegatingMethodAccessorImpl.java:25)
> > 14:18:44,476 ERROR [STDERR] at
> > java.lang.reflect.Method.invoke(Method.java:3
> > 24)
> > 14:18:44,476 ERROR [STDERR] at
> > org.jboss.ejb.StatelessSessionContainer$Conta
> > inerInterceptor.invoke(StatelessSessionContainer.java:664)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.resource.connectionmanager.CachedCo
> > nnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.plugins.StatelessSessionInstanc
> > eInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.plugins.AbstractTxInterceptor.i
> > nvokeNext(AbstractTxInterceptor.java:96)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.plugins.TxInterceptorCMT.runWit
> > hTransactions(TxInterceptorCMT.java:242)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.plugins.TxInterceptorCMT.invoke
> > (TxInterceptorCMT.java:61)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.plugins.SecurityInterceptor.inv
> > oke(SecurityInterceptor.java:129)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.plugins.LogInterceptor.invoke(L
> > ogInterceptor.java:166)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.StatelessSessionContainer.invok
> > e(StatelessSessionContainer.java:313)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.ejb.Container.invoke(Container.java
> > :705)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.mx.server.MBeanServerImpl.invoke(MB
> > eanServerImpl.java:491)
> > 14:18:44,486 ERROR [STDERR] at
> > org.jboss.invocation.jrmp.server.JRMPInvoker.
> > invoke(JRMPInvoker.java:362)
> > 14:18:44,486 ERROR [STDERR] at
> > sun.reflect.GeneratedMethodAccessor23.invoke(
> > Unknown Source)
> > 14:18:44,486 ERROR [STDERR] at
> > sun.reflect.DelegatingMethodAccessorImpl.invo
> > ke(DelegatingMethodAccessorImpl.java:25)
> > 14:18:44,486 ERROR [STDERR] at
> > java.lang.reflect.Method.invoke(Method.java:3
> > 24)
> > 14:18:44,486 ERROR [STDERR] at
> > sun.rmi.server.UnicastServerRef.dispatch(Unic
> > astServerRef.java:261)
> > 14:18:44,486 ERROR [STDERR] at
> > sun.rmi.transport.Transport$1.run(Transport.j
> > ava:148)
> > 14:18:44,486 ERROR [STDERR] at
> > java.security.AccessController.doPrivileged(N
> > ative Method)
> > 14:18:44,486 ERROR [STDERR] at
> > sun.rmi.transport.Transport.serviceCall(Trans
> > port.java:144)
> > 14:18:44,486 ERROR [STDERR] at
> > sun.rmi.transport.tcp.TCPTransport.handleMess
> > ages(TCPTransport.java:460)
> > 14:18:44,486 ERROR [STDERR] at
> > sun.rmi.transport.tcp.TCPTransport$Connection
> > Handler.run(TCPTransport.java:701)
> > 14:18:44,486 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)
> > 14:18:44,496 ERROR [STDERR] Caused by:
> > java.lang.IllegalArgumentException:
> > xaRes
> > not enlisted
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.tm.TxCapsule.delistResource(TxCapsu
> > le.java:546)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.tm.TransactionImpl.delistResource(T
> > ransactionImpl.java:93)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.resource.connectionmanager.LocalTxC
> >
onnectionManager$LocalConnectionEventListener.delist(LocalTxConnectionManage
> > r.ja
> > va:347)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.resource.connectionmanager.LocalTxC
> >
onnectionManager.managedConnectionDisconnected(LocalTxConnectionManager.java
> > :272
> > )
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.resource.connectionmanager.BaseConn
> > ectionManager2.disconnect(BaseConnectionManager2.java:627)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.resource.connectionmanager.CachedCo
> > nnectionManager.disconnect(CachedConnectionManager.java:358)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.resource.connectionmanager.CachedCo
> > nnectionManager.pushMetaAwareObject(CachedConnectionManager.java:126)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.resource.connectionmanager.CachedCo
> > nnectionInterceptor.invoke(CachedConnectionInterceptor.java:183)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.ejb.plugins.StatelessSessionInstanc
> > eInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
> > 14:18:44,496 ERROR [STDERR] at
> > org.jboss.ejb.plugins.AbstractTxInterceptor.i
> > nvokeNext(AbstractTxInterceptor.java:96)
> > 14:18:44,496 ERROR [STDERR] ... 41 more
> >
> > 1)Why JBoss think it has some transaction though TransactionManager in
> > first
> > method correctly reports NO_TRANSACTION...
> > 2)Why it tries to free/suspend(how I can understand) some resource
though
> > my
> > first method dosen't enlist any resources at all-
> > the method dosen't contains any DataSource.getConnection()- what
resource
> > it
> > tries to "delist".
> > 3)Why JBoss talk about "xaRes" though I'm not using any "XA"
> > resources/connections- my oracle configured through Local resource
> > manager.
> > //----------------------------------------------------
> > Excerpt from org.jboss.tm.TxCapsule.
> > boolean delistResource(XAResource xaRes, int flag)
> > throws IllegalStateException, SystemException
> > {
> > //....
> > try
> > {
> > lock();
> >
> > if (trace)
> > {
> > log.trace("delistResource(): Entered, tx=" +
> > toString() + " status=" + getStringStatus(status));
> > }
> >
> > int idx = findResource(xaRes);
> >
> > if (idx == -1)
> > throw new IllegalArgumentException("xaRes not enlisted");//
> > Exception----------------------
> > //...
> >
> >
> > This problem arise only if I call second method from the bean itself but
> > direct remote invocation works well.
> >
> > Thanks in advice.
> >
> >
> >
> >
> > _______________________________________________________________
> >
> > Don't miss the 2002 Sprint PCS Application Developer's Conference
> > August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> >
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
>
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user