7
respostas

Não consigo abrir o projeto "argentum-web" pelo tomcat

Meu problema ocorre no curso "Integração Contínua: Maturidade e Produtividade no Desenvolvimento de Software", na aula 01 - Meu primeiro build, na atividade 07. O instrutor copia o arquivo "argentum-web.war" para a pasta webapps do tomcat e depois abre o projeto usando a url "localhost:porta/argentum-web", segui os passos do instrutor entretanto não consigo obter o mesmo resultado, recebo um erro 404 (erro1), tentei também copiar toda a pasta "argentum-web" para dentro da pasta "webapps", mas neste caso recebo um erro HTTP Status 500 – Internal Server Error (erro2). Segue os resultados de erro obtidos no browser:

Erro1

HTTP Status 404 – Not Found
Type Status Report

Message /argentum-web/

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/7.0.93

Erro 2

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Não é possível criar instância para·a classe: br.com.caelum.argentum.bean.ArgentumBean.

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Não é possível criar instância para·a classe: br.com.caelum.argentum.bean.ArgentumBean.
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

(as informações do erro são extensas ...)
7 respostas

Sandro, posta a stacktrace completa pra gente, mesmo que extensa?

Vou enviar em partes devido o limite de caracteres do fórum. Segue a stacktrace completa:

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Não é possível criar instância para·a classe: br.com.caelum.argentum.bean.ArgentumBean.

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Não é possível criar instância para·a classe: br.com.caelum.argentum.bean.ArgentumBean.
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

com.sun.faces.mgbean.ManagedBeanCreationException: Não é possível criar instância para·a classe: br.com.caelum.argentum.bean.ArgentumBean.
    com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:191)
    com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
    com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
    com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
    com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
    com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
    com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
    org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:71)
    org.apache.el.parser.AstValue.getValue(AstValue.java:161)
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
    com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
    javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
    javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
    javax.faces.component.UIOutput.getValue(UIOutput.java:174)
    javax.faces.component.UIInput.getValue(UIInput.java:291)
    org.primefaces.util.ComponentUtils.getValueToRender(ComponentUtils.java:92)
    org.primefaces.util.ComponentUtils.getValueToRender(ComponentUtils.java:56)
    org.primefaces.component.inputmask.InputMaskRenderer.encodeMarkup(InputMaskRenderer.java:99)
    org.primefaces.component.inputmask.InputMaskRenderer.encodeEnd(InputMaskRenderer.java:57)
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:89)
    org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
    org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:206)
    org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:123)
    org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:58)
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
    javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Parte 2:

Root Cause

java.lang.RuntimeException: java.net.ConnectException: Connection timed out: connect
    br.com.caelum.argentum.ws.ClienteWebService.getNegociacoes(ClienteWebService.java:26)
    br.com.caelum.argentum.bean.ArgentumBean.<init>(ArgentumBean.java:39)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    java.lang.Class.newInstance(Class.java:442)
    com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
    com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
    com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
    com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
    com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
    com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
    com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
    org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:71)
    org.apache.el.parser.AstValue.getValue(AstValue.java:161)
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
    com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
    javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
    javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
    javax.faces.component.UIOutput.getValue(UIOutput.java:174)
    javax.faces.component.UIInput.getValue(UIInput.java:291)
    org.primefaces.util.ComponentUtils.getValueToRender(ComponentUtils.java:92)
    org.primefaces.util.ComponentUtils.getValueToRender(ComponentUtils.java:56)
    org.primefaces.component.inputmask.InputMaskRenderer.encodeMarkup(InputMaskRenderer.java:99)
    org.primefaces.component.inputmask.InputMaskRenderer.encodeEnd(InputMaskRenderer.java:57)
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:89)
    org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
    org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:206)
    org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:123)
    org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:58)
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
    javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Parte 3:

Root Cause

java.net.ConnectException: Connection timed out: connect
    java.net.DualStackPlainSocketImpl.connect0(Native Method)
    java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
    java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    java.net.Socket.connect(Socket.java:589)
    java.net.Socket.connect(Socket.java:538)
    sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
    sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
    sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
    sun.net.www.http.HttpClient.New(HttpClient.java:339)
    sun.net.www.http.HttpClient.New(HttpClient.java:357)
    sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
    sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
    sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
    sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
    sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
    sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
    br.com.caelum.argentum.ws.ClienteWebService.getNegociacoes(ClienteWebService.java:23)
    br.com.caelum.argentum.bean.ArgentumBean.<init>(ArgentumBean.java:39)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    java.lang.Class.newInstance(Class.java:442)
    com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
    com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
    com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
    com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
    com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
    com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
    com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
    org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:71)

Parte 4:

org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:71)
    org.apache.el.parser.AstValue.getValue(AstValue.java:161)
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
    com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
    javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
    javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
    javax.faces.component.UIOutput.getValue(UIOutput.java:174)
    javax.faces.component.UIInput.getValue(UIInput.java:291)
    org.primefaces.util.ComponentUtils.getValueToRender(ComponentUtils.java:92)
    org.primefaces.util.ComponentUtils.getValueToRender(ComponentUtils.java:56)
    org.primefaces.component.inputmask.InputMaskRenderer.encodeMarkup(InputMaskRenderer.java:99)
    org.primefaces.component.inputmask.InputMaskRenderer.encodeEnd(InputMaskRenderer.java:57)
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:89)
    org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
    org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:206)
    org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:123)
    org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:58)
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
    javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Oi Sandro, o problema raiz esta senod a conexao que ele tenta abrir em ClienteWebService.getNegociacoes(ClienteWebService.java:23). Ha algum firewall ou restricao por ai?

Sandro, voce conseguiu resolver?

A classe br.com.caelum.argentum.ws.ClienteWebService está realmente falhando para conectar no webservice. Ou ele nao esta ligado, ou a aplicação esta sem direito de acessar a web