Git Product home page Git Product logo

Comments (10)

Clayton7510 avatar Clayton7510 commented on May 20, 2024 2

Thanks for raising this issue. There is a fix in place in the 0.8.1-SNAPSHOT release now that was tested with a Spring Boot packaged Jar. I'm planning on releasing v0.8.1 sometime this weekend.

from rulebook.

Clayton7510 avatar Clayton7510 commented on May 20, 2024 1

Here are some examples of how to add the snapshot repo to your project: https://github.com/rulebook-rules/rulebook/wiki/Download-and-Install

from rulebook.

eitansela avatar eitansela commented on May 20, 2024 1

After hours of digging and comparing my code to your example Spring Boot application, I finally found the problem!

It is related to the following in build.gradle:
springBoot { executable = true }

This is done as part of Spring Boot convention to enable Spring Boot applications run as Linux in systemd services, as detailed here:
https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html

Once I removed that part, it worked!
This is actually a good news, since we will not use Spring Boot applications run as Linux in systemd, but as part of a Docker image. So it is redundant and can be deleted.

Thanks for all your help! Especially for the Spring Boot example application you posted.
Keep up the good work :-)

from rulebook.

eitansela avatar eitansela commented on May 20, 2024

From where can I take this fix? It is not in maven repository...

from rulebook.

Clayton7510 avatar Clayton7510 commented on May 20, 2024

It's in the sonatype snapshot maven repo: "https://oss.sonatype.org/content/repositories/snapshots"

from rulebook.

eitansela avatar eitansela commented on May 20, 2024

Succeeded to use sonatype snapshot maven repo.
However, with 0.8.1-SNAPSHOT , when trying to run standalone executable Spring-Boot jar,I get the following exception:

14-09-2017 07:12:26.350 [XNIO-2 task-1] ERROR c.d.r.model.runner.RuleBookRunner - Unable to find rule classes in package 'com.my.example' java.nio.file.InvalidPathException: com.my.example: 'com.my.example' is not a valid path at com.deliveredtechnologies.rulebook.model.runner.RuleBookRunner.findRuleClassesInPackage(RuleBookRunner.java:148) at com.deliveredtechnologies.rulebook.model.runner.RuleBookRunner.run(RuleBookRunner.java:73) at com.weissbeerger.recommendation.engine.controller.PortfolioPageRuleController.getRecommenations(PortfolioPageRuleController.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

In eclipse IDE it works flawlessly.

from rulebook.

Clayton7510 avatar Clayton7510 commented on May 20, 2024

Are you using a Spring Boot war deployed on Wildfly? Or a standalone Spring Boot jar w/Undertow? Or, could you attach your source?

I tested this with the Spring Boot example project under rulebook-examples.

But I'll validate the other scenarios listed above and add examples to validate this evening. And of course, if you can provide your specific example, I can ensure it works with that too.

from rulebook.

eitansela avatar eitansela commented on May 20, 2024

I use standalone Spring Boot jar w/Undertow

from rulebook.

Clayton7510 avatar Clayton7510 commented on May 20, 2024

Interesting. That's what I also use here in the helloworld-spring-web app in the Issue90_PojoResults branch (currently deployed as v0.8.1). And I didn't run into that issue; it worked as expected. The project can be seen here: https://github.com/rulebook-rules/rulebook/tree/Issue90_PojoResults/rulebook-examples

Would you mind attaching your example or providing a link so I can see what your specific issue is? Judging by your error, it appears as if RuleBook cannot find the package that contains the POJO rules to scan. However, since you said it is working in your IDE, I have to wonder what's specifically going on there - perhaps a corner case that wasn't accounted for.

from rulebook.

Clayton7510 avatar Clayton7510 commented on May 20, 2024

The fix for including POJO rules in a Spring Boot uber jar is in v0.8.1, now pushed to Maven Central.

from rulebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.