https://bz.apache.org/bugzilla/show_bug.cgi?id=61347

            Bug ID: 61347
           Summary: Maven Java 8 Web Project does deploys in Apache
                    Tomcat.
           Product: Tomcat 8
           Version: 8.5.16
          Hardware: PC
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Examples
          Assignee: dev@tomcat.apache.org
          Reporter: bkna...@gmail.com
  Target Milestone: ----

Created attachment 35181
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35181&action=edit
Reference Project to reproduce reported error.

Hi Team,

I created a java web maven project in JDK 1.8.
It’s get successfully compiled in eclipse and but when I deployed this project
in Apache tomcat then it's showing me an error at the time of deployment.

In attached reference project you can find a Java class with name
TradeServiceImpl and this class exposed as a rest web service.
In this class I used Java 1.8 new feathers like for each loop. Line no 42.

error: 

java.lang.ArrayIndexOutOfBoundsException: 2560
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at
com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:133)
        at
com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner$1.f(FileSchemeScanner.java:86)
        at com.sun.jersey.core.util.Closing.f(Closing.java:71)
        at
com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner.scanDirectory(FileSchemeScanner.java:83)
        at
com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner.scan(FileSchemeScanner.java:71)
        at
com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:223)


My finding: When I comment the line number 42 and use old style of looping
statement in class TradeServiceImpl, then it's get deployed successfully in
Apache tomcat. At initial level I thing it may be jar versions issue but if
this is jar version issue then why Instant, Duration classes (Introduced in
Java 1.8) is executing. Please check POM.XML 

For reference, I attached sample project in this ticket. Please find it.
Dependency Requirements
JDK Version: 1.8
MAVEN: 3.5.0
Apache-Tomcat: 8.5.16
Eclipse: Eclipse Oxygen
Rest Client: Postman

Steps to reproduce this error
1) Unzip attached file.
2) Import this maven project in eclipse and resolve the dependency.
3) Then run this project.
4) Configure this project with Apache, you can attach Apache in eclipse.
5) Run this project in eclipse.   

Request Type: POST
Request URL: http://localhost:8080/RestWebProject/service/tradeService/service

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to