Hi all,
Many Thanks to all in advance for their help on this!
I have a small problem with xdoclet - apologies for the long posting I
didn't want to leave out anything.
When I create util classes for Session beans getLocalHome uses the
BeanLocalHome.JNDI_NAME value to do the
InitialContext.lookup(jndi_string) in the generated util class, This
means that I can call getLocalHome() from a web applciation, e.g. a
Junit Test run using the Junitee xodclet target.
When util classes for Entity beans are generated, getLocalHome() uses
the BeanLocalHome.COMP_NAME value to do the
InitialContext.lookup(jndi_string), this is as far as I can see only
available from inside the container. This means that the
util.getLocalHome() is not available from a web applcation even if this
is in the same VM as the app server, like JBoss / Jetty or JBoss /
Tomcat ( I've tested both! ). This means the util objects created by
xdoclet won't work if used from web - clients.
I've also tried using the entity generated util (which doesn't work from
a web -client) in a Session bean and it works fine, so the util object
is correct for use within other beans only.
I've had this occur under both Windows 2000 and Red Hat 7.2
Xdoclet is 1.1.2
Ant is Apache Ant version 1.5Beta2 compiled on May 31 2002
JDK is Sun 1.4.1_01
J2EE JDK is 1.3.1
App Server is JBoss 3.2.0RC1 / Jetty and JBoss 3.0.4_Tomcat4.0.4
I've incuded the xdoclet @ejb.bean tags from both the session bean that
creates a working util class (from anywhere), as well as the enitity
that doesn't, well only allows you to call from another bean)
I'd really prefer to be able to use the benefit of having the web
container in the same VM as the app server and use the Local interfaces,
the only option I can think is that I should modify how xdoclet works -
but then that would mean not using the COMP_NAME lookup and always using
JNDI_NAME. Would this be much more inefficent?
The xdocet tags from the two beans follow:
The Entity bean that doesn't work:
@ejb.bean
name="Context"
type="CMP"
view-type="local"
local-jndi-name="ejb/Context"
primkey-field="contextId"
schema="Context"
cmp-version="${ejb.cmp.version}"
@ejb.value-object
name="Context"
match="*"
@ejb.transaction
type="Required"
@ejb.persistence
table-name="CONTEXT"
@ejb.ejb-ref
ejb-name="UIDGenerator"
view-type="local"
@ejb.ejb-ref
ejb-name="ContextModel"
view-type="local"
@ejb.ejb-ref
ejb-name="ContextElement"
view-type="local"
@ejb.finder
signature="Collection findAll()"
query="SELECT OBJECT(c) FROM Context AS c"
@jboss.create-table "${jboss.create.table}"
@jboss.remove-table "${jboss.remove.table}"
@jboss.tuned-updates "${jboss.tuned.updates}"
The session bean that works:
@ejb.bean
name="ContextModel"
type="Stateless"
view-type="both"
jndi-name="ContextModel"
local-jndi-name="local/ContextModel"
@ejb.transaction
type="Required"
@ejb.util
generate="physical"
@ejb.ejb-ref
ejb-name="Association"
view-type="local"
@ejb.ejb-ref
ejb-name="AssociationType"
view-type="local"
@ejb.resource-ref
res-name="${jndi.queue.ConnectionFactory}"
res-type="javax.jmx.QueueConnectionFactory"
res-auth="Container"
@ejb.resource-ref
res-name="${jndi.queue.order}"
res-type="javax.jms.Queue"
res-auth="Container"
@ejb.resource-ref
res-name="${jndi.datasource}"
res-type="javax.sql.DataSource"
res-auth="Container"
@jboss.resource-manager
res-man-name="${jndi.queue.ConnectionFactory}"
res-man-jndi-name="${jboss.queue.ConnectionFactory}"
@jboss.resource-manager
res-man-name="${jndi.queue.order}"
res-man-jndi-name="${jboss.queue.order}"
@jboss.resource-manager
res-man-name="${jndi.datasource}"
res-man-jndi-name="${jboss.datasource}"
@weblogic.resource-description
res-ref-name="${jndi.queue.ConnectionFactory}"
jndi-name="${weblogic.queue.ConnectionFactory}"
@weblogic.resource-description
res-ref-name="${jndi.queue.order}"
jndi-name="${weblogic.queue.order}"
@weblogic.resource-manager
res-ref-name="${jndi.datasource}"
jndi-name="${weblogic.datasource}"
Oisin Kim
Aurium
Tel: +353 1 6611132
Fax: +353 1 6615200
e-mail: [EMAIL PROTECTED]
web site: http://www.aurium.net
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user