title: Broadleaf: error in execting custom service
body: <p>Hi I Have Created a Custom Service to Save Custom objects and using existing objects but after running the application the following error will be displaying in server console and stops the application to start</p>
  
  <p>Here is my code for custom service :</p>
  
  <pre><code>@Service  
  public class FilterExtra {
   // @Autowired
  
   @Resource(name="org.broadleafcommerce.core.search.domain.FieldImpl")
  
  FieldImpl f;
  
  // @Autowired
  
  @Resource(name="org.broadleafcommerce.core.catalog.domain.Product")
    Product p;
  
  public static String nme="";
  
  @PersistenceContext(unitName = "blPU")
  public EntityManager em;
  
  ProductAttribute pa;
  @SuppressWarnings("unchecked")
  public String check1(String name) {
       Query q=em.createQuery("SELECT * FROM PRODUCT_ATTRIBUTE WHERE NAME=:name");
       q.setParameter("name", name);
       List&lt;ProductAttribute&gt; inf0 = q.getResultList();
       System.out.println(inf0);
        if(inf0!=null)
        {
  
          f.setFriendlyName(name);
          f.setAbbreviation(name);
          f.setEntityType(p.getFieldEntityType());
          f.setPropertyName("productAttributes("+name+").value");
          em.merge(f);
        }
       if(name.equals(nme))
       {
           return name;
       }
       else {
      return null;
       }
       }
       }
  </code></pre>
  
  <p>here is my XML file:
  screen shot of xml file:</p>
  
  <p><a href="http://i.prntscr.com/wkVH2q8MQBmAeJ26BfEvZw.png" rel="nofollow noreferrer">http://i.prntscr.com/wkVH2q8MQBmAeJ26BfEvZw.png</a></p>
  
  <p>here is server log for error:</p>
  
  <blockquote>
    <p>Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
    2017-11-23 09:59:43.881 ERROR 3827 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : </p>
  </blockquote>
  
  <hr>
  
  <p>APPLICATION FAILED TO START</p>
  
  <hr>
  
  <p>Description:</p>
  
  <p>A component required a bean named 'org.broadleafcommerce.core.search.domain.FieldImpl' that could not be found.</p>
  
  <p>Action:</p>
  
  <p>Consider defining a bean named 'org.broadleafcommerce.core.search.domain.FieldImpl' in your configuration.</p>
  
  <p>Please Help me to Solve the issue</p>
  
  <p>Thanks in Advance</p>