dm Server
  1. dm Server
  2. DMS-47

missing package import errors not reported when using component-auto-scan

    Details

    • Type: Defect Defect
    • Status: Done Done
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: Sprint 4, 2.0.0.M2, 2.0.0.RELEASE
    • Component/s: None
    • Labels:
      None
    • Environment:

      Eclipse Ganymede on Ubuntu 8.04 + latest STS nightlies.

    • Story Points:
      2

      Description

      Create a bundle projet A where applicationContext.xml declares :

      • component auto scan on a package X
      • a dataSource (for a MySQL DB for example)

      In the package X, I create a class Dummy annotated by @Repository having a dependency on a DataSource (via @Resource).

      In the manifest, I import the Spring library and the mySQL Driver package, but not the javax.sql package.
      I also export the Dummy class as an OSGi service.

      I then create a second bundle B with a web personality and a controller where the Dummy service is injected into a controller (to force the publishing of the service).

      When trying to deploy the par file composed of A and B bundles, I get the following S2AP startup log:

      [2008-07-03 01:26:03.491] main <SPKB0001I> Platform starting.
      [2008-07-03 01:26:05.914] main <SPKE0000I> Boot subsystems installed.
      [2008-07-03 01:26:06.511] main <SPKE0001I> Base subsystems installed.
      [2008-07-03 01:26:07.169] platform-dm-1 <SPPM0000I> Installing profile 'web'.
      [2008-07-03 01:26:07.568] platform-dm-7 <SPSC0001I> Creating HTTP/1.1 connector with scheme http on port 7070.
      [2008-07-03 01:26:07.611] platform-dm-7 <SPSC0001I> Creating HTTP/1.1 connector with scheme https on port 7443.
      [2008-07-03 01:26:07.616] platform-dm-7 <SPSC0001I> Creating AJP/1.3 connector with scheme http on port 7009.
      [2008-07-03 01:26:07.691] platform-dm-7 <SPSC0000I> Starting ServletContainer.
      [2008-07-03 01:26:07.713] platform-dm-1 <SPPM0001I> Installed profile 'web'.
      [2008-07-03 01:26:08.174] platform-dm-14 <SPPM0002I> Platform open for business with profile 'web'.
      [2008-07-03 01:26:08.356] Deployer Recovery <SPSC1000I> Creating web application '/'.
      [2008-07-03 01:26:08.442] async-delivery-thread-1 <SPSC1001I> Starting web application '/'.
      [2008-07-03 01:26:08.675] Deployer Recovery <SPDE0010I> Deployment of 'platform.admin.splash-1.0.0.beta8.war' version '0' completed.
      [2008-07-03 01:26:09.030] Deployer Recovery <SPSC1000I> Creating web application '/admin'.
      [2008-07-03 01:26:09.101] async-delivery-thread-1 <SPSC1001I> Starting web application '/admin'.
      [2008-07-03 01:26:09.503] Deployer Recovery <SPDE0010I> Deployment of 'platform.admin.web-1.0.0.beta8.war' version '0' completed.
      [2008-07-03 01:26:10.284] Deployer Recovery <SPSC1000I> Creating web application '/services'.
      [2008-07-03 01:26:10.598] async-delivery-thread-1 <SPSC1001I> Starting web application '/services'.
      [2008-07-03 01:26:10.760] Deployer Recovery <SPDE0010I> Deployment of 'djo.q2.proto' version '1' completed.
      [2008-07-03 01:26:10.766] fs-watcher <SPDE0048I> Processing 'INITIAL' event for file 'platform.admin.splash-1.0.0.beta8.war'.
      [2008-07-03 01:26:10.770] fs-watcher <SPDE0048I> Processing 'INITIAL' event for file 'platform.admin.web-1.0.0.beta8.war'.
      [2008-07-03 01:26:32.650] platform-tomcat-thread-1 <SPSC1000I> Creating web application '/dummy'.
      [2008-07-03 01:26:33.858] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:26:35.852] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:26:39.853] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:26:47.853] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:27:02.714] async-delivery-thread-1 <SPWE1001E> Failed to create web application '/dummy': the associated web bundle 'djo.bug.sample-1-djo.bug.sample.consumer' failed to publish its ApplicationContext within 30 seconds.
      [2008-07-03 01:27:02.723] platform-tomcat-thread-1 <SPDE0040E> Deployment of module 'file [/home/djo/java/servers/springsource-ap-1.0.0.beta8/work/com.springsource.platform.deployer/Module/djo.bug.sample-1/djo.bug.sample.producer-1.0.0.jar]' took too long and timed out.
      [2008-07-03 01:27:02.848] platform-tomcat-thread-1 <SPDE0011E> Deployment failed.
      [2008-07-03 01:27:03.853] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:27:35.853] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:28:35.853] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:29:35.853] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:30:35.853] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:31:32.862] Timer-0 <SPDE0020E> Application context creation failure for bundle 'djo.bug.sample-1-djo.bug.sample.consumer'.
      org.springframework.context.ApplicationContextException: Application context initializition for 'djo.bug.sample-1-djo.bug.sample.consumer' has timed out
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:427)
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:114)
      at java.util.TimerThread.mainLoop(Timer.java:534)
      at java.util.TimerThread.run(Timer.java:484)

      [2008-07-03 01:31:35.854] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:32:35.854] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:33:35.854] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.
      [2008-07-03 01:34:35.854] service-monitor-thread-1 <SPCC0001W> Mandatory reference '&dummy' waiting for service with filter '(&(objectClass=djo.bug.sample.producer.api.IDummy)(com.springsource.platform.app.name=djo.bug.sample-1))'.

      No mention anywhere to a missing package import

      But when I disable component auto scan and proceed via full XML instead, I get a much better NCDFE :

      Caused by: java.lang.NoClassDefFoundError: javax/sql/DataSource
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2444)

      Anyway, I'll attach a sample project to reproduce this.

        Activity

        Andy Wilkinson logged work - 05/May/09 6:04 AM - Restricted to
        • Time Spent:
          20m
           
          <No comment>
        Andy Wilkinson logged work - 05/May/09 6:04 AM - Restricted to
        • Time Spent:
          1m
           
          GREENHOPPER AUTO-RESET

          People

          • Assignee:
            Andy Wilkinson
            Reporter:
            Jawher Moussa
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date:

              Time Tracking

              Estimated:
              Original Estimate - 4h
              4h
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 0.35h Time Not Required
              0.35h