1: Наше приложение работает на Weblogic Application Server, версия 10.3.0EJB 3.0 поиск в Weblogic 10.3.0
2: В нашей системе, мы должны развернуть EJB, соответствующую EJB 3.0 спецификации.
Вы можете найти пример кода для нашей окружающей среды UAT, как показано ниже:
/*The remote interface*/
package com.serverside.ejb.session;
import javax.ejb.Remote;
@Remote
public interface ASimpleSessionBeanRemote {
public void printThis(String print);
}
/*The bean class*/
package com.serverside.ejb.session;
import javax.ejb.Remote;
import javax.ejb.Stateless;
/**
* Session Bean implementation class ASimpleSessionBean
*/
@Stateless(name="ASimpleSessionBean", **mappedName = "ASimpleSessionEJB"**)
@Remote(ASimpleSessionBeanRemote.class)
public class ASimpleSessionBean implements ASimpleSessionBeanRemote {
/**
* Default constructor.
*/
public ASimpleSessionBean() {
// TODO Auto-generated constructor stub
}
@Override
public void printThis(String print) {
// TODO Auto-generated method stub
System.out.println("ASimpleSessionBean : "+print);
}
}
3: Вышеуказанные файлы при расфасованные в баночки получить развернуты на сервере успешно.
4: Согласно спецификации EJB 3.0, deployement дескрипторы не mandatory.Hence, банку не включает в себя EJB-jar.xml и WebLogic-jar.xml-EJB
5: Пожалуйста найти ниже, EJB3.0 аннотация ссылка согласно Weblogic документации Application Server:
Annotation : @Stateless
Package: javax.ejb.Stateless
Attribute : mappedName
Description :
Specifies the product-specific name to which the stateless session bean should be mapped.
You can also use this attribute to specify the JNDI name of this stateless session bean. WebLogic Server uses the value of the mappedName attribute when creating the bean’s global JNDI name. In particular, the JNDI name will be:
mappedName#name_of_businessInterface
where name_of_businessInterface is the fully qualified name of the business interface of this session bean.
For example, if you specify mappedName="bank" and the fully qualified name of the business interface is com.CheckingAccount, then the JNDI of the business interface is bank#com.CheckingAccount.
6: в соответствии с приведенной выше спецификацией, образец EJB развернут на сервере приложений имеет связывающее имя (как это отражено в дереве JNDI), как следует:
ASimpleSessionEJB # com.serverside.ejb.session.ASimpleSessionBeanRemote
JNDI поиска, используя это имя преуспевает:
InitialContext.doLookup("ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSesionBeanRemote");
7: Теперь мы хотим, чтобы имя связывания быть простой строкой поиска т.е. должен что-то вроде:
InitialContext.doLookup ("ASimpleSessionEJB");
8: Для реализации точки 7, мы пытались с помощью EJB-jar.xml и WebLogic-EJB-jar.xml следующим образом (К сожалению, не мог понять, как прикрепить/визуализации файлов XML):
9: Inspite точки-8, имя связывания остается следующим:
ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSessionBeanRemote
10: Просьба направить нам о решении и реализации присутствовать точка-7.
Спасибо!
См. Мой ответ в следующей теме: http://stackoverflow.com/questions/8909573/how-to-access-ejb-from-a-quartz-job/10885831#10885831 –