geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Hillmann" <ed.hillm...@gmail.com>
Subject Re: Q: MDB Application cannot find Interface defined in RAR file
Date Tue, 02 Oct 2007 01:46:46 GMT
Still digging.  Looking at the source for OpenEjbSystemGBean, and this
is the bit of code falling over...

        Thread.currentThread().setContextClassLoader(classLoader);
        try {
            for (Map.Entry<String, String> entry :
listenerToActivationSpecMap.entrySet()) {
                String messageListenerInterface = entry.getKey();
                String activationSpecClass = entry.getValue();

                // only process RA if not previously processed
                String containerName =
getResourceAdapterId(resourceAdapterWrapper) + "-" +
messageListenerInterface;
                if
(processedResourceAdapterWrappers.putIfAbsent(containerName,
resourceAdapterWrapper) == null) {
                    try {
                        // get default mdb config
                        ContainerInfo containerInfo =
configurationFactory.configureService(MdbContainerInfo.class);
                        containerInfo.id = containerName;
                        containerInfo.displayName = containerName;

                        // set ra specific properties
                        containerInfo.properties.put("MessageListenerInterface",

resourceAdapter.getClass().getClassLoader().loadClass(messageListenerInterface));
                        containerInfo.properties.put("ActivationSpecClass",

resourceAdapter.getClass().getClassLoader().loadClass(activationSpecClass));

containerInfo.properties.put("ResourceAdapter", resourceAdapter);

                        // create the container
                        assembler.createContainer(containerInfo);
                    } catch (Exception e) {
                        log.error("Unable to deploy mdb container " +
containerName, e);
                    }
                }
            }
        } finally {
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }

So, in my ra.xml, I have an ActivationSpec using the TreEventListener
as the interface.  So the line

                        // set ra specific properties
                        containerInfo.properties.put("MessageListenerInterface",

resourceAdapter.getClass().getClassLoader().loadClass(messageListenerInterface));

is where it's not finding it.  Is the resourceAdapter.getClass() the
class that I've written that implements ResourceAdapter the interface
(which is in the svConnector-ra.jar file)?

I've provided the svConnector-api.jar file so people using the
connector don't need to load all the ra classes.  And when I build the
jars, the ra.jar references the api.jar.

I can't find in the source code, where the OpenEjbSystemGBean is being
created, so I can't tell what classLoader is being used.  I assume I
could duplicate the interface in both archive files, but I'm trying
not to duplicate anything.

Thanks for any help,
Ed

Mime
View raw message