3

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

Here is my code for custom service :

@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<ProductAttribute> 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;
     }
     }
     }

here is my XML file: screen shot of xml file:

http://i.prntscr.com/wkVH2q8MQBmAeJ26BfEvZw.png

here is server log for error:

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 :


APPLICATION FAILED TO START


Description:

A component required a bean named 'org.broadleafcommerce.core.search.domain.FieldImpl' that could not be found.

Action:

Consider defining a bean named 'org.broadleafcommerce.core.search.domain.FieldImpl' in your configuration.

Please Help me to Solve the issue

Thanks in Advance

Santoshraju V
  • 330
  • 1
  • 13

0 Answers0