Object obj = ic.lookup("java:comp/env/ejb/RouteFacade"); //这样会有NamingException
Object obj = ic.lookup("RouteFacade"); //这样写就不会出错
Object obj = ic.lookup("RouteFacade"); //这样写就不会出错
解决方案 »
- 做项目用JFreeChart画时序图,遇到一个需求。
- 用hibernate进行多对一关联报错,没有baidu解决的办法。纠结。
- 游标里套游标没能循环输出数据,希望高手能帮忙解答一下,谢谢
- Struts2中对数字进行格式化
- jfreereport
- hibernate JDBCException logWarnings SQL Warning: 17110, SQLState: null
- eclipse中tomcat启动问题
- 跪求struts+spring+hibernate的框架简单例子,谢谢先
- eclipse 和Tomcat开发servlet的问题!!
- 问题出在哪???请指教
- 那里有LDAP的资料
- 高分求救!一个很简单的问题,程序无法运行,提示错误(100分)
java:comp/env/-- is private to each ejb and is defined by the ejb-ref and ejb-local-ref in the bean, what you should do instead is :in your ejb-jar.xml for the bean that references CompanyUser bean through java:comp/env/ejb/CompanyUser<session>
...
<ejb-local-ref>
<ejb-ref-name>ejb/CompanyUser</ejb-ref-name>
...
plus information according to the bean :
ejb-ref-type, local-home, local
...
<ejb-link>CompanyUser<ejb-link>
</ejb-local-ref>
...
</session>of course we assume that you two beans are in the same jar deployement.otherwise you don't specify ejb-link and use jboss.xml instead to make the link to the bean.
不过,对于ejb调用ejb时需要在ejb-jar.xml里面加入引用参考才可以用“java:comp/env/”方式调用这一点我是知道的,
可我的问题是在app client如果也用“java:comp/env/”方式调用ejb应该怎么做呢,我是在application-client.xml里面加入了关于ejb引用的描述的。有了一个appClient.jar文件了,这个jar文件里面包括了客户应用所需要的ejb远程接口类以及客户程序,还有application-client.xml、MANIFEST.MF,MANIFEST.MF里面定义了main class。然后在jbuilder里面建了一个ear,设置了ejb模块(ejb.jar)和app client模块(appClient.jar),编译成功了,可是deploy的时候报这样的错误:
Unable to activate application, app, from source, e:\bea\user_projects\mydomain\.\myserver\upload\app\app.ear. Reason: Unable to create mbean Name: appClient.jar Type: null Exception: weblogic.management.MBeanCreationException: - with nested exception:[javax.management.MalformedObjectNameException: type cannot be null]这是为什么呢?