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

EJB and CORBA from same client Application

0 views
Skip to first unread message

RChesworth

unread,
Sep 21, 2000, 3:00:00 AM9/21/00
to
I have an existing application that makes use of CORBA services
using OrbixWeb 3.2 with JDK 1.2. I would like to additionally
make calls to EJB services (currently testing on J2EE from sun).
Is this a valid configuration from within a single application?

I have added the option -Xbootclasspath to load the OrbixWeb
class files which works fine. It uses naming services to contact
the Orbix 3.0 server.

I have added a class that requests services through EJB and JNDI.
The pertinent section follows:

ServicesFactory.java
import java.rmi.*;

import javax.ejb.*;
import javax.naming.*;
import javax.rmi.*;
.......
private static ServicesFactory factory = new
ServicesFactory();

private InitialContext jndiContext = null;

public void login( String userId, String password )
throws RemoteException, CreateException, NamingException
{
// create the context
this.jndiContext = new InitialContext();
// get the service home
Object ref = null;
// __DEBUG__
if ( this.useTestService ) {
ref =
this.jndiContext.lookup(LOGIN_SERVICE_TEST_HOME);
}
else {
ref = this.jndiContext.lookup( LOGIN_SERVICE_HOME );
}
LoginServiceHome home = (LoginServiceHome)
PortableRemoteObject.narrow( ref, LoginServiceHome.class );
// get the service
LoginService loginService = home.create();
// login to the service
this.sessionId = loginService.login( userId, password,
businessUnit );
// save a handle to the service
this.loginServiceHandle = loginService.getHandle();
}

// End ServicesFactory.java

When I attempt to exercise this code, after contacting the
Orbix Server (OrbixWeb jar files in -Xbootclasspath), I get the
following exception:

java.lang.NoSuchMethodError:org.omg.CORBA.portable.OutputStream:
method orb()Lorg/omg/CORBA/ORB; not found
java.lang.NoSuchMethodError: org.omg.CORBA.portable.OutputStream:
method orb()Lorg/omg/CORBA/ORB; not found
at
com.sun.corba.ee.internal.core.ServiceContext.write(ServiceContex
t.java:96)
at
com.sun.corba.ee.internal.core.ServiceContexts.write(ServiceConte
xts.java:167)
at
com.sun.corba.ee.internal.iiop.RequestMessage.write(RequestMessag
e.java:101)
at
com.sun.corba.ee.internal.iiop.ClientRequestImpl.<init>(ClientReq
uestImpl.java:33)
at
com.sun.corba.ee.internal.corba.ClientDelegate.createRequest(Clie
ntDelegate.java:313)
at
com.sun.corba.ee.internal.corba.ClientDelegate.createRequest(Clie
ntDelegate.java:327)
at
com.sun.corba.ee.internal.corba.InitialNamingClient.resolve(Initi
alNamingClient.java:197)
at
com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitial
References(InitialNamingClient.java:278)
at
com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initi
al_references(InitialNamingClient.java:187)
at
com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(OR
B.java:1362)
at
com.sun.corba.ee.internal.POA.POAORB.resolve_initial_references(P
OAORB.java:541)
at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext
java:53)
at
com.sun.enterprise.naming.SerialContext.<init>(SerialContext.java
:79)
at
com.sun.enterprise.naming.SerialInitContextFactory.getInitialCont
ext(SerialInitContextFactory.java:54)
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.ja
va:672)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java
:250)
at javax.naming.InitialContext.init(InitialContext.java:226)
at
javax.naming.InitialContext.<init>(InitialContext.java:182)
at
com.sabre.pie.client.connect.ServicesFactory.login(ServicesFactor
y.java:152)

Any suggestions will be appreciated.

Thanks,
-Rich


kuniyil

unread,
Sep 21, 2000, 3:00:00 AM9/21/00
to
How do I package java.lang.Object into CORBA::Any type?


Bill Lloyd

unread,
Sep 21, 2000, 3:00:00 AM9/21/00
to
Rich,

I think you don't want to use -Xbootclasspath. Instead, you should be using
the java properties for the ORBClass and the ORBSingleton. -Xbootclasspath
is sort of a hack (it's *not* just JDK 1.2's version of -classpath!) and
it's better to use the JVM's provided properties.

If you check the OrbixWeb sample code, you'll see some examples of doing
this in code -- where you construct a java.lang.Properties object and pass
it to orb.init() which will then work around the pesky Sun ORB. I should
say I *think* the demos which ship with OrbixWeb show this -- if they don't
I'm positive that the code generated by the Code Generation Toolkit will do
it, so just start with a small IDL file and whip up a quick demo with the
CGT and check out the client code.

That's a good start. The rest of it I can't really help you with. I've
never done it myself.

Cheers,

-B


"RChesworth" <rcheswort...@sun.partner.remarq.com.invalid> wrote in
message news:000000ab...@usw-ex0108-192.remarq.com...

0 new messages