2015-11-06 4 views
7

लोड नहीं किया जा सका मैंने कुछ कोड लिखा है जिसमें मैं एक और वेब सेवा का उपभोग कर रहा हूं और वेबस्वायर टेम्पलेट का उपयोग कर उस webservice से अनुरोध भेज रहा हूं। लेकिन जब मैं कोड ट्रिगर करता हूं तो मुझे निम्न अपवाद मिल रहा है। मैंने स्प्रिंग कोर & की lib की जांच की है सब कुछ ठीक लगता है लेकिन यह नहीं पता कि यह सेवा इस तरह के अपवाद को क्यों फेंक रही है।'क्लास पथ संसाधन [संगठन/springframework/ws/क्लाइंट/कोर/WebServiceTemplate.properties]

ApplicationContxt:

<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"> 
    <property name="soapVersion"> 
     <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12" /> 
    </property> 
</bean> 

<bean id="manageContactService" class="com.canaldigital.tsi.managecontacts.serviceprovider.ManageContactService"> 
    <property name="manageContactsWSTemplate" ref="manageContactsWSTemplate" /> 
</bean> 

    <bean name="manageContactsWSTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"> 
    <constructor-arg ref="messageFactory" /> 

    <property name="defaultUri" value="http://tsi-vip-abc.com:7111/abc_v2/ProxyService?WSDL" /> 

    <property name="marshaller" ref="manageContactMarshaller" /> 
    <property name="unmarshaller" ref="manageContactUnmarshaller" /> 

</bean> 

सेवा:

public class ManageContactService extends WebServiceGatewaySupport { 

     private WebServiceTemplate manageContactsWSTemplate;   
     public WebServiceTemplate getManageContactsWSTemplate() { 
    return manageContactsWSTemplate; 
} 
public void setManageContactsWSTemplate(WebServiceTemplate manageContactsWSTemplate) { 
    this.manageContactsWSTemplate = manageContactsWSTemplate; 
} 
    public void sendNPSReminder(String phoneNum, String customerNum, String countryCode) { 


      SendNPSReminderRequestType sendNPSReminderRequest = new SendNPSReminderRequestType(); 
      Contact contact = new Contact();    
      sendNPSReminderRequest.setCountryCode(CountryCodeCV.NO); 
      contact.setPhone(new BigInteger(phoneNum));    
      sendNPSReminderRequest.setContact(contact); 
      sendNPSReminderRequest.setCustomerNumber(customerNum); 

      try{ 

       JAXBElement<SendNPSReminderResponseType> response = (JAXBElement<SendNPSReminderResponseType>) manageContactsWSTemplate.marshalSendAndReceive(sendNPSReminderRequest); 
      }catch (Exception e) { 

       e.printStackTrace(); 
      } 

    } 

    } 

StackTrace:

java.lang.IllegalStateException: Could not load 'class path resource [org/springframework/ws/client/core/WebServiceTemplate.properties]': class path resource [org/springframework/ws/client/ 
ore/WebServiceTemplate.properties] cannot be opened because it does not exist 
     at org.springframework.ws.support.DefaultStrategiesHelper.<init>(DefaultStrategiesHelper.java:78) 
     at org.springframework.ws.support.DefaultStrategiesHelper.<init>(DefaultStrategiesHelper.java:88) 
     at org.springframework.ws.client.core.WebServiceTemplate.initDefaultStrategies(WebServiceTemplate.java:338) 
     at org.springframework.ws.client.core.WebServiceTemplate.<init>(WebServiceTemplate.java:130) 
     at org.springframework.ws.client.core.support.WebServiceGatewaySupport.<init>(WebServiceGatewaySupport.java:65) 
     at com.canaldigital.tsi.managecontacts.serviceprovider.ManageContactService.<init>(ManageContactService.java:24) 
     at com.canaldigital.tsi.managecontacts.utils.CDCommonTasksJob.launch(CDCommonTasksJob.java:97) 
     at sun.reflect.GeneratedMethodAccessor2044.invoke(Unknown Source) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
     at java.lang.reflect.Method.invoke(Method.java:597) 
     at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:64) 
     at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) 
     at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:82) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:440) 
     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) 
     at java.lang.Thread.run(Thread.java:662) 
+0

क्या आपने अपनी बीन घोषणा में सभी वर्तनी को दोबारा जांच लिया है? मुझे यकीन नहीं है कि यह पूरी घोषणा तोड़ देगा, लेकिन आपको 'unmarshaller' संपत्ति ('marshaller' की तुलना में) में एक वर्तनी गलती हो सकती है। – Gorbles

+0

मुझे वर्तनी गलती init नहीं मिल सका। क्या आप उस गलती का स्पष्ट रूप से उल्लेख कर सकते हैं? – user3548196

+0

\t user3548196

उत्तर

4

कि संसाधन, spring-ws-core निर्भरता का हिस्सा है तो यह बॉक्स से बाहर काम करना चाहिए, लेकिन, मुझे लगता है कि आप डब्लूएलएस 11 का उपयोग कर रहे हैं (जैसा कि आपने इसे टैग किया है)। इसलिए, यह संभव है कि आप वसंत निर्भरता का उपयोग नहीं कर रहे हैं बल्कि इसके बजाय वसंत वेबलॉगिक में पैक किया गया है।

निम्नलिखित के रूप में इस का उपयोग कर WEB-INF/weblogic.xml वर्णनकर्ता से बचने की कोशिश:

<?xml version="1.0" encoding="UTF-8"?> 
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"> 

    <container-descriptor> 
     <prefer-application-packages> 
      <package-name>org.springframework.*</package-name> 
     </prefer-application-packages> 

     <prefer-application-resources> 
      <resource-name>org.springframework.*</resource-name> 
     </prefer-application-resources> 
    </container-descriptor> 

</weblogic-web-app> 
इस विन्यास आप WLS org.springframework.* के लिए अपने संकुल और संसाधनों का उपयोग करने के लिए कह रहे हैं

उम्मीद है कि यह मदद करता है!

+0

यह अब मेरी weblogic.xml है: : Weblogic-वेब-एप्लीकेशन \t xmlns: WLS = "http: // xmlns.oracle.com/weblogic/weblogic-web-app "> \t \t \t सच \t मुझे यह त्रुटि मिल रही है कि यह संपत्ति सत्य नहीं हो सकती है। – user3548196

+0

@ user3548196 आप 'प्राथमिक-अनुप्रयोग-पैकेज' और/या 'प्राथमिक-अनुप्रयोग-संसाधन' के संयोजन में 'प्राथमिक-वेब-इंफ-क्लास' का उपयोग नहीं कर सकते हैं। इसे देखें: https://docs.oracle.com/cd/E24329_01/web.1211/e21049/weblogic_xml.htm#WBAPP659 – malaguna

संबंधित मुद्दे