Acton
> Here is a question when i am trying to deploying the sample
> banking system. I am doing in weblogic6.1.
> In system, a RMILogger RMI remote object needs to be done.
> There are two files:RMILogger.java and RMILoggerImpl. I complied
> them successfully.
> In next step, use weblogic.rmic to generate stub class. But
> seems nothing to be created.(is it right or not?).
rmic in 6.1 only creates a deployment descriptor and only in special
circumstances. If you compile with -iiop you will also get iiop stubs.
> Now I am bindng it to a name in weblogic name service.But it
> shows up that "ClassCastException" occurs. I check source code
> and delete 2 lines about adding RMISecurityManager. Then now
> bound to name service.
> Finally Client code could look up the name and create the
> object. But when the method is invoked(Here is log(Sting s)),
> error occurs with "weblogic.rjvm.PeerGoneException: Peer
> requested connection shutdown weblogic.rjvm.PeerGoneException:
> Peer requested connection shutdown".
Don't know. You need to provide more details or contact support.
andy
--
********
What is this deployment descriptor? Where is it after creation?
Is it neccessary for RMI deploy in weblogic6.1?
*********
> What is this deployment descriptor? Where is it after creation?
> Is it neccessary for RMI deploy in weblogic6.1?
Something like:
myrmiDD.xml
It specifies non-standard options like transactions and clustering
andy
--
In this system, there is a RMI named RMILogger. There are two files associated
with it: RMILogger.java
and RMILoggerImpl.java.
I compile them with no error.
Next , I am using weblogic.rmic to generate stub files and no any reponse.
It seems that it is doing as
dynamic and hot generation stuff. Shall I start weblogic server now? I think
server might record something in
the memory now.
Now time to register in weblogic name service by running RMILoggerImpl.
But a error with
"ClassCastException" occurs. I look thourgh source code and delete two line codes
as following:
if (System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());
then it works! Does it matter? But as doc said, it doesn't matter to add security
manager or not.
Last I try to use client code to use remote object. Looking up is ok.
But when invocation of log(s) method
is trigged, error is:
weblogic.rjvm.PeerGoneException: Peer requested connection shutdown]
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:60)
at $Proxy1.log(Unknown Source)
at examples.tutorials.migration.banking.RMIClient.main(RMIClient.java:10)
My client code is:
public class RMIClient{
public static void main(String[] args){
RMILogger theLogger = null;
try{
theLogger = (RMILogger)Naming.lookup("//zeus:7452/RMILoggerServer");
System.out.println("Successfully connected to RMILoggerServer");
theLogger.log("Acton Wang: haha");
System.out.println("Successfully Execute it!!");
}catch(Throwable t){
t.printStackTrace();
}
}
}
I do as i am told. So I could not figure it out.
could you help me to solve it ? I appreciate greatly.
Acton
try using an InitialContextFactory
Hashtable props = new Hashtable();
props.put(Context.PROVIDER_URL, "t3://zeus:7452");
props.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
Context rootContext = new InitialContext(props);
RMILogger tester
= (RMILogger)PortableRemoteObject.narrow(rootContext.lookup("RMILoggerServer"),
RMILogger.class);
andy
--
java.rmi.ConnectException: PeerGone; nested exception is:
weblogic.rjvm.PeerGoneException: Peer requested connection shutdown
weblogic.rjvm.PeerGoneException: Peer requested connection shutdown
at weblogic.rjvm.ConnectionManagerClient.handlePeerGone(ConnectionManagerClient.java:199)
at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
at weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.rmi.extensions.RemoteRuntimeException - with nested exception:
[java.rmi.ConnectException: PeerGone; nested exception is:
weblogic.rjvm.PeerGoneException: Peer requested connection shutdown]
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:60)
at $Proxy1.log(Unknown Source)
at examples.tutorials.migration.banking.RMIClient.main(RMIClient.java:20)
</p>
The print trace is following:
[java.rmi.ConnectException: PeerGone; nested exception is:
weblogic.rjvm.PeerGoneException: Peer requested connection shutdown]
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:60)
at $Proxy1.log(Unknown Source)
at examples.tutorials.migration.banking.RMIClient.main(RMIClient.java:24
Does it do with the Security issue in WebLogic?
Thanks !
Acton Wang
I doubt it. Are you sure you are trying to connect to the port WLS is
listening on? The default port is 7001. Are you able to get the rmi
examples working. You ought to start there first.
andy
--
I did all the process according to the
instructions of RMI in WebLogic6.1 doc online. RMILogger.java
and RMILoggerImpl.java are from banking.zip from this site.
Thanks!
Acton
I notice that in hello RMI sample, it extends java.rmi.* and in
RMILogger, weblogic.rmi.* is being used.
So i am wondering how i could implement RMI in weblogic6.1.
thanks!
Acton