Results 1 to 5 of 5

Thread: unresolved service dependency

  1. #1
    Join Date
    Aug 2009
    Posts
    3

    Default unresolved service dependency

    I'm new to the spring framework and I've inherited code from a dynamic module that is unable to create an application context for an applet because of an unsatisfied dependency. Here's what I get in the log

    [17:16:01,156][WARN][startup.DependencyWaiterApplicationContextExecutor] Timeout occured before finding service dependencies for [OsgiBundleXmlApplicationContext(bundle=client, config=osgibundle:/META-INF/spring/*.xml)]
    [17:16:01,156][ERROR][startup.DependencyWaiterApplicationContextExecutor] Unable to create application context for [client], unsatisfied dependencies: Dependency on [(objectClass=javax.swing.JApplet)] (from bean [&Applet])

    My application-context xml has this reference in it

    <osgi:reference id="Applet" interface="javax.swing.JApplet" timeout="10000">
    </osgi:reference>

    but I don't understand why this dependency would be unresolved. Any ideas?

    Thanks

  2. #2
    Join Date
    Aug 2009
    Posts
    3

    Default further investigation

    I've been doing further investigation into this issue and I've found that the javax.* classes are boot delegated and also should be exported by the system package and thus not being imported to my client bundle. What I don't understand is that if the java.swing.JApplet class is being exported by the system package and being boot delegated, why my bundle is timing out when looking for the service. Is there something I'm missing?

  3. #3
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

    your problem is not related to exported/imported packages but rather to a service dependency. The Spring application context of your bundle relies on a dependency that is not available in the service registry and that's why its bootstrapping failed when it reaches the timeout. It looks like there's no OSGi service published under the javax.swing.JApplet interface and Spring DM's extender wait until this dependency is fulfilled or until it reaches the timeout that you specified in the reference tag.

  4. #4
    Join Date
    Aug 2009
    Posts
    3

    Default

    Thanks for the clarification. As I said, I'm new to this, but I have all this inherited code. The osgi service reference to a service that doesn't exist confuses me, especially considering this server module had been up and running a few months ago. Is there a generic package that exports javax.swing classes as services that I'm missing? As far as I understand it, I otherwise need to export my own service in another module declaring

    <osgi:service id="citizenRegistry" interface="javax.swing.JApplet" />

    and make the javax.swing classes included in my build. Is it as simple as that, or do I have to make a new class for osgi to interface with it and then create a bean with the javax.swing.JApplet class?

  5. #5
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Carl, the configuration is not about classes but instances of those classes exported as services. javax.swing package & co are included in the JDK so there is no need to package it up.
    You just need to have a service matching that description (in this case, a service that is published under the interface javax.swing.Applet) available so that it can be imported by the consumer.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

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
  •