You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Cornelius, Martin (DWBI)" <Ma...@smiths-heimann.com> on 2009/09/09 14:19:53 UTC

Using JacORB as OSGi Bundle succeded (was: Bundelizing Jacorb -- getting screwed)

Richard S. Hall wrote

> Martin Cornelius wrote
> AFAIKS, the only solution to this problem is to make jacorb 'self-
> contained', i.e., put a copy of javax.rmi.CORBA.Stub into the jacorb
> bundle. Of course, there may be other classes that are missing...
> >
> 
> Yep. Sucks.

Just putting javax.rmi.CORBA.Stub into the jacorb bundle is no solution, because javax.rmi.CORBA.Stub itself depends on tons of sun.* and com.sun* classes 8-(

However, there is a simple solution, albeit it requires rebuilding jacorb: Just specify -Dno-rmi=true when building jacorb. This results in a jacorb.jar, where org.jacorb.orb.Reference directly extends org.omg.CORBA.portable.ObjectImpl. The drawback of this might be, that the resulting jacorb does not support rmi-iiop, but that's not needed for 'normal' CORBA communication.

After bundelization of the jacorb.jar with bnd, the resulting bundle still has a dependeny to package javax.rmi.CORBA, but this one doesn't harm. It is due to usage of class javax.rmi.CORBA.ClassDesc in org.jacorb.orb.CDROutputStream. As javax.rmi.CORBA.ClassDesc has no dependencies into org.omg.*, this is OK.

Additionally, I ripped package org.omg.SendingContext out of the runtime (rt.jar) and added it to jacorb.jar. This might be needed because class org.omg.SendingContext.RunTime also depends on org.omg.CORBA.Object. 

With the bundle produced from this jacorb.jar (using bnd), i was able to run jacorb and an application that uses it as felix bundles - without having jacorb on the classpath. Hurrayyyyy, eventually this cost me about 2 weeks of work !

If anybody is still interested in a detailed HOWTO use JacORB-2.3.1 as felix bundle, just ask...

regards, Martin
_______________________________________________________________

 
************************************************
The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege.  If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager.  Please do not copy it for any purpose, or disclose its contents to any other person.  The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.  The recipient should check this e-mail and any attachments for the presence of viruses.  The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Using JacORB as OSGi Bundle succeded

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Great! Thanks for reporting back.

-> richard

On 9/9/09 8:19, Cornelius, Martin (DWBI) wrote:
> Richard S. Hall wrote
>
>    
>> Martin Cornelius wrote
>> AFAIKS, the only solution to this problem is to make jacorb 'self-
>> contained', i.e., put a copy of javax.rmi.CORBA.Stub into the jacorb
>> bundle. Of course, there may be other classes that are missing...
>>      
>>>        
>> Yep. Sucks.
>>      
> Just putting javax.rmi.CORBA.Stub into the jacorb bundle is no solution, because javax.rmi.CORBA.Stub itself depends on tons of sun.* and com.sun* classes 8-(
>
> However, there is a simple solution, albeit it requires rebuilding jacorb: Just specify -Dno-rmi=true when building jacorb. This results in a jacorb.jar, where org.jacorb.orb.Reference directly extends org.omg.CORBA.portable.ObjectImpl. The drawback of this might be, that the resulting jacorb does not support rmi-iiop, but that's not needed for 'normal' CORBA communication.
>
> After bundelization of the jacorb.jar with bnd, the resulting bundle still has a dependeny to package javax.rmi.CORBA, but this one doesn't harm. It is due to usage of class javax.rmi.CORBA.ClassDesc in org.jacorb.orb.CDROutputStream. As javax.rmi.CORBA.ClassDesc has no dependencies into org.omg.*, this is OK.
>
> Additionally, I ripped package org.omg.SendingContext out of the runtime (rt.jar) and added it to jacorb.jar. This might be needed because class org.omg.SendingContext.RunTime also depends on org.omg.CORBA.Object.
>
> With the bundle produced from this jacorb.jar (using bnd), i was able to run jacorb and an application that uses it as felix bundles - without having jacorb on the classpath. Hurrayyyyy, eventually this cost me about 2 weeks of work !
>
> If anybody is still interested in a detailed HOWTO use JacORB-2.3.1 as felix bundle, just ask...
>
> regards, Martin
> _______________________________________________________________
>
>
> ************************************************
> The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege.  If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager.  Please do not copy it for any purpose, or disclose its contents to any other person.  The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.  The recipient should check this e-mail and any attachments for the presence of viruses.  The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
> ************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Using JacORB as OSGi Bundle succeded (was: Bundelizing Jacorb -- getting screwed)

Posted by rahushar <ra...@ciena.com>.
Hello Martin,

I am going through the same problem that you faced 4 yrs ago :-). I have to
use jacorb.jar in my OSGi bundle. However after bundeling, I am getting
Verify error and perhaps for the same reason as you mentioned in your post
"JacORB as OSGi Bundle succeded (was: Bundelizing Jacorb -- getting
screwed)".

Here is the error that is thrown:
Bad type on operand stack
Exception Details:
  Location:
   
org/jacorb/orb/Delegate.getReference(Lorg/jacorb/poa/POA;)Lorg/omg/CORBA/portable/ObjectImpl;
@42: invokevirtual
  Reason:
    Type 'org/jacorb/orb/Reference' (current frame, stack[0]) is not
assignable to 'org/omg/CORBA/portable/ObjectImpl'
  Current Frame:
    bci: @42
    flags: { }
    locals: { 'org/jacorb/orb/Delegate', 'org/jacorb/poa/POA',
'java/lang/String', 'org/jacorb/orb/Reference' }
    stack: { 'org/jacorb/orb/Reference', 'org/jacorb/orb/Delegate' }

I am using Jacorb-3.4 with JRE-7 and Equinox as the OSGi platform.
Should I go ahead and re-bundle Jacorb as you suggested? Or is there a
better alternative where-in we can also use RMI-IIOP as well?

Any advise will be appreciated.

Regards,
Rahul



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Bundelizing-Jacorb-getting-screwed-tp4843264p5007392.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org