Spring で JAX-WS をセットアップしましたが、log4j 以外はすべて動作します。
私は公式の sping ドキュメントに従っています: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/remoting.html#remoting-web-services-jaxws-export-servlet
次のように定義されたエンドポイントを使用します。
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
@WebService(serviceName="AccountService")
public class AccountServiceEndpoint extends SpringBeanAutowiringSupport {
@Autowired
private AccountService biz;
@WebMethod
public void insertAccount(Account acc) {
biz.insertAccount(acc);
}
次に、 AccountService の impl にログを書き込もうとしました:
public class AccountServiceImpl implements AccountService {
private static Logger logger = Logger.getLogger(AccountServiceImpl.class.getName());
...
public void insertAccount(Account acc) {
logger.debug("someting... " )
....
}
}
そしてweb.xmlで
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:my_log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
my_log4j.xml をテストしましたが、構成は完全に正しく、WebApplicationContext init の前に my_log4j.xml がロードされたことを示すログも起動時に取得しました。
WebServiceがSpringを使い果たしているためか、log4jConfigLocationが機能していないのではないかと思っています
私が使用しているサーバーはWebsphere Application Server 7.0です