4
respostas

Erro ao subir aplicação argentum-web no tomcat

Estou com o seguinte problema ao tentar acessar a aplicação argentum-web em um tomcat loca.

javax.servlet.ServletException: Cant instantiate class: 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: Cant instantiate class: 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)
4 respostas

Continua

Root Cause

com.thoughtworks.xstream.io.StreamException:  : The element type "meta" must be terminated by the matching end-tag "</meta>".
    com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:65)
    com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:51)
    com.thoughtworks.xstream.XStream.fromXML(XStream.java:789)
    br.com.caelum.argentum.reader.LeitorXML.carrega(LeitorXML.java:17)
    br.com.caelum.argentum.ws.ClienteWebService.getNegociacoes(ClienteWebService.java:24)
    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)
Root Cause

org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 762; The element type "meta" must be terminated by the matching end-tag "</meta>".
    com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
    com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:58)
    com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:51)
    com.thoughtworks.xstream.XStream.fromXML(XStream.java:789)
    br.com.caelum.argentum.reader.LeitorXML.carrega(LeitorXML.java:17)
    br.com.caelum.argentum.ws.ClienteWebService.getNegociacoes(ClienteWebService.java:24)
    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)
Note The full stack trace of the root cause is available in the server logs.

Parece ser um erro fora do escopo das aulas, mas como não consigo acessar a aplicação mais, mas para poder continuar com as aulas, gostaria de saber o que pode ser feito nesse caso

Hm, por algum motivo ele não tá conseguindo instanciar a classe ArgentumBean, será que não tá faltando alguma configuração lá?