Liberty Profile - Remote EJB

与世无争的帅哥 提交于 2019-12-11 06:39:35

问题


I am trying to call a remote ejb from my application and getting error

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: javax.naming.NameNotFoundException: CNTR4009E: The edu.osu.cse5234.ooth.business.view.InventoryService remote interface for the InventoryServiceBean enterprise bean in the OutOfTheHouse-EJB.jar module in the OutOfTheHouse-EJBEAR application could not be obtained for the java:global/OutOfTheHouse-EJBEAR/OutOfTheHouse-EJB/InventoryServiceBean!edu.osu.cse5234.ooth.business.view.InventoryService JNDI name because remote interfaces are not supported by any of the features configured in the server.xml file.

I found that we need to add

<featureManager>
    <feature>ejbRemote-3.2</feature>
    <feature>localConnector-1.0</feature>
</featureManager>

but I am not getting an option to add ejbRemote in my server.xml. What could be the reason?


回答1:


Open server.xml, view in the Design mode (as opposed to Source mode), expand Server Configuration and click on Feature Manager. On the right side feature manager deatails will be listed. Click on Add. Add the following features:

ejblite-3.2 javaee-7.0 jndi-1.0 localConnnector-1.0

Additionally, make sure the EAR project is added to WAS liberty profile. Increase console log level to INFO (Server Manager --> Add --> Logging then edit console log level in the details window). The console output will spit out the JNDI name exactly as generated by the container. Copy paste into ServiceLocator code.

  • Praveen



回答2:


I get this error as soon as I enable features "webProfile-7.0" or "javaee-7.0". These features load other features and it seems that one of them prevents the EJB from being bound. Also there is no log entry containing the JNDI name in this case. To solve this issue I just enable the features I really need (servlet-3.1, localConnector-1.0, ejbLite-3.2, ejbRemote-3.2, jsp-2.3 in my case). This also speeds up server start.




回答3:


The problem was with the version of liberty profile I was using. I used a different one and I was able to add javaee-7.0 as feature and after that it worked fine.



来源:https://stackoverflow.com/questions/33327301/liberty-profile-remote-ejb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!