[jboss-user] [JBoss Seam] - Re: SEAM don't can find session bean !!

JohnBat26 do-not-reply at jboss.com
Thu Mar 29 05:36:25 EDT 2007


waynebagguley: Yes, I put  seam.properties (size: 0 b)
in root ejb.jar

This is parent class for session bean:
----------
package org.it.itMail.service;

/**
 * Autogenerated EJB session bean base class UserActionBean.
 *
 * 
 */
@javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
@javax.ejb.Remote({org.it.itMail.service.UserActionRemote.class})
public abstract class UserActionBase
    implements org.it.itMail.service.UserActionRemote
{
    // ------ Session Context Injection ------
    
    @javax.annotation.Resource
    protected javax.ejb.SessionContext context;

    // ------ Persistence Context Definitions --------
    
    /**
     * Inject persistence context itMail     
     */
    @javax.persistence.PersistenceContext(unitName = "itMail")    
    protected javax.persistence.EntityManager emanager;

    // ------ DAO Injection Definitions --------

    /**
     * Inject DAO UserDao
     */
    @javax.ejb.EJB
    private org.it.itMail.domain.UserDao userDao;

    // --------- Attribute Definitions ------------
    
    /**
     * The user property
     */
    protected org.it.itMail.domain.User user;
    
    
    // --------------- Constructors ---------------
    
    public UserActionBase()
    {
        super();
    }

    // ------- Accessors for Attributes ----------
    

    // ------ DAO Getters --------

    /**
     * Get the injected DAO UserDao
     */
    protected org.it.itMail.domain.UserDao getUserDao()
    {
        return this.userDao;
    }

    // -------- Business Methods  --------------
    
    /**
     * 
     */
    @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
    public org.it.itMail.domain.User getUser(java.lang.Integer id)
    {
        if (id == null)
        {
            throw new IllegalArgumentException(
                "org.it.itMail.service.UserActionBean.getUser(java.lang.Integer id) - 'id' can not be null");
        }
        try
        {
            return this.handleGetUser(id);
        }
        catch (Throwable th)
        {
            throw new org.it.itMail.service.UserActionException(
                "Error performing 'org.it.itMail.service.UserAction.getUser(java.lang.Integer id)' --> " + th,
                th);
        }
    }
    
    /**
     * Performs the core logic for {@link #getUser(java.lang.Integer)}
     */
    protected abstract org.it.itMail.domain.User handleGetUser(java.lang.Integer id)
        throws java.lang.Exception;

    /**
     * 
     */
    @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
    public void getUsers()
    {
        try
        {
            this.handleGetUsers();
        }
        catch (Throwable th)
        {
            throw new org.it.itMail.service.UserActionException(
                "Error performing 'org.it.itMail.service.UserAction.getUsers()' --> " + th,
                th);
        }
    }
    
    /**
     * Performs the core logic for {@link #getUsers()}
     */
    protected abstract void handleGetUsers()
        throws java.lang.Exception;


    // -------- Lifecycle Callbacks --------------
    
}------------------
This is session bean, which seam don't can find:
-----------------------------------

package org.it.itMail.service;

import java.util.List;

import javax.ejb.Remove;
import javax.ejb.Stateful;

import org.it.itMail.domain.*;
import org.jboss.annotation.ejb.LocalBinding;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;

/**
 * @see org.it.itMail.service.UserActionBean
 */
/**
 * Do not specify the javax.ejb.Stateful annotation
 * Instead, define the session bean in the ejb-jar.xml descriptor
 * @javax.ejb.Stateful
 */
/**
 * Uncomment to enable webservices for UserActionBean
 *@javax.jws.WebService(endpointInterface = "org.it.itMail.service.UserActionWSInterface")
 */
@Stateful
@Name("userAction")

public class UserActionBean 
    extends org.it.itMail.service.UserActionBase 
{
    /**
     * 
     */
    private static final long serialVersionUID = 5450987872243833212L;
    @DataModel
    private List < User > userList;
    // --------------- Constructors ---------------
    
    public UserActionBean()
    {
        super();
    }

    // -------- Business Methods Impl --------------
    
    /**
     * @see org.it.itMail.service.UserActionBase#getUser(java.lang.Integer)
     */
    protected org.it.itMail.domain.User handleGetUser(java.lang.Integer id)
        throws java.lang.Exception
    {
        //TODO: put your implementation here.
        // Dummy return value, just that the file compiles
        return null;
    }

    /**
     * @see org.it.itMail.service.UserActionBase#getUsers()
     */
    protected void handleGetUsers()
        throws java.lang.Exception
    {
        userList = (List < User >) this.getUserDao().loadAll();
        
    }


    // -------- Lifecycle Callback Implementation --------------
    

    // ----------- Destroy Method Implementation -----------
    
    
    /**
     * Remove lifecycle method
     */
    @Destroy @Remove
    public void remove() {
        handleDestroy();
    }
    
    /**
     * @see org.it.itMail.service.UserActionBean#destroy()
     */
    protected void handleDestroy()
    {
        //TODO: put your implementation here
    }
}
------------
:)
-----------------------------------

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

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



More information about the jboss-user mailing list