Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Problem with Dashboard Tutorial: Creating a Spring-powered OSGi Bundle

  1. #1

    Default Problem with Dashboard Tutorial: Creating a Spring-powered OSGi Bundle

    I am new to Spring and OSGi, and decided to go through the tutorials from the STS Dashboard. I am getting stuck though at the step "Creating a Spring-powered OSGi Bundle". In "Exploring the console output" it reads:

    "You should see a series of INFO messages as the extender bundle automatically creates the module context for the Spring-powered sample bundle."

    This never happens however. When I run the bundle I just see an osgi prompt, no messages. I suspect the tutorial refers to a previous version of Eclipse (I am using 3.5.0 on Ubuntu Linux and also the installer version under Windows XP, but both produce the same problem), because in the first step: "Setting the target platform for Spring Dynamic Modules" it reads:

    "Click the link below to open the PDE preferences page and select "Spring Dynamic Modules for OSGi Service Platforms" from the target selection box at the bottom of the panel. Click the Load target button to load the bundles in the target platform definition, and then click OK to close the dialog."

    Both of my installations do not have such a page.
    There is a "Plug-in Development" header in the Eclipse Preferences Dialog, and below this header is an item called "Target Platform" which displays a single Entry in the "Target Definitions" List Box, titled "Running Platform". I created a new entry by pressing the "Add" button, then select "Template" from the "Initialize the target definition with" radio button group, and finally select "Spring Dynamic Modules for SGGi(tm) Service Platforms 1.1.2" and press "Next". At this point there is a Tab Page titled "Locations" and in the single List Box below there is a single entry with the following location:

    ${bundle_loc:org.springframework.ide.eclipse.osgi. targetdefinition}/release/target

    I pressed finish and activated the "Spring DM Release" Target Definition by checking the Check Box, but this didn't seem to fix the issue. So I am stuck!

    Any suggestions as to how to resolve this? It seems like a configuration issue, not a bug, but the Tutorial seems broken.

    Gert

  2. #2
    Join Date
    May 2009
    Posts
    2

    Default same here

    For what it is worth, I'm having identical issues w/ the tutorial. Seems to be independent of eclipse (3.4 or 3.5) and OS (windows or rhel). I followed the same work-arounds that you did. You might check

    .metadata/.plugins/org.eclipse.pde.core/Spring Powered Bundle Sample

    for logs. There, I found a log w/ the stack dump:

    Code:
    !SESSION 2009-08-30 22:52:45.764 -----------------------------------------------
    eclipse.buildId=unknown
    java.version=1.5.0_18
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
    Command-line arguments:  -dev file:/root/workspace-sts-2.1.0.SR01/.metadata/.plugins/org.eclipse.pde.core/Spring Powered Bundle Sample/dev.properties -os linux -ws gtk -arch x86 -clean -console
    
    !ENTRY org.springframework.osgi.extender 4 0 2009-08-30 22:52:46.936
    !MESSAGE 
    !STACK 0
    org.osgi.framework.BundleException: The activator org.springframework.osgi.extender.internal.activator.ContextLoaderListener for bundle org.springframework.osgi.extender is invalid
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:146)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:980)
    	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:355)
    	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1074)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:616)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:299)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:489)
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:211)
    	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:321)
    Caused by: java.lang.StackOverflowError
    	at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:150)
    	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:289)
    	at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:69)
    	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:209)
    ...
    I'm guessing that since the extender bundle is broken, we don't see the messages the tutorial tells us that we should see.

    At this point I quit with the conclusion that the tutorial is broken for this release of STS.

  3. #3
    Join Date
    Aug 2009
    Posts
    1

    Smile Resolution

    Probably the problem appears with the SLF4J and commons plugins bundled with the Target Platform.

    I experienced the same issue as mentioned by you guys i.e. I could not see log statements.

    To avoid this, click on Run ==> Run Configurations ==> OSGI Framework. Select your Run time configuration i.e. Spring Powered Bundle Sample. Under the target platform, I selected all bundles and unchecked com.springsource.slf4j.api and com.springsource.slf4j.jcl.

    After doing this, I could see logs on the console. Posting a resolution here so that others don't spend hours on finding out root cause of the issue!

  4. #4

    Default

    Thanks max540 and sonkalp,

    Sonkalps suggestion indeed works. In fact you only need to disable one of the 2, either "com.springsource.slf4j.api" or "com.springsource.slf4j.jcl".

    The fact is however that the tutorial in the current STS packages is broken and need fixing. I think many people, like me, follow these kind of tutorials to quickly evaluate the technology, and if you come across hurdles like this, many people will regard the product as inmature.
    It is not only that the logging messags do not show, also the instructions about setting the target platform are wrong (or maybe obsolete)

    So I rewrote the the affected paragraphs:

    Setting the target platform for Spring Dynamics Modules

    Before creating the sample project for this tutorial, you need to ensure that the Eclipse Plug-in Development target platform is set to the "Spring DM Release" target.
    Click the link below to open the “Plug-in Development” page under the “Target Platform” category. You will see a listbox labeled “Target Definitions” with a single entry, “Running Platform” which is checkmarked and labeled “(Active)”. Click the “Add” button to the right to open the “Create New Target Definition” Wizard and click on the “Template” radio button. Select “Spring Dynamic Modules for OSGi (tm) Service Platforms 1.1.2” and press “Next” and finally “Finish” to accept the proposed name and location and close the wizard. A new entry "Spring DM Release" is displayed in the “Target Definitions” listbox. Click the checkbox to activate it.

    Launching your bundle in OSGi

    The Spring Powered Bundle project defines a launch configuration called "Spring Powered Bundle Sample". Open the run configurations dialog by clicking the link below and select this launch profile under the "OSGi Framework" category. Click “Select All” and de-select either “com.springsource.sl4j.api (1.5.6)” or “com.springsource.sl4j.jcl (1.5.6)”. Click on the Run button to launch the framework.
    I hereby grant and invite Springsource to use this updated text anyway they like including it in their next STS update if they wish.

    I will now continue my tutorial.

  5. #5
    Join Date
    Aug 2004
    Location
    Ottawa ON Canada
    Posts
    6

    Default

    I'm having other issues as well...Live Update samples don't work.

    In niether the OSGi tutorials or the Spring DM tutorials.

    No matter what I change, nothing happens.

    If anyone has a solution to that, I'd ;ove to see it, since that is a big selling point for this kind of dev
    \"Philosophy is questions that may never be answered, Religion is answers that may never be questioned\"

  6. #6
    Join Date
    Oct 2008
    Posts
    6

    Default

    Hi,

    I already post a thread without answer for the same problem here : http://forum.springsource.org/showthread.php?t=76021

    I tried to download STS 2.1.0 to resolved the problem and it's worse . There is about 880 modules that can be selected.

  7. #7
    Join Date
    Oct 2009
    Posts
    3

    Unhappy Gert is right...please fix the tutorials

    I spend a fair amount of time and frustration fumbling around with problems with the SDM for OSGI tutorial before I finally found this support thread. I just want to echo Gert's sentiments that it is important that you SpringSource guys keep these tutorials up to date. The tutorials ARE THE mechanism for evaluating your platform, and problems with them may lead folks to abandon your tools in haste. I almost did.

    Blat

  8. #8
    Join Date
    Aug 2006
    Posts
    7

    Exclamation

    Quote Originally Posted by Blatwurst View Post
    I just want to echo Gert's sentiments that it is important that you SpringSource guys keep these tutorials up to date. The tutorials ARE THE mechanism for evaluating your platform, and problems with them may lead folks to abandon your tools in haste. I almost did.

    Blat
    Couldn't agree more. I spent the last 4 hours in frustration with this problem, and if it hadn't been for this thread which helped me by removing the "...jcl" bundle I would already be evaluating Netbeans + Glassfish 3 instead. Actually, might do that anyway because I can't get live update to work as the tutorial explains.

    Again, the previous posters are so right when they say how important the tutorials are. SpringSource, I generally love your products, but I need to know how to use them.

    Geir

  9. #9
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    All,

    you're absolutely right: the tutorials are important and shouldn't get outdated.

    Somehow this post slipped through the cracks on my end. I just now noticed it.

    The problems are fixed now and will make it into the next version of STS.

    Sorry for everyone you experienced issues with this tutorial. Thanks to everyone you helped out.

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  10. #10
    Join Date
    Aug 2006
    Posts
    7

    Default

    Quote Originally Posted by Christian Dupuis View Post
    The problems are fixed now and will make it into the next version of STS.

    That is great news, thank you! I am very eager to try this out, but it doesn't look like you guys publish nightly/snapshot builds, right? When can I expect the next release which includes this fix?

    Thanks!

    Geir

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •