title: Is there a good way to diagnose spring bean/service creation problem?
body: <p>My project uses spring and spring-dm for bean/service configuration. When I try to import an old project which also use spring for DI, bean will not be created. </p>
  
  <p>An example to make clear,</p>
  
  <p>I first define a url-alias in spring-appContext.xml</p>
  
  <pre><code>&lt;bean name="xxxx" class="XRegistry" init-method="init"&gt;
      &lt;property name="webRoot" value="/WebContent"&gt;&lt;/property&gt;
      &lt;property name="alias" value="/test"&gt;&lt;/property&gt;
      &lt;property name="cAliasPattern" value="/test/*.do" /&gt;
      &lt;property name="conConfigFile" value="ddd.xml"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>in ddd.xml, I define some controller bean with url like /test/abc.do</p>
  
  <p>No errors occur when launching as OSGi framework in eclipse.
  But when I try to access the URL(/test/abc.do)，"<strong>Unknown OSGi URL</strong>:" is met.</p>
  
  <p>The problem really confuses me is I am not clear where to start. My bundle has depended on spring bundles and have appContext.xml and dispatcher.xml. Just a normal spring usage scenario. </p>
  
  <p>As spring looks like black box to me, I can only try some other possible reasons I can think, but haven't fixed it till now. Is somebody know how to moniter the spring startup process or helpful logs?</p>
  
  <p>Thanks. </p>
  
  <p><strong>Edit</strong> when using spring-dm, you need to create a new fragment including log4j.properties to enable logging. This can help u to track spring startuping error.</p>
  
  <p>As I explain in the 1st answer, the root cause is found, two choice, </p>
  
  <ol>
  <li>For those bundles exist in both workspace and target platform, increase the bundle's version in current workspace. When error happens , you should also look into the dependency bundles</li>
  <li>Remove the high version bundles in target platform.</li>
  </ol>