geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsthode <>
Subject Use of a GBean from a Message EJB
Date Wed, 25 Jun 2008 11:09:27 GMT

Hello all,

I'm trying to deploy an enterprise application in Geronimo 2.1.1 wich makes
use of a GBean from inside a Message EJB. That GBean is a custom developed
GBean that creates a thread and uses the persistence unit defined in my
persistence.xml as well as a ConnectionFactory and a Topic for a JMS
destination, all of them injected with the <reference> tags in the <gbean>
definition. All that does not represent a problem as all the injections work
right and I've created the connection to the JMS destination from my GBean
with no major trouble.

My problem comes when I try to reference that GBean from my Message EJB.
I've tried to add a <gbean-ref> to the <message-driven> definition of this
MDB but I get the following exception when deploying (see below for the

[severity=ERROR,message=unexpected element
(uri:"", local:"ref-name").
Expected elements are <{

If anyone needs the details for the exception stack trace I can post them,
but I think the error message is explanatory enough and the stack trace is
quite too long.

I've checked all the xsd files and <ref-name> is defined inside a
<gbean-ref> tag and it belongs to the geronimo-naming-1.2 schema , so I
don't get the meaning of this message.

Also I've tried to change the namespace to the <ref-name> tag and set it to
<ref-name xmlns=""> as the
error message suggests, but fails with the same error message. And i've
tried to prepend the "nam:" namespace to the <ref-name> tag also, but with
no success either.

And another question is, when I set the reference in my openejb-jar.xml, how
do I use this GBean from my MDB? I've tried to set a @Reference annotation
but I guess this is not going to work as I think it's only for JDBC, JMS and
the like resources, not for GBeans.

This is my openejb-jar.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="" 
<!-- the next tag is causing trouble with an "unexpected element" exception
  <sys:gbean name="UpdatesProcessorGBean"
<!-- this is the persistence unit defined in persistence.xml -->
    	<reference name="samplePU">
<!-- this is a connection factory defined in sampleMsgResources -->
  	<reference name="UpdatesConnectionFactory">
<!-- this is a Topic defined in sampleMsgResources -->
  	<reference name="sampleTopic">

If anyone has an idea, please help me, as I'm stuck and I don't know where
to go next.

Thank you.
View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message