GlassFish v4.0.1 Daily Build Supports Java 8 Lambda : Adam Bien's Weblog

GlassFish v4.0.1 Daily Build Supports Java 8 Lambda : Adam Bien's Weblog Adam Bien's Weblog « Airhacks Q & A and... | Main | 1st Airhacks Q&A And... » GlassFish v4.0.1 Daily Build Supports Java 8 Lambda GlassFish v4.0 does not support lambdas. If you attempt to deploy a Java EE 7 application with CDI and Lambdas you are going to get the following exception: Severe: Exception while visiting WEB-INF/classes/com/airhacks/lambda/test/BackendService.class of size 1825 java.lang.ArrayIndexOutOfBoundsException: 52264 at org.objectweb.asm.ClassReader.readClass(ClassReader.java:2015) at org.objectweb.asm.ClassReader.accept(ClassReader.java:469) at org.objectweb.asm.ClassReader.accept(ClassReader.java:425) at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:362) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:165) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:127) at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:347) at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:67) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:306) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:744) The following test source was used: @RequestScoped public class BackendService { public double average() { List<Integer> numbers = new ArrayList<>(); numbers.add(42); numbers.add(21); numbers.add(7); return numbers.stream().mapToInt(i -> i).average().getAsDouble(); } } However, GlassFish v4.0.1 nightly builds builds starting with March, 20th 2014 supports Java 8 and lambdas. You can deploy Java EE 7 applications running on Java 8 with lambdas. See you at Java EE Workshops at MUC Airport ! Posted at 11:28AM Apr 03, 2014 by Adam Bien , Comments[1]  | Views/Hits: 1174 NEW workshop: HTML 5 and JavaScript Essentials , Three days in April 2017: from Java EE 7 Architectures over Microservices to Performance, Troubleshooting and Monitoring On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming. Newsletter: airhacks.news A book about rethinking Java EE Patterns Comments: Cool. Any idea on how to get support on 4.0? Anything that I can upgrade or patch myself? Posted by Yannick Majoros on April 18, 2014 at 04:05 PM CEST # Post a Comment: Name: E-Mail: URL: Notify me by email of new comments Remember Information? Your Comment: HTML Syntax: NOT allowed Number of posts: 1594 Number of comments: 5869 Yesterday's hits: 25314 Today's hits: 3135 Post reads / hour: 1340 Top posts: Java 8 FlatMap Example : Adam Bien's Weblog 91028 Java 8: Reading A File Into A String : Adam Bien's Weblog 54903 Delving into JSF Scaffolding with JPA on Netbeans 6.1 : Adam Bien's Weblog 46733 Java 7+: Writing A String To File--A One Liner : Adam Bien's Weblog 36470 Reading InputStream Into String With Java 8 : Adam Bien's Weblog 31266 Java 8: From Ordinary For-Loop To An IntStream : Adam Bien's Weblog 24593 Building Perfect Anti-Facades - Almost Without Layers, For Better Maintaina[...] 23670 JAX-RS: Returning A List Of Instances, Problem and Solution : Adam Bien's W[...] 21586 Adam Bien (Comments) 19121 Trending (last hour): How Big Is An Java Object? : Adam Bien's Weblog 2 Building An Angular 2 Application With Java EE 7 Backend : Adam Bien's Weblog 2 Eclipse vs. Netbeans or JFace (SWT) vs. Swing - the art test and experiment[...] 1 Fluent Interface Pattern with EJB 3 and JPA - a working sample : Adam Bien'[...] 1 @Inject vs. @EJB : Adam Bien's Weblog 1 about.adam-bien.com blog archives realworldpatterns.com Real World Java EE Patterns Rethinking Best Practices Order from amazon.de Order from amazon.com Online Workshops ...the last 150 posts GlassFish on Steroids, Micro, Full, Clouds and Commercial Support--An Interview With Dominika Tasarz Load Balancing Microservices With Docker, nginx and TomEE Accidental Spring Evangelism, Rolling Updates, Log Management, Exception Factories, Docker, Queuing Choices or 33rd airhacks.tv Java EE 8 News, Central Logs, Layering, Util, ExceptionFactories, JDBC in Docker, DTOs, Lombok--Or 33rd airhacks.tv TomEE 7.0.2 Full--Docker Smoke Test Slicing The Monolith--With Java EE And Docker HTTP Status Code Test Service: statustest Custom Matchers, Better Messages: JAX-RS Client Rulz v0.0.4 released New Java EE Related Docker Images Arrived: Docklands Adding And Substracting Path Instances With Java How Many "Util"(-ities) Classes Ship With Java 8? Class Naming: Suffix "Util" Is Evil Slideless Microservices From Oredev Unwrapping Exceptions With ApplicationException Microservices Simplify Exception Handling in JAX-RS Serializing POJOs Wi