On Oct 2, 2006, at 4:13 PM, Nathan Mittler wrote:

I'm pretty new to EJB so it might take me a while to figure out how to set it up for debugging on the server.  If you know of some docs that would get me started, it would be appreciated.  I'll keep you posted as to what I find.

Start geronimo like

java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar bin/server.jar --long

open the openejb project in your favorite IDE and remote-debug on port 5005.... put a breakpoint where the TCCL is being set in setupDelivery and see if you hit it and what the classloader is.

Easy in IDEA.... don't know about any other IDEs

I'm not sure which g/openejb version you are on, but you should be able to check out something appropriate from 

http://svn.apache.org/repos/asf/incubator/openejb/tags/v2_1_1/openejb2

thanks
david jencks


Thanks,
Nate

On 10/2/06, David Jencks <david_jencks@yahoo.com> wrote:
The code paths look identical to me.  I haven't had time to set up a test case.  Can you get set up to debug in openejb and see what is happening in openejb EndpointHandler.setupDelivery?  That's where we should be setting the application classloader onto the thread.  (I'm looking at apache-incubator openejb2 trunk but I think the same code applies to all released openejb2 versions)

thanks
david jencks

On Oct 2, 2006, at 3:29 PM, Nathan Mittler wrote:

Hey guys,
Does anyone have any more insight as to what may be going on here?

Thanks,
Nate

On 9/30/06,  Nathan Mittler <nathan.mittler@gmail.com > wrote:
David, Thanks for the response.  Sure thing - I've captured the stack trace from the ejbCreate method of both MDBs.

First, here's the stack trace from the JMS MDB:

java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1158)
        at com.test.CourierPositionMDB.ejbCreate(CourierPositionMDB.java :32)
        at com.test.CourierPositionMDB$$FastClassByCGLIB$$c60caec2.invoke(<generated>)
        at org.openejb.slsb.EJBCreateMethod.execute(EJBCreateMethod.java:94)
        at org.openejb.dispatch.DispatchInterceptor.invoke (DispatchInterceptor.java:72)
        at org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(ComponentContextInterceptor.java:56)
        at org.openejb.mdb.MDBInstanceContext.ejbCreate(MDBInstanceContext.java :153)
        at org.openejb.mdb.MDBInstanceFactory.createInstance(MDBInstanceFactory.java:72)
        at org.openejb.util.SoftLimitedInstancePool.acquire(SoftLimitedInstancePool.java:81)
        at org.openejb.mdb.MDBInstanceInterceptor.invoke (MDBInstanceInterceptor.java:81)
        at org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor.java:82)
        at org.openejb.mdb.MDBContainer.invoke(MDBContainer.java:242)
        at org.openejb.mdb.EndpointHandler.invoke (EndpointHandler.java:180)
        at org.openejb.mdb.EndpointHandler.intercept(EndpointHandler.java:223)
        at org.openejb.mdb.EndpointProxy$$EnhancerByCGLIB$$e708dc8a.onMessage(<generated>)
        at org.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:117)
        at org.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:57)
        at org.activemq.ActiveMQSession.deliver (ActiveMQSession.java:569)
        at org.activemq.ActiveMQSession.run(ActiveMQSession.java:551)
        at org.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
        at org.apache.geronimo.connector.work.WorkerContext.run (WorkerContext.java:291)
        at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:172)
        at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:289)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run (Unknown Source)
        at java.lang.Thread.run(Thread.java:595)

... and here's the stack trace from the custom MDB:

java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1158)
        at com.test.CourierPositionMDB.ejbCreate(CourierPositionMDB.java:56)
        at com.test.CourierPositionMDB$$FastClassByCGLIB$$adae8521.invoke(<generated>)
        at org.openejb.slsb.EJBCreateMethod.execute (EJBCreateMethod.java:94)
        at org.openejb.dispatch.DispatchInterceptor.invoke(DispatchInterceptor.java:72)
        at org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(ComponentContextInterceptor.java :56)
        at org.openejb.mdb.MDBInstanceContext.ejbCreate(MDBInstanceContext.java:153)
        at org.openejb.mdb.MDBInstanceFactory.createInstance(MDBInstanceFactory.java:72)
        at org.openejb.util.SoftLimitedInstancePool.acquire (SoftLimitedInstancePool.java:81)
        at org.openejb.mdb.MDBInstanceInterceptor.invoke(MDBInstanceInterceptor.java:81)
        at org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor.java:82)
        at org.openejb.mdb.MDBContainer.invoke(MDBContainer.java:242)
        at org.openejb.mdb.EndpointHandler.invoke(EndpointHandler.java:180)
        at org.openejb.mdb.EndpointHandler.intercept(EndpointHandler.java :223)
        at org.openejb.mdb.EndpointProxy$$EnhancerByCGLIB$$224d7765.onCourierPosition(<generated>)
        at com.test.ra.EndpointWorker$1.run(EndpointWorker.java:109)
        at org.apache.geronimo.connector.work.WorkerContext.run (WorkerContext.java:291)
        at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:172)
        at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:289)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run (Unknown Source)
        at java.lang.Thread.run(Thread.java:595)

Thanks,
Nate



On 9/30/06,  David Jencks <david_jencks@yahoo.com > wrote:

On Sep 30, 2006, at 8:27 AM, Nathan Mittler wrote:

> Hi,
> Has anyone created custom connectors with G?
>
> I have a two versions of a simple MDB - one that implements
> javax.jms.MessageListener and one that implements a custom
> interface.  When onMessage is invoked by the AMQ RAR, I appear to
> be in the context of the MDB's classloader and can use dependencies
> specified in the MDB's deployment plan.  However, when I invoke the 
> MDB from a custom connector, it seems to be in the context of the
> RAR classloader and I don't have access to any of the MDB's
> dependencies.  I assume that I'm doing something bone-headed in my
> connector, but I'm not seeing it.  Any ideas?

It oughtta work :-).  I don't think it's your connector.  Would it be
difficult to get stack traces from the mdbs to see if the paths to
get to the mdb are different? 

thanks
david jencks

>
> Thanks for the help,
> Nate