On Wed, Feb 28, 2001 at 05:00:54PM +0100, Schouten, Andreas wrote:
> Hello!
>
> How can I connect a CORBA server from a jBoss j2ee application?
First, this is a question for jboss-user, not jboss-dev, IMHO.
> I tried to install a JavaBean with CORBA connect as MBean service in jBoss.
> First I wrote a Mbean
> which register a simple object and I can work with this object in my
> Sessionbean.
Do you mean you bound a CORBA object reference into JNDI? Sounds reasonable.
> A standalone application which connects to the CORBA server works fine
> with the same code as the bean. Now I want connect the CORBA server while
> starting the
> MBean but this does not work.
>
> 1)
> orb = ORB.int(stringarray, props);
>
> returns an instance of org.omg.ORB, but
>
> obj = orb.string_to_object(ior)
>
> causes a NullpointerException.
More details.
> 2)
> orb = ORB.int();
>
> returns also an instance of org.omg.ORB, but
>
> obj = orb.string_to_object(ior)
>
> causes a security exception.
More details.
> My server.policy file have only one entry:
> CodeBase <All> permission java.security.AllPermission
>
> So the server should accept the network access.
>
>
> Who does thow this exception? How can I avoid this?
More details.
> Maybe there is a better way integrating CORBA apps?
Well, the full-on J2EE way to do it is to write a resource adapter and use
JCA. If you don't require the app server to manage security or transactions
then I think the way you're doing it is fine.
Toby.