Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
unresolved service dependency Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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?

    Comment


    • #3
      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.

      Comment


      • #4
        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?

        Comment


        • #5
          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.

          Comment

          Working...
          X