Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
@Autowire が挿入された XXXMapper.java を含む ServiceXX.java があります。ServiceXXX.java は Web サービス @WebService(endpointInterface ="com.xxx...") です。Java クライアントで Web サービスを呼び出すと、すべてが正しく接続されているように見えますが、SoapClient で Web サービスを呼び出すと、XXXMapper は null になります。なんで?:(
として宣言されたクラスが@WebServiceコンテナーの Web サービス スタック (Spring ではない) によってインスタンス化されているため、コンテキストが自動配線のためにそれを認識していないことが原因である可能性があります。これを解決するには、サービス クラスを extends することができますSpringBeanAutowiringSupport。次に、コンテナによって初期化された後、スプリングはそれを自動配線します。
@WebService
SpringBeanAutowiringSupport
ちなみに、そのBeanはspring-webモジュールにあります。
spring-web