WAR outside the EAR, not able to reference JAR inside EAR. In wildfly 8

会有一股神秘感。 提交于 2019-12-25 06:47:00

问题


I am migrating to Wildfly 8.2 from JBoss 5.1, I am deploying a Web Service using the resteasy and some EAR which has the code to get the requested data from the DB. Both the EAR which has multiple (6) JARs, but when I call the Web Service, it is not able to find the EAR and refer it's JARs

14:57:48,183 INFO [stdout] (default task-4) InitialContextFactory not defined - using default: org.jnp.interfaces.NamingContextFactory

14:57:48,184 ERROR [stderr] (default task-4) javax.naming.NameNotFoundException: bpc/AccountManagementService -- service jboss.naming.context.java.bpc.AccountManagementService

I have 2 separate deployment of EAR and WAR and both of them are deployed simultaneously and they both get deployed without any hassle.

Why are then not able to integrate is my issue right now.


回答1:


If you migrated from jboss 5 to wildfly, you have to adjust your jndi lookups.. You are getting a NameNotFoundException, so probably you are performing a lookup using the old jndi syntax..

When you startup your server, the log will show you different jndi names for your ejbs.. If you are looking for an ejb from a war, and both of them are not bundled in the same ear, then you have to use the java:global naming type..

For example, assuming that AccountManagementService is an interface, annotate it with @Remote, and search it from your war using the following jndi syntax

java:global/earName/ejb-jar-name/AccountManagementService!com.example.AccountManagementServiceImpl

See if this document helps (Modify JNDI lookup code section) https://docs.jboss.org/author/display/AS71/Order+Application+Migration+from+EAP5.1+to+AS7




回答2:


I resolved this issue by adding jboss-deployment-structure.xml in my WAR file under the web-inf folder by adding dependency like

dependencies>  
            <module name="deployment.MY_EAR.ear.MY_EJB_JAR.jar"/>  
</dependencies>



回答3:


I have similar issue. I am migrating from weblogic to wildfly.

One JAR which has only one property file and one EAR, both are deployed simultaneously without any issue. From EAR application, need to access the property file from the JAR.

This is working fine in weblogic but wildfly not identifying the property file.



来源:https://stackoverflow.com/questions/27492119/war-outside-the-ear-not-able-to-reference-jar-inside-ear-in-wildfly-8

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