[jboss-user] [JNDI/Naming/Network] - JNDI - javax.ejb.EJBException
MARCOS GOMES
do-not-reply at jboss.com
Mon Feb 25 09:33:15 EST 2008
Hi,
I have a problem finding out a session bean:
javax.servlet.ServletException: javax.ejb.EJBException: javax.naming.NameNotFoundException: travel not bound
org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:126)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
--------------------------------------------------------
I'm trying to access the bean like this:
TravelAgentLocal travelag = null;
try {
javax.naming.InitialContext ctx = new InitialContext( );
travelag = (TravelAgentLocal)ctx.lookup("travel");
}
catch (javax.naming.NamingException ne) {
throw new EJBException(ne);
}
--------------------------------------------------------
This is my session bean:
package com.travelagent;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.jboss.seam.annotations.Name;
import com.entitybean.Empresa;
@Stateless
@Name("travel")
public class TravelAgentBean implements TravelAgentRemote, TravelAgentLocal{
@PersistenceContext(unitName="system") private EntityManager manager;
public void createEmpresa(Empresa emp){
manager.persist(emp);
}
public Empresa findEmpresa(int pKey){
return manager.find(Empresa.class, pKey);
}
}
The question is: using this session bean inside a war file it doesn't work, but when I deploy it using a jar file, deleting "@Name("travel")" it works well.
Could someone help me, please ?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131855#4131855
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131855
More information about the jboss-user
mailing list