Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

Erro ao acessar aplicação Leilões

Bom dia pessoa, Subi a aplicação e quando fui acessar a url http://localhost:8080/ ocorreu o erro:

HTTP ERROR: 500

javax.servlet.http.HttpServletResponse.setCharacterEncoding(Ljava/lang/String;)V

RequestURI=/ Caused by:

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.setCharacterEncoding(Ljava/lang/String;)V at br.com.caelum.vraptor.http.WebXmlEncodingHandler.setEncoding(WebXmlEncodingHandler.java:43) at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:91) at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:58) at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)

4 respostas
solução!

Olá Felipe,

Se você analizar a stacktrace vai reparar que ele acusou um NoSuchMethodError no método setCharacterEncoding(). Este método existe no java servlet somente a partir da versão 2.4. Qual versão de servlet sua aplicação está usando?

Lucas e Felipe, estou tendo o mesmo erro que o Felipe, mas nao estou conseguindo resolver. tenho varios arquivos servlet.jar no meu computador. No diretorio do apache-ant, tem a versao 2.3 (servlet-api.2.3.jar). Idem no diretorio de repositorio do Maven. No dir onde descompactei a pasta leiloes, tem a versao 2.5.6.1.1.4 E aih, como inicializamos a aplicacao via cmd ant jetty.run, quala biblioteca ele usa? Como mudar isso? Se fosse no eclipse, sei que o caminho seria via Build Path e Order, mas assim, como proceder? Obrigado

Marcelo, o Maven usa o arquivo pom.xml para baixar suas dependências. Você chegou a passar a referência para o java servlet no pom? Se sim, a versão que você está usando no Maven é a 2.4 ou posterior?

Obrigado pelo retorno. Estou rodando no Windows 7 e meu projeto eh um projeto simples Java, sem Maven, logo nao tem dependencias nem pom.xml Vc esta falando pom.xml do projeto leiloes? Simplesmente estou abrindo o Eclipse com o projeto de testes do capitulo 1 e abro uma janela de cmd, onde passo para o dir onde descompactei o projeto leiloes e executo ant jetty.run

Ele comeca a mostrar os downloads das dependencias deste projeto ate que em determinado momento da class not found em classes do pacote servlet, Abaixo a listagem. Alguma luz?

.java:142) [jetty] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) [jetty] at java.net.URLClassLoader.access$100(URLClassLoader.java:71) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [jetty] at java.security.AccessController.doPrivileged(Native Method) [jetty] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoa der.java:1393) [jetty] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader. java:1072) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppCl assLoader.java:356) [jetty] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppCl assLoader.java:341) [jetty] at com.opensymphony.module.sitemesh.util.Container.searchForClos estClass(Container.java:91) [jetty] at com.opensymphony.module.sitemesh.util.Container.get(Container .java:61) [jetty] at com.opensymphony.sitemesh.webapp.ContainerTweaks.(Conta inerTweaks.java:15) [jetty] at com.opensymphony.sitemesh.webapp.SiteMeshFilter.init(SiteMesh Filter.java:32) [jetty] at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.j ava:97) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHa ndler.java:620) [jetty] at org.mortbay.jetty.servlet.Context.startContext(Context.java:1 40) [jetty] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppCon text.java:1234) [jetty] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandl er.java:517) [jetty] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext. java:460) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo llection.java:152) [jetty] at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(Co ntextHandlerCollection.java:156) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo llection.java:152) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapp er.java:130) [jetty] at org.mortbay.jetty.Server.doStart(Server.java:222) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.ant.ServerProxyImpl.start(ServerProxyImpl.j ava:209) [jetty] at org.mortbay.jetty.ant.JettyRunTask.execute(JettyRunTask.java: 204) [jetty] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja va:292) [jetty] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jetty] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces sorImpl.java:57) [jetty] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet hodAccessorImpl.java:43) [jetty] at java.lang.reflect.Method.invoke(Method.java:606) [jetty] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU tils.java:106) [jetty] at org.apache.tools.ant.Task.perform(Task.java:348) [jetty] at org.apache.tools.ant.Target.execute(Target.java:435) [jetty] at org.apache.tools.ant.Target.performTasks(Target.java:456) [jetty] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav a:1393) [jetty] at org.apache.tools.ant.Project.executeTarget(Project.java:1364)

[jetty] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De faultExecutor.java:41) [jetty] at org.apache.tools.ant.Project.executeTargets(Project.java:1248 ) [jetty] at org.apache.tools.ant.Main.runBuild(Main.java:851) [jetty] at org.apache.tools.ant.Main.startAnt(Main.java:235) [jetty] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [jetty] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) [jetty] Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.JspFa ctory [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [jetty] at java.security.AccessController.doPrivileged(Native Method) [jetty] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] ... 55 more [jetty] 2015-02-14 01:33:16.802::WARN: failed HandlerCollection@300f2577 [jetty] java.lang.NoClassDefFoundError: javax/servlet/jsp/JspFactory [jetty] at java.lang.ClassLoader.defineClass1(Native Method) [jetty] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [jetty] at java.security.SecureClassLoader.defineClass(SecureClassLoader .java:142) [jetty] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) [jetty] at java.net.URLClassLoader.access$100(URLClassLoader.java:71) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [jetty] at java.security.AccessController.doPrivileged(Native Method) [jetty] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoa der.java:1393) [jetty] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader. java:1072) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppCl assLoader.java:356) [jetty] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppCl assLoader.java:341) [jetty] at com.opensymphony.module.sitemesh.util.Container.searchForClos estClass(Container.java:91) [jetty] at com.opensymphony.module.sitemesh.util.Container.get(Container .java:61) [jetty] at com.opensymphony.sitemesh.webapp.ContainerTweaks.(Conta inerTweaks.java:15) [jetty] at com.opensymphony.sitemesh.webapp.SiteMeshFilter.init(SiteMesh Filter.java:32) [jetty] at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.j ava:97) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHa ndler.java:620) [jetty] at org.mortbay.jetty.servlet.Context.startContext(Context.java:1 40) [jetty] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppCon text.java:1234) [jetty] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandl er.java:517) [jetty] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext. java:460) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo llection.java:152) [jetty] at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(Co ntextHandlerCollection.java:156) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo llection.java:152) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapp er.java:130) [jetty] at org.mortbay.jetty.Server.doStart(Server.java:222) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.ant.ServerProxyImpl.start(ServerProxyImpl.j ava:209) [jetty] at org.mortbay.jetty.ant.JettyRunTask.execute(JettyRunTask.java: 204) [jetty] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja va:292) [jetty] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jetty] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces sorImpl.java:57) [jetty] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet hodAccessorImpl.java:43) [jetty] at java.lang.reflect.Method.invoke(Method.java:606) [jetty] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU tils.java:106) [jetty] at org.apache.tools.ant.Task.perform(Task.java:348) [jetty] at org.apache.tools.ant.Target.execute(Target.java:435) [jetty] at org.apache.tools.ant.Target.performTasks(Target.java:456) [jetty] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav a:1393) [jetty] at org.apache.tools.ant.Project.executeTarget(Project.java:1364)

[jetty] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De faultExecutor.java:41) [jetty] at org.apache.tools.ant.Project.executeTargets(Project.java:1248 ) [jetty] at org.apache.tools.ant.Main.runBuild(Main.java:851) [jetty] at org.apache.tools.ant.Main.startAnt(Main.java:235) [jetty] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [jetty] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) [jetty] Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.JspFa ctory [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [jetty] at java.security.AccessController.doPrivileged(Native Method) [jetty] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] ... 55 more [jetty] 2015-02-14 01:33:17.359::WARN: Error starting handlers [jetty] java.lang.NoClassDefFoundError: javax/servlet/jsp/JspFactory [jetty] at java.lang.ClassLoader.defineClass1(Native Method) [jetty] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [jetty] at java.security.SecureClassLoader.defineClass(SecureClassLoader .java:142) [jetty] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) [jetty] at java.net.URLClassLoader.access$100(URLClassLoader.java:71) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [jetty] at java.security.AccessController.doPrivileged(Native Method) [jetty] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoa der.java:1393) [jetty] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader. java:1072) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppCl assLoader.java:356) [jetty] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppCl assLoader.java:341) [jetty] at com.opensymphony.module.sitemesh.util.Container.searchForClos estClass(Container.java:91) [jetty] at com.opensymphony.module.sitemesh.util.Container.get(Container .java:61) [jetty] at com.opensymphony.sitemesh.webapp.ContainerTweaks.(Conta inerTweaks.java:15) [jetty] at com.opensymphony.sitemesh.webapp.SiteMeshFilter.init(SiteMesh Filter.java:32) [jetty] at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.j ava:97) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHa ndler.java:620) [jetty] at org.mortbay.jetty.servlet.Context.startContext(Context.java:1 40) [jetty] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppCon text.java:1234) [jetty] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandl er.java:517) [jetty] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext. java:460) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo llection.java:152) [jetty] at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(Co ntextHandlerCollection.java:156) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo llection.java:152) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapp er.java:130) [jetty] at org.mortbay.jetty.Server.doStart(Server.java:222) [jetty] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc le.java:50) [jetty] at org.mortbay.jetty.ant.ServerProxyImpl.start(ServerProxyImpl.j ava:209) [jetty] at org.mortbay.jetty.ant.JettyRunTask.execute(JettyRunTask.java: 204) [jetty] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja va:292) [jetty] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jetty] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces sorImpl.java:57) [jetty] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet hodAccessorImpl.java:43) [jetty] at java.lang.reflect.Method.invoke(Method.java:606) [jetty] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU tils.java:106) [jetty] at org.apache.tools.ant.Task.perform(Task.java:348) [jetty] at org.apache.tools.ant.Target.execute(Target.java:435) [jetty] at org.apache.tools.ant.Target.performTasks(Target.java:456) [jetty] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav a:1393) [jetty] at org.apache.tools.ant.Project.executeTarget(Project.java:1364)

[jetty] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De faultExecutor.java:41) [jetty] at org.apache.tools.ant.Project.executeTargets(Project.java:1248 ) [jetty] at org.apache.tools.ant.Main.runBuild(Main.java:851) [jetty] at org.apache.tools.ant.Main.startAnt(Main.java:235) [jetty] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [jetty] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) [jetty] Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.JspFa ctory [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [jetty] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [jetty] at java.security.AccessController.doPrivileged(Native Method) [jetty] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [jetty] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jetty] ... 55 more [jetty] 2015-02-14 01:33:17.862::INFO: Started SelectChannelConnector@0.0.0 .0:8080 [jetty] Web application 'leiloes': starting scanner at interval of 3 seconds .