"Glassfish 3,Netbeans 7-6ren"> "Glassfish 3,Netbeans 7-我有带有 ejb 和 war 模块的企业应用程序,并且由于我创建了本地界面 web 模块,因此不会部署。它构建良好。 EJB 项目在 Web 项目中被引用。 还有当我删除 从 web.xml 它部署,-6ren">
gpt4 book ai didi

jakarta-ee - war 不会部署 "Unresolved "Glassfish 3,Netbeans 7

转载 作者:行者123 更新时间:2023-12-04 02:16:27 26 4
gpt4 key购买 nike

我有带有 ejb 和 war 模块的企业应用程序,并且由于我创建了本地界面 web 模块,因此不会部署。它构建良好。 EJB 项目在 Web 项目中被引用。

还有当我删除 <ejb-local-ref>从 web.xml 它部署,但随后查找方法失败。

玻璃鱼错误:

SEVERE: Exception while deploying the app [Projekat-war] : Error: Unresolved <ejb-link>: Projekat-ejb.jar#ZaWebSessionBean



简单的界面:
@Local
public interface ZaWebSessionBeanLocal {

String vrati(String str);

}

@Stateless
public class ZaWebSessionBean implements ZaWebSessionBeanLocal {

@Override
public String vrati(String str) {
return "vrati";
}

// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")


}

和 web.xml
<ejb-local-ref>
<ejb-ref-name>ZaWebSessionBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>za_web.ZaWebSessionBeanLocal</local>
<ejb-link>Projekat-ejb.jar#ZaWebSessionBean</ejb-link>
</ejb-local-ref>

查找方法(生成):
public class HeaderBean {
ZaWebSessionBeanLocal zaWebSessionBean = lookupZaWebSessionBeanLocal();

private ZaWebSessionBeanLocal lookupZaWebSessionBeanLocal() {
try {
Context c = new InitialContext();
return (ZaWebSessionBeanLocal) c.lookup("java:global/Projekat/Projekat-ejb/ZaWebSessionBean!za_web.ZaWebSessionBeanLocal");
} catch (NamingException ne) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
throw new RuntimeException(ne);
}
}

完整日志:
SEVERE: Exception while deploying the app [Projekat-war] : Error: Unresolved <ejb-link>: Projekat-ejb.jar#ZaWebSessionBean
SEVERE: Unresolved <ejb-link>: Projekat-ejb.jar#ZaWebSessionBean
SEVERE: Exception while deploying the app [Projekat-war]
SEVERE: Error: Unresolved <ejb-link>: Projekat-ejb.jar#ZaWebSessionBean
java.lang.RuntimeException: Error: Unresolved <ejb-link>: Projekat-ejb.jar#ZaWebSessionBean
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:724)
at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:2004)
at com.sun.enterprise.deployment.Application.visit(Application.java:1777)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:195)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:185)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:94)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:827)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:769)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)

SEVERE: Exception while deploying the app [Projekat-war] : Error: Unresolved <ejb-link>: Projekat-ejb.jar#ZaWebSessionBean

最佳答案

我在尝试部署我的应用程序时遇到了同样的问题,NetBeans 自己在我的 web.xml 中生成了这个代码。

在您的 web.xml 中完全删除

<ejb-local-ref>
<ejb-ref-name>appName</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<ejb-link>AppName#SomeClass</ejb-link>
</ejb-local-ref>

它应该在此之后部署。

关于jakarta-ee - war 不会部署 "Unresolved <ejb-link>"Glassfish 3,Netbeans 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12868434/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com