[jboss-user] [Beginners Corner] - EJB + JNDI BINDING = A MESS

2lopez do-not-reply at jboss.com
Sun Aug 26 11:27:21 EDT 2007


I to all.

I'm developing a EJB3 + Struts app on jboss 4.2. It's very important to me, my final project at the university. I have a problem binding the stateless GestionBitacora. Simply I can't!

My code:

GestionBitacora.java
package stateless.bitacora;
  | 
  | import java.sql.Timestamp;
  | import java.util.Calendar;
  | 
  | import javax.ejb.Stateless;
  | import javax.persistence.EntityManager;
  | import javax.persistence.PersistenceContext;
  | 
  | import entidades.Bitacora;
  | 
  | @Stateless
  | //@EJB(name="ejb/GestionBitacora",beanName="GestionBitacora",beanInterface=GestionEntrada.class)
  | public class GestionBitacoraBean implements GestionBitacora {
  |     @PersistenceContext(unitName="MySqlDS") private EntityManager miEntityManager;
  |     
  |     public void log(String _msg) {
  |         Bitacora b = new Bitacora();
  |         b.setMsg(_msg);
  |         b.setTiempo(new Timestamp(Calendar.getInstance().getTimeInMillis()));
  |         miEntityManager.persist(b);
  |     }
  | 
  | }


The remote interface:
package stateless.bitacora;
  | 
  | import javax.ejb.Remote;
  | 
  | @Remote
  | public interface GestionBitacora {
  | 
  |     public void log(String _msg);
  | }

The ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
  | <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" 
  | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
  | http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
  |    <enterprise-beans>
  | 
  |       <!-- MORE STATELESS EJBs, BUT PROPERLY BOUND -->
  | 
  |       <session>
  |          <ejb-name>GestionBitacora</ejb-name>
  |          <ejb-ref>
  |             <ejb-ref-name>ejb/GestionBitacora</ejb-ref-name>
  |             <ejb-ref-type>Session</ejb-ref-type>
  |             <remote>stateless.bitacora</remote>
  |             <ejb-link>GestionBitacora</ejb-link>
  |             <injection-target>
  |                 <injection-target-class>stateless.bitacora.GestionBitacora</injection-target-class>
  |                 <injection-target-name>gestionBitacora</injection-target-name>
  |             </injection-target>
  |          </ejb-ref>
  |       </session>
  |    </enterprise-beans>
  | </ejb-jar>


I'm completely lost!!! The other Stateless EJB are perfectly deployed and ready to use, but this GestionUsuario isn't, according to the JNDIView... I've been investigating for hours, but found nothing.

Anybody could help me? Thanks in advance, it would be much appreciated.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078142#4078142

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078142



More information about the jboss-user mailing list