Translated message

A translation of this page exists in English.

SimpleJaxWsServiceExporter を使用して POJO エンドポイントを開発する際に SpringBeanAutowiringSupport が機能しない

Solution In Progress - Updated -

Issue

  • @WebService アノテーションが付いたクラスを JBoss EAP 5.x にデプロイし、依存性の注入をエンドポイントクラスに設定しました。
  • 注入が適切に実行されることを確認するために SpringBeanAutoWiringSupport を設定しましたが、注入は機能していないようです。
  • エンドポイントをパブリッシュするために Spring の SimpleJaxWsServiceExporter を使用しました。
  • クライアントコードを使用して基になるサービスを呼び出すと、@Autowired アノテーションが注入されたオブジェクトで NullPointerException が返されます。
  • サンプルアプリケーションコードは以下のようになります。

  • サービスインターフェイス:

package ws;
import org.springframework.stereotype.Service;

@Service("greetingService")
public interface GreetingService {
    public String sayHello();
}
  • サービス Bean
package ws;
import org.springframework.stereotype.Component;

@Component
public class Greetings {

    public String getGreeting() {
        return "Welcome to MedCloudDataStore!!!";
    }
}
  • サービスエンドポイント
package ws;

import javax.jws.WebMethod;
import javax.jws.WebService;

import org.springframework.web.context.support.SpringBeanAutowiringSupport;

@WebService(serviceName = "GreetingService")
public class GreetingServiceEndpoint extends SpringBeanAutowiringSupport implements GreetingService {

    @Autowired
    private Greetings greetings;

    @WebMethod
    public String sayHello() {
        return greetings.getGreeting();
    }
}

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.0.0
    • 6.0.1
  • JBossWS-CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content