jooby-project / jooby

The modular web framework for Java and Kotlin
https://jooby.io
Apache License 2.0
1.71k stars 197 forks source link

Exception which could not ever happen happens on Java 10 #1054

Closed asm0dey closed 6 years ago

asm0dey commented 6 years ago

On simple class like this:

public class App extends Jooby {

    {
        use(new Jackson());
        use(AccountController.class);
    }

    public static void main(final String[] args) {
        run(App::new, args);
    }

}

I'm getting exception with following stacktrace:

java.lang.IllegalStateException: Can't read class: package.AccountController
    at org.jooby.internal.RouteMetadata.extractMetadata(RouteMetadata.java:273)
    at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:146)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4154)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153)
    at org.jooby.internal.RouteMetadata.lambda$md$0(RouteMetadata.java:259)
    at org.jooby.funzy.Throwing.fn(Throwing.java:2423)
    at org.jooby.funzy.Throwing.access$400(Throwing.java:39)
    at org.jooby.funzy.Throwing$Supplier.get(Throwing.java:145)
    at org.jooby.funzy.Try.apply(Try.java:691)
    at org.jooby.internal.RouteMetadata.md(RouteMetadata.java:259)
    at org.jooby.internal.RouteMetadata.startAt(RouteMetadata.java:254)
    at org.jooby.internal.mvc.MvcRoutes.lambda$routes$2(MvcRoutes.java:287)
    at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
    at java.base/java.util.TimSort.sort(TimSort.java:220)
    at java.base/java.util.Arrays.sort(Arrays.java:1514)
    at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
    at org.jooby.internal.mvc.MvcRoutes.routes(MvcRoutes.java:291)
    at org.jooby.Jooby.lambda$normalize$39(Jooby.java:2726)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1378)
    at org.jooby.Jooby.normalize(Jooby.java:2716)
    at org.jooby.Jooby.bootstrap(Jooby.java:2783)
    at org.jooby.Jooby.start(Jooby.java:2182)
    at org.jooby.Jooby.start(Jooby.java:2163)
    at org.jooby.Jooby.run(Jooby.java:2094)
    at revolut.App.main(App.java:24)
Caused by: java.lang.IllegalArgumentException: null
    at org.jooby.internal.asm.ClassReader.<init>(Unknown Source)
    at org.jooby.internal.asm.ClassReader.<init>(Unknown Source)
    at org.jooby.internal.asm.ClassReader.<init>(Unknown Source)
    at org.jooby.internal.RouteMetadata.extractMetadata(RouteMetadata.java:269)
    ... 36 common frames omitted
~/transfers » java -version
java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)
TLaue commented 6 years ago

I have the same issue when migrating our app from Java 8 to 9.

java.lang.IllegalStateException: Can't read class: package.ProductResources at org.jooby.internal.RouteMetadata.extractMetadata(RouteMetadata.java:273) at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:146) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) at com.google.common.cache.LocalCache.get(LocalCache.java:4147) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146) at org.jooby.internal.RouteMetadata.lambda$md$0(RouteMetadata.java:259) at org.jooby.funzy.Throwing.fn(Throwing.java:2423) at org.jooby.funzy.Throwing.access$400(Throwing.java:39) at org.jooby.funzy.Throwing$Supplier.get(Throwing.java:145) at org.jooby.funzy.Try.apply(Try.java:691) at org.jooby.internal.RouteMetadata.md(RouteMetadata.java:259) at org.jooby.internal.RouteMetadata.startAt(RouteMetadata.java:254) at org.jooby.internal.mvc.MvcRoutes.lambda$routes$2(MvcRoutes.java:287) at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.base/java.util.TimSort.sort(TimSort.java:220) at java.base/java.util.Arrays.sort(Arrays.java:1514) at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:348) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:430) at org.jooby.internal.mvc.MvcRoutes.routes(MvcRoutes.java:291) at org.jooby.Jooby.lambda$normalize$39(Jooby.java:2726) at java.base/java.util.ArrayList.forEach(ArrayList.java:1380) at org.jooby.Jooby.normalize(Jooby.java:2716) at org.jooby.Jooby.bootstrap(Jooby.java:2783) at org.jooby.Jooby.start(Jooby.java:2182) at org.jooby.Jooby.start(Jooby.java:2163) at org.jooby.Jooby.run(Jooby.java:2094) at de.avat.pilot.Selene.main(Selene.java:477) Caused by: java.lang.IllegalArgumentException at org.jooby.internal.asm.ClassReader.(Unknown Source) at org.jooby.internal.asm.ClassReader.(Unknown Source) at org.jooby.internal.asm.ClassReader.(Unknown Source) at org.jooby.internal.RouteMetadata.extractMetadata(RouteMetadata.java:269) ... 36 more