Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » RMI Callback using Container OC4J - Server dont see the client (Oracle AS 10g, 10.1.3.1, WinXP)
RMI Callback using Container OC4J - Server dont see the client [message #339004] Wed, 06 August 2008 08:20
fredrischter
Messages: 1
Registered: August 2008
Junior Member
RMI Callback using Container OC4J - Server dont see the client

Hi people, i'm Fred, i do work programming java,

I'm gotting a problem when trying to use RMI Callback, server Oracle Application Server 10g, Container OC4J.

I create a server application, putting inside the JAR the client interface to able he to run the callback, i do the deploy on the OC4J container and it work there. When i run the client i got this exception.

I have a lot of EJBs 2.1 stateless working perfectly, my problem is when i try to use callback methods. I need to use EJB 2.1, i need too to use AS 10g of oracle and i need too to use callback.

Regarding the code dont present problems of sintax or building, i removed the great part of the code because it dont matter the problem, the parts that is relative to the problem is there below.

How you can see there on the exception stacktrace, the server is called to register the client instance, but, instead of just regard the interface, he try to instantiate the class that implements the interface (he realy dont have this class with he, because he should not to know this implementation), he dont find this class, realy he should not find it. The problem is that he wants to instantiate this class instead of use just the interface for calling.

When i made this program with the server made on hand, not using the oc4j container, this worked with callback, or be, the client was exporting his object and the server was finding its reference, but not dont find it.. (and looks for the implementing class)

Here is the EJB 2.1 code section that causes the error:


// ------------------- EJB on that the client will register and after will receive callings ---------------------------------------------------

public interface Patio extends EJBObject {
...
boolean registrarCampoListener(CampoListener cl) throws RemoteException; // método que deve registrar um cliente para receber chamadas do servidor
}

public interface PatioHome extends EJBHome {
Patio create() throws RemoteException, CreateException;
}

public class PatioBean implements SessionBean {
public boolean registrarCampoListener(CampoListener cl) {
try {
consoles.addElement(cl);
return true;
} catch(Exception e) {
return false;
}
}
}

// ----------------------- client Interface -----------------------------------------------


public interface CampoListener extends Remote {
public int acao(String acao) throws RemoteException;
}

// ----------------------- class that implements the interface ---------------

public class AcessoServicos implements CampoListener,Serializable {
Patio pra; // É A REFERENCIA REMOTA DO EJB QUE ESTÁ NO SERVIDOR, JÁ INSTANCIADA E FUNCIONANDO
....
public static void main(String[] args) {
System.out.println("Executando teste:");
System.out.println("Registrando Listener de Campo:");
try {
UnicastRemoteObject.exportObject((CampoListener)as); // ESTE FUNCIONA

boolean result=pra.registrarCampoListener((CampoListener)as); // AQUI TEMOS O PROBLEMA

System.out.println("registro realizado com sucesso: "+result);
} catch (RemoteException e) {
System.out.println("Excessao ao tentar exportar cliente");
e.printStackTrace();
}
}

public int acao(String acao) {
System.out.println("acao recebida: " + acao);
return 1111;
}
}

// --------------------------------------STACKTRACE------------------------------------------------------------------






06/08/2008 09:36:26 oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
WARNING: Exceção retornada pelo servidor remoto: {0}
oracle.classloader.util.AnnotatedClassNotFoundException:

Classe não encontrada: com.vale.lg.controlepatio.ccp.client.AcessoServicos

Classe dependente: com.evermind.io.ClassLoaderObjectInputStream
Carregador: oc4j:10.1.3
Origem do Código: /D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar
Configuração: <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar

Este carregador foi iniciado em CCP.root:0.0.0 usando o método Class.forName().

A classe não encontrada não está disponível nos códigos-fonte ou nos carregadores no sistema.
at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2068) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1679) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.lang.Class.forName0 (Native method) [unknown, by unknown]
at java.lang.Class.forName (Class.java:242) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at com.evermind.io.ClassLoaderObjectInputStream.resolveClass (ClassLoaderObjectInputStream.java:33) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at java.io.ObjectInputStream.readNonProxyDesc (ObjectInputStream.java:1538) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readClassDesc (ObjectInputStream.java:1460) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readOrdinaryObject (ObjectInputStream.java:1693) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1299) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readObject (ObjectInputStream.java:339) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at com.evermind.server.rmi.RMIProtocol$Version.unmarshallParameterDirectly (RMIProtocol.java:402) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIProtocol$Version_1_0.unmarshallParameter (RMIProtocol.java:471) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIProtocol.readObject (RMIProtocol.java:80) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIProtocol.readValue (RMIProtocol.java:161) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.ServerRmiMessageHandler.handleMethodInvocation (ServerRmiMessageHandler.java:514) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.ServerRmiMessageHandler.handleOrmiRequest (ServerRmiMessageHandler.java:272) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.ServerRmiMessageHandler.dispatchRequest (ServerRmiMessageHandler.java:241) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIServerConnection.processReceivedCommand (RMIServerConnection.java:176) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIConnection.handleCommand (RMIConnection.java:152) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands (RMIConnection.java:127) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIServerConnection.listenForOrmiCommands (RMIServerConnection.java:390) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIConnection.run (RMIConnection.java:107) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run (ReleasableResourcePooledExecutor.java:303) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap:1.5.0_06]

oracle.oc4j.rmi.OracleRemoteException: Invocation error: oracle.classloader.util.AnnotatedClassNotFoundException:

Classe não encontrada: com.vale.lg.controlepatio.ccp.client.AcessoServicos

Classe dependente: com.evermind.io.ClassLoaderObjectInputStream
Carregador: oc4j:10.1.3
Origem do Código: /D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar
Configuração: <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar

Este carregador foi iniciado em CCP.root:0.0.0 usando o método Class.forName().

A classe não encontrada não está disponível nos códigos-fonte ou nos carregadores no sistema.
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:139)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:517)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:461)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:2Cool
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.registrarCampoListener(Unknown Source)
at com.vale.lg.controlepatio.ccp.client.AcessoServicos.main(AcessoServicos.java:233)

Nested exception is:
oracle.classloader.util.AnnotatedClassNotFoundException:

Classe não encontrada: com.vale.lg.controlepatio.ccp.client.AcessoServicos

Classe dependente: com.evermind.io.ClassLoaderObjectInputStream
Carregador: oc4j:10.1.3
Origem do Código: /D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar
Configuração: <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar

Este carregador foi iniciado em CCP.root:0.0.0 usando o método Class.forName().

A classe não encontrada não está disponível nos códigos-fonte ou nos carregadores no sistema.
at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2068) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1679) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.lang.Class.forName0 (Native method) [unknown, by unknown]
at java.lang.Class.forName (Class.java:242) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at com.evermind.io.ClassLoaderObjectInputStream.resolveClass (ClassLoaderObjectInputStream.java:33) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at java.io.ObjectInputStream.readNonProxyDesc (ObjectInputStream.java:1538) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readClassDesc (ObjectInputStream.java:1460) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readOrdinaryObject (ObjectInputStream.java:1693) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1299) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at java.io.ObjectInputStream.readObject (ObjectInputStream.java:339) [jre bootstrap, by jre.bootstrap:1.5.0_06]
at com.evermind.server.rmi.RMIProtocol$Version.unmarshallParameterDirectly (RMIProtocol.java:402) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIProtocol$Version_1_0.unmarshallParameter (RMIProtocol.java:471) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIProtocol.readObject (RMIProtocol.java:80) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIProtocol.readValue (RMIProtocol.java:161) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.ServerRmiMessageHandler.handleMethodInvocation (ServerRmiMessageHandler.java:514) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.ServerRmiMessageHandler.handleOrmiRequest (ServerRmiMessageHandler.java:272) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.ServerRmiMessageHandler.dispatchRequest (ServerRmiMessageHandler.java:241) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIServerConnection.processReceivedCommand (RMIServerConnection.java:176) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIConnection.handleCommand (RMIConnection.java:152) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands (RMIConnection.java:127) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIServerConnection.listenForOrmiCommands (RMIServerConnection.java:390) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.rmi.RMIConnection.run (RMIConnection.java:107) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run (ReleasableResourcePooledExecutor.java:303) [/D:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in D:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap:1.5.0_06]
Previous Topic: Scheduled refresh of Discoverer Portlet is failed
Next Topic: REP-50171: Authentication failed
Goto Forum:
  


Current Time: Thu Mar 28 17:14:32 CDT 2024