Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMI question

0 views
Skip to first unread message

acton wang

unread,
Feb 21, 2002, 11:24:01 AM2/21/02
to

hi,
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?).
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".
What is it?
Call for help!

Acton

Andy Piper

unread,
Feb 21, 2002, 12:32:46 PM2/21/02
to
"acton wang " <aw...@intelixinc.com> writes:

> 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
--

acton wang

unread,
Feb 21, 2002, 1:32:25 PM2/21/02
to

Andy Piper <an...@xemacs.org> wrote:
>"acton wang " <aw...@intelixinc.com> writes:
>
>> 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

********

What is this deployment descriptor? Where is it after creation?
Is it neccessary for RMI deploy in weblogic6.1?

*********

Andy Piper

unread,
Feb 21, 2002, 11:24:45 PM2/21/02
to
"acton wang" <aw...@intelixinc.com> writes:

> 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
--

Acton Wang

unread,
Feb 22, 2002, 10:30:57 AM2/22/02
to

Here is detailed information about my case:

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

Andy Piper

unread,
Feb 22, 2002, 12:08:19 PM2/22/02
to
"Acton Wang" <aw...@intelixinc.com> writes:

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

--

acton wang

unread,
Feb 22, 2002, 2:49:16 PM2/22/02
to

<p>
Still the old Exception as:

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>

Acton Wang

unread,
Feb 22, 2002, 4:47:56 PM2/22/02
to

The exception is "java.rmi.ConnectException" which is thrown if
a connection is refused to the remote host for a remote method
call.

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

Andy Piper

unread,
Feb 22, 2002, 5:12:37 PM2/22/02
to
"Acton Wang" <aw...@intelixinc.com> writes:

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

--

Acton Wang

unread,
Feb 22, 2002, 5:33:31 PM2/22/02
to

I changed 7001 to 7452, cos there are two weblogics running.

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

Acton Wang

unread,
Feb 22, 2002, 6:40:33 PM2/22/02
to

I did RMI hello sample before. But it didn't work correctly.
It needs stub class (but I could not creat using weblogic.rmic).

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

0 new messages