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

Dúvida no Ex. 1 da Aula 4 - Aplicações Web

Olá boa noite a todos,

Quando executo o comando $> mvn jetty:run

estou recebendo a seguinte mensagem de log no console:


$ mvn jetty:run
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for br.com.caelum.maven:produtos-web:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.mortbay.jetty:jetty-maven-plugin is missing. @ line 26, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building produtos-web Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> jetty-maven-plugin:8.1.16.v20140903:run (default-cli) @ produtos-web >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ produtos-web ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ produtos-web ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ produtos-web ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ricardoramos/Curso Maven Caelum/produtos-web/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ produtos-web ---
[INFO] No sources to compile
[INFO] 
[INFO] <<< jetty-maven-plugin:8.1.16.v20140903:run (default-cli) @ produtos-web <<<
[INFO] 
[INFO] --- jetty-maven-plugin:8.1.16.v20140903:run (default-cli) @ produtos-web ---
[INFO] Configuring Jetty for project: produtos-web Maven Webapp
[INFO] webAppSourceDirectory not set. Defaulting to /home/ricardoramos/Curso Maven Caelum/produtos-web/src/main/webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = /home/ricardoramos/Curso Maven Caelum/produtos-web/target/classes
[INFO] Context path = /
[INFO] Tmp directory = /home/ricardoramos/Curso Maven Caelum/produtos-web/target/tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] web.xml file = file:/home/ricardoramos/Curso%20Maven%20Caelum/produtos-web/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = /home/ricardoramos/Curso Maven Caelum/produtos-web/src/main/webapp
2015-08-28 00:59:11.394:INFO:oejs.Server:jetty-8.1.16.v20140903
2015-08-28 00:59:11.512:WARN:oejx.XmlParser:FATAL@null line:8 col:2 : org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 2; A marcação no documento após o elemento-raiz deve estar correta.
2015-08-28 00:59:11.513:WARN:oejw.WebAppContext:Failed startup of context o.m.j.p.JettyWebAppContext{/,file:/home/ricardoramos/Curso%20Maven%20Caelum/produtos-web/src/main/webapp/},file:/home/ricardoramos/Curso%20Maven%20Caelum/produtos-web/src/main/webapp/
org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 2; A marcação no documento após o elemento-raiz deve estar correta.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDriver.next(XMLDocumentScannerImpl.java:1397)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)
    at org.eclipse.jetty.xml.XmlParser.parse(XmlParser.java:246)
    at org.eclipse.jetty.webapp.Descriptor.parse(Descriptor.java:65)
    at org.eclipse.jetty.webapp.WebDescriptor.parse(WebDescriptor.java:148)
    at org.eclipse.jetty.webapp.MetaData.setWebXml(MetaData.java:170)
    at org.eclipse.jetty.webapp.WebXmlConfiguration.preConfigure(WebXmlConfiguration.java:61)
    at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:457)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:493)
    at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:298)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:520)
    at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:365)
    at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:523)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
2015-08-28 00:59:11.517:WARN:oejsh.RequestLogHandler:!RequestLog
2015-08-28 00:59:11.536:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server

E ao acessar a URL: http://localhost:8080/ estou recebendo o status HTTP 503:

HTTP ERROR: 503

Problem accessing /. Reason:

    Service Unavailable

Powered by Jetty://

Alguém já passou por isso também? Será que alguém poderia me dar uma ajuda?

Abraços!

2 respostas
solução!

Parece ter algo estranho em algum dos arquivos de configuração xml. dá uma olhada no seu web.xml, se não achar nada posta ele aqui.

Olá Mario, muito obrigado pela ajuda e consegui resolver o problema, realmente estava com um problema no arquivo web.xml.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software