Greetings !

I have  been migrating my ejb from Voyager to Orion, in Orion and I'am using
a simple directory structure without jar my classes, and I have gotten an
mistake that I can't understand.
The error is:
IIdBeanHome_StatefulSessionHomeWrapper5.java:127:Exception
java.rmi.RemoteException must be caught,
or it must be declared in the throws clause of this method.
return new kynesoft.ecom.subastar.ejb.ids.IdBean();

Here  is my code ejb:

/**
  * File: IIdBean.java
  * Package: reto.ejb.ids
  * interface name: IIdBean
  * Descripción: Interfaz remota para el bean de usuarios (IdBean)
  * @author  Luciano Salvatorelli
  * @author  Salvador Velasco
  * @version %I%, %U%
  * @see     javax.ejb.*
  * Fecha de ultima modificacion: 16/03/2000
*/
package kynesoft.ecom.subastar.ejb.ids;

import java.rmi.RemoteException;

import java.lang.Exception;

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.Vector;
import java.util.Enumeration;

import javax.ejb.EJBObject;
import javax.ejb.EntityBean;
import javax.ejb.CreateException;
import javax.ejb.RemoveException;
import javax.ejb.FinderException;

import shared.helpers.*;
import shared.error.*;

public interface IIdBean extends EJBObject
{
    public int generateId (String table, String field) throws
RemoteException, AppException;
}


/**
  * file: IIdBeanHome
  * Package: reto.ejb.ids.java
  * Interface name: IIdBeanHome
  * Description: Interfaz home para el bean de usuarios
  * @author  Luis Da Costa
  * @author  Patricia T. Núñez Rojas Berti
  * @version %I%, %U%
  * @see     javax.ejb.*
  * Fecha de ultima modificacion: 05/11/1999
*/
package kynesoft.ecom.subastar.ejb.ids;

import java.rmi.RemoteException;
import java.util.Enumeration;
import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;


public interface IIdBeanHome extends EJBHome
{
    IIdBean create() throws CreateException, RemoteException;
}


/**
  * file: IdBean.java
  * Package: reto.ejb.ids
  * class name: IdBean
  * Descripción: Bean para los usuarios
  * @author  Luis Da Costa
  * @author  Luciano Salvatorelli
  * @author  Patricia T. Núñez Rojas Berti
  * @version %I%, %U%
  * @see     javax.ejb.*
  * Fecha de ultima modificacion: 05/11/1999
*/
package kynesoft.ecom.subastar.ejb.ids;

import java.rmi.RemoteException;

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.Vector;
import java.util.Enumeration;

import java.lang.NoSuchFieldException;

import javax.ejb.EntityBean;
import javax.ejb.CreateException;
import javax.ejb.RemoveException;
import javax.ejb.FinderException;

import shared.helpers.*;
import shared.error.*;
import shared.util.*;

import kynesoft.error.subastar.*;
import kynesoft.ecom.subastar.Parameters;
import kynesoft.ecom.subastar.ejb.TableFields;

/* ===================================================================== */
/**
  * Bean para el manejo de los clientes de la BD
  * @author  Luis Da Costa
  * @author  Luciano Salvatorelli
  * @author  Salvador Velasco
  * @version %I%, %U%
  * @see     javax.ejb.*
  * Fecha de ultima modificacion: 15/03/2000
*/

public class IdBean extends AbstractSession
{
    // maximo numero de cifras que tiene el # total de registros por tablas
    private static int COD_LENGTH = 9;

    /* =====================================================================
*/
    /**
     *  Constructor de la clase.
     *  Observaciones:  Las tareas a realizar por el constructor son:
     *              (1) Seleccionar la base de datos a leer: RetoDB
     *              (2) Inicializar la estructura interna para guardar los
     *                  de Mem Secundaria
    */
    public IdBean() throws RemoteException
    {
        try
        {
            // Indicar que la BD a utilizar es la de SubastarDB
            this.setDBHelperDatasourceUrl(new
kynesoft.ecom.subastar.Parameters().getDatasourceUrl());
        }
        catch(Exception e)
        {
            e.printStackTrace(System.out);
        }
    }


/* ===================================================================== */
/**
 *  Funcion de creacion del bean (segun los estandares EJB).
 *      Ver especificaciones EJB para entender tipos de
 *      excepciones levantadas, y valor retornado.
 *      Esta funcion se encuentra en la interfaz home con el
 *      nombre create()
 *  @throws RemoteException     en caso de error remoto (conexion,envio,...)
 *  @throws CreateException     si no se puede crear el objeto.
*/

    public void ejbCreate() throws CreateException, RemoteException
    {
    }

/* ======================================================= */
/**
 *  Primera funcion que se ejecuta despues del ejbCreate()
 *  (Ver especificaciones EJB).
 *  (tiene exactamente la misma firma que ejbCreate())
*/

    public void ejbPostCreate()
    {
    }


/* ===================================================================== */
/**
 *  Genera un id.
 *
 *  @param  tableName   (e) Nombre de la tabla
 *  @param  fieldName   (e) Nombre del campo
 *
 *  @return un codigo representando al id
 *
 *  @throws AppException    en caso de error dependiente de la aplicacion
 *  @throws RemoteException en caso de error en la conexion (red, ...)
*/
    public int generateId(String tableName, String fieldName) throws
RemoteException, AppException
    {
        ResultSet rs;
        String query, update;
        int counter;
        String entityName;
        ErrorInfo theError;

        try {
            entityName = tableName.trim() + "_" + fieldName.trim();
            query = "SELECT iCounter FROM Ids WHERE sEntity = '" +
entityName + "'";
            rs = getDBHelper().executeQuery(query);
            // solo deberia obtener 1 registro
            if (rs.next() == false) {
                // no tengo ningun registro... debe ser la primera vez que
entro...
                query = "INSERT INTO Ids (sEntity,iCounter) VALUES ('" +
entityName + "',0)";
                getDBHelper().executeUpdate(query);
                getDBHelper().executeComplete();
                counter = 0;
            }
            else
            {
                // tomo el contador presente en la tabla y lo incremento
                counter = rs.getInt(1);
            }
            // incremento el contador (porque estoy generando un nuevo
codigo)
            counter++;
            // actualizo el contador
            query = "UPDATE Ids SET iCounter = " + counter + " WHERE sEntity
= '" + entityName + "'";
            getDBHelper().executeUpdate(query);
            return counter;
        }
        catch( SQLException exception )
        {
            theError = new ErrorInfo(SubastarErrorManager.ERR_SPECIFIC_SQL);
            theError.addParam(exception.toString());
            throw new AppException(exception.toString(), theError,
exception);
        }
        finally
        {
            getDBHelper().executeCompleteConsumeException();
        }
    }
}


I don't know what to do ....

Thank you very much for your help

And I hope a soon answer

Bye

Michel






_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html


Reply via email to