Nilseu
Fiquei um tanto confuso com o c�digo, mas eu
acredito que esteja tudo certo. Eu costumo ver esse
erro (ClassCastException) quando o cliente n�o possui
a interface Home no classpath ou quando ela est� com
vers�o de compila��o diferente da interface Home do
servidor, o que � bastante prov�vel pois vc est�
rodando a partir do prompt.
--- Nilseu Padilha <[EMAIL PROTECTED]>
escreveu: > Obrigado pela ajuda, aqui vao as classes
da minha
> aplicacao. Ja chegeui ao extremo de baixar os fontes
> do
> jboss para compila-lo na mesma versao de jdk (calma,
> nao compilei ainda).
>
>
> /*
> ** UsuarioSessionFacade.java
> */
>
> package AgendaBusiness;
>
>
> import java.rmi.RemoteException;
>
> import javax.ejb.EJBObject;
>
> /**
> * Created 23/09/2002 16:29:32
> * Code generated by the Forte for Java EJB Module
> * @author Administrator
> */
>
> public interface UsuarioSessionFacade extends
> EJBObject {
> public int addUsuario(UsuarioVO usuario) throws
> java.rmi.RemoteException;
> public UsuarioVO[] findAll() throws
> java.rmi.RemoteException;
> public UsuarioVO findByUsername(String username)
> throws java.rmi.RemoteException;
> }
>
>
>
> /*
> ** UsuarioSessionFacadeEJBean.java
> */
>
>
> package AgendaBusiness;
>
>
> import javax.ejb.CreateException;
> import javax.ejb.SessionBean;
> import javax.ejb.SessionContext;
> import javax.ejb.SessionSynchronization;
>
> /**
> * Created 23/09/2002 16:29:32
> * Code generated by the Forte for Java EJB Module
> * @author Administrator
> *
> * @ejb:bean
> name="AgendaBusiness/UsuarioSessionFacadeEJBean"
> * display-name="Customer Session"
> * type="Stateless"
> * view-type="remote"
> *
>
jndi-name="ejb/AgendaBusiness/UsuarioSessionFacadeEJBean"
> *
> * @ejb:interface
> remote-class="AgendaBusiness.UsuarioSessionFacade"
> extends="javax.ejb.EJBObject"
> *
> * @ejb:home
>
remote-class="AgendaBusiness.UsuarioSessionFacadeEJBeanHome"
>
> extends="javax.ejb.EJBHome"
> *
> * @jboss:container-configuration name="Standard
> Stateless SessionBean"
> */
>
> public class UsuarioSessionFacadeEJBean implements
> SessionBean {
> private SessionContext context;
>
> /**
> * No argument constructor required by
> container.
> */
> public UsuarioSessionFacadeEJBean() {
> }
>
> /**
> * Create method specified in EJB 1.1 section
> 6.10.3
> */
> public void ejbCreate() {
> System.out.println("ejbCreate()");
> }
>
>
> /* Methods required by SessionBean Interface.
> EJB 1.1 section 6.5.1. */
>
> /**
> * @see
>
javax.ejb.SessionBean#setContext(javax.ejb.SessionContext)
> */
> public void setSessionContext(SessionContext
> context){
> this.context = context;
> }
>
> /**
> * @see javax.ejb.SessionBean#ejbActivate()
> */
> public void ejbActivate() {
> System.out.println("ejbActivate()");
> }
>
> /**
> * @see javax.ejb.SessionBean#ejbPassivate()
> */
> public void ejbPassivate() {
> System.out.println("ejbPassivate()");
> }
>
> /**
> * @see javax.ejb.SessionBean#ejbRemove()
> */
> public void ejbRemove() {
> System.out.println("ejbRemove()");
> }
>
> /* public void
> setSessionContext(javax.ejb.SessionContext
> sessionContext) throws javax.ejb.EJBException,
> java.rmi.RemoteException {
> }
> */
> public int addUsuario(UsuarioVO usuario){
> try{
> AgendaIntegration.DAOFactory
> myDAOFactory =
>
> AgendaIntegration.DAOFactory.getDAOFactory
>
> (AgendaIntegration.DAOFactory.POSTGRES);
> AgendaIntegration.UsuarioDAO myUsuario =
> myDAOFactory.getUsuarioDAO();
> return myUsuario.addUsuario(usuario);
> } catch
> (AgendaIntegration.UsuarioDAOException e){}
> return 0;
> }
> public UsuarioVO[] findAll() {
>
> try{
> AgendaIntegration.DAOFactory
> myDAOFactory =
>
> AgendaIntegration.DAOFactory.getDAOFactory
>
> (AgendaIntegration.DAOFactory.POSTGRES);
> AgendaIntegration.UsuarioDAO myUsuario =
> myDAOFactory.getUsuarioDAO();
> return myUsuario.findAll();
> } catch
> (AgendaIntegration.UsuarioDAOException e){}
> return null;
> }
>
> public UsuarioVO findByUsername(String username)
> {
>
> try{
> AgendaIntegration.DAOFactory
> myDAOFactory =
>
> AgendaIntegration.DAOFactory.getDAOFactory
>
> (AgendaIntegration.DAOFactory.POSTGRES);
> AgendaIntegration.UsuarioDAO myUsuario =
> myDAOFactory.getUsuarioDAO();
> return
> myUsuario.findByUsername(username);
> } catch
> (AgendaIntegration.UsuarioDAOException e){}
> return null;
>
> }
> }
>
>
>
>
> /*
> ** UsuarioSessionFacadeHome.java
> */
>
> package AgendaBusiness;
> import java.rmi.RemoteException;
>
> import javax.ejb.CreateException;
> import javax.ejb.EJBHome;
>
> /**
>
=== message truncated ===
_______________________________________________________________________
Yahoo! GeoCities
Tudo para criar o seu site: ferramentas f�ceis de usar, espa�o de sobra e acess�rios.
http://br.geocities.yahoo.com/
---------------------------------------------------------------------
Para cancelar a subscri��o, envie mensagem para:
[EMAIL PROTECTED]
Para comandos adicionais, envie mensagem para: [EMAIL PROTECTED]