Juergen Kreileder wrote:

> >>>>> "Rajesh" == Rajesh Patel <[EMAIL PROTECTED]> writes:
>
>     Rajesh> black:rpatel% javac bank/CGGAMPSSLSocketFactory.java
>     Rajesh> bank/CGGAMPSSLSocketFactory.java:17: The method
>     Rajesh> bank.Socket createSocket(java.lang.String, int) declared
>     Rajesh> in class bank.CGGAMPSSLSocketFactory cannot override the
>     Rajesh> method of the same signature declared in class
>     Rajesh> java.rmi.server.RMISocketFactory.  They must have the same
>     Rajesh> return type.
>     Rajesh>     public Socket createSocket(String host,int port) throws IOException{
>     Rajesh>                   ^
>
>     Rajesh> I am totally lost i have the same function signature as of
>     Rajesh> RMISocketFactory.
>
> No, you haven't.  You have "bank.Socket createSocket(String, int)" but
> it should be "java.net.Socket createSocket(String, int)".
>
> Adding "import java.net.Socket;" or using "java.net.Socket" instead of
> the unqualified "Socket" should fix this.

>

Thank you very much.  I had import javax.net.*  so i thought it is ok but actually it
requires java.net.Socket as return type and other places it requires javax.net.*  So
now it works for that part but now i get following exception.  Can you give me some
guideline if possible,

% startserver
java.security.Policy: error adding Entry
sun.security.provider.PolicyParser$GrantEntry@7749ec69 java.net.MalformedURLException:
no protocol: jsse.jar
java.rmi.MarshalException: Error marshaling transport header; nested exception is:
        java.net.SocketException: Socket closed
java.net.SocketException: Socket closed
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])
        at com.sun.net.ssl.internal.ssl.AppOutputStream.write([DashoPro-V1.2-120198])
        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:72)
        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:130)
        at java.io.DataOutputStream.flush(DataOutputStream.java:104)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:203)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
        at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
        at java.rmi.Naming.rebind(Naming.java:161)
        at bank.BankServerImpl.main(BankServerImpl.java:40)
%

I have following in my code to support ssl,

java.security.Security.addProvider(
     new com.sun.net.ssl.internal.ssl.Provider());
 System.setProperty("java.protocol.handler.pkgs",
                 "com.sun.net.ssl.internal.www.protocol");
try{
     RMISocketFactory.setSocketFactory(new CGGAMPSSLSocketFactory());
 }catch (IOException e){
     e.printStackTrace();
 }

Isn't that enough?  What am i missing?
Thanks,

-Raj

>
> --
> Juergen Kreileder, Blackdown Java-Linux Team
> http://www.blackdown.org/java-linux.html
> JVM'01: http://www.usenix.org/events/jvm01/


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to