title: Instantiating spring beans in dynamically created classes
body: <p>I am dynamically creating classes which contain spring beans, however the beans are not getting instantiated or initialised, leaving them as null.</p>
  
  <p>How do I make sure that a dynamically created class creates all of its spring beans properly?</p>
  
  <p>This is how I am dynamically creating the class:</p>
  
  <pre><code>Class ctransform;
  try {
      ctransform = Class.forName(strClassName);
      Method handleRequestMethod = findHandleRequestMethod(ctransform);
      if (handleRequestMethod != null) {
          return (Message&lt;?&gt;) handleRequestMethod.invoke(ctransform.newInstance(), message);
              }
      }
  </code></pre>
  
  <p>This leaves all spring bean objects within ctransform (of type strClassName) as null. </p>