gpt4 book ai didi

java - 为什么 lambda 表达式会抛出此错误?

转载 作者:行者123 更新时间:2023-12-01 11:34:44 36 4
gpt4 key购买 nike

当启动我的 jetty 服务器时,它会抛出此错误:

[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for br.com.governa.ponto:governa-ponto-web:war:1.0-SNAPSHOT [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: br.com.governa.admin:governa-admin-persistencia:jar -> duplicate declaration of version (?) @ line 32, column 15 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-web:jar -> duplicate declaration of version (?) @ line 147, column 15 [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] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building governa-ponto-web Maven Webapp 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> jetty-maven-plugin:9.0.5.v20130815:start (default-cli) @ governa-ponto-web >>> [INFO] [INFO] <<< jetty-maven-plugin:9.0.5.v20130815:start (default-cli) @ governa-ponto-web <<< [INFO] [INFO] --- jetty-maven-plugin:9.0.5.v20130815:start (default-cli) @ governa-ponto-web --- [INFO] Configuring Jetty for project: governa-ponto-web Maven Webapp [INFO] webAppSourceDirectory not set. Defaulting to /home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/main/webapp [INFO] Reload Mechanic: automatic [INFO] Classes = /home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/target/classes [INFO] Configuring Jetty from xml configuration file = /home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/test/resources/jetty.xml [INFO] Configuring Jetty from xml configuration file = /home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/test/resources/jetty-ssl.xml [INFO] Configuring Jetty from xml configuration file = /home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/test/resources/jetty-https.xml [INFO] Context path = /governa-ponto-web [INFO] Tmp directory = /home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/target/tmp [INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml [INFO] Web overrides = none [INFO] web.xml file = file:/home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/main/webapp/WEB-INF/web.xml [INFO] Webapp directory = /home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/main/webapp [INFO] jetty-9.0.5.v20130815 log4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. [INFO] No Transaction manager found - if your webapp requires one, please configure one. [WARNING] EXCEPTION java.lang.ArrayIndexOutOfBoundsException: 22502 at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:986) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:781) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:769) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:769) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:769) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:769) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:769) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:769) at org.eclipse.jetty.maven.plugin.MavenAnnotationConfiguration.doParse(MavenAnnotationConfiguration.java:91) at org.eclipse.jetty.maven.plugin.MavenAnnotationConfiguration.parseWebInfClasses(MavenAnnotationConfiguration.java:70) at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:122) at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:464) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1317) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:731) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:490) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:280) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:108) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:108) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:108) at org.eclipse.jetty.server.Server.start(Server.java:342) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58) at org.eclipse.jetty.server.Server.doStart(Server.java:290) at org.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:68) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:563) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:359) at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:167) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) 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:108) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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) [INFO] No Spring WebApplicationInitializer types detected on classpath [INFO] Initializing Spring root WebApplicationContext May 08, 2015 12:12:03 PM com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra 2.2.10 ( 20150205-0906 https://svn.java.net/svn/mojarra~svn/tags/2.2.10@14334) for context '/governa-ponto-web' May 08, 2015 12:12:06 PM com.sun.faces.spi.InjectionProviderFactory createInstance INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed. May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 18 at position 47 May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 0 at position 48 May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 0 at position 49 May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 0 at position 50 May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool -17 at position 51 May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 15 at position 239 May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 76 at position 242 May 08, 2015 12:12:06 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 16 at position 243 May 08, 2015 12:12:08 PM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor INFO: Monitoring file:/home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/main/webapp/WEB-INF/faces-config.xml for modifications May 08, 2015 12:12:08 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent INFO: Running on PrimeFaces 5.1 May 08, 2015 12:12:08 PM org.primefaces.extensions.application.PostConstructApplicationEventListener processEvent INFO: Running on PrimeFaces Extensions 3.0.0 [INFO] Set web app root system property: 'webapp.root' = [/home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/main/webapp] [INFO] Initializing Spring FrameworkServlet 'rest' [INFO] Started o.e.j.m.p.JettyWebAppContext@1ee27d73{/governa-ponto-web,[file:/home/vinicius/projetos/GerenciadorPonto/Fontes/trunk/governa-ponto-all/governa-ponto-web/src/main/webapp/, jar:file:/home/vinic ius/.m2/repository/com/sun/faces/jsf-impl/2.2.10/jsf-impl-2.2.10.jar!/META-INF/resources/, jar:file:/home/vinicius/.m2/repository/org/primefaces/primefaces/5.1/primefaces-5.1.jar!/META-INF/resources/, jar:f ile:/home/vinicius/.m2/repository/org/primefaces/extensions/primefaces-extensions/3.0.0/primefaces-extensions-3.0.0.jar!/META-INF/resources/, jar:file:/home/vinicius/.m2/repository/org/primefaces/themes/all -themes/1.0.10/all-themes-1.0.10.jar!/META-INF/resources/],AVAILABLE}{/governa-ponto-web.war} [WARNING] !RequestLog [INFO] Started ServerConnector@3da7772b{SSL-http/1.1}{0.0.0.0:8443} [INFO] Started Jetty Server

我的 lambda 代码:

List<HorarioDetalhe> horarioDetalheLista = new ArrayList<HorarioDetalhe>();
horarioDetalheLista.addAll(Arrays.asList(
new HorarioDetalhe(DiaDaSemanaEnum.SEG),
new HorarioDetalhe(DiaDaSemanaEnum.TER),
new HorarioDetalhe(DiaDaSemanaEnum.QUA),
new HorarioDetalhe(DiaDaSemanaEnum.QUI),
new HorarioDetalhe(DiaDaSemanaEnum.SEX),
new HorarioDetalhe(DiaDaSemanaEnum.SAB),
new HorarioDetalhe(DiaDaSemanaEnum.DOM)));
horarioDetalheList = horarioDetalheLista.stream()
.sorted(Comparator.comparing(HorarioDetalhe::getDiaSemana ))
.collect(Collectors.toList());

最佳答案

我的 Jetty 版本很旧,我已更改为 9.2.0.v20140526 并且可以使用

关于java - 为什么 lambda 表达式会抛出此错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30126975/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com