[英]How to inject EJB into a Spring
I have a stateless Bean with following heirarchy and present accountserver
, accountserverBean implements accountserver
. 我有一个无状态Bean,具有以下层次结构和当前
accountserver
, accountserverBean implements accountserver
。 with there corresponding ejb-jar.xml
and weblogicjar.xml
有对应的
ejb-jar.xml
和weblogicjar.xml
Then I have my spring Bean with the following payload.java
with corressponding spring.xml
然后,我有我的Spring bean与以下
payload.java
与corressponding spring.xml
So Inside the spring libs folder I have added account.jar
因此,在spring libs文件夹中,我添加了
account.jar
So how can I call method present in accountserverBean from payload class???? 那么如何从有效负载类中调用accountserverBean中存在的方法呢?
Also I have used the below Code in payload.java 我也在payload.java中使用了以下代码
Context ctx=new InitialContext();
accountserver as=(accountserver)ctx.lookup("java:com/accountserver");
But this doesnt work. 但这不起作用。
Since both are in same context I can call the EJB method Please provide me with solution 由于两者都在同一个上下文中,所以我可以调用EJB方法。请向我提供解决方案
I guess you want to integrate EJB and Spring applications. 我猜您想集成EJB和Spring应用程序。 Did you try this: http://static.springsource.org/spring/docs/2.5.x/reference/ejb.html ?
您是否尝试过: http : //static.springsource.org/spring/docs/2.5.x/reference/ejb.html ?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.