Announcement Announcement Module
Collapse
No announcement yet.
problem in retrieving spring bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem in retrieving spring bean

    HI

    I've application context xml for my web service. for every bean class defined in application context file it has setter and getter method. all the beans are created correctly ( i verified using sops i'm able to see all values in bean) but when I send a webservice request getting null pointer exception . I debugged it and found bean instance is null. what could be the reason for this.

    I'm looking it up from Spring not creating it using the new operator. I'm getting NullPointerException at String res = qcServiceHandler.processRequest(request); in the below class

    any idea?

    --------------
    Service class:
    --------------

    private QCReportServiceHandler qcServiceHandler;

    public String qcReportServices(String request){
    try {
    System.out.println("GLASQCReportServiceImpl |request is "+request + " "+qcServiceHandler);

    String res = qcServiceHandler.processRequest(request); return res;

    } catch (Exception e) {

    e.printStackTrace();
    }
    return null;
    }

    public final QCReportServiceHandler getQcServiceHandler() {
    System.out.println(" qcServiceHandler ="+qcServiceHandler);
    return qcServiceHandler;
    }
    /**
    * @param qcServiceHandler the qcServiceHandler to set
    */
    public final void setQcServiceHandler(QCReportServiceHandler qcServiceHandler) {
    this.qcServiceHandler = qcServiceHandler;
    }



    application context xml
    -----------------------

    <bean id="glasService "
    class="service.GLASQCReportServiceImpl">
    <property name="qcServiceHandler" ref="qcReportServiceHandler"/>
    </bean>

  • #2
    Can you post the definition of the qcReportServiceHandler bean? And how is the bean initialized in the glasService initialized in your SOAP service?

    Comment


    • #3
      this is the defination of qcReportServiceHandler bean

      <bean id="qcReportServiceHandler"
      class="service.QCReportServiceHandler">
      <property name="varianceUpdateHandler" ref="varianceUpdateHandler"/>

      </bean>

      <bean id="varianceUpdateHandler"
      class="service.VarianceHandler">
      <property name="qcVarRepositoryLocation" value="d:/temp"/>
      </bean>

      I'm using XFIRE soap framework to expose web service.


      <beans >

      <service xmlns="http://xfire.codehaus.org/config/1.0">
      <name>GLASQCService</name>
      <namespace>http://abc</namespace>
      <serviceClass>service.GLASQCReportService</serviceClass>
      <implementationClass>service.GLASQCReportServiceIm pl</implementationClass>

      </service>
      </beans>


      any idea?

      Comment

      Working...
      X