Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload protected with pac4j auth error #361

Closed
ghost opened this issue Apr 19, 2016 · 0 comments
Closed

upload protected with pac4j auth error #361

ghost opened this issue Apr 19, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 19, 2016

I've got 2 similar upload endpoints:

  • '/api/upload' - doesn't require sign in
  • '/api/protected/upload' - require sign in
    When I upload a file (POST, multipart/form-data) to the first one everything works fine - no matter if I'm signed in or not.
    Protected upload endpoint throws (after sign in of course):
POST /api/protected/upload resulted in exception   »» Err.java:61
org.jooby.Err: Server Error(500)
    at org.jooby.internal.HttpHandlerImpl.handleErr(HttpHandlerImpl.java:355) [jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.HttpHandlerImpl.handle(HttpHandlerImpl.java:293) [jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.netty.NettyHandler.channelRead0(NettyHandler.java:85) [jooby-netty-1.0.0.CR2.jar!/:1.0.0.CR2]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-transport-4.1.0.CR7.jar!/:4.1.0.CR7]
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83) [netty-transport-4.1.0.CR7.jar!/:4.1.0.CR7]
    at io.netty.channel.DefaultChannelHandlerInvoker$7.run(DefaultChannelHandlerInvoker.java:159) [netty-transport-4.1.0.CR7.jar!/:4.1.0.CR7]
    at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:56) [netty-common-4.1.0.CR7.jar!/:4.1.0.CR7]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742) [netty-common-4.1.0.CR7.jar!/:4.1.0.CR7]
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145) [netty-common-4.1.0.CR7.jar!/:4.1.0.CR7]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66]
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.ArrayStoreException: org.jooby.internal.UploadImpl
  at org.jooby.internal.pac4j.AuthContext.<init>(AuthContext.java:54)
  while locating org.jooby.internal.pac4j.AuthContext
  at org.jooby.pac4j.Auth.configure(Auth.java:692)
  while locating org.pac4j.core.context.WebContext

1 error
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1047) ~[guice-4.0.jar!/:na]
    at org.jooby.internal.RequestImpl.require(RequestImpl.java:264) ~[jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.Request.require(Request.java:625) ~[jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.pac4j.AuthFilter.handle(AuthFilter.java:76) ~[jooby-pac4j-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.Route$Handler.handle(Route.java:1539) ~[jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.pac4j.FormFilter.handle(FormFilter.java:94) ~[jooby-pac4j-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.RouteImpl.handle(RouteImpl.java:105) ~[jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.RouteChain.next(RouteChain.java:70) ~[jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.Route$Chain.next(Route.java:1947) ~[jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.HttpHandlerImpl.handle(HttpHandlerImpl.java:287) [jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    ... 8 common frames omitted
Caused by: java.lang.ArrayStoreException: org.jooby.internal.UploadImpl
    at com.google.common.collect.ImmutableList.copyIntoArray(ImmutableList.java:481) ~[guava-19.0.jar!/:na]
    at com.google.common.collect.ImmutableCollection.toArray(ImmutableCollection.java:185) ~[guava-19.0.jar!/:na]
    at org.jooby.internal.pac4j.AuthContext.lambda$params$3(AuthContext.java:142) ~[jooby-pac4j-1.0.0.CR2.jar!/:1.0.0.CR2]
    at java.util.Map.forEach(Map.java:630) ~[na:1.8.0_66]
    at org.jooby.internal.pac4j.AuthContext.params(AuthContext.java:139) ~[jooby-pac4j-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.pac4j.AuthContext.<init>(AuthContext.java:57) ~[jooby-pac4j-1.0.0.CR2.jar!/:1.0.0.CR2]
    at org.jooby.internal.pac4j.AuthContext$$FastClassByGuice$$42c851e7.newInstance(<generated>) ~[guice-4.0.jar!/:1.0.0.CR2]
    at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[guice-4.0.jar!/:na]
    at org.jooby.internal.RequestScope.lambda$scope$170(RequestScope.java:49) ~[jooby-1.0.0.CR2.jar!/:1.0.0.CR2]
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[guice-4.0.jar!/:na]
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012) ~[guice-4.0.jar!/:na]
    ... 18 common frames omitted
@jknack jknack added this to the 1.0.0.CR3 milestone Apr 19, 2016
@jknack jknack closed this as completed in 4e0d6d0 Apr 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant