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]
Similar Messages
-
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. -
How to get InitialContextFactory using RMI/IIOP without using weblogic.jar
Hi Robert
I know this is an old post. but I am interested in knowing how to get the
initial context using RMI/IIOP without the use weblogic specific classes
like weblogic.jndi.WLInitialContextFactory . If you have a code snippet that
you can provide as an example, it would be just great.
thanx in advance
Daya Sharma
See comments inline...
Stewart Wachs wrote:
I would like to get an initial context to Weblogic JNDI from a client.
code snippet:
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFacorty");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
try {
Context ctx = new InitialContext(ht);
catch(...) {
This works fine when I include weblogic.jar (and other dependend weblogic
jar's) in the classpath.
Is there a way to access WL JNDI from a client without the weblogicclasses
in the classpath?If you are using WLS 6.1, you could use RMI/IIOP to do this but in general,
the
answer is no, you will need at least some of the weblogic classes on the
client.
If not, is there a lightweight jar available for distribution for client
JNDI connectivity?This is something in the works. In addition, a colleague and I are working
on
a white paper that describes the "Thin Client Options with WebLogic Server"
that we hope to make available in the not too distant future...
Are there any licencing issues with distributing the weblogic classes to
clients that need to access WL JNDI?No. WLS is licensed by the server so you are free to distribute
weblogic.jar
to your clients.
Hope this helps,
RobertTake a look at the RMI/IIOP section of our whitepaper "Small Footprint
Client options for BEA WebLogic Server" at:
http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
Daya Sharma wrote:
Hi Robert
I know this is an old post. but I am interested in knowing how to get the
initial context using RMI/IIOP without the use weblogic specific classes
like weblogic.jndi.WLInitialContextFactory . If you have a code snippet that
you can provide as an example, it would be just great.
thanx in advance
Daya Sharma
See comments inline...
Stewart Wachs wrote:
I would like to get an initial context to Weblogic JNDI from a client.
code snippet:
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFacorty");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
try {
Context ctx = new InitialContext(ht);
catch(...) {
This works fine when I include weblogic.jar (and other dependend weblogic
jar's) in the classpath.
Is there a way to access WL JNDI from a client without the weblogic
classes
in the classpath?
If you are using WLS 6.1, you could use RMI/IIOP to do this but in general,
the
answer is no, you will need at least some of the weblogic classes on the
client.
If not, is there a lightweight jar available for distribution for client
JNDI connectivity?
This is something in the works. In addition, a colleague and I are working
on
a white paper that describes the "Thin Client Options with WebLogic Server"
that we hope to make available in the not too distant future...
Are there any licencing issues with distributing the weblogic classes to
clients that need to access WL JNDI?
No. WLS is licensed by the server so you are free to distribute
weblogic.jar
to your clients.
Hope this helps,
Robert -
Hi all,
this is my client code which access EJB 2.1 and SUN JES AS 8.1 using RMI IIOP
i get the remote home interface well but when i use home.create(), it retruns null.
can anyone help me???
Here is the coding,
Properties props = new Properties();
//props.put("javax.rmi.CORBA.UtilClass",
// "com.sun.corba.ee.impl.javax.rmi.CORBA.Util");
props.put("org.omg.CORBA.ORBClass","com.ooc.OBServer.ORB");
props.put("org.omg.CORBA.ORBSingletonClass","com.ooc.CORBA.ORBSingleton");
props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.cosnaming.CNCtxFactory");
props.put(Context.PROVIDER_URL, "iiop://10.24.17.68:3360"); // the port of the application server
props.put("ooc.orb.service.NameService",
"corbaloc:iiop:10.24.17.68:3360/NameService");
String[] args = null;
ORB orb = ORB.init(args, props);
Context ctx;
Object obj;
try {
ctx = new InitialContext(props);
System.out.println("RMI: 1");
obj = ctx.lookup("ejb/NewSessionBean");
System.out.println("RMI: 2");
System.out.println("object name: "+obj.getClass().getName());
System.out.println("object class loader: "+obj.getClass().getClassLoader());
NewSessionRemoteHome home = (NewSessionRemoteHome) PortableRemoteObject.
narrow(obj, NewSessionRemoteHome.class);
System.out.println("Interface name: "+home.getClass().getName());
System.out.println("RMI: 3: " + home.toString());
if (home == null){
System.out.println("home is null");
NewSessionRemote remo = (NewSessionRemote)home.create();
System.out.println("RMI: 4");
remo.printText("Welcome to RMI world"); //the message send by the client
System.out.println("The sending of RMI is succeed");
} catch (Exception ex) {
System.out.println("exception starts:");
ex.printStackTrace();
System.out.println("Exception occurs. Exception: " + ex.getMessage());
Here is the traces,
RMI: 1
RMI: 2
object name: com.ooc.CORBA.StubForObject
object class loader: null
Interface name: fr.teleca.orangebenchosa.cdrstat._NewSessionRemoteHome_Stub
RMI: 3: IOR:000000000000004b524d493a66722e74656c6563612e6f72616e676562656e63686f73612e6 36472737461742e4e657753657373696f6e52656d6f7465486f6d653a30303030303030303030303 0303030300000000000010000000000000188000102000000000c31302e32342e31372e3638000d2 0000000000056afabcb00000000260000003f00000009533141532d4f52420000000000000002000 00008526f6f74504f41000000001237353732393838353136303237353936380000000000000d010 d0bede7dc000000000001ff140000000000070000000100000020000000000001000100000002050 10001000100200001010900000001000101000000002600000002000200000000000300000016000 000000000000c31302e32342e31372e3638000d1600000000000300000016000000000000000c313 02e32342e31372e3638000d1300000000001f0000000400000003000000200000000400000001000 000210000007c000000000000000100000000000000240000001e000000660000000000000001000 0000c31302e32342e31372e3638000d1600400000000000000008060667810201010100000017040 1000806066781020101010000000764656661756c740004000000000000000000000100000008060 66781020101010000000f
exception starts:
java.lang.ClassCastException
at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.isLocal(Unknown Source)
at javax.rmi.CORBA.Util.isLocal(Unknown Source)
at fr.teleca.orangebenchosa.cdrstat._NewSessionRemoteHome_Stub.create(Unknown Source)
at fr.teleca.orangebenchosa.servicelogic.CallHandler$EndState.sendCDRStat(CallHand ler.java:1385)
at fr.teleca.orangebenchosa.servicelogic.CallHandler$EndState.start(CallHandler.ja va:1047)
at com.appium.TAS.SessionContainer.StatefulObject.enterState(StatefulObject.java)
at fr.teleca.orangebenchosa.servicelogic.CallHandler.access$4800(CallHandler.java: 61)
at fr.teleca.orangebenchosa.servicelogic.CallHandler$SuccessfulLogicState.routeRes (CallHandler.java:902)
at com.appium.TAS.SessionComponents.CallControl.a.exec(a.java)
at com.appium.Basement.Synchronization.Asynchronizer.d(Asynchronizer.java)
at com.appium.Basement.Synchronization.g.run(g.java)
Exception occurs. Exception: nullHi ejp,
because my stand alone client application runs on telecom server which uses orbacus. It calls the remote method on sun AS using RMI IIOP
I specifed the properties of the client to use SUN AS naming services.
I added j2ee.jar and appserv-rt.jar in my client program. but i dont know eventhough i specified the Util properties to use as below
props.put("javax.rmi.CORBA.UtilClass","com.sun.corba.ee.impl.javax.rmi.CORBA.Util");
props.put("org.omg.CORBA.ORBClass", "com.sun.corba.ee.impl.orb.ORBImpl");
props.put("org.omg.CORBA.ORBSingletonClass", "com.sun.corba.ee.impl.orb.ORBSingleton");
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
props.put(Context.PROVIDER_URL,"iiop://10.24.17.68:3360"); // the port of the application server
props.put("ooc.orb.service.NameService", "corbaloc:iiop:10.24.17.68:3360/NameService");
ORB orb = ORB.init(args,props);
Context ctx;
Object obj;
try {
ctx = new InitialContext(props);
obj= ctx.lookup("ejb/NewSessionBean");
NamingEnumeration ne = ctx.listBindings("ejb");
while (ne.hasMore()) {
System.out.println("Binding: " + ne.next());
System.out.println("object name"+obj.getClass().getName());
System.out.println("object class loader"+obj.getClass().getClassLoader());
NewSessionRemoteHome home=(NewSessionRemoteHome)PortableRemoteObject.narrow(obj,NewSessionRemoteHome.class);
System.out.println("Interface name: "+home.getClass().getName());
NewSessionRemote remo=home.create();
System.out.println("Remote name: "+remo.getClass().getName());
remo.printText("Welcome"); //the message send by the client
} catch (Exception ex) {
ex.printStackTrace();
but it uses J2SE Util. Is there any other workaround to do?
Thanks
mdb -
ClassCastException while narrow an EJV using RMI-IIOP
Hi,
I'm trying to deploy an EJB on weblogic 6.1 SP4 on an AIX system, and a client
(JSP) running on weblogic 6.1 SP4 on a SUN system. And, the dialog between EJB
and servlet has to use RMI-IIOP (due to exploitation constraints).
I receive this exception when getting the reference of the EJB's home :
java.lang.ClassCastException: Cannot narrow remote object to ejbMweb.TstEjbMwebHome
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:124)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:132)
at cliEjbMweb.cliTstMweb.narrow(cliTstMweb.java:133)
at cliEjbMweb.cliTstMweb.getHome(cliTstMweb.java:31)
at cliEjbMweb.cliTstMweb.testBean1(cliTstMweb.java:53)
at jsp_servlet.__index._jspService(__index.java:91)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:321)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
The same test using t3 is running OK (there is no problem of classpath).
Can you hel me ?
Thank you !
Marc"Marc" <[email protected]> writes:
It can't download the stub, you need to set an appropriate security
manager for the RMIClassLoader to work, or make sure the stubs are on
the client.
andy
Hi,
I'm trying to deploy an EJB on weblogic 6.1 SP4 on an AIX system, and a client
(JSP) running on weblogic 6.1 SP4 on a SUN system. And, the dialog between EJB
and servlet has to use RMI-IIOP (due to exploitation constraints).
I receive this exception when getting the reference of the EJB's home :
java.lang.ClassCastException: Cannot narrow remote object to ejbMweb.TstEjbMwebHome
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:124)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:132)
at cliEjbMweb.cliTstMweb.narrow(cliTstMweb.java:133)
at cliEjbMweb.cliTstMweb.getHome(cliTstMweb.java:31)
at cliEjbMweb.cliTstMweb.testBean1(cliTstMweb.java:53)
at jsp_servlet.__index._jspService(__index.java:91)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:321)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
The same test using t3 is running OK (there is no problem of classpath).
Can you hel me ?
Thank you !
Marc -
Dear,
Can anyone tell me when we use RMI-IIOP? When we use RMI-IIOP and
EJB? When will use JSP? When will use servlet?
Sorry for that silly question, but i really want to know it?
kurtAs I know, If using RMI-IIOP, we have to handle lots of stuffs like
connection pool, security...etc.
Am I right?
Kurt
Tom Barnes <[email protected]> wrote in message
news:[email protected]..
>
>
Andy Piper wrote:
RMI-IIOP is useful for:
a) Interop, i.e. between different appservers
b) C++ client integration
Customers also sometimes want it because they have security
restrictions on what protocols they can put through a firewall.
It is also useful for light-weight Java clients. RMI-IIOP clients need
not use the (large) weblogic.jar jar.
Tom -
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 -
Using updated tools with WLS 8.1 SP3
I'm attempting to take advantage of some ant 1.6 features. However, it appears that the ant XML parsers are getting in the way of the embedded WLS xml parsers:
[servicegen] java.lang.ClassCastException
[servicegen] at weblogic.apache.xerces.parsers.SAXParser.<init>(SAXParser.java:140)
[servicegen] at weblogic.apache.xerces.parsers.SAXParser.<init>(SAXParser.java:125)
[servicegen] at weblogic.apache.xerces.jaxp.SAXParserImpl.<init>(SAXParserImpl.java:102)
[servicegen] at weblogic.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:112)
[servicegen] at weblogic.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:140)
[servicegen] at weblogic.xml.jaxp.WebLogicSAXParserFactory.setFeature(WebLogicSAXParserFactory.java:56)
[servicegen] weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Cannot invoke boolean constructor of processor ] - with nested exception:
[servicegen] [java.lang.reflect.InvocationTargetException - with target exception:
[servicegen] [weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - with nested exception:
[servicegen] [java.lang.ClassCastException]]]
Based on some research this appears to be an issue with WLS getting a parser that it cannot handle. Given that the version of ant included with 8.1sp3 is pretty old, is there a way to use newer versions? I'm giving up for now on macrodef's but would, as a general statement, like to keep up with new tools as they become available. I'd like to not be dependent on turning a battleship to incorporate 15 months of development work (the time between now and the release of ant 1.5.3 as included with 8.1sp3).
Thanks for any information.Had some problems like this before. Even thought I cannot offer specific advice as to how to fix this. If you do this, it could help.
Encountered a problem in eclipse while using WLS servicegen ANT task and, of course, the optional FTP task. I am using Eclipse Version: 3.0.0 Build id: 200406192000. With this comes ANT 1.6.1 standard. In order to get servicegen ANT task working I had to include the weblogic.jar in the ANT Classpath. Ofcourse this had another side effect, the FTP task that used to work earlier quit working. I still havent figured out the root cause of the problem but inorder to get around I did the following. To fix this, I added a new Task called FTP, I picked the c:\....\lib\ant-commons-net.jar in the location. The name I retained it as ftp. In the left page, I nagivated down to the lead of the tree [root]/->org->apache->...->net and in the right pane, I chose FTP. After this step when I ran I ran into an odd error Buildfile: C:\Work\JSSE-EJB.xml BUILD FAILED: java.lang.NoClassDefFoundError: com/oroinc/net/ftp/FTP Total time: 78 milliseconds I was under the impression that this is a legacy component and that the new version of the net component has org.apache....FTP structure. I am really not sure where, but to fix the issue, I had to get the NetComponents.jar from http://www.savarese.org/downloads/NetComponents/ and included it in the classpath. After this step, presto, servicegen task works fine with FTP task. However, I cannot imagine doing this for all the optional tasks. But for now there is a winding work around. -
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!!!!!! -
RMI /IIOP VPN WL 5.1
Hi All,
Is it possible for 2 WL 5.1 containers (EJBs) to communicate with each
oher when
they are connected by VPN and use RMI /IIOP ?
-thanks
SAndeep[email protected] (Kurt Seidensticker) writes:
Is it possible to use RMI-IIOP between WLS 5.1 and 6.1?
I am trying to figure out a way to have EJB's
communicate between the two version.Not now, but the intent is for that to work before the end of the
year.
andy -
EJB client connection [RMI/IIOP]
1) Just to test the communication between EJB client and EJB using RMI/IIOP in WLS 9.2, I have created two InitialContexts and I have seen that here are only two InitialContext. But, I can see only a single connection displayed (Monitoring Channels tab for the default [IIOP] channel). Is this expected? Doesn’t is suppose to create two connections?
2) If only one connection is established. What is the way this model will scale up?? I can have multiple calls..right?
3) What is the connection time out works on this? If I have a stub cached. Does that mean my RMI/IIOP connection still be alive?MC Sreeram <> writes:
1) Just to test the communication between EJB client and EJB using RMI/IIOP in WLS 9.2, I have created two InitialContexts and I have seen that here are only two InitialContext. But, I can see only a single connection displayed (Monitoring Channels tab for the default [IIOP] channel). Is this expected? Doesn???t is suppose to create two connections?Connections are share beween the same port and ip addresses.
2) If only one connection is established. What is the way this model will scale up?? I can have multiple calls..right?Yes. It scales up nicely.
3) What is the connection time out works on this? If I have a stub cached. Does that mean my RMI/IIOP connection still be alive?The stub should transparently re-establish the connection if it is timed out
andy -
Hi,
I have a question on using EJB / or RMI servers with CORBA clients using
RMI-IIOP transport, which in theory should work, but in practice has few
glitches.
Basically, I have implemented a very simple server, StockTreader, which
looks up for a symbol and returns a 'Stock' object. In the first example, I
simplified the 'Stock' object to be a mere java.lang.String, so that lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case 1) and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
But the problem arises when I tried using the RMI server (via IIOP) with the
CORBA client, when the client tries to narrow the object ref obtained from
the naming service into the CORBA idl defined type (StockTrader) it ends up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a PortableRemoteObject derived
class, to make it IIOP compliant), and then the server to register the stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming =NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ": " +obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to register the RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref name (with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the naming
service, the operation StockTraderHelper.narrow() fails in the segment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registered in a CORBA
server (as opposed to an RMI server), but works correctly with no casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hariOn the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
include the examples.
"<=one way=>" wrote:
With reference to your and other messages, it appears that one should not
expect that WLS RMI-IIOP will work in a complex real-life system, at least
not now. In other words, support for real-life CORBA clients is not an
option in the current release of WLS.
TIA
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
needs for uses who need to use IDL to talk to the Weblogic server,
generically. This example illustrates the simplest connectivity; it does not
address how
to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
this topic either, a point which is telling if all the less happy to hear.
For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
correct; better examples are forth coming.
Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
programming model is busted; busted in the sense that there are no C++
libraries to support the EJB model, and busted in the sense that there is
simply no
support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
in productive ways.
For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
dispatch IIOP request into RMI server objects. The way I look at it is this:
it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
practically nothing to do with CORBA.
ST wrote:
Eduardo,
Can you give us more details about the comment below:
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
implementation. We
don't need a "HelloWorld" example, we need a concrete serious example(fully
tested and seriously documented) that works so that we can get a betteridea
on how to integrate CORBA and EJB.
Thanks,
Said
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
Please post request to the news group...
As I said, you must separate the idl related classes (class files and
java
files) from the rmi classes... in the rmic step, you must set a newtarget
(as you did), emit the java files into that directory (it's not clearyou
did this), then remove all the rmi class files from the class path... ifyou
need to compile more classes at that point, copy the java files to theidl
directly is you must, but you can not share the types in any way.
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
an idl client in java to work.
Harindra Rajapakshe wrote:
Hi Eduardo,
Thanks for the help. That is the way I compiled my CORBA client, by
separating the IDL-generated stubs from the RMI ones, but still I
get a
CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
Here's what I did;
+ Define the RMI interfaces, in this case a StockTrader interface.
+ Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
making
it IIOP compliant
+ Implemnnt an RMI server, and compile using JDK1.2.2
+ use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
utility rmic;
rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
+ generate Java mappings to the IDL generated above, using RMI-IIOPplugin
util,
idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
This creates source for the package stock and also
org.omg.CORBA.*
package, presumably IIOP type marshalling
+ compile all classes generated above using JDK1.2.2
+ Implement client (CORBA) using the classes generated above, NOTthe
RMI
proxies.
+ start RMI server, with stockTrader server obj
+ start tnameserv
+ start CORBA client
Then the client errors when trying to narrow the obj ref from the
naming
service, into the CORBA IDL defined interface using,
org.omg.CORBA.Object obj =naming.resolve(nn);
StockTrader trader =StockTraderHelper.narrow(obj); // THIS
ERRORS..!!!
throwing a CORBA.BAD_PARAM exception.
any ideas..?
Thanks in advance,
-hari
----- Original Message -----
From: Eduardo Ceballos <[email protected]>
Newsgroups: weblogic.developer.interest.rmi-iiop
To: Hari Rajapakshe <[email protected]>
Sent: Wednesday, July 26, 2000 4:38 AM
Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
Please see the post on june 26, re Errors compiling... somewherein
there,
I suspect, you are referring to the rmi class file when you are
obliged
to
completely segregate these from the idl class files.
Hari Rajapakshe wrote:
Hi,
I have a question on using EJB / or RMI servers with CORBA
clients
using
RMI-IIOP transport, which in theory should work, but in practice
has
few
glitches.
Basically, I have implemented a very simple server,
StockTreader,
which
looks up for a symbol and returns a 'Stock' object. In the firstexample, I
simplified the 'Stock' object to be a mere java.lang.String, so
that
lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case
1)
and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
But the problem arises when I tried using the RMI server (via
IIOP)
with
the
CORBA client, when the client tries to narrow the object ref
obtained
from
the naming service into the CORBA idl defined type (StockTrader)
it
ends
up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending
java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a
PortableRemoteObject
derived
class, to make it IIOP compliant), and then the server to
register
the
stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation
class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming=NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ":"
+obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to
register
the
RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref
name
(with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the
naming
service, the operation StockTraderHelper.narrow() fails in thesegment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the
type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registeredin a
CORBA
server (as opposed to an RMI server), but works correctly with
no
casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hari -
RMI/IIOP + WLS cluster
Two questions:
Can I access a WLS cluster using RMI/IIOP?
If positive, will the load-balancing and fail-over work the same way as with
T3?
Thanks
Serhii Sokolenko
Serhii Sokolenko wrote:
> Two questions:
>
> Can I access a WLS cluster using RMI/IIOP?
yes you can
>
>
> If positive, will the load-balancing and fail-over work the same way as with
> T3?
no because IIOP stubs are not smart and cluster-aware
>
>
> Thanks
> Serhii Sokolenko
-
RMI-IIOP nulls out Hashtable in 6.1 SP2
Hi,
We have a client communicating with a server via a session bean, using RMI-IIOP.
The client that is sending "sessionBean.foo(A a)", where "A" is a serializable
object that contains a Hashtable "h", and "a.h" is initialized to a new Hashtable.
When we look at A inside the sessionBean, "h" contains null. Is it possible that
somewhere in the marshalling process, "h" was nulled out?
We have tried this, all in WLS 6.1 SP2:
- compiling and running in JDK1.3.1_02, client and server
- compiling and running in JDK1.3.1_01, client and server
Thanks for your help,
JoelThanks for the quick response(s),
Where we can get this patch to SP2?
It doesn't appear to be available through support.bea.com or the developer area.
Is it on the web, or do we have to e-mail support?
Joel
Andy Piper <[email protected]> wrote:
"Cameron Purdy" <[email protected]> writes:
Right. Also, JDK 1.3 does not encode null objects correctly so you
will find that we trim Vectors to not contain nulls because of this
problem.
You know, Hashtables are custom marshaled and we found a number of
problems with custom marshaling in SP2. These are all fixed in SP3 and
a patch is available from BEA support for SP2 users. However, it seems
unlikely that this is your problem since you don't get any marshaling
errors.
andy
Only if h is transient or you have over-ridden serialization (e.g.
readObject / writeObject).
Peace,
Cameron Purdy
Tangosol, Inc.
Clustering Weblogic? You're either using Coherence, or you should be!
Download a Tangosol Coherence eval today at http://www.tangosol.com/
"Joel Lucuik" <[email protected]> wrote in message
news:3c6d53cb$[email protected]..
Hi,
We have a client communicating with a server via a session bean,
using
RMI-IIOP.
The client that is sending "sessionBean.foo(A a)", where "A" is aserializable
object that contains a Hashtable "h", and "a.h" is initialized to
a new
Hashtable.
When we look at A inside the sessionBean, "h" contains null. Is itpossible that
somewhere in the marshalling process, "h" was nulled out?
We have tried this, all in WLS 6.1 SP2:
- compiling and running in JDK1.3.1_02, client and server
- compiling and running in JDK1.3.1_01, client and server
Thanks for your help,
Joel -
Hi,
I'd like to have some precisions about the communication between a
remote java fat client and a weblogic ejb container.
We should use RMI, but what is the protocol we have to use : RMI IIOP
or HTTP
Can we wrap rmi with http ?
thanks in advanceYou can use RMI over t3(weblogic specific) or IIOP.
Please take a look at http://edocs.bea.com/wls/docs81/rmi_iiop/index.html
-utpal
"truecolor" <[email protected]> wrote in message
news:[email protected]..
Hi,
I'd like to have some precisions about the communication between a
remote java fat client and a weblogic ejb container.
We should use RMI, but what is the protocol we have to use : RMI IIOP
or HTTP
Can we wrap rmi with http ?
thanks in advance
Maybe you are looking for
-
I recently bought ringtones from my ipad thinking that they would also be on my iphone. They are not showing up, do i have to purchase them on both devices?
-
Flex components not compatible with iOS/ADT packager?
I've been struggling hard and long to export a simple Hello World project to my iPhone with AIR 2.6. After a lot if reading on different blogs and sites I've gotten as far as packaging my debug swf to an IPA with ADT. The app starts on my iPhone but
-
Hi Guys Having issues with Loadrunner playing SSL. IT records okay but once you start to play back it stops with error messge.. The issue is with SSL... so please how do you set SSL combatibility with loadrunner 7. Thanks
-
Is it safe to do my banking on my iPad 2
I usually do my banking on my laptop which has norton installed. Is it safe to use my iPad2 to do all my transactions and view my accounts. Also is is safe to purchase items of eBay, amazon etc
-
Document viewer, 3rd party
Hi all, just got a Curve from Tmobile, and have found that Tmobile does not support Blackberry software above 4.2, thus I don't have Documents to Go bundled. Anyone found a 3rd party software to store and view Word documents that they have had luck