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! >