EAR之外的WAR,无法在EAR中引用JAR。在野生蝇8 [英] WAR outside the EAR, not able to reference JAR inside EAR. In wildfly 8

查看:240
本文介绍了EAR之外的WAR,无法在EAR中引用JAR。在野生蝇8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从JBoss 5.1迁移到Wildfly 8.2,我正在使用resteasy和一些EAR部署Web服务,其中包含从DB获取所请求数据的代码。 EAR都有多个(6)JAR,但是当我调用Web服务时,它无法找到EAR并引用它的JAR

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](默认任务-4)InitialContextFactory未定义 - 使用默认值:org.jnp.interfaces.NamingContextFactory

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

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

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

我有2个单独部署的EAR和WAR,它们都是同时部署的,它们都可以毫不费力地部署。

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.

推荐答案

如果你从jboss 5迁移到wildfly,你必须调整你的jndi lookups ..你得到一个NameNotFoundException,所以你可能正在使用旧的jndi语法执行查找..

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..

当你启动你的服务器时,日志会显示你的ejbs的不同jndi名称..
如果你正在寻找战争的ejb,并且它们都没有捆绑在同样的耳朵,然后你必须使用java:全局命名类型..

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..

例如,假设AccountManagementService是一个接口,用@Remote注释它,并搜索它来自你的战争使用以下jndi语法

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

查看此文档是否有帮助(修改JNDI查找代码部分) https://docs.jboss.org/author/display/AS71 /订单+应用+移民+来自+ EAP5.1 +到+ AS7

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

这篇关于EAR之外的WAR,无法在EAR中引用JAR。在野生蝇8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆