標準のロガー初期化をインジェクションに置き換えようとしています
1位
ステートレスBean/Webサービスで溶接溶接ロギングを使用しようとしていました
@Stateless
@WebService
public class EchoSSL {
@Inject
private Logger log;
public EchoSSL() {
}
public String echo(String msg) {
log.debug("Log test");
return "Echoing: " + msg;
}
}
しかし、それは私には機能しません..私はjava.lang.reflect.InvocationTargetExceptionを取得します
javax.servlet.ServletException:java.lang.reflect.InvocationTargetException at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:326)at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:102) )org.glassfish.webservices.EjbWebServiceServlet.service(EjbWebServiceServlet.java:110)at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)at com.sun.grizzly.http.servlet.FilterChainImpl.doFilter( FilterChainImpl.java:195)at com.sun.grizzly.http.servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.java:139)at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:376)at com com.sun.grizzly.tcp.http11.GrizzlyAdapterの.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:329)。service(GrizzlyAdapter.java:166)at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java: 245)com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)at com.sun.grizzly.http.ProcessorTask .process(ProcessorTask.java:954)at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)atcom.sun。 grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)atcom.sun.grizzly.http.HttpProtocolChain。execute(HttpProtocolChain.java:76)at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)at com.sun.grizzly.ContextTask .run(ContextTask.java:69)at com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:330)at com.sun.grizzly.util.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:309 )at java.lang.Thread.run(Thread.java:619)原因:java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java :39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:297)... 24 more原因:javax.xml.ws.soap.SOAPFaultException:javax.ejb.EJBException at com.sun.xml .ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189)at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)at com.sun.xml.ws.client.sei.SyncMethodHandler .invoke(SyncMethodHandler.java:119)at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub .java:140)at $ Proxy484.sayHello(Unknown Source)... 29 more原因:javax.ejb.EJBException at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5070)at com.sun .ejb.containers.BaseContainer。completeNewTx(BaseContainer.java:4968)at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4756)at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:200)at$Proxy464。 sayHello(Unknown Source)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava。 lang.reflect.Method.invoke(Method.java:597)at org.glassfish.webservices.InvokerImpl.invoke(InvokerImpl.java:78)at org.glassfish.webservices.EjbInvokerImpl.invoke(EjbInvokerImpl.java:78)at com com.sun.xml.ws.server.sei.EndpointMethodHandlerの.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)。comb(EndpointMethodHandler.java:257)at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:95)at com.sun.xml.ws.api.pipe.Fiber .__ doRun(Fiber。 java:629)at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573) com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:112)at org .glassfish.webservices.MonitoringPipe.process(MonitoringPipe.java:138)at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)at com.sun.xml.ws.api .pipe.Fiber .__ doRun(Fiber.java:629)at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)at com.sun.xml.ws.api.pipe.Fiber .doRun(Fiber.java:573)at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber。java:470)at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:112)at com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java: 306)com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)at com.sun.xml.ws.api.pipe.Fiber .__ doRun(Fiber.java:629) com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)at com.sun .xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:112)at com.sun.enterprise .security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:195)at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:127)atcom.sun.xml.ws.api。pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)at com.sun.xml.ws.api.pipe.Fiber .__ doRun(Fiber.java:629)atcom.sun.xml.ws.api.pipe。 fiber._doRun(Fiber.java:588)at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)at com.sun.xml.ws.api.pipe.Fiber.runSync( Fiber.java:470)at com.sun.xml.ws.server.WSEndpointImpl $ 2.process(WSEndpointImpl.java:295)at com.sun.xml.ws.transport.http.HttpAdapter $ HttpToolkit.handle(HttpAdapter.java :519)com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:288)at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143) )org.glassfish.webservices.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:116)at org.glassfish.webservices.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)atorg.glassfish。webservices.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:196)at org.glassfish.webservices.EjbWebServiceServlet.service(EjbWebServiceServlet.java:127)... 22 more原因:java.lang.NullPointerException at ua.eset.inferno.heresy .ws.security.Hello.sayHello(Hello.java:33)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)atorg.glassfish。 com.sun.ejb.containers.BaseContainerのejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)。com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)at com.sun .ejb.EjbInvocation.proceed(EjbInvocation.java:567)at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy .java:139)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava。 com.sun.ejb.containers.interceptorsのlang.reflect.Method.invoke(Method.java:597)。AroundInvokeInterceptor.intercept(InterceptorManager.java:858)at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java: 367)com.sun.ejb.containers.BaseContainer .__ intercept(BaseContainer.java:5215)at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)at com.sun.ejb.containers.WebServiceInvocationHandler .invoke(WebServiceInvocationHandler.java:188)...66詳細__intercept(BaseContainer.java:5215)at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:188)... 66もっと__intercept(BaseContainer.java:5215)at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:188)... 66もっと
何が欠けていますか?
2位
これを参照しているこのチュートリアルを試すよりも-カスタムインジェクション
しかし、それも役に立ちません。
Mavenの依存関係-
<dependencies>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-logger</artifactId>
<version>1.0.0-CR2</version>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
<version>1.0.0.Alpha1</version>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-api</artifactId>
<version>1.0-CR2</version>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>1.0.1-CR2</version>
</dependency>
</dependencies>
Q1:ejb / Webサービスでの溶接ロガー注入のルールは何ですか?
Q2:wsdl / EJB / WebServiceの問題でしょうか?