Rmi/iiop with jndi naming service
C:\JBuilderX\jdk1.4\bin\javaw -classpath "C:\HelloRMIIIOP\HelloRMIIIOP\classes;C:\JBuilderX\lib\cx.jar;C:\JBuilderX\jdk1 .4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java 2Demo.jar;C:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\JBuilderX\jdk1.4\jre\lib\ applet\WMPNS.jar;C:\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\JBuilderX\jdk1.4\jr e\lib\ext\cosnaming.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilderX\j dk1.4\jre\lib\ext\ldapsec.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\ JBuilderX\jdk1.4\jre\lib\ext\providerutil.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\su njce_provider.jar;C:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilderX\jdk1.4 \jre\lib\im\thaiim.jar;C:\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\JBuilderX\jdk1.4\j re\lib\jsse.jar;C:\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\l ib\rt.jar;C:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\JBuilderX\jdk1.4\lib\dt. jar;C:\JBuilderX\jdk1.4\lib\htmlconverter.jar;r" HelloServer
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.cosnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)Trouble: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.cosnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory ]
at javax.naming.InitialContext.<init>(InitialContext.java:175)
at HelloServer.main(HelloServer.java:13)
Caused by: java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
... 4 more
please help!!!i its driving me nuts!!!
soem will say i need to download jndi jar file i ll tell u did that butt i still have the error.moerover i think in jdk 1.4 jndi is already there. i checked the class path and double checked the cosnaming.jar file and i still have the problem
pleas him i am stuck with this for months.
i read in books its a classpath problem but i did check the classpath!!!!!!
C:\JBuilderX\jdk1.4\bin\javaw -classpath "C:\HelloRMIIIOP\HelloRMIIIOP\classes;C:\JBuilderX\lib\cx.jar;C:\JBuilderX\jdk1 .4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java 2Demo.jar;C:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\JBuilderX\jdk1.4\jre\lib\ applet\WMPNS.jar;C:\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\JBuilderX\jdk1.4\jr e\lib\ext\cosnaming.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilderX\j dk1.4\jre\lib\ext\ldapsec.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\ JBuilderX\jdk1.4\jre\lib\ext\providerutil.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\su njce_provider.jar;C:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilderX\jdk1.4 \jre\lib\im\thaiim.jar;C:\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\JBuilderX\jdk1.4\j re\lib\jsse.jar;C:\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\l ib\rt.jar;C:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\JBuilderX\jdk1.4\lib\dt. jar;C:\JBuilderX\jdk1.4\lib\htmlconverter.jar;r" HelloServer
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.cosnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)Trouble: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.cosnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory ]
at javax.naming.InitialContext.<init>(InitialContext.java:175)
at HelloServer.main(HelloServer.java:13)
Caused by: java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
... 4 more
please help!!!i its driving me nuts!!!
soem will say i need to download jndi jar file i ll tell u did that butt i still have the error.moerover i think in jdk 1.4 jndi is already there. i checked the class path and double checked the cosnaming.jar file and i still have the problem
pleas him i am stuck with this for months.
i read in books its a classpath problem but i did check the classpath!!!!!!
Similar Messages
-
RMI-IIOP and glassfish naming service
I have some very basic test applications to test RMI-IIOP. The applications are one server (registers the Remote object) and one client (tries to retreive the remote object stub and invoke a simple hello() method).
I've been trying to get it to work by registering the Remote object (see below) in glassfish naming service (JNDI) but I get the following an error saying: "Class rmi.ListenerRemoteImpl not exported, or else is actually a JRMP stub". I haven't been able to figure out why...
Then I found another guide which I followed and managed to get to work. The only difference there was that I used orbd as naming service.
Why is this? Doesn't Glassfish JNDI support RMI-IIOP in this way?
Any help is greatly appreciated!
I followed the following steps in creating the application:
-Created the following classes:
Client.java //The client
Server.java //The server
ListenerRemote.java //Remote interface implementing Remote
ListenerRemoteImpl.java //Implemtation extends PortableRemoteObject and implements ListenerRemote
-Generated stubs with rmic using -iiop
-Compile and run...Here is some of the code...
Client that fails with glassfish but not with orbd:
=========================================
public static void main(String[] args) throws Exception {
ListenerRemoteImpl listener = new ListenerRemoteImpl();
Properties props = new Properties();
props.load(new FileInputStream("jndi.properties"));
//Uncommenting this and starting orbd makes it work. When default jndi.properties from Glassfish is used, it does not work.
//props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
//props.put("java.naming.provider.url", "iiop://localhost:1060");
Context ctx = new InitialContext(props);
ctx.rebind("listener", listener);
System.out.println("Listener bound!");
==================================
ListenerRemoteImpl:
==================================
public class ListenerRemoteImpl extends PortableRemoteObject implements ListenerRemote {
public ListenerRemoteImpl() throws RemoteException {
super();
public void sayHello() throws RemoteException {
System.out.println("Hello!");
==================================
The stacktrace when glassfish naming service is used:
==================================
2007-aug-10 17:24:32 com.sun.corba.ee.impl.util.Utility autoConnect
VARNING: "IOP00511403: (INV_OBJREF) Class rmi.ListenerRemoteImpl not exported, or else is actually a JRMP stub"
org.omg.CORBA.INV_OBJREF: vmcid: SUN minor code: 1403 completed: No
at com.sun.corba.ee.impl.logging.UtilSystemException.objectNotExported(UtilSystemException.java:569)
at com.sun.corba.ee.impl.logging.UtilSystemException.objectNotExported(UtilSystemException.java:592)
at com.sun.corba.ee.impl.util.Utility.autoConnect(Utility.java:147)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.writeAny(Util.java:323)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$10.write(DynamicMethodMarshallerImpl.java:256)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeArguments(DynamicMethodMarshallerImpl.java:407)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:157)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
at com.sun.enterprise.naming._SerialContextProvider_DynamicStub.rebind(_SerialContextProvider_DynamicStub.java)
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:403)
at javax.naming.InitialContext.rebind(InitialContext.java:408)
at rmi.Client.main(Client.java:48)
Exception in thread "main" javax.naming.CommunicationException: java.rmi.NoSuchObjectException: CORBA INV_OBJREF 1398080891 No; nested exception is:
org.omg.CORBA.INV_OBJREF: vmcid: SUN minor code: 1403 completed: No
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:405)
at javax.naming.InitialContext.rebind(InitialContext.java:408)
at rmi.Client.main(Client.java:48)
================================== -
How to configure OC4J using RMI/IIOP with SSL
Any help?
I just mange configure the OC4J using RMI/IIOP but base on
But when I follow further to use RMI/IIOP with SSL I face the problem with: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
p/s: I use self generate keystore which should be ok as I can use it for https connection.
Any one can help?
Below is the OC4J log:
D:\oc4j\j2ee\home>java -Djavax.net.debug=all -DGenerateIIOP=true -Diiop.runtime.debug=true -jar oc4j.jar
05/02/23 16:43:16 ================ IIOPServerExtensionProvider.preInitApplicationServer
05/02/23 16:43:38 ================= IIOPServerExtensionProvider.postInitApplicationServer
05/02/23 16:43:38 ================== config = {SEPS={IIOP={ssl-port=5556, port=5555, ssl=true, trusted-clients=*, ssl-client-server-auth-port=5557, keystore=D:\\oc4j\\j2ee\\home\\server.keystore, keystore-password=123456, truststore=D:\\oc4j\\j2ee\\home\\server.keystore, truststore-password=123456, ClassName=com.oracle.iiop.server.IIOPServerExtensionProvider, host=localhost}}}
05/02/23 16:43:38 ================== server.getAttributes() = {threadPool=com.evermind.server.ApplicationServerThreadPool@968fda}
05/02/23 16:43:38 ================== pool: null
05/02/23 16:43:38 ====================== In startServer ...
05/02/23 16:43:38 ==================== Creating an IIOPServer ...
05/02/23 16:43:38 ========= IIOP server being initialized
05/02/23 16:43:38 SSL port: 5556
05/02/23 16:43:38 SSL port 2: 5557
05/02/23 16:43:43 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): getEndpoint(IIOP_CLEAR_TEXT, 5555, null)
05/02/23 16:43:43 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): createListener( socketType = IIOP_CLEAR_TEXT port = 5555 )
05/02/23 16:43:44 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): getEndpoint(SSL, 5556, null)
05/02/23 16:43:44 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): createListener( socketType = SSL port = 5556 )
05/02/23 16:43:45 ***
05/02/23 16:43:45 found key for : mykey
05/02/23 16:43:45 chain [0] = [
Version: V1
Subject: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
Key: SunJSSE RSA public key:
public exponent:
010001
modulus:
b1239fff 2ae5d31d b01a0cfb 1186bae0 bbc7ac41 94f24464 e92a7e33 6a5b0844
109e30fb d24ad770 99b3ff86 bd96c705 56bf2e7a b3bb9d03 40fdcc0a c9bea9a1
c21395a4 37d8b2ce ff00eb64 e22a6dd6 97578f92 29627229 462ebfee 061c99a4
1c69b3a0 aea6a95b 7ed3fd89 f829f17e a9362efe ccf8034a 0910989a a8573305
Validity: [From: Wed Feb 23 15:57:28 SGT 2005,
To: Tue May 24 15:57:28 SGT 2005]
Issuer: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
SerialNumber: [ 421c3768]
Algorithm: [MD5withRSA]
Signature:
0000: 34 F4 FA D4 6F 23 7B 84 30 42 F3 5C 4B 5E 18 17 4...o#..0B.\K^..
0010: 73 69 73 A6 BF 9A 5D C0 67 8D C3 56 DF A9 4A AC sis...].g..V..J.
0020: 88 AF 24 28 C9 39 16 22 29 81 01 93 86 AA 1A 5D ..$(.9.")......]
0030: 07 89 26 22 91 F0 8F DE E1 4A CF 17 9A 02 51 7D ..&".....J....Q.
0040: 92 D3 6D 9B EF 5E C1 C6 66 F9 11 D4 EB 13 8F 17 ..m..^..f.......
0050: E7 66 58 9F 6C B0 60 7C 39 B4 E0 B7 04 A7 7F A6 .fX.l.`.9.......
0060: 4D A5 89 E7 F4 8A DC 59 B4 E7 A5 D4 0A 35 9A F1 M......Y.....5..
0070: A2 CD 3A 04 D6 8F 16 B1 9E 6F 34 40 E8 C0 47 03 ..:[email protected].
05/02/23 16:43:45 ***
05/02/23 16:43:45 adding as trusted cert:
05/02/23 16:43:45 Subject: CN=Client, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
05/02/23 16:43:45 Issuer: CN=Client, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
05/02/23 16:43:45 Algorithm: RSA; Serial number: 0x421c3779
05/02/23 16:43:45 Valid from Wed Feb 23 15:57:45 SGT 2005 until Tue May 24 15:57:45 SGT 2005
05/02/23 16:43:45 adding as trusted cert:
05/02/23 16:43:45 Subject: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
05/02/23 16:43:45 Issuer: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
05/02/23 16:43:45 Algorithm: RSA; Serial number: 0x421c3768
05/02/23 16:43:45 Valid from Wed Feb 23 15:57:28 SGT 2005 until Tue May 24 15:57:28 SGT 2005
05/02/23 16:43:45 trigger seeding of SecureRandom
05/02/23 16:43:45 done seeding SecureRandom
05/02/23 16:43:45 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): getEndpoint(SSL_MUTUALAUTH, 5557, null)
05/02/23 16:43:45 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): createListener( socketType = SSL_MUTUALAUTH port = 5557 )
05/02/23 16:43:45 matching alias: mykey
matching alias: mykey
05/02/23 16:43:46 ORB created ..com.oracle.iiop.server.OC4JORB@65b738
05/02/23 16:43:47 com.sun.corba.ee.internal.corba.ClientDelegate(Thread[Orion Launcher,5,main]): invoke(ClientRequest) called
05/02/23 16:43:47 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): process: dispatching to scid 2
05/02/23 16:43:47 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): dispatching to sc [email protected]7
05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ClientDelegate(Thread[Orion Launcher,5,main]): invoke(ClientRequest) called
05/02/23 16:43:48 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): process: dispatching to scid 2
05/02/23 16:43:48 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): dispatching to sc com.sun.corba.ee.internal.corba.ServerDelegate@9300cc
05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Entering dispatch method
05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Consuming service contexts, GIOP version: 1.2
05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Has code set context? false
05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Dispatching to servant
05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Handling invoke handler type servant
05/02/23 16:43:48 NS service created and started ..org.omg.CosNaming._NamingContextExtStub:IOR:000000000000002b49444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e30000000000001000000000000007c000102000000000c31302e312e3231342e31310015b3000000000031afabcb0000000020d309e06a0000000100000000000000010000000c4e616d65536572766963650000000004000000000a0000000000000100000001000000200000000000010001000000020501000100010020000101090000000100010100
05/02/23 16:43:48 NS ior = ..IOR:000000000000002b49444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e30000000000001000000000000007c000102000000000c31302e312e3231342e31310015b3000000000031afabcb0000000020d309e06a0000000100000000000000010000000c4e616d65536572766963650000000004000000000a0000000000000100000001000000200000000000010001000000020501000100010020000101090000000100010100
05/02/23 16:43:48 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0) initialized
05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Listener,5,main]): Server getConnection(119e583[Unknown 0x0:0x0: Socket[addr=/127.0.0.1,port=1281,localport=5556]], SSL)
05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Listener,5,main]): host = 127.0.0.1 port = 1281
05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Listener,5,main]): Created connection Connection[type=SSL remote_host=127.0.0.1 remote_port=1281 state=ESTABLISHED]
com.sun.corba.ee.internal.iiop.MessageMediator(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): Creating message from stream
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, handling exception: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, SEND TLSv1 ALERT: fatal, description = unexpected_message
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, WRITE: TLSv1 Alert, length = 2
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeSocket()
05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ReaderThread(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): IOException in createInputStream: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
05/02/23 16:45:14 javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.d(DashoA12275)
05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA12275)
05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.messages.MessageBase.readFully(MessageBase.java:520)
05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.messages.MessageBase.createFromStream(MessageBase.java:58)
05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.MessageMediator.processRequest(MessageMediator.java:110)
05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.IIOPConnection.processInput(IIOPConnection.java:339)
05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.ReaderThread.run(ReaderThread.java:63)
05/02/23 16:45:14 Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.InputRecord.b(DashoA12275)
05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA12275)
05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
05/02/23 16:45:14 ... 6 more
05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.IIOPConnection(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): purge_calls: starting: code = 1398079696 die = true
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called close()
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeInternal(true)
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called close()
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeInternal(true)
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called close()
05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeInternal(true)
05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): DeleteConn called: host = 127.0.0.1 port = 1281Good point, I do belive what you are referring to is this:
Any client, whether running inside a server or not, has EJB security properties. Table 15-2 lists the EJB client security properties controlled by the ejb_sec.properties file. By default, OC4J searches for this file in the current directory when running as a client, or in ORACLE_HOME/j2ee/home/config when running in the server. You can specify the location of this file explicitly with the system property setting -Dejb_sec_properties_location=pathname.
Table 15-2 EJB Client Security Properties
Property Meaning
# oc4j.iiop.keyStoreLoc
The path and name of the keystore. An absolute path is recommended.
# oc4j.iiop.keyStorePass
The password for the keystore.
# oc4j.iiop.trustStoreLoc
The path name and name of the truststore. An absolute path is recommended.
# oc4j.iiop.trustStorePass
The password for the truststore.
# oc4j.iiop.enable.clientauth
Whether the client supports client-side authentication. If this property is set to true, you must specify a keystore location and password.
# oc4j.iiop.ciphersuites
Which cipher suites are to be enabled. The valid cipher suites are:
TLS_RSA_WITH_RC4_128_MD5
SSL_RSA_WITH_RC4_128_MD5
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
TLS_RSA_EXPORT_WITH_RC4_40_MD5
SSL_RSA_EXPORT_WITH_RC4_40_MD5
TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
nameservice.useSSL
Whether to use SSL when making the initial connection to the server.
client.sendpassword
Whether to send user name and password in clear form (unencrypted) in the service context when not using SSL. If this property is set to true, the user name and password are sent only to servers listed in the trustedServer list.
oc4j.iiop.trustedServers
A list of servers that can be trusted to receive passwords sent in clear form. This has no effect if client.sendpassword is set to false. The list is comma-delimited. Each entry in the list can be an IP address, a host name, a host name pattern (for example, *.example.com), or * (where "*" alone means that all servers are trusted. -
Problem with the naming service
Hi All,
I want to register one distributed object with
the naming service explicitly. I set the distributed
property "allowed" for the class, and in the init
method, i tried to set isAnchored property and tried
to register the object using REgisterObject method. It
says, object already registered with the naming
service. So, i set Distributed Property isDefault, the
same error pops up. What could be the mistake? I know
that, from the same partition, we can't register
twice.
any help is appreicated.
Thanks,
Babu
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/See https://opends.dev.java.net/servlets/ProjectForumMessageView?messageID=31827&forumID=3292.
Regards,
Ludovic. -
Use RMI-IIOP with wls 5.1 or 6.0 ???
Morning,
I was wondering if is was possible to use RMI-IIOP with
WebLogic Server 5.1 or 6.0 and if possible with which version
of the RMI-IIOP specification ???
I've not seen any information about that in the documentation ; if anybody could
help, I would appreciate !
Thanks a lot.
Pierre-Yves FOURMOND
Axway Software. a Sopra Group Company
Direction Edition de Progiciels
EAI - R&D XTalk
Puteaux 2 - Bureau n°204
[email protected]
01 47 17 22 55"Pierre-Yves Fourmond" <[email protected]> writes:
I was wondering if is was possible to use RMI-IIOP with
WebLogic Server 5.1 or 6.0 and if possible with which version
of the RMI-IIOP specification ???WLS 5.1SP11 has the same RMI-IIOP runtime as WLS6.1SP2. 6.0 contains
the old runtime, at the moment it seems most customers are happy to
upgrade to 6.1 from 6.0
andy
>
I've not seen any information about that in the documentation ; if anybody could
help, I would appreciate !
Thanks a lot.
Pierre-Yves FOURMOND
Axway Software. a Sopra Group Company
Direction Edition de Progiciels
EAI - R&D XTalk
Puteaux 2 - Bureau n°204
[email protected]
01 47 17 22 55--
" .sigs are like your face - rarely seen by you and uglier than you think"
mail: [email protected] -
JApplet communication with CORBA naming service
I have an applet that needs to resolve/bind to object in the CORBA naming service (we are using Orbix2000). The applet is able to establish a socket connection to the host that is running the naming service; however it cannot find the naming service. I have done extensive research on the web (followed the tutorials from the Sun site) and google to no avail. Can anyone shed some light? We have successfully used Orbix2000 with Java apps. This is the first access via an applet.
thanks,
kat
This is the exception I get when running it from NS4.7 browser:
Initializing the ORB CORBA exception: java.lang.NullPointerException java.lang.NullPointerException at com.iona.corba.art.artimpl.ORBDelegate.resolve_initial_references(ORBDelegate.java:835) at com.iona.corba.art.artimpl.ORBImpl.resolve_initial_references(ORBImpl.java:203) at CSGConsole.init(CSGConsole.java:139) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
This is the applet code snippet
import CLMOperator.*; // package contains the CORBA client stubs
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
// Create and initialize the CORBA ORB
System.setProperty("org.omg.CORBA.ORBClass","com.iona.corba.art.artimpl.ORBImpl");
System.setProperty("org.omg.CORBA.ORBSingletonClass","com.iona.corba.art.artimpl.ORBSingleton");
String[] args = { "-ORBInitRef", "NameService=corbaloc:iiop:sea03s20.ds.boeing.com:3075/NameService" };
System.out.println( "Initializing the ORB" );
// ORB orb = ORB.init(this, args);
Properties props = new Properties();
props.put("org.omg.CORBA.ORBInitialHost", "sea03s20.ds.boeing.com");
props.put("org.omg.CORBA.ORBInitialPort", "3075");
ORB orb = ORB.init(this, props);
// Get the root naming context
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow( objRef );
// Resolve the object reference in naming
NameComponent nc = new NameComponent("CLMOperator", "");
NameComponent path[] = { nc };
CLMOperator.CLMOper clmOper = CLMOperator.CLMOperHelper.narrow(ncRef.resolve(path));
// Call the CLMOperator server object and invoke on the method
clmOper.Notify(1, 'A');
catch(Exception e) {
System.out.println("CORBA exception: " + e);
e.printStackTrace(System.out);Kat:
I ran into a similar problem. I was wondering if it had anything to do with a security policy between the applet and CORBA, i.e., apllet using the NamingService. To test this, I built a another CORBA Java Client (character interface, not applet) and it works fine. The applet must require something else, like setting a security policy. I sent a query off to someone who manages the Java environment. If I get an answer, I'll post it here.
bfin -
Im currently working on some code and Im really in need of a naming service, preferably one with a service provider for JNDI. In essence what Im looking for is a very basic name server, although knowing little about the suject at this point Im thinking that ldap, nis are really not well suited to my needs as my key goal is mapping names to references( under dynamic contexts), which Ive allready half implemented. As things are getting more complex and what Ive implemented of rather poor design, Im starting to feel like Im going to have a rough month or two ahead of me!! I dont want to re-invent the wheel and I know in my heart someone has allready coded the software I need!!! Unfortunately My search has been fruitless. Id greatly appreciate it if someone can steer me in the right direction. In the meantime I think Ill be pulling my hair out trying to figure out how to code the software I need.... Sorry for not fully explaining what Im after, if not enough info just let me know and Ill try to provide more detail.............
Hi Prisco,
You can go very well fo JNDI. And you can use Netscape or Iplanet Directory server as LDAP server.
Please Download the Directory Server from this URL.
http://www.iplanet.com/downloads/download/2087.html
Also here with I am giving you a simple Authentication program, which makes use of JNDI and Netscape Directory server. If you follow these steps, you will get a good idea about JNDI.
DESCRIPTION:
I am trying to use LDAP to control access to a HTML page. I want an authentication
box to pop up, allowing the user to authenticate to the HTML page through a LDAP server.
If they succesfully authenticate, I need to check their username against a list
of valid usernames that's stored in a database, then give access to the page
based on that list. How can I implement this solution?
SOLUTION:
The best way is to use Basic Authentication solution with JNDI and LDAP server,
Netscape Directory server(for example) with a simple servlet program. Java Naming
and Directory Interface (JNDI) API is standardized, and enable to use different
directory services such as Netscape Directory server. LDAP server can be used
for storing some common data's used in the sample solution.
It can be done through a servlet to check the user and its password which is
stored in the LDAP server.
In order to demonstrate a sample solution, I will use the Netscape Directory
Server 4.13 as the LDAP server, which is loaded my own LDIF file with customized
attributes. The basic authentication algorithm will be used in this sample
solution.
The following steps are to implement this sample solution:
1. Creating our own LDAP data Interchange format (LDIF) file.
2. Loading(Import) the Ldif file in Netscape Directory Server.
3. Creation of user schema files for customized attributes.
4. Load the user schema files in the Netscape Directory Server.
5. Restart the Directory Server
6. A simple servlet program for basic authentication.
7. A sample HTML file is given last, used in servlet program.
Here are the detail description of the above steps:
STEP 1: Creating our own LDAP data Interchange format (LDIF) file:
Here is the LDIF (LDAP data Interchange format) file is a text based format used to work
on LDAP data, with both our application and end users.
Through this LDIF file, I am having an attribute "customerid: timb" for which I will
be preparing the authentication, which will have its own password
"userpassword: bakrudeen", through which it can be maintained in a common place.
Here again in the same LDIF file, other information related to the "customerid: timb"
such as common name "cn: Tim Briggs", sur name "sn: Briggs" etc are maintained.
The data in LDAP is organized in a tree, called a Directory Information tree(DIT).
Each leaf in DIT is called an entry. The first entry in DIT is called the root entry.
Here is a sample LDIF File which is used in our sample solution:-
Here the DIT is maintained in such a way data is organized in LDAP, is fairly simple. In this
sample we store all of our entries in a common root o=fedup.com, with the following branches
Customers - Customer Entries with " customer id: timb" , userpassword: bakrudeen, and other
information related to this customer is kept in a common place.
dn: uid=timb,ou=Customers,o=fedup.com
changetype:add
objectclass: customer
objectclass: inetorgperson
objectclass: organizationalPerson
objectclass: person
objectclass: top
cn: Tim Briggs
uid: timb
givenname: Tim
customerid: timb
sn: Briggs
facsimiletelephonenumber: 4101
telephonenumber: 4145
creatorsname: uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot
createtimestamp: 20000501084001Z
aci: (target="ldap:///uid=timb,ou=Customers,o=fedup.com")(targetattr="*")(version 3.0; acl "unknown"; allow (all)(userdn = "ldap:///anyone");)
ou: Customers
mail:
userpassword: bakrudeen
modifiersname: uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot
modifytimestamp: 20000605084001Z
STEP 2: Loading(Import) the Ldif file in Netscape Directory Server:-
Once after creating the above sample LDIF File, it should be added in Netscape Directory Server.
It should be imported in order to add the neccessary atributes in the Netscape Directory server,
so that we can make use of the Common data.
Steps for Importing the LDIF file in the Directory Server:-
1) Create an instance of the Directory Server.
2) Bind it to the different port with different organizational unit
(Here in this program, it is 1124).
3) Press the Configuration from the menu.
4) Then select import from the Console menu.
5) Choose the LDIF file you are going to import.
6) There also you have to provide a file for rejected entries, ie it will list all the entries
which is not added while loading.
STEP 3: Creation of our own USER SCHEMA Files:-
It is necessary for adding the attributes which are not defined in the
Netscape directory server. In the above, customerid which is defined in ldif
file is not existing in the directory server.
Here is the Schema file for attributes:(ie for defining for eg customer id).
The name of the file is slapd.user_at.conf:-
attribute customerid customerid-oid cis single
attribute packageid packageid-oid cis single
attribute receivedate receivedate-oid cis single
attribute shipdate shipdate-oid cis single
attribute shipperid shipperid-oid dn single
attribute receiveid receiveid-oid dn single
#Java Attributes
# Schema for storing java objects and java object references
attribute javaClassName 1.3.6.1.4.1.42.2.27.4.1.1 ces single
attribute javaCodebase 1.3.6.1.4.1.42.2.27.4.1.6 ces
attribute javaSerializedData 1.3.6.1.4.1.42.2.27.4.1.7 bin single
attribute javaRemoteLocation 1.3.6.1.4.1.42.2.27.4.1.8 ces single
attribute javaFactory 1.3.6.1.4.1.42.2.27.4.1.4 ces single
attribute javaReferenceAddress 1.3.6.1.4.1.42.2.27.4.1.3 ces
Here is Schema file for your own object classes:-
The name of the file is Slapd.user_oc.conf:-
In the similar way as above there are no "customer" class in the object classes
defined in the LDAP, so we will have to create our own "customer" Object class.
Also it extends inetOrgPerson to add some new attributes such as "customerid".
The object class of an entry specifies what attributes are required and what
attributes are allowed in a particular entry.
Also for eg, Package classes in the object class is created.
Here is the sample file for creating the above:-
objectclass package
oid package-oid
superior top
requires
packageid,
receiveid,
shipdate,
shipperid
allows
description,
ou,
receivedate
objectclass customer
oid customer-oid
superior inetorgperson
requires
customerid
allows
c
#JAVA Schema
# Schema for storing java objects and java object references
objectclass javaContainer
oid 1.3.6.1.4.1.42.2.27.4.2.1
superior top
requires
cn
objectclass javaObject
oid 1.3.6.1.4.1.42.2.27.4.2.4
superior top
requires
javaClassName
allows
javaCodebase
objectclass javaSerializedObject
oid 1.3.6.1.4.1.42.2.27.4.2.5
superior javaObject
requires
javaSerializedData
objectclass javaRemoteObject
oid 1.3.6.1.4.1.42.2.27.4.2.6
superior javaObject
requires
javaRemoteLocation
objectclass javaNamingReference
oid 1.3.6.1.4.1.42.2.27.4.2.7
superior javaObject
requires
javaReferenceAddress,
javaFactory
STEP 4: Loading the USER SCHEMA files in Directory Server:-
All the attributes created above should be added to the corresponding directory server,
in order to make it as a common attribute.
Steps for adding the User Schema files to the Directory Server:-
1. Copy the above user schema files to the appropriate instance of Netscape Directory Server
created above so that the existing LDIF file which is used in the Netscape directory
server is not appended or overwritten.
2. For eg, put it in "NetscapeServer/slapd-HostName/config" to replace the empty
files "slapd.user_at.conf" and "slapd.user_oc.conf" by default.
3. Then restart the Directory Server.
STEP 5: Simple Servlet Program for BASIC AUTHENTICATION.
Here is the simple servlet program for Basic Authentication:-
Here the way the LDAP authentication works is by attempting to the server with a
DN and a password. No user in their right mind will remember their DN, so we use
some other attribute such as user-id. Then we search in the LDAP server to find
an entry that contains the attribute. Here we are maintaining SUBTREE_SCOPE using
JNDI, which starts its search starting from the base entry, and searches
everything below it including the base entry. Also I am maintaining Global
variables for LDAP setting.
// Importing the necessary Packages
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.naming.*;
import javax.naming.directory.*;
public class AuthServ extends HttpServlet {
// Here are our global variables of our LDAP Settings.
public static String MY_CUSTOMER_BASE = "ou=Customers,o=fedup.com";
public static String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory";
public static int MY_PORT = 1124;
public static String MY_HOST = "ldap://sundts1.india.sun.com:" + MY_PORT;
public static String MY_MGR = "cn=Directory Manager";
public static String MY_PWD = "password";
public static String MY_SEARCHBASE = "o=fedup.com";
Hashtable env = new Hashtable();
// Using the Get Method of Servlet
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");
// To Check to See if there is any data in the "Authorization" Http header from the browser.
// If not it will prompt for username and password.
String auth = req.getHeader("Authorization");
// Do we allow the user
if (!allowedUser(auth) ) {
// Not Allowed, so report unauthorized
res.setStatus(res.SC_UNAUTHORIZED);
res.setHeader("WWW-Authenticate", "BASIC realm=\"users\"");
// User is allowed in
else
// Using SSI to include and display the content of a Simple HTML Page
RequestDispatcher rd= this.getServletContext().getRequestDispatcher("/auth.html");
rd.include(req,res);
// This method checks to see whether the user exist in the LDAP database.
protected boolean allowedUser(String auth) throws IOException {
Hashtable env = new Hashtable();
boolean status = false;
try {
// No Authorization
if (auth == null) return false;
// Basic Authentication is Handled, Other possibilities are MD5 hash or SSL Certificates.
if (!auth.toUpperCase().startsWith("BASIC ")) {
return false; //only do BASIC
// Get encoded user and password, comes after BASIC
String userpassEncoded = auth.substring(6);
// Decode it, using any base 64 decoder
sun.misc.BASE64Decoder dec = new sun.misc.BASE64Decoder();
String userpassDecoded = new String(dec.decodeBuffer(userpassEncoded));
StringTokenizer st = new StringTokenizer(userpassDecoded,":");
String customerid = st.nextToken();
String pwd = st.nextToken();
Please Note:
LDAP Authentication works by attempting to bind to the server with a DN and a password.
No user will remember their DN so we use some other attribute such as user-id.
Then we search in the LDAP server to find an entry in the LDAP server to find an entry
that contains the attribute.
For a Secure System, we should use an attribute that will be unique per entry such as
uid, in our case the "customerid" attribute.
// Prepare for context
env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
env.put(Context.PROVIDER_URL, MY_HOST);
// Get a reference to a directory context
DirContext ctx = new InitialDirContext(env);
// Specify the scope of the search
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
// Perform the actual search
// We give it a searchbase, a filter and the constraints
// containing the scope of the search
NamingEnumeration results =
ctx.search(MY_CUSTOMER_BASE, "(customerid=" + customerid + ")", constraints);
String dn = null;
If it does not throw an exception,
then it is considered to be an Successful Authentication
// Now step through the search results
while (results != null && results.hasMore()) {
SearchResult sr = (SearchResult) results.next();
dn = sr.getName() + "," + MY_CUSTOMER_BASE;
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, dn);
env.put(Context.SECURITY_CREDENTIALS, pwd);
try {
DirContext ctx2 = new InitialDirContext(env);
status = true;
} catch (AuthenticationException e) {
log(e.toString());
} catch (NamingException x) {
log(x.toString());
return status;
STEP 6: Simple HTML file used in Servlet Program:-
Here is the Simple HTML File we are including in RequestDispatcher of the above program:-
<html>
<head>
<title> Authorisation</title>
</head>
<body>
<h1> Your Authorisation is Successful </h1>
</body>
</html>
I hope this will help you.
Thanks
Bakrudeen -
Rmi/iiop with clients behind firewall?
I have a client app (standalone/applet) that will be running behind a firewall and I'm trying to connect it to S1AS7 through rmi/iiop. I keep getting some connection exceptions on the server when it tries to connect back to the client. Is there anyway to find out which port the server tries to connect to the client so I can open up that port with the firewall? Is there any other workarounds?
Check out the below document. This is a document for the earlier version of the appserver, but I guess this part should still hold good in S1AS 7 :
http://docs.sun.com/source/816-5777-10/jpgrichc.htm#24425
Basically, during the RMI-IIOP communication, the ports are assigned dynamically and hence we cannot exactly say which ports will be used for the response.
As a general rule of thumb, the response will be going through the ephemeral ports. (Ephemeral ports are temporary ports assigned by a machine's IP stack, and are assigned from a designated range of ports for this purpose. When the connection terminates, the ephemeral port is available for reuse, although most IP stacks won't reuse that port number until the entire pool of ephemeral ports have been used. So, if the client program reconnects, it will be assigned a different ephemeral port number for its side of the new connection.)
So, it is advisable to open the the entire ephemeral port range in the firewall.
On Solaris, the ephemeral port range can be determined using the below command :
# /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port
These values could also be altered using the below commands :
# /usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 49152
# /usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 61000
Hope that helps...
Cheers,
VM -
Jndi naming service in rmi/iiop
C:\HelloRMIIIOP\HelloRMIIIOP>path="C:\Sun\AppServer\jdk\jre\bin"
C:\HelloRMIIIOP\HelloRMIIIOP>java -classpath "C:\HelloRMIIIOP\HelloRMIIIOP\class
es;C:\Sun\AppServer\lib;C:\Sun\AppServer\lib\appserv-rt.jar" HelloServer
Trouble: javax.naming.NoInitialContextException: Cannot instantiate class: com.s
un.jndi.cosnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundExcept
ion: com/sun/jndi/cosnaming/CNCtxFactory ]
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.c
osnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundException: com/
sun/jndi/cosnaming/CNCtxFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
52)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:175)
at HelloServer.main(HelloServer.java:13)
Caused by: java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.jav
a:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
49)
... 4 more
i am just trying to ruing simple program some of u might say its a classpath problem . yes i know its a classpath problem i includeed the jar files needed including rt.jar but i still got this problem what is wrong with this stinking jini anyone can help please????C:\HelloRMIIIOP\HelloRMIIIOP>path="C:\Sun\AppServer\jdk\jre\bin"
C:\HelloRMIIIOP\HelloRMIIIOP>java -classpath "C:\HelloRMIIIOP\HelloRMIIIOP\class
es;C:\Sun\AppServer\lib;C:\Sun\AppServer\lib\appserv-rt.jar" HelloServer
Trouble: javax.naming.NoInitialContextException: Cannot instantiate class: com.s
un.jndi.cosnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundExcept
ion: com/sun/jndi/cosnaming/CNCtxFactory ]
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.c
osnaming.CNCtxFactory [Root exception is java.lang.ClassNotFoundException: com/
sun/jndi/cosnaming/CNCtxFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
52)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:175)
at HelloServer.main(HelloServer.java:13)
Caused by: java.lang.ClassNotFoundException: com/sun/jndi/cosnaming/CNCtxFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.jav
a:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
49)
... 4 more
i am just trying to ruing simple program some of u might say its a classpath problem . yes i know its a classpath problem i includeed the jar files needed including rt.jar but i still got this problem what is wrong with this stinking jini anyone can help please???? -
Can you use CORBA Naming Service with javax.naming.event.EventContext?
Can you use CORBA Naming Service with javax.naming.event.EventContext?
It seems like it doesn't work. When I try to do something like
EventContext eCtx_ = (EventContext)namingCtx_.lookup("");
I'm using JacORB's naming service.
I just want to clarify that I cannot or can use javax.naming.event.EventContext with CORBA Naming Service.Can anyone tell me if it is doable or not doable.
I looked at the COSNaming SPI, and it seems like it doesn't implement javax.naming.event.EventContext.
Am I correct or not? -
Error 11 with TCP Listen.vi and named service
I am using TCP Listen.vi with a named service so my Real-Time application can act as a TCP server without the clients needing to know the specific port. I am using LabVIEW 8.5.
I am getting Error 11 from TCP Listen.vi if no client has connected within a certain amount of time. I have traced the problem down to the TCP Listen Internal List.vi inside Internecine Avoider.vi in TCP Listen.vi. I think I have found a bug in this vi.
What is happening is that the Search function of TCP Listen Internal List.vi is not finding the named service, so new listeners continue to be created until there are too many open. See the attached picture. I think the circled function should be "not equal" instead of "equal".
Has anyone run across this problem before?
Thanks,
Cherie
Attachments:
TCP Listen.PNG 39 KBCherie,
Let us assume that al listener for your port number and name is not yet created and you have put the TCP Listen in a loop.
1st Iteration:
Searching the internal list will not find a name or port and hence it will create a connection and if successful will insert the port number and name to Internal List.
2nd Iteration onwards:
It will find the previous connection, provided you are still passing the same port number. If in the second iteration the port number changes, then what you say may happen
Will it be possible for you to post the TCP VI you have in RT?
That said...I don't get why that compare with zero is required? If port number was 0 in the first iteration then anyway after creating the listener, the new port number will be updated to the list along with the service name, isn't it?
Message Edited by kikiduu on 09-06-2008 08:50 AM
"A VI inside a Class is worth hundreds in the bush"
യവന് പുലിയാണു കേട്ടാ!!! -
Losing RMI-IIOP connection at server end
Hi all
I have a system running on Solaris 9, JVM 1.4.2_06 with a webapp hosted in Tomcat 5.5 connecting over RMI-IIOP to another java service on the same machine. The connection is established at webapp initialisation via a lookup to the naming service (currently tnameserv).
Unfortunately, after a period of time (varies between a few hours and a couple of days), the RMI connection simply disappears from the server-side point of view, and the webapp grinds to a halt. Taking a thread dump of Tomcat and the service at the point of failure shows that Tomcat still has "JavaIDL Reader" threads listening to the service, but the service has lost all of its "JavaIDL Reader" threads listening to Tomcat.
I've traced the problem as far as line 518 of com.sun.corba.se.internal.iiop.messages.MessageBase:
bytecount = is.read(buf, offset + n, size - n);This read on the InputStream is throwing an IOException. I have configured the system so that IP address 127.0.0.1 is being used in all places.
It may well be that this is not the right forum for this question, but has anyone else ever come across a problem like this? All suggestions most welcome.
Regards
BrianIn trying to find an answer to your question, have actually discovered that the root cause of the issue is actually a little lower in the stack.
SocketInputStream.read(byte[],int,int) is returning -1 (EOF), and this is being interpretted into an IOException by the MessageBase class. So now I need to work out why this unexpected EOF may be occurring on this platform.
I imagine this is no longer very relevant to the RMI forum. I've posted on the Socket Programming forum.
Regards
Brian -
While registering a remote object with a naming service, for example, Naming.rebind("MyService", remoteobj),the stub gets registered and that stub is sent by a registry to a client in response to Naming.lookup(""MyService). Then client becomes able to call method remotely. I tried a example in which I did not bind a remote object and I had a stub on client. And at client I created an object of stub class and invoked a remote method but it did not work. Why it is necessary to have a remote object bound to registry at server, because it ultimately binds stub and that stub is sent by a call (Naming.lookup("MyService")). To me the only requirement is to have a stub at client side to make remote calls. Is there any additional information sent by a registry to a client in addition to sending a stub in a rsponse to callNaming.lookup("MYService") which isneeded at client for calling remote method on stub. Another point is that Stub needs to know the IP address and port no. to be able to talk to listening service on remote jvm for execution of methods there, but when I decompiled the stub, I did not find anything like that. I would be thankfull to you if you provide me a clear picture of what I have asked for.
Thanks in advanceSince you have no clue what remote procedure calls are all about, I would suggest you take the tutorial on RMI. This should answer all your questions.
Additionally, you should also take a lesson in using separate paragraphs when writing. -
Reading JNDI naming information?
Does anyone know if it's possible to list out the JNDI naming service information? I'd like to query the service and ask if it knows about my application ;-)
(Websphere has a "dumpNameSpace.sh" script that does this, if that's any help?)
Cheers!The only way to do it would be JNI. Look around, you're bound to find someone who's written a JNI module for it already.
Also a certain amount of stuff is available through the System.getProperty() method (e.g. the username, their home directory, etc.) -
How write rmi-iiop over ssl with weblogic server 6.1 - No server found
//New
Hello,
I have written an appication like this:
- An EJB server running on Weblogic server 6.1
(named: BankServerHome)
-A java client calling the BankServer.
Platform: windows 2000 - jdk1.3
Now I want to secure the communication with SSL protocol.
I have done this:
-generate a key peer with weblogic service named certificate.
-send the CSR to a CA and place the answer into the weblogic
server certificate directory.
-update path for ServerCertificateChainFileName,
ServerCertificateFileName, ServerKeyFileName into config.xml.
-launch weblogicServer
-> server certificate is recognized
-> listening port 7001 and 7002.
(-stop weblogicServer!)
At now, all is all right, errors come hereafter:
Then I follow the guideline "Programming weblogic Security" (version of 30/07/2001).
"To use RMI over IIOP over SSL with a Java client, do the following:
2. Extend the java.rmi.server.RMISocketFactory class to handle SSL socket
connections. Be sure to specify the port on which WebLogic Server listens for
SSL connections. For an example of a class that extends the
java.rmi.server.RMISocketFactory class, see Listing 4-22.
3. Run the ejbc compiler with the -d option.
4. Add your extension of the java.rmi.server.RMISocketFactory class to the
CLASSPATH of the Java client.
5. Use the following command options when starting the Java client:
-xbootclasspath/a:%CLASSPATH%
-Dorg.omg.CORBA.ORBSocketFactoryClass=implementation of java.rmi.server.RMISocketFactory
-Dssl.certs=directory location of digital certificate for Java client
-Dssl.key=directory location of private key for Java client"
At step 3. I found into documentation that -d is linked to a directory name.
When I run ejbc with this option -d I have the message:
"ERROR: You must specify an output directory or jar with the -d option to weblogic.ejbc."
% So what option can I use to run ejbc for secure usage?
At step 5. Whatever I write for -Dorg.omg.CORBA.ORBSocketFactoryClass,
this pointed class is not instanciated.
Then I can not create a socket with my client.
The folowing exception is raised:
javax.naming.CommunicationException [Root exception is java.net.ConnectException:
No server found at T3S://localhost:7002]
So, my questions are:
% Why -Dorg.omg.CORBA.ORBSocketFactoryClass must be known by the client and not
the server?
My java client part, managing connection is:
-------------------BEGIN OF CONNECTION MANAGER-------------------
Properties env = new Properties ();
// Shouldn't have to do this, but for now you must
if ( factory.equals ("weblogic.jndi.WLInitialContextFactory") ) {
env.put ("java.naming.provider.url", "t3s://localhost:7002");
InitialContext context = new InitialContext (env);
BankSessionServerHome bssh = (BankServerHome) context.lookup("BankServerHome");
BankServer = bssh.create();
-------------------END OF CONNECTION MANAGER-------------------
I have also try
env.put ("java.naming.provider.url", "corbaloc:iiop://localhost:7002");
but it throws the following error
javax.naming.InvalidNameException: url does not conatin !!!
% What is the code for the java client allowing connection with the ejb?
% And better, can I have a sample example for rmi-iiop over ssl?
(...wlserver6.1\samples\examples\iiop\ejb\stateless\rmiclient\client.java do not
speak ssl!)
Any help will be appreciate from you...
Best Regards.
Oliver"oliver" <[email protected]> writes:
The SSL support is poorly doc'd right now. We have fixed this and
updated the way you do things in SP2. Please either wait for SP2 or
contact support.
andy
I have written an appication like this:
- An EJB server running on Weblogic server 6.1
(named: BankServerHome)
-A java client calling the BankServer.
Platform: windows 2000 - jdk1.3
Now I want to secure the communication with SSL protocol.
I have done this:
-generate a key peer with weblogic service named certificate.
-send the CSR to a CA and place the answer into the weblogic
server certificate directory.
-update path for ServerCertificateChainFileName,
ServerCertificateFileName, ServerKeyFileName into config.xml.
-launch weblogicServer
-> server certificate is recognized
-> listening port 7001 and 7002.
(-stop weblogicServer!)
At now, all is all right, errors come hereafter:
Then I follow the guideline "Programming weblogic Security" (version of 30/07/2001).
"To use RMI over IIOP over SSL with a Java client, do the following:
2. Extend the java.rmi.server.RMISocketFactory class to handle SSL socket
connections. Be sure to specify the port on which WebLogic Server listens for
SSL connections. For an example of a class that extends the
java.rmi.server.RMISocketFactory class, see Listing 4-22.
3. Run the ejbc compiler with the -d option.
4. Add your extension of the java.rmi.server.RMISocketFactory class to the
CLASSPATH of the Java client.
5. Use the following command options when starting the Java client:
-xbootclasspath/a:%CLASSPATH%
-Dorg.omg.CORBA.ORBSocketFactoryClass=implementation of java.rmi.server.RMISocketFactory
-Dssl.certs=directory location of digital certificate for Java client
-Dssl.key=directory location of private key for Java client"
At step 3. I found into documentation that -d is linked to a directory name.
When I run ejbc with this option -d I have the message:
"ERROR: You must specify an output directory or jar with the -d option to weblogic.ejbc."
% So what option can I use to run ejbc for secure usage?
At step 5. Whatever I write for -Dorg.omg.CORBA.ORBSocketFactoryClass,
this pointed class is not instanciated.
Then I can not create a socket with my client.
The folowing exception is raised:
javax.naming.CommunicationException [Root exception is java.net.ConnectException:
No server found at T3S://localhost:7002]
So, my questions are:
% Why -Dorg.omg.CORBA.ORBSocketFactoryClass must be known by the client and not
the server?
My java client part, managing connection is:
-------------------BEGIN OF CONNECTION MANAGER-------------------
Properties env = new Properties ();
// Shouldn't have to do this, but for now you must
if ( factory.equals ("weblogic.jndi.WLInitialContextFactory") ) {
env.put ("java.naming.provider.url", "t3s://localhost:7002");
InitialContext context = new InitialContext (env);
BankSessionServerHome bssh = (BankServerHome) context.lookup("BankServerHome");
BankServer = bssh.create();
-------------------END OF CONNECTION MANAGER-------------------
I have also try
env.put ("java.naming.provider.url", "corbaloc:iiop://localhost:7002");
but it throws the following error
javax.naming.InvalidNameException: url does not conatin !!!
% What is the code for the java client allowing connection with the ejb?
% And better, can I have a sample example for rmi-iiop over ssl?
(...wlserver6.1\samples\examples\iiop\ejb\stateless\rmiclient\client.java do not
speak ssl!)
Any help will be appreciate from you...
Best Regards.
Oliver
Maybe you are looking for
-
How do I import my email and address book from Netscape mail 7.1?
I've been using Netscape Mail 7.1 since it first came out, but I'm moving to the Apple Mac world and need to keep my old emails. I've been told by the Apple Genius Bar people that I could do this with Thunderbird.
-
Copy/Paste functionlity is not working in oracle forms 11g
Hi All, We are using custom built big application (oracle 11g/forms 11g). 1. And few user are not able to copy/paste from oracle forms 11g to winword.And its random sometime they can ,sometime they can't . 2. If they have problem means they have copy
-
AP Authentication feature in Cisco 1242AG/1310G
Dear All, can you tell me please what I can define in the menu Security--> AP Authentication in the AIRONET 1242AG and 1310G APs ? Is this feature for LWAPP only [authentication of AP against LWAPP Controller] ? Thanks.
-
Fm8 and png graphics in XML export
Hi, If I add a gif-image (for example) to structured doc and write out XML, fm8 writes out the dpi value to dpi-attribute (dtd uses default fmimage attrs in this case) if the facet is not resized. If it wsa resized, frame writes out impsize. This is
-
How to view database values from server to client
hi friends i have database in server side, i am storing values to the database from client side machine through remote methods. But now i need to view the database values from the server side. how to do this using RMI. Plz give me suggestion. by vino