Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 03 15:51
    marcelstoer commented #2252
  • Aug 03 15:39
    marcelstoer commented #2252
  • Aug 02 23:10
    agentgt commented #2408
  • Aug 02 23:09
    agentgt opened #2409
  • Aug 02 21:57
    agentgt edited #2408
  • Aug 02 20:08
    agentgt opened #2408
  • Aug 02 16:57
    dependabot[bot] labeled #2407
  • Aug 02 16:57
    dependabot[bot] labeled #2407
  • Aug 02 16:57
    dependabot[bot] opened #2407
  • Aug 02 16:57

    dependabot[bot] on maven

    Bump ant from 1.10.9 to 1.10.11… (compare)

  • Aug 02 00:29
    dependabot[bot] labeled #2406
  • Aug 02 00:29
    dependabot[bot] labeled #2406
  • Aug 02 00:28
    dependabot[bot] opened #2406
  • Aug 02 00:28

    dependabot[bot] on npm_and_yarn

    Bump swagger-ui-dist from 3.51.… (compare)

  • Aug 01 23:38

    jknack on 2.x

    Implemented getting client cert… Return the certificates in a li… Merge pull request #2402 from c… (compare)

  • Aug 01 23:38
    jknack closed #2402
  • Aug 01 23:38
    jknack closed #2401
  • Aug 01 23:38
    jknack milestoned #2402
  • Aug 01 23:38
    jknack labeled #2402
  • Jul 30 02:06
    agentgt edited #2405
Adam Gent
@agentgt
However I don't really have a better solution and I like I said before the ASM parsing very impressive.
If Jooby only had the JAXRS annotations I would vastly prefer a plain jane Java APT with some bare minimum for POJO schema detection ASM stuff.
That is the other problem with the openapi implementation. It requires a maven plugin. An APT does not.
Adam Gent
@agentgt
Anyway my current solution for our code base right now is to make a subclass Jooby called FakeJooby that then mvc installs all of our controllers and then give the maven plugin that class instead of our real Jooby.
Adam Gent
@agentgt
I wonder how many folks are making APIs with script API vs the MVC/JAXRS API
It seems like if you are doing an the microservice you have to annotate anyway so you might as well do the MVC style
Adam Gent
@agentgt
Oh besides inheritance and dynamic contextPath obviously adding scripts/mvc after the jooby object is instantiated doesn't work either.
I wouldn't be surprised if multiple constructors and/or constructors that take arguments doesn't work Amazingly it works and now that I think about it makes since it just looking for mvc calls
Adam Gent
@agentgt
Also you can't name your "application" class Jooby anything because the OpenAPI module does a replace("Jooby") on the name
so MyJooby for example as a classname would fail because it would become Myopenapi.json
That is probably abug
Hashim Sayyid
@Sayyiditow

@Sayyiditow Try with: https://jooby.io/#router-composing-install

Thanks!

Md. Jaber Hossain
@mhossain191058
Hi i think jooby is the fastest java based full stack web framework in the market right?
lospejos
@lospejos
Hi! I'm trying to start Jooby project that uses HikariCP on Java 14/15, mvn package works fine, I see a resulting fatjar. But in Idea I see errors cannot resolve symbol DataSource near import javax.sql.DataSource; line. I also cannot find this package javax.sql inside fatjar. I also see, that io.jooby.hikari.HikariModule has line import javax.sql.DataSource;. It seems that javax.sql is removed from JDK 14, 15. Does Jooby supports working on Java 14, 15? Thanks
lospejos
@lospejos
@jknack Hi! When do you plan to release a Jooby 2.9.5 version? I see in this version you upgraded Jackson to 2.12.0 and get rid of Jackson AfterBurner which had problems with Java 9+ (sun.misc.Unsafe and all this stuff), so I want to adopt new version of Jooby. Thanks
Edgar Espina
@jknack
nothing stop us from new release
so I can try between today and weekend
jackson 2.12.0 get rid of afterburner?
did you fix the Java 14/15 Datasource error? How did you fix it?
lospejos
@lospejos
@jknack jackson 2.12.0 get rid of afterburner? It seems yes, see here: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.12#new-modules-status-changes
@jknack
nothing stop us from new release
so I can try between today and weekend
OK, sounds good :-) Will wait for it
@jknack did you fix the Java 14/15 Datasource error? How did you fix it? No, currently I switched to another project. It seems that I something did wrong and faced this DataSource error.
andychan82
@andychan82

Hi! Just found an OOM problem when using netty as the server implementation, here is the code i used. I am using go-hey as the load test tools and try to load the server with post body. With netty implementation, i get out-of-memory problem. With jetty implementation, the garbage collection works well, and no out-of-memory problem.

./hey -z 10s -m POST -d '{"key":"value"}' http://127.0.0.1:8080

Below is the code i used for testing:

package app;
import io.jooby.Jooby;
public class App extends Jooby {
  {
    get("/", ctx -> "Welcome to Jooby!");
    post("/", ctx -> "you are using post request!!!");
  }
  public static void main(final String[] args) {
    runApp(args, App::new);
  }
}
lospejos
@lospejos
@humar82 Consider creating issue here https://github.com/jooby-project/jooby/issues
lospejos
@lospejos
@jknack I have one more question, that is not very clear for me: if I will use MVC API style (with annotations), will it lead to some runtime reflection, performance penalty or requirement to use Java reflection API inside Jooby? I mean, If I will use MVC API style, will it be as safe, performant (from runtime point of view, not compiling/building application) as script API style? Thanks
Jonathan Curran
@joncfoo
I want to have a mix of authenticated + unauthenticated routes using MVC + annotations + Pac4j. Is this possible? From what I've seen Pac4j integration appears to be focused on path-based checks.
Edgar Espina
@jknack
@lospejos MVC doesn’t rely on reflection. It uses a byte code generator tool for direct calls (no performance overhead)
@joncfoo Route pipeline in jooby is defined in the way you add them (ordered)
So, if you want unauthenticaed routes, put them before the install(new Pac4jModule());
then all the route you added after that, are going to be authenticated
if that doesn’t work, you can rely on path patterns
Jonathan Curran
@joncfoo
Gotcha, that would mean that I can't mix unauthenticated + authenticated methods in a MVC class that is defined after installing the module.
lospejos
@lospejos
@jknack Still no 2.9.5 version?
Edgar Espina
@jknack
@joncfoo That’s right
@lospejos not yet, will try tomorrow
Edgar Espina
@jknack
lospejos
@lospejos
@jknack jooby 2.9.5 is out - that's good news, thanks!
Deepak Arora
@deepakarora3
Hi, I am trying to use jooby for hosting an api which will be protected by a JWT token. I have a jar file which I have to use for validating the token. The question is - what is the preferred way to validate the JWT token before the path is hit? In other words, lets say I have three routes set up /foo/1, /foo/2 and /foo/3. And lets say I have 3 different JWT tokens which are used to authorize access to each of these routes. Will creating 3 scoped decorators (one for each route) work? Or do I have 1 handler for all three and I call the validation from inside of the handler based on the path? Sorry if I am sounding a bit confused but right now I guess I am. Just to make my scenario more clear, had it been a heavyweight framework like JEE, a servlet filter would have been used for this purpose. Any help would be greatly appreciated.
Marcel Stör
@marcelstoer
@jknack would fixing jooby-project/jooby#2252 be as easy as switching that constructor parameter in NettyPush?
andychan82
@andychan82

I am trying to use the openapi annotation to create swagger doc, not sure how to work with the parameters when using script api
Here is the code i am using , and it failed during maven build

Please help. Thanks.

code

public class App extends Jooby {

    {
        install(new GsonModule());
        install(new OpenAPIModule());   
        get("/test/test", this::test);

    }

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

    @Operation(
            description = "test",
            parameters = {@Parameter(name = "token", in = ParameterIn.QUERY)},
            requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = ApiRequest.class)))
    )
    public ApiRequest test( 
            Context ctx) {
        ctx.setResponseType(MediaType.json);
        return new ApiRequest();
    }

}

error

[ERROR] Failed to execute goal io.jooby:jooby-maven-plugin:2.9.5:openapi (default) on project swagger-test: execution of openapi resulted in exception: Parameter not found: token at  position: 0 for annotation: {name=token, in=[Ljava.lang.String;@1f018dd} -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.jooby:jooby-maven-plugin:2.9.5:openapi (default) on project swagger-test: execution of openapi resulted in exception
......
Caused by: org.apache.maven.plugin.MojoFailureException: execution of openapi resulted in exception
    at io.jooby.maven.BaseMojo.execute(BaseMojo.java:83)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
    ... 24 more
Caused by: java.lang.IllegalArgumentException: Parameter not found: token at  position: 0 for annotation: {name=token, in=[Ljava.lang.String;@1f018dd}
    at io.jooby.internal.openapi.OpenAPIParser.parameters(OpenAPIParser.java:450)
    at io.jooby.internal.openapi.OpenAPIParser.lambda$operation$57(OpenAPIParser.java:380)
    at io.jooby.internal.openapi.AsmUtils.annotationList(AsmUtils.java:108)
    at io.jooby.internal.openapi.OpenAPIParser.operation(OpenAPIParser.java:380)
......
Marcel Stör
@marcelstoer

@jknack would fixing jooby-project/jooby#2252 be as easy as switching that constructor parameter in NettyPush?

If so, I could easily raise a PR to that effect.

Max De Marzi
@maxdemarzi
Got a weird issue.
I am able to run unit tests just fine... but when I try to DEBUG a unit test in Intellij IDEA on Jooby 2.9.5 using Java 11, I get a ClassNotFoundException for org.junit.internal.AssumptionViolatedException
Max De Marzi
@maxdemarzi
nevermind... had a java exception breakpoint set I forgot about...
Max De Marzi
@maxdemarzi
Also I've been using Rocker for template but https://github.com/casid/jte seems to be 25% to 100% faster. Maybe a good addition to Jooby?
Bart van Deenen
@bvdeenen
Hi Jooby people
I'm trying to find if there's a maximum number of concurrent tcp connections for jooby-jetty somewhere? We're currently facing a performance issue with an http/1 client (we will upgrade it), but for now it looks like we might be hitting a tcp connections limit
sameer
@SameerChorge94

Hello Guys,
i am new to jooby graphql development
i referenced below jooby graphql-starter example to setup the graphql server with java
https://github.com/jooby-project/jooby/tree/2.x/starters/graphql-starter

i have some doubts related to the setting up the graphql resolvers context with jooby server setup
As per the project requirements i need to set the databases sessions and some information in graphql context which also need a way to get the same context reference in datafetcher used in above example
anyone have suggestions or workarounds regarding same?

andrendp
@andrendp

I am trying to use the openapi annotation to create swagger doc, not sure how to work with the parameters when using script api
Here is the code i am using , and it failed during maven build

Please help. Thanks.

code

public class App extends Jooby {

    {
        install(new GsonModule());
        install(new OpenAPIModule());   
        get("/test/test", this::test);

    }

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

    @Operation(
            description = "test",
            parameters = {@Parameter(name = "token", in = ParameterIn.QUERY)},
            requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = ApiRequest.class)))
    )
    public ApiRequest test( 
            Context ctx) {
        ctx.setResponseType(MediaType.json);
        return new ApiRequest();
    }

}

error

[ERROR] Failed to execute goal io.jooby:jooby-maven-plugin:2.9.5:openapi (default) on project swagger-test: execution of openapi resulted in exception: Parameter not found: token at  position: 0 for annotation: {name=token, in=[Ljava.lang.String;@1f018dd} -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.jooby:jooby-maven-plugin:2.9.5:openapi (default) on project swagger-test: execution of openapi resulted in exception
......
Caused by: org.apache.maven.plugin.MojoFailureException: execution of openapi resulted in exception
    at io.jooby.maven.BaseMojo.execute(BaseMojo.java:83)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
    ... 24 more
Caused by: java.lang.IllegalArgumentException: Parameter not found: token at  position: 0 for annotation: {name=token, in=[Ljava.lang.String;@1f018dd}
    at io.jooby.internal.openapi.OpenAPIParser.parameters(OpenAPIParser.java:450)
    at io.jooby.internal.openapi.OpenAPIParser.lambda$operation$57(OpenAPIParser.java:380)
    at io.jooby.internal.openapi.AsmUtils.annotationList(AsmUtils.java:108)
    at io.jooby.internal.openapi.OpenAPIParser.operation(OpenAPIParser.java:380)
......

Did you manage to sort this out? I get the same issue with 2.9.5 where I cannot add any parameters. I have followed the docs to the tee but with no luck.

Or is there any other working examples on how to get the parameters into the swagger openapi.json

Here is even a more basic one that still gives the issue:

 @GET
    @Operation(
            summary = "Find a pet by ID",
            description = "Find a pet by ID or throws a 404",
            parameters = { @Parameter(name = "id", description = "Pet ID") }
    )
    public String test(){
        return "Bla";
    }

Then I also get the following error:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':openAPI'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:156)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
    ...
andychan82
@andychan82

Here is even a more basic one that still gives the issue:

 @GET
    @Operation(
            summary = "Find a pet by ID",
            description = "Find a pet by ID or throws a 404",
            parameters = { @Parameter(name = "id", description = "Pet ID") }
    )
    public String test(){
        return "Bla";
    }

Then I also get the following error:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':openAPI'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:156)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
    ...

try this

 @GET
    @Operation(
            summary = "Find a pet by ID",
            description = "Find a pet by ID or throws a 404",
            parameters = { @Parameter(name = "id", description = "Pet ID") }
    )
    public String test(@QueryParam String id){
        return "Bla";
    }