Problem calling AS8.2 EJB from Sun WebServer 6.1

I am calling an EJB from Java Studio Creator JSF portlet. When I deploy the portlet on a Sun Portal 7, running on a Webserver 6.1, then

InitialContext.lookup(String)

returns

com.sun.corba.se.impl.corba.CORBAObjectImpl

instead of

...MyClassHome_DynamicStub

Thenarrow then returns null instead of the class...

I've found a solution to this here: http://forum.java.sun.com/thread.jspa?forumID=136&threadID=619420

The solution is to use another INITIAL_CONTEXT_FACTORY:

props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.appserv.naming.S1ASCtxFactory")

But I need this to be done on a WebServer, and

com.sun.appserv.naming.S1ASCtxFactory is contained in a Application server jar (appserver-rt.jar I believe).

According to this:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6336410

I can't use this jar in a Sun Webserver. And it's probably true, the portlet doesn't work with the jar packaged in to the WAR.

Is there any other solution to this?

[1101 byte] By [Martin777a] at [2007-11-26 18:09:30]
# 1
> Is there any other solution to this?Yes, there is. The EJB Client Jar was missing the RMI stubs. When I called the EJB from the AS8, the server probably created the stubs, but webserver didn't. rmic -iiop classname solved the issue.
Martin777a at 2007-7-9 5:41:29 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...