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

bean parser fails on empty parameters #550

Closed
jknack opened this issue Nov 9, 2016 · 0 comments
Closed

bean parser fails on empty parameters #550

jknack opened this issue Nov 9, 2016 · 0 comments
Labels
Milestone

Comments

@jknack
Copy link
Member

jknack commented Nov 9, 2016

Given

public class Person {
  String name;
}

{
   get("/", req -> {
      Person person = req.params(Person.class);
   });
}

A call like:

GET /?name=John&enabled

Results in an error:

org.jooby.Err: Server Error(500): Failed to parse parameters to 'example.Person'
	at org.jooby.internal.MutantImpl.to(MutantImpl.java:98)
	at org.jooby.internal.MutantImpl.to(MutantImpl.java:76)
	at org.jooby.Mutant.to(Mutant.java:307)
	at org.jooby.Request.params(Request.java:716)
	at com.jwt.fh.Fh.lambda$null$3e93b7c$1(Fh.java:122)
	at com.jwt.fh.api.EntryManager.lambda$null$20(EntryManager.java:319)
	at javaslang.control.Try.of(Try.java:37)
	at com.jwt.fh.api.EntryManager.lambda$execute$21(EntryManager.java:319)
	at org.skife.jdbi.v2.tweak.transactions.LocalTransactionHandler.inTransaction(LocalTransactionHandler.java:183)
	at org.skife.jdbi.v2.BasicHandle.inTransaction(BasicHandle.java:330)
	at com.jwt.fh.api.EntryManager.execute(EntryManager.java:319)
	at com.jwt.fh.Fh.lambda$new$24(Fh.java:101)
	at org.jooby.Route$OneArgHandler.handle(Route.java:1755)
	at org.jooby.internal.RouteImpl.handle(RouteImpl.java:113)
	at org.jooby.internal.RouteChain.next(RouteChain.java:70)
	at org.jooby.Route$Chain.next(Route.java:2101)
	at org.jooby.Route$Handler.handle(Route.java:1713)
	at org.jooby.internal.RouteImpl.handle(RouteImpl.java:113)
	at org.jooby.internal.RouteChain.next(RouteChain.java:70)
	at org.jooby.Route$Chain.next(Route.java:2101)
	at org.jooby.Route$Handler.handle(Route.java:1713)
	at org.jooby.internal.RouteImpl.handle(RouteImpl.java:113)
	at org.jooby.internal.RouteChain.next(RouteChain.java:70)
	at org.jooby.Route$Chain.next(Route.java:2101)
	at org.jooby.internal.HttpHandlerImpl.handle(HttpHandlerImpl.java:306)
	at org.jooby.internal.netty.NettyHandler.channelRead0(NettyHandler.java:92)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:363)
	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: null
	at org.jooby.internal.parser.bean.BeanPlan.compile(BeanPlan.java:159)
	at org.jooby.internal.parser.bean.BeanPlan.newBean(BeanPlan.java:118)
@jknack jknack added the bug label Nov 9, 2016
@jknack jknack added this to the 1.0.0 milestone Nov 9, 2016
@jknack jknack closed this as completed in b2f4652 Nov 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant