title: Unable to run Flink job when jar file is submitted, but program running otherwise in Intellij
body: <p>My Flink Program runs successfully in IntellijIdea, but when I make a jar file of that program to submit it as jar, it shows me the following error</p>
  
  <pre><code>ava.lang.RuntimeException: Could not look up the main(String[]) method from the class org.carleton.cep.monitoring.latest.MobileCEP: org/apache/flink/cep/pattern/conditions/IterativeCondition
      at org.apache.flink.client.program.PackagedProgram.hasMainMethod(PackagedProgram.java:480)
      at org.apache.flink.client.program.PackagedProgram.&lt;init&gt;(PackagedProgram.java:217)
      at org.apache.flink.client.program.PackagedProgram.&lt;init&gt;(PackagedProgram.java:148)
      at org.apache.flink.runtime.webmonitor.handlers.JarActionHandler.getJobGraphAndClassLoader(JarActionHandler.java:91)
      at org.apache.flink.runtime.webmonitor.handlers.JarPlanHandler.handleRequest(JarPlanHandler.java:42)
      at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandler.respondAsLeader(RuntimeMonitorHandler.java:88)
      at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:84)
      at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:44)
      at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      at io.netty.handler.codec.http.router.Handler.routed(Handler.java:62)
      at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:57)
      at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:20)
      at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      at org.apache.flink.runtime.webmonitor.HttpRequestHandler.channelRead0(HttpRequestHandler.java:105)
      at org.apache.flink.runtime.webmonitor.HttpRequestHandler.channelRead0(HttpRequestHandler.java:65)
      at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
      at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:147)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
      at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
      at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: java.lang.NoClassDefFoundError: org/apache/flink/cep/pattern/conditions/IterativeCondition
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
      at java.lang.Class.getMethod0(Class.java:3018)
      at java.lang.Class.getMethod(Class.java:1784)
      at org.apache.flink.client.program.PackagedProgram.hasMainMethod(PackagedProgram.java:474)
      ... 34 more
  Caused by: java.lang.ClassNotFoundException: org.apache.flink.cep.pattern.conditions.IterativeCondition
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 40 more
  </code></pre>
  
  <p>I have taken care of classpath in the manifest file, Previously I was able to run with my jar as well. </p>
  
  <p>It seems that there is some issue with my pattern code which is given below</p>
  
  <pre><code> // detecting pattern
  
      Pattern&lt;JoinedEvent, ?&gt; pattern = Pattern.&lt;JoinedEvent&gt;begin("start")
              .subtype(JoinedEvent.class).
                      where(new SimpleCondition&lt;JoinedEvent&gt;() {
                          @Override
                          public boolean filter(JoinedEvent streamEvent) throws Exception {
  
                              return streamEvent.getRRInterval()&gt;= 10 ;
                          }
                      })
  
              .subtype(JoinedEvent.class).where(new SimpleCondition&lt;JoinedEvent&gt;() {
                  @Override
                  public boolean filter(JoinedEvent streamEvent) throws Exception {
                      return streamEvent.getQrsInterval() &gt;= 10 ;
                  }
              } )
              .within(Time.milliseconds(WindowLength));
  </code></pre>