War wont deploy "Unresolved <ejb-link>" Glassfish 3, Netbeans 7
Posted
by
Ime Imee
on Stack Overflow
See other posts from Stack Overflow
or by Ime Imee
Published on 2012-10-12T23:28:21Z
Indexed on
2012/10/14
9:37 UTC
Read the original article
Hit count: 784
I have enterprise aplication with ejb and war module, and since I created local interface web module wont deploy. It builds fine. EJB project is referenced inside web project.
Also when I delete <ejb-local-ref>
from web.xml it deploys, but then lookup method fails.
Glassfish error:
SEVERE: Exception while deploying the app [Projekat-war] : Error: Unresolved <ejb-link>: Projekat-ejb.jar#ZaWebSessionBean
Simple interface:
@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")
}
And 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>
Lookup method (generated) :
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);
}
}
Full log:
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
© Stack Overflow or respective owner