OSGi Manifests for jar files

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

OSGi Manifests for jar files

Postby kcacciatore » Wed Mar 14, 2007 2:26 pm

Hi,

I'd like to suggest adding OSGi bundle manifests to the jar files so that the jar files can operate properly in an OSGi framework.

Thanks,

Kyle
kcacciatore
 
Posts: 6
Joined: Mon Dec 12, 2005 2:33 pm

Postby JIDE Support » Wed Mar 14, 2007 2:32 pm

Any reference about how to create such an manifest?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Postby kcacciatore » Wed Mar 14, 2007 2:44 pm

http://www.osgi.org/ for the abstract behind it. Also helpful is Peter Kriens website (http://www.aqute.biz/Main/OSGi) and information on Eclipse's Equinox framework (http://www.eclipse.org/equinox/resources.php)

Basically, it's listing exported and imported dependencies between jar files within the manifest of each jar file.

Thanks,

Kyle
kcacciatore
 
Posts: 6
Joined: Mon Dec 12, 2005 2:33 pm

Postby JIDE Support » Wed Mar 14, 2007 2:54 pm

Thanks for the information. I'll check those out.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Postby chrismhopkins » Mon Jul 16, 2007 4:19 am

Have you looked into this anymore? I'd be very interested in a OSGi-ified version of the JIDE jars as we are trying to use JIDE within OSGi and running into issues with the L&F.

Thanks,
Chris
chrismhopkins
 
Posts: 46
Joined: Tue Feb 17, 2004 10:35 am

Postby JIDE Support » Mon Jul 16, 2007 9:02 am

We haven't get to it yet. Is it hard for you to add the information? I ask because we are not familiar with it. Unless it needs some special knowledge of JIDE, you probably can do it faster than we do. Once you do it, we can integerate it into JIDE release if it makes sense.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Postby kcacciatore » Mon Jul 16, 2007 10:21 am

Not necessarily special knowledge, but a complete knowledge of interdependencies between the jide jars is necessary to do a proper implementation, one that developers can use to leverage OSGi in their applications.

Chris, can you be more specific about the issue you're having? I'm betting that something like the way L&F is set is a good example of classloader issues that come up in an OSGi environment.

Thanks,

Kyle
kcacciatore
 
Posts: 6
Joined: Mon Dec 12, 2005 2:33 pm

Postby JIDE Support » Mon Jul 16, 2007 10:26 am

The dependency among jide jars is straightforward. jide-common.jar is the base one which doesn't depend on any other jars. jide-dock, jide-action, jide-components, jide-grids and jide-dialogs all depend on and only depend on jide-common.jar. There are no inter-dependencies among these five jars.

In fact,

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Postby chrismhopkins » Tue Jul 17, 2007 7:29 am

kcacciatore wrote:Chris, can you be more specific about the issue you're having? I'm betting that something like the way L&F is set is a good example of classloader issues that come up in an OSGi environment.


Sure Kyle. If I'm using any widget that uses JIDE I get this type of error on startup (there are many of them for various Swing components):

UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenu[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Help]
java.lang.Error
at javax.swing.UIDefaults.getUIError(UIDefaults.java:691)
at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
at javax.swing.UIDefaults.getUI(UIDefaults.java:721)
at javax.swing.UIManager.getUI(UIManager.java:860)
at javax.swing.JMenu.updateUI(JMenu.java:192)
at javax.swing.JMenuItem.init(JMenuItem.java:170)
at javax.swing.JMenuItem.<init>(JMenuItem.java:119)
at javax.swing.JMenuItem.<init>(JMenuItem.java:96)
at javax.swing.JMenu.<init>(JMenu.java:144)
at com.cra.metronome.menu.Menu.getJMenuItem(Menu.java:45)
at com.cra.metronome.menu.Menu.getJMenuItem(Menu.java:1)
at com.cra.metronome.frame.Frame$4.run(Frame.java:298)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
chrismhopkins
 
Posts: 46
Joined: Tue Feb 17, 2004 10:35 am

Postby chrismhopkins » Tue Jul 17, 2007 7:35 am

I checked out the OSS Common layer (thanks JIDE folks!) and see that the UIDefaultsLookup is using UIManager.get(...) to lookup things. Perhaps UIManager is using the wrong classloader?

Just a thought.

- Chris
chrismhopkins
 
Posts: 46
Joined: Tue Feb 17, 2004 10:35 am

Postby JIDE Support » Tue Jul 17, 2007 7:39 am

We/UIManager use what default class loader. Do you know your class loader? If so, I guess you can use UIManager.put("ClassLoader", myLoader) to set the class you want UIManager to use.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Postby chrismhopkins » Tue Jul 17, 2007 7:43 am

JIDE Support wrote:We/UIManager use what default class loader. Do you know your class loader? If so, I guess you can use UIManager.put("ClassLoader", myLoader) to set the class you want UIManager to use.


I'm ignorant enough of the classloader scheme that OSGi uses to not know if that is the problem. :) Perhaps Kyle has some insight and I will try to figure things out on my end too.

I'll let you know how it goes.

Thanks,
Chris
chrismhopkins
 
Posts: 46
Joined: Tue Feb 17, 2004 10:35 am

Postby kcacciatore » Tue Jul 17, 2007 7:45 am

In an OSGi environment, classloaders are created for each bundle (which more or less translates to a jar file in this context). The OSGi manifest dictates which classes are exported, and which bundles the manifested jar depends on.

So the first thing to do would be to make sure the manifest file for the jide jars is properly exporting the class files required by your app, and that your app's manifest file is properly expressing the dependency on the jide jars.

Depending on what exactly is going on under the hood, you may have a case where the jide classes need to know about your applications classes. Check out this article's "Buddy Loading" section with respect to that scenario..

http://www.ibm.com/developerworks/libra ... index.html

Obviously it's Equinox specific, so I'm not sure how it's done in other implementations.

Kyle
kcacciatore
 
Posts: 6
Joined: Mon Dec 12, 2005 2:33 pm

Postby stars » Mon Dec 10, 2007 3:39 am

Anything new on jide OSGi compliancy?

We are currently implementing our core OSGi-GUI-bundle based on Jide and we keep on having issues because of unresolved packages.

Have you guys done any progress on it?

I really think you should consider this OSGi service approach thing because it is bound to be used more and more and forces deliverables to be "cleaner".
stars
 
Posts: 107
Joined: Tue Jan 30, 2007 6:13 am

Postby JIDE Support » Mon Dec 10, 2007 10:23 am

Not yet. We haven't got the chance to figure out how to do it as we are using OSGi ourselves. Could one of you guys make one of the jide jars compatible with OSGi as an example and we can look at it and do it for the rest of jide jars? I assume it is just some extra information in manifest file, is it?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Postby stars » Tue Dec 11, 2007 3:16 am

Exactly, it's additional info in the MANIFEST about dependencies imported/exported/private.

The whole idea is to declare java packages in the manifest files so the OSGi framework can decide which classloader to use.

Each bundle registered in the framework has its own classloader (managed by the framework) that knows about the packages available within its bundle. The framework is thus able to decide which classloader is able to access the desired resource.

If one uses maven, one can use the maven-bundle-plugin (http://felix.apache.org/site/maven-bundle-plugin-bnd.html). With little configuration, its parses the classes and generates the manifest.

In my mind, it can't be done by hand because there's just to much error prone manual entries to add. Furthermore, one must know exactly which packages to export, which packages to import, and which package to keep private.

I admit it's a little effort to do but your deliverable would gain from it since OSGi forces dependencies to be 100% "clean".
stars
 
Posts: 107
Joined: Tue Jan 30, 2007 6:13 am

Postby JIDE Support » Thu Dec 13, 2007 11:03 pm

I noticed this tool - http://oscar-osgi.sourceforge.net/mangen/. Since you know well in this topic, can you take a look and see if it is something we can use? You can run it on jide jars and see if it puts the correct information to manifest files.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Re: OSGi Manifests for jar files

Postby mDeveloper » Tue Jan 27, 2009 6:32 am

Did this issue get resolved?
I am running into the same problem. We are using OSGI framework.
I am getting
java.lang.ClassCastException: com.jidesoft.plaf.office2003.Office2003Painter cannot be cast to com.jidesoft.plaf.basic.ThemePainter
at com.jidesoft.plaf.office2003.Office2003PopupMenuSeparatorUI.installDefaults(Unknown Source)
When I try to run my application using webstart.
here is my other post
viewtopic.php?f=10&t=6910&p=34160#p34160

thanks,
mDeveloper
 
Posts: 37
Joined: Wed Jun 04, 2008 6:01 am

Re: OSGi Manifests for jar files

Postby JIDE Support » Thu Feb 26, 2009 3:17 pm

We added Import-Package and Export-Package to manifest to all JIDE jars. As we don't have a test environment, we are not sure if it helps in OSGi use cases. If you get a chance, you can give 2.5.4 release a try and let me know if it works better.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Re: OSGi Manifests for jar files

Postby chrismhopkins » Mon Apr 20, 2009 11:13 am

JIDE Support wrote:We added Import-Package and Export-Package to manifest to all JIDE jars. As we don't have a test environment, we are not sure if it helps in OSGi use cases. If you get a chance, you can give 2.5.4 release a try and let me know if it works better.

Thanks,


Sorry...I'm just now getting around to looking into this. Did the Manifest sections get included with subsequent releases or just 2.5.4? I looked at 2.6.1 and I don't see the Import-Package/Export-Package declarations on jide-common.jar. I do see it on others but the jide-common.jar is important to add those declarations to.

Thanks,
Chris
chrismhopkins
 
Posts: 46
Joined: Tue Feb 17, 2004 10:35 am

Re: OSGi Manifests for jar files

Postby JIDE Support » Mon Apr 20, 2009 12:13 pm

We checked it and will fix it in next release.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Re: OSGi Manifests for jar files

Postby JIDE Support » Fri May 01, 2009 8:04 pm

Just so you know, this is fixed in 2.6.2 release.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Re: OSGi Manifests for jar files

Postby basszero » Tue Jun 02, 2009 5:11 am

I've been using JIDE in my own OSGi based application (uses Equinox, eclipse implemenation of OSGi). The classloader magic was a bit tricky and I was able to make things work without relying on implemenation specifc (buddy-policy) OSGi extensions. JIDE needs to be available to ALL of the bundles in the framework as well as the root classloader (for swing). I was able to do this by making JIDE jars into Fragment bundles of the System Bundle. Additionally, I had to combine all of the JIDE jars into one jar (hope I'm allowed to do this). This combined jar/bundle then exports ALL of the packages.

Here is the manifest line I needed:

Fragment-Host: system.bundle; extension:=framework

I don't think this works in Apache Felix because they haven't fully implements the OSGi R4 spec whereas Eclipse Equinox has.
basszero
 
Posts: 18
Joined: Mon Apr 18, 2005 12:39 pm

Re: OSGi Manifests for jar files

Postby JIDE Support » Wed Jun 03, 2009 8:11 am

Are you saying we just need to put this line in the manifest file?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37145
Joined: Sun Sep 14, 2003 10:49 am

Re: OSGi Manifests for jar files

Postby chrismhopkins » Fri Sep 04, 2009 6:33 am

I just downloaded the 2.7.2 release and will start looking into whether or not the jar files are OSGi compliant as-is. Would you rather have me post the results here or should I email directly with someone at JIDE Software to resolve any necessary changes?

Thanks,
Chris
chrismhopkins
 
Posts: 46
Joined: Tue Feb 17, 2004 10:35 am

Next

Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest