title: Error creating bean with name 'myServiceCustomerOffer' defined in ServletContext resource [/WEB-INF/beans.xml]
body: <p>I have defined my <code>bean.xml</code> as below for Web Service</p>
  
  <pre><code>&lt;jaxws:endpoint id="serviceCustomerOffer" implementor="#myServiceCustomerOffer"
          implementorClass="com.abc.mime.ws.manage.customeroffer.ManageCustomerOfferImpl"
          address="/getCustomerOffer" /&gt;
  
      &lt;bean id="myServiceCustomerOffer" name="myServiceCustomerOfferName" class="com.abcd.mime.ws.manage.customeroffer.ManageCustomerOfferImpl" &gt;
          &lt;constructor-arg index="0" ref="CustomerOfferFacade" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="CustomerOfferFacade" name="CustomerOfferFacade"
          class="com.abc.mime.ws.facade.customeroffer.CustomerOfferFacadeImpl"&gt;
          &lt;constructor-arg index="0" ref="customerOfferDAO" /&gt;
          &lt;constructor-arg index="1" ref="generalDomainSql" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="customerOfferDAO" name="customerOfferDAOName"
          class="com.abc.mime.ws.dao.bscs.sql.customeroffer.CustomerOfferDAOImpl"&gt;
  
      &lt;/bean&gt;
            &lt;bean id="generalDomainSql" name="generalDomainSqlName"
          class="com.abcd.mime.ws.dao.bscs.sql.generaldomain.GeneralDomainDAOImpl"&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>I am getting following error while deployment on tomcat 6 server. all the classes are defined in proper structure.</p>
  
  <pre><code>13/Feb/2014 05:08:10,423 [http-8090-1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceCustomerOffer': Cannot resolve reference to bean 'myServiceCustomerOffer' while setting constructor argument with index 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myServiceCustomerOffer' defined in ServletContext resource [/WEB-INF/beans.xml]: 1 constructor arguments specified but no matching constructor found in bean 'myServiceCustomerOffer' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
  Caused by: 
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myServiceCustomerOffer' defined in ServletContext resource [/WEB-INF/beans.xml]: 1 constructor arguments specified but no matching constructor found in bean 'myServiceCustomerOffer' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
      at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
  </code></pre>
  
  <p>Here is <code>ManageCustomerOfferImpl.java</code> which is used in my code. This is also mapped in wsdl file.</p>
  
  <pre><code>package com.abcd.mime.ws.manage.customeroffer;
  import java.rmi.RemoteException;
  import java.util.Date;
  
  import javax.jws.WebService;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import com.abcd.mime.ws.manage.customeroffer.ManageCustomerOffer;
  
  @WebService(endpointInterface = "com.abcd.mime.ws.manage.customeroffer.ManageCustomerOffer")
  public class ManageCustomerOfferImpl implements ManageCustomerOffer{
  
  
  
          private CustomerOfferFacade customerOfferFacade; 
  
          private Log logger = LogFactory
                  .getLog(com.abcd.mime.ws.manage.customeroffer.ManageCustomerOfferImpl.class);
  
  public ManageCustomerOfferImpl( CustomerOfferFacade _customerOffer) { this.customerOfferFacade = _customerOffer; }
  
          @Override
          public CustomerOfferResponse getCustomerOffer(CustomerOfferRequest customerOfferRequest) throws CustomerOfferFault {
  
              logger.debug("ManageCustomerOfferImpl - getCustomerOffer: Received from Consumer MSISDN = ["+ customerOfferRequest.getMSISDN()+"]");
              // TODO Auto-generated method stub
  
              ustomerOfferResponse customerOfferResponse = customerOfferFacade.getCustomerOffer(customerOfferRequest);
  
  
              logger.debug("ManageCustomerOfferImpl - getCustomerOffer: Sending Response back to Consumer =&gt;&gt;  "+ customerOfferResponse);
              return customerOfferResponse;
          }
  
      }
  </code></pre>
  
  <p>It was working earlier but while making some corrections it stopped working</p>
  
  <pre><code>Error13/Feb/2014 09:22:06,625 [http-8090-2] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceCustomerOffer': Invocation of init method failed; nested exception is java.lang.StackOverflowError
  Caused by: 
  java.lang.StackOverflowError
      at java.lang.ref.SoftReference.get(SoftReference.java:93)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2285)
      at java.lang.Class.getDeclaredFields(Class.java:1743)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:298)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:227)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:179)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:172)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:301)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:227)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:179)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:172)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:301)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:227)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:179)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:172)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:301)
      Feb 13, 2014 9:22:06 AM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceCustomerOffer': Invocation of init method failed; nested exception is java.lang.StackOverflowError
  Caused by: java.lang.StackOverflowError
      at java.lang.ref.SoftReference.get(SoftReference.java:93)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2285)
      at java.lang.Class.getDeclaredFields(Class.java:1743)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:298)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:227)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:179)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:172)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:301)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:227)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:179)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:172)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:301)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:227)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:179)
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:172)
      at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:301)
  </code></pre>