MATRIT
MATRIT

Reputation: 19

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

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.

Upvotes: 0

Views: 886

Answers (3)

Jayaraman
Jayaraman

Reputation: 1

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.

Upvotes: 0

MATRIT
MATRIT

Reputation: 19

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>

Upvotes: 0

mendieta
mendieta

Reputation: 3500

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

Upvotes: 1

Related Questions