-
1. Re: accessing local interfaces across jars
jdyao May 13, 2003 9:01 PM (in response to famousactress)Hi. I has the same problem when accessing local interfaces across jars.
I found the last source code :
importEjbJarXml(Element element)
{
....
// set the ejb local references
iterator = getChildrenByTagName(element, "ejb-local-ref");
while (iterator.hasNext())
{
Element ejbLocalRef = (Element) iterator.next();
EjbLocalRefMetaData ejbLocalRefMetaData = new EjbLocalRefMetaData();
ejbLocalRefMetaData.importEjbJarXml(ejbLocalRef);
ejbLocalReferences.put(ejbLocalRefMetaData.getName(),
ejbLocalRefMetaData);
}
....
}
importJbossXml(Element element)
{
........
// set the external ejb-references (optional)
iterator = getChildrenByTagName(element, "ejb-ref");
while (iterator.hasNext())
{
Element ejbRef = (Element)iterator.next();
String ejbRefName = getElementContent(getUniqueChild(ejbRef,
"ejb-ref-name"));
EjbRefMetaData ejbRefMetaData = getEjbRefByName(ejbRefName);
if (ejbRefMetaData == null)
{
throw new DeploymentException("ejb-ref " + ejbRefName
+ " found in jboss.xml but not in ejb-jar.xml");
}
ejbRefMetaData.importJbossXml(ejbRef);
}
........
}
That is, the local bean don't support crossing jar?
If you want to access the local bean (in other jar) by it's jndi name and don't config the 'ejb-local-ref' infomation in ejb-jar.xml , it will throw NameNotFoundException. -
2. How to accessing local interface when crossing jar.
jdyao May 13, 2003 9:55 PM (in response to famousactress)A local bean in A.jar,
B local bean in B.jar , B will accessing A bean.
the B ejb-jar.xml config like these.
<ejb-local-ref >
<ejb-ref-name>ejb/ASession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>common.ASessionLocalHome</local-home>
common.ASessionLocal
<ejb-link>A.jar#ASession</ejb-link>
</ejb-local-ref>
It may help you resolve these problem.
A.jar, B.jar locate './deploy/' directory.