简单的Restful调用导致InvocationTargetException

时间:2012-03-14 21:33:43

标签: httpclient seam resteasy

我正在使用Seam和RestEasy。 RestEasy提供httpClient类型功能等。

当页面加载时调用我的一个动作(也就是说,它是从xxx.page.xml调用的)。代码如下:

try {
  ClientRequest request = new ClientRequest(url);
  ClientResponse response = null;
  response = request.get();

} catch (Exception e) {
  e.printStackTrace();
}

永远不会到达e.printStackTrace(),但在尝试request.get()时,代码会生成以下异常:

  

请求处理期间的异常:   由javax.el.E​​LException引起的消息:“java.lang.reflect.InvocationTargetException”

org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339) org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348) org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) org.jboss.el.parser.AstValue.invoke(AstValue.java:96) org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) org.jboss.seam.core.Expressions $ 2.invoke(Expressions.java:175) org.jboss.seam.navigation.Page.preRender(Page.java:311) org.jboss.seam.navigation.Pages.preRender(Pages.java:350) org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561) org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472) org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148) org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118) com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

为什么反映API调用甚至涉及????

0 个答案:

没有答案