Rmi beans pacotes diferentes

0 respostas
K

Senhores,

Dadas as seguintes classes:

public interface IVenda extends Remote { public PessoaBean findPessoa(String cpf) throws RemoteException; }

public PessoaBean findPessoa(String cpf) throws RemoteException { try { PessoaBean result = new PessoaBean(); result.setId(1); result.setNome("Kuesley Fernandes"); return result; } catch (Exception ex) { throw new RemoteException("Não foi possível encontrar CPF "+cpf); } } public static void main(String[] args) { try { server.VendaServer obj = new server.VendaServer(); Naming.bind("VendaServer", obj); LOG.info("Objeto iniciado!"); } catch (Exception ex) { LOG.error(ex.getMessage(), ex); } }

public class PessoaBean implements Serializable { private int id; private String nome; ... }

Quando a classe PessoaBean está em um “.jar” diferente o servidor RMI não sobe apresentando a exception:

Caused by: java.lang.NoClassDefFoundError: model/RetornoBean

Se coloco a classe dentro do mesmo “.jar” (projeto) o negócio funciona.

Alguém sabe o que pode ser?

Abraços

by
Kuesley@

Criado 20 de novembro de 2007
Respostas 0
Participantes 1