Hi!
Ken Jenks wrote:
> I'm still trying to get the examples from Monson-Haefel's "Enterprise
> JavaBeans" (2nd Edition) to run in jBoss.
>
> When I deploy the travelagent.jar file (a SessionBean), jBoss complains
> that it can't find the Cabin class files (the EntityBean). The Cabin's
> client works fine, so I know the Cabin bean deploys correctly.
>
> How can I use jboss.xml to tell jBoss to add a directory to the classpath?
> I know I can do this by adding the classpath to jboss.conf and restarting
> jBoss, but this isn't how autodeploy is supposed to work. (Is it?)
>
> Here's what I have so far.
I think you need to move your understanding of a jar from the practical
towards the intention of a jar.
What is an EJB jar?
It is the smallest possible assembly of components. If you have two
components that are directly dependent on each other in order to
implement a specific application then they should be in the same jar.
So, the first question is: why have you put two interrelated components
in two jars instead of one?
The second is: if there are indeed good reasons for having two jars, you
must make it possible for them to "know the face" of each other.
Inter-faces. So, by placing the interfaces of one bean in anothers jar,
that another bean will be able to inter-face with the first one. Do you
see?
Let me be explicit:
Bean A has following classes:
ABean - the bean
AHome - the home interface
ARemote - the remote interface
Bean B has following classes:
BBean - the bean
BHome - the home interface
BRemote - the remote interface
Bean B wants to access bean B. As always, in order to talk to components
through an interface, that interface must be available. So, package
ABean,AHome and ARemote in A.jar and deploy, and package BBean, BHome,
BRemote, Ahome, and ARemote in B.jar and deploy. Any B instances can now
access the A component.
Makes sense?
regards,
Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]