Hi Lian, If you are using the statefun-sdk directly (an embedded mode) then, most likely is that you are missing a META-INF/services/org.apache.flink.statefun.sdk.spi.StatefulFunctionModule file that would point to your modules class. We are using Java SPI [1] to load all the stateful functions modules at runtime. Alternatively, you can use the @AutoService annotation [2] (you will need to add a maven dependency for that [3])
If you are using the remote functions deployment mode, then please make sure that your module.yaml file is present in your Dockerfile. (for example [4]) Good luck, Igal. [1] https://docs.oracle.com/javase/tutorial/ext/basics/spi.html [2] https://github.com/apache/flink-statefun/blob/master/statefun-examples/statefun-greeter-example/src/main/java/org/apache/flink/statefun/examples/greeter/GreetingModule.java#L30 [3] https://github.com/apache/flink-statefun/blob/master/pom.xml#L85,L89 [4] https://github.com/apache/flink-statefun/blob/master/statefun-examples/statefun-python-greeter-example/Dockerfile#L20 On Tue, Nov 10, 2020 at 4:47 PM Tzu-Li (Gordon) Tai <tzuli...@apache.org> wrote: > Hi, > > StateFun provide's a Harness utility exactly for that, allowing you to > test a StateFun application in the IDE / setting breakpoints etc. > You can take a look at this example on how to use the harness: > https://github.com/apache/flink-statefun/tree/master/statefun-examples/statefun-flink-harness-example > . > > Cheers, > Gordon > > On Tue, Nov 10, 2020 at 5:04 AM Lian Jiang <jiangok2...@gmail.com> wrote: > >> >> Hi, >> >> I created a POC by mimicing statefun-greeter-example. However, it failed >> due to: >> >> Caused by: java.lang.IllegalStateException: There are no ingress defined. >> at >> org.apache.flink.statefun.flink.core.StatefulFunctionsUniverseValidator.validate(StatefulFunctionsUniverseValidator.java:25) >> ~[statefun-flink-core.jar:2.2.0] >> at >> org.apache.flink.statefun.flink.core.StatefulFunctionsJob.main(StatefulFunctionsJob.java:71) >> ~[statefun-flink-core.jar:2.2.0] >> at >> org.apache.flink.statefun.flink.core.StatefulFunctionsJob.main(StatefulFunctionsJob.java:47) >> ~[statefun-flink-core.jar:2.2.0] >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> ~[?:1.8.0_265] >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >> ~[?:1.8.0_265] >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> ~[?:1.8.0_265] >> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265] >> at >> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:288) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:198) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.client.program.PackagedProgramUtils.getPipelineFromProgram(PackagedProgramUtils.java:150) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.client.program.PackagedProgramUtils.createJobGraph(PackagedProgramUtils.java:77) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.statefun.flink.launcher.StatefulFunctionsJobGraphRetriever.retrieveJobGraph(StatefulFunctionsJobGraphRetriever.java:101) >> ~[statefun-flink-distribution.jar:2.2.0] >> at >> org.apache.flink.runtime.dispatcher.runner.JobDispatcherLeaderProcessFactoryFactory.createFactory(JobDispatcherLeaderProcessFactoryFactory.java:55) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.runtime.dispatcher.runner.DefaultDispatcherRunnerFactory.createDispatcherRunner(DefaultDispatcherRunnerFactory.java:51) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:194) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runCluster(ClusterEntrypoint.java:216) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.runtime.entrypoint.ClusterEntrypoint.lambda$startCluster$0(ClusterEntrypoint.java:169) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> at >> org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:168) >> ~[flink-dist_2.12-1.11.1.jar:1.11.1] >> >> I have confirmed that something is wrong in my application causing this >> error. However, it is hard to spot the issue visually and a little tricky >> to debug in IDE (e.g. intellij). For example, if I can create an >> application in Intellij and step through statefun library code and my code, >> it will be easier to find the root cause. Any guidance on how to set this >> up? Appreciate any hint. Thanks! >> >