You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Abdullah bin Omar <ab...@gmail.com> on 2021/03/03 15:55:29 UTC

Compile Error

Hi,

I am running a code (Example Program) from [1], and followed the [2] for
the dependencies. I used this in the pom.xml:

<project xmlns=*"http://maven.apache.org/POM/4.0.0
<http://maven.apache.org/POM/4.0.0>"*
xmlns:xsi=*"http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance>"*
xsi:schemaLocation=*"http://maven.apache.org/POM/4.0.0
<http://maven.apache.org/POM/4.0.0>
https://maven.apache.org/xsd/maven-4.0.0.xsd
<https://maven.apache.org/xsd/maven-4.0.0.xsd>"*>

  <modelVersion>4.0.0</modelVersion>

  <groupId>org.apache.flink </groupId>

  <artifactId>newinput</artifactId>

  <version>0.0.1-SNAPSHOT</version>



  <dependencies>

  <dependency>

<groupId>org.apache.flink</groupId>

  <artifactId>flink-streaming-java_2.11</artifactId>

  <version>1.12.0</version>

  <scope>provided</scope>

</dependency>




<dependency>

       <groupId>org.slf4j</groupId>

       <artifactId>slf4j-api</artifactId>

       <version>1.7.5</version>

   </dependency>

   <dependency>

       <groupId>org.slf4j</groupId>

       <artifactId>slf4j-log4j12</artifactId>

       <version>1.7.5</version>

   </dependency>

</dependencies>


</project>



I got an error, No Executor Factory Found

After that, I add flink-clients dependencies in the pom.xml

<dependency>

<groupId>org.apache.flink</groupId>

  <artifactId>flink-clients_2.11</artifactId>

          <type>jar</type>

  <version>1.12.0</version>

  <scope>provided</scope>

</dependency>


Then the previous error (No Executor Factory Found) was removed. However, a
new bunch of error appeared (like Job execution failed)

[1]
https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/
[2]
https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration


*Questions:*

(1) is the flink-clients dependencies correct?

(2) I just opened a maven project in Eclipse IDE, and am using the
flink-1.12 version.I used the java code similar to Example Program [1], and
using the above dependencies in pom.xml
I am wondering that are those steps correct? or something missing to
install or add anything in the code/pom.xml?

Thank you

Best Regards,
Abdullah

Re: Compile Error

Posted by Chesnay Schepler <ch...@apache.org>.
Could you paste the contents of the properties section of your pom.xml?

target.java.version should be set to 1.8; I do not understand why it 
tries to compile to another java version.

On 3/4/2021 5:24 PM, Abdullah bin Omar wrote:
> I used mvn install. it shows this one:
>
> SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
>
> SLF4J: Class path contains multiple SLF4J bindings.
>
> SLF4J: Found binding in 
> [jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>
> SLF4J: Found binding in 
> [file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
>
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings 
> <http://www.slf4j.org/codes.html#multiple_bindings> for an explanation.
>
> SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
>
> [INFO] Scanning for projects...
>
> [INFO]
>
> [INFO] ---------------------< org.apache.flink:newinput 
> >----------------------
>
> [INFO] Building newinput 0.0.1-SNAPSHOT
>
> [INFO] --------------------------------[ jar 
> ]---------------------------------
>
> [INFO]
>
> [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
> newinput ---
>
> [WARNING] Using platform encoding (UTF-8 actually) to copy filtered 
> resources, i.e. build is platform dependent!
>
> [INFO] Copying 0 resource
>
> [INFO]
>
> [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 
> newinput ---
>
> [INFO] Changes detected - recompiling the module!
>
> [WARNING] File encoding has not been set, using platform encoding 
> UTF-8, i.e. build is platform dependent!
>
> [INFO] Compiling 1 source file to 
> /Users/abdullah/Documents/newinput/target/classes
>
> [INFO] -------------------------------------------------------------
>
> [ERROR] COMPILATION ERROR :
>
> [INFO] -------------------------------------------------------------
>
> [ERROR] Source option 5 is no longer supported. Use 7 or later.
>
> [ERROR] Target option 5 is no longer supported. Use 7 or later.
>
> [INFO] 2 errors
>
> [INFO] -------------------------------------------------------------
>
> [INFO] 
> ------------------------------------------------------------------------
>
> [INFO] BUILD FAILURE
>
> [INFO] 
> ------------------------------------------------------------------------
>
> [INFO] Total time:2.000 s
>
> [INFO] Finished at: 2021-03-04T10:21:26-06:00
>
> [INFO] 
> ------------------------------------------------------------------------
>
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 
> (default-compile) on project newinput: Compilation failure: 
> Compilation failure:
>
> [ERROR] Source option 5 is no longer supported. Use 7 or later.
>
> [ERROR] Target option 5 is no longer supported. Use 7 or later.
>
> [ERROR] -> [Help 1]
>
> [ERROR]
>
> [ERROR] To see the full stack trace of the errors, re-run Maven with 
> the -e switch.
>
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>
> [ERROR]
>
> [ERROR] For more information about the errors and possible solutions, 
> please read the following articles:
>
> [ERROR] [Help 1] 
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 
> <http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException>
>
>
> On Thu, Mar 4, 2021 at 10:18 AM Chesnay Schepler <chesnay@apache.org 
> <ma...@apache.org>> wrote:
>
>     use mvn install then, it is the closest thing to package.
>
>     On 3/4/2021 5:12 PM, Abdullah bin Omar wrote:
>>     I found this one (attached pic 1) when I run the pom.xml from
>>     eclipse IDE. I select maven clean.
>>
>>
>>
>>
>>     On Thu, Mar 4, 2021 at 10:00 AM Chesnay Schepler
>>     <chesnay@apache.org <ma...@apache.org>> wrote:
>>
>>         I think your confusion is caused by using using "mvn clean",
>>         instead of "mvn clean package".
>>
>>         "mvn clean" cleans up, deleting jars and such, whereas "mvn
>>         package" compiles the code and packages a jar.
>>
>>         On 3/4/2021 3:41 PM, Abdullah bin Omar wrote:
>>>         Hi Chesnay,
>>>
>>>         Thank you for your reply. Sorry for coming up late.
>>>
>>>         I follow the maven quickstart. when I run the pom.xml in
>>>         m2Maven clean way. Then it gives me this output in console:
>>>
>>>         SLF4J: Class path contains multiple SLF4J bindings.
>>>
>>>         SLF4J: Found binding in
>>>         [jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>>>
>>>         SLF4J: Found binding in
>>>         [file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
>>>
>>>         SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings
>>>         <http://www.slf4j.org/codes.html#multiple_bindings> for an
>>>         explanation.
>>>
>>>         SLF4J: Actual binding is of type
>>>         [org.slf4j.impl.SimpleLoggerFactory]
>>>
>>>         SLF4J: Class path contains multiple SLF4J bindings.
>>>
>>>         SLF4J: Found binding in
>>>         [jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>>>
>>>         SLF4J: Found binding in
>>>         [file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
>>>
>>>         SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings
>>>         <http://www.slf4j.org/codes.html#multiple_bindings> for an
>>>         explanation.
>>>
>>>         SLF4J: Actual binding is of type
>>>         [org.slf4j.impl.SimpleLoggerFactory]
>>>
>>>         [INFO] Scanning for projects...
>>>
>>>         [INFO]
>>>
>>>         [INFO] ---------------------< org.apache.flink:newinput
>>>         >----------------------
>>>
>>>         [INFO] Building newinput 0.0.1-SNAPSHOT
>>>
>>>         [INFO] --------------------------------[ jar
>>>         ]---------------------------------
>>>
>>>         [INFO]
>>>
>>>         [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @
>>>         newinput ---
>>>
>>>         [INFO] Deleting /Users/abdullah/Documents/newinput/target
>>>
>>>         [INFO]
>>>         ------------------------------------------------------------------------
>>>
>>>         [INFO] BUILD SUCCESS
>>>
>>>         [INFO]
>>>         ------------------------------------------------------------------------
>>>
>>>         [INFO] Total time:0.281 s
>>>
>>>         [INFO] Finished at: 2021-03-04T08:10:00-06:00
>>>
>>>         [INFO]
>>>         ------------------------------------------------------------------------
>>>
>>>
>>>         and now when I run the code, it shows this error:
>>>
>>>         Error: Could not find or load main class newinput.count
>>>
>>>         Caused by: java.lang.ClassNotFoundException: newinput.count
>>>
>>>
>>>         *_Question:_*
>>>         in quickstarts
>>>         <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>,
>>>         it said in build project section,
>>>
>>>         You will find a JAR file that contains your application,
>>>         plus connectors and libraries that you may have added as
>>>         dependencies to the application:
>>>         |target/<artifact-id>-<version>.jar|.
>>>         If you use a different class than /StreamingJob/ as the
>>>         application’s main class / entry point, we recommend you
>>>         change the |mainClass| setting in the |pom.xml| file
>>>         accordingly.
>>>
>>>          I do not Understand the above two lines.
>>>
>>>         The class name that I used is named "count": so different
>>>         from a streaming job.
>>>
>>>         *Is something I missed due to not understanding those two
>>>         lines?*
>>>         *
>>>         *
>>>         *Thank you!*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>         On Wed, Mar 3, 2021 at 2:49 PM Chesnay Schepler
>>>         <chesnay@apache.org <ma...@apache.org>> wrote:
>>>
>>>             The flink-clients dependency is correct.
>>>
>>>             We will need additional information to debug the Job
>>>             execution failures, because these can happen due to all
>>>             kind of reasons.
>>>             Things like the full stacktrace, or exceptions from the
>>>             logging output.
>>>
>>>             Additionally, I would recommend to base your project on
>>>             the quickstarts
>>>             <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>.
>>>
>>>             On 3/3/2021 4:55 PM, Abdullah bin Omar wrote:
>>>>             Hi,
>>>>
>>>>             I am running a code (Example Program) from [1], and
>>>>             followed the [2] for the dependencies. I used this in
>>>>             the pom.xml:
>>>>
>>>>             <projectxmlns=/"http://maven.apache.org/POM/4.0.0
>>>>             <http://maven.apache.org/POM/4.0.0>"/xmlns:xsi=/"http://www.w3.org/2001/XMLSchema-instance
>>>>             <http://www.w3.org/2001/XMLSchema-instance>"/xsi:schemaLocation=/"http://maven.apache.org/POM/4.0.0
>>>>             <http://maven.apache.org/POM/4.0.0>
>>>>             https://maven.apache.org/xsd/maven-4.0.0.xsd
>>>>             <https://maven.apache.org/xsd/maven-4.0.0.xsd>"/>
>>>>
>>>>             <modelVersion>4.0.0</modelVersion>
>>>>
>>>>             <groupId>org.apache.flink </groupId>
>>>>
>>>>             <artifactId>newinput</artifactId>
>>>>
>>>>             <version>0.0.1-SNAPSHOT</version>
>>>>
>>>>             <dependencies>
>>>>
>>>>             <dependency>
>>>>
>>>>             <groupId>org.apache.flink</groupId>
>>>>
>>>>             <artifactId>flink-streaming-java_2.11</artifactId>
>>>>
>>>>             <version>1.12.0</version>
>>>>
>>>>             <scope>provided</scope>
>>>>
>>>>             </dependency>
>>>>
>>>>
>>>>
>>>>
>>>>             <dependency>
>>>>
>>>>             <groupId>org.slf4j</groupId>
>>>>
>>>>             <artifactId>slf4j-api</artifactId>
>>>>
>>>>             <version>1.7.5</version>
>>>>
>>>>             </dependency>
>>>>
>>>>             <dependency>
>>>>
>>>>             <groupId>org.slf4j</groupId>
>>>>
>>>>             <artifactId>slf4j-log4j12</artifactId>
>>>>
>>>>             <version>1.7.5</version>
>>>>
>>>>             </dependency>
>>>>
>>>>             </dependencies>
>>>>
>>>>
>>>>             </project>
>>>>
>>>>
>>>>
>>>>             I got an error, No Executor Factory Found
>>>>
>>>>             After that, I add flink-clients dependencies in the pom.xml
>>>>
>>>>             <dependency>
>>>>
>>>>             <groupId>org.apache.flink</groupId>
>>>>
>>>>             <artifactId>flink-clients_2.11</artifactId>
>>>>
>>>>                 <type>jar</type>
>>>>
>>>>             <version>1.12.0</version>
>>>>
>>>>             <scope>provided</scope>
>>>>
>>>>             </dependency>
>>>>
>>>>
>>>>             Then the previous error (No Executor Factory Found) was
>>>>             removed. However, a new bunch of error appeared (like
>>>>             Job execution failed)
>>>>
>>>>
>>>>             [1]
>>>>             https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/
>>>>             <https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/>
>>>>             [2]
>>>>             https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration
>>>>             <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration>
>>>>
>>>>
>>>>             */_Questions:_/*
>>>>
>>>>             (1) is the flink-clients dependencies correct?
>>>>
>>>>             (2) I just opened a maven project in Eclipse IDE, and
>>>>             am using the flink-1.12 version.I used the java code
>>>>             similar to Example Program [1], and using the above
>>>>             dependencies in pom.xml
>>>>             I am wondering that are those steps correct? or
>>>>             something missing to install or add anything in the
>>>>             code/pom.xml?
>>>>
>>>>             Thank you
>>>>
>>>>             Best Regards,
>>>>             Abdullah
>>>>
>>>>
>>>>
>>>
>>
>


Re: Compile Error

Posted by Abdullah bin Omar <ab...@gmail.com>.
I used mvn install. it shows this one:

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in
[jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

[INFO] Scanning for projects...

[INFO]

[INFO] ---------------------< org.apache.flink:newinput
>----------------------

[INFO] Building newinput 0.0.1-SNAPSHOT

[INFO] --------------------------------[ jar
]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @
newinput ---

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!

[INFO] Copying 0 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ newinput
---

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding UTF-8,
i.e. build is platform dependent!

[INFO] Compiling 1 source file to
/Users/abdullah/Documents/newinput/target/classes

[INFO] -------------------------------------------------------------

[ERROR] COMPILATION ERROR :

[INFO] -------------------------------------------------------------

[ERROR] Source option 5 is no longer supported. Use 7 or later.

[ERROR] Target option 5 is no longer supported. Use 7 or later.

[INFO] 2 errors

[INFO] -------------------------------------------------------------

[INFO]
------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO]
------------------------------------------------------------------------

[INFO] Total time:  2.000 s

[INFO] Finished at: 2021-03-04T10:21:26-06:00

[INFO]
------------------------------------------------------------------------

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project newinput: Compilation failure: Compilation
failure:

[ERROR] Source option 5 is no longer supported. Use 7 or later.

[ERROR] Target option 5 is no longer supported. Use 7 or later.

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions,
please read the following articles:

[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

On Thu, Mar 4, 2021 at 10:18 AM Chesnay Schepler <ch...@apache.org> wrote:

> use mvn install then, it is the closest thing to package.
>
> On 3/4/2021 5:12 PM, Abdullah bin Omar wrote:
>
> I found this one (attached pic 1) when I run the pom.xml from eclipse IDE.
> I select maven clean.
>
>
>
>
>
> On Thu, Mar 4, 2021 at 10:00 AM Chesnay Schepler <ch...@apache.org>
> wrote:
>
>> I think your confusion is caused by using using "mvn clean", instead of
>> "mvn clean package".
>>
>> "mvn clean" cleans up, deleting jars and such, whereas "mvn package"
>> compiles the code and packages a jar.
>>
>> On 3/4/2021 3:41 PM, Abdullah bin Omar wrote:
>>
>> Hi Chesnay,
>>
>> Thank you for your reply. Sorry for coming up late.
>>
>> I follow the maven quickstart. when I run the pom.xml in m2Maven clean
>> way. Then it gives me this output in console:
>>
>> SLF4J: Class path contains multiple SLF4J bindings.
>>
>> SLF4J: Found binding in [
>> jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class
>> ]
>>
>> SLF4J: Found binding in [
>> file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class
>> ]
>>
>> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
>> explanation.
>>
>> SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
>>
>> SLF4J: Class path contains multiple SLF4J bindings.
>>
>> SLF4J: Found binding in [
>> jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class
>> ]
>>
>> SLF4J: Found binding in [
>> file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class
>> ]
>>
>> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
>> explanation.
>>
>> SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
>>
>> [INFO] Scanning for projects...
>>
>> [INFO]
>>
>> [INFO] ---------------------< org.apache.flink:newinput
>> >----------------------
>>
>> [INFO] Building newinput 0.0.1-SNAPSHOT
>>
>> [INFO] --------------------------------[ jar
>> ]---------------------------------
>>
>> [INFO]
>>
>> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ newinput ---
>>
>> [INFO] Deleting /Users/abdullah/Documents/newinput/target
>>
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> [INFO] BUILD SUCCESS
>>
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> [INFO] Total time:  0.281 s
>>
>> [INFO] Finished at: 2021-03-04T08:10:00-06:00
>>
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> and now when I run the code, it shows this error:
>>
>> Error: Could not find or load main class newinput.count
>>
>> Caused by: java.lang.ClassNotFoundException: newinput.count
>>
>> *Question:*
>> in quickstarts
>> <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>,
>> it said in build project section,
>>
>> You will find a JAR file that contains your application, plus connectors
>> and libraries that you may have added as dependencies to the application:
>> target/<artifact-id>-<version>.jar.
>> If you use a different class than *StreamingJob* as the application’s
>> main class / entry point, we recommend you change the mainClass setting
>> in the pom.xml file accordingly.
>>
>>  I do not Understand the above two lines.
>>
>> The class name that I used is named "count": so different from a
>> streaming job.
>>
>> *Is something I missed due to not understanding those two lines?*
>>
>> *Thank you!*
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Mar 3, 2021 at 2:49 PM Chesnay Schepler <ch...@apache.org>
>> wrote:
>>
>>> The flink-clients dependency is correct.
>>>
>>> We will need additional information to debug the Job execution failures,
>>> because these can happen due to all kind of reasons.
>>> Things like the full stacktrace, or exceptions from the logging output.
>>>
>>> Additionally, I would recommend to base your project on the quickstarts
>>> <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>
>>> .
>>>
>>> On 3/3/2021 4:55 PM, Abdullah bin Omar wrote:
>>>
>>> Hi,
>>>
>>> I am running a code (Example Program) from [1], and followed the [2] for
>>> the dependencies. I used this in the pom.xml:
>>>
>>> <project xmlns=*"http://maven.apache.org/POM/4.0.0
>>> <http://maven.apache.org/POM/4.0.0>"* xmlns:xsi=*"http://www.w3.org/2001/XMLSchema-instance
>>> <http://www.w3.org/2001/XMLSchema-instance>"* xsi:schemaLocation=*"http://maven.apache.org/POM/4.0.0
>>> <http://maven.apache.org/POM/4.0.0>
>>> https://maven.apache.org/xsd/maven-4.0.0.xsd
>>> <https://maven.apache.org/xsd/maven-4.0.0.xsd>"*>
>>>
>>>   <modelVersion>4.0.0</modelVersion>
>>>
>>>   <groupId>org.apache.flink </groupId>
>>>
>>>   <artifactId>newinput</artifactId>
>>>
>>>   <version>0.0.1-SNAPSHOT</version>
>>>
>>>
>>>
>>>   <dependencies>
>>>
>>>   <dependency>
>>>
>>> <groupId>org.apache.flink</groupId>
>>>
>>>   <artifactId>flink-streaming-java_2.11</artifactId>
>>>
>>>   <version>1.12.0</version>
>>>
>>>   <scope>provided</scope>
>>>
>>> </dependency>
>>>
>>>
>>>
>>>
>>> <dependency>
>>>
>>>        <groupId>org.slf4j</groupId>
>>>
>>>        <artifactId>slf4j-api</artifactId>
>>>
>>>        <version>1.7.5</version>
>>>
>>>    </dependency>
>>>
>>>    <dependency>
>>>
>>>        <groupId>org.slf4j</groupId>
>>>
>>>        <artifactId>slf4j-log4j12</artifactId>
>>>
>>>        <version>1.7.5</version>
>>>
>>>    </dependency>
>>>
>>> </dependencies>
>>>
>>>
>>> </project>
>>>
>>>
>>>
>>> I got an error, No Executor Factory Found
>>>
>>> After that, I add flink-clients dependencies in the pom.xml
>>>
>>> <dependency>
>>>
>>> <groupId>org.apache.flink</groupId>
>>>
>>>   <artifactId>flink-clients_2.11</artifactId>
>>>
>>>           <type>jar</type>
>>>
>>>   <version>1.12.0</version>
>>>
>>>   <scope>provided</scope>
>>>
>>> </dependency>
>>>
>>>
>>> Then the previous error (No Executor Factory Found) was removed.
>>> However, a new bunch of error appeared (like Job execution failed)
>>>
>>> [1]
>>> https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/
>>> [2]
>>> https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration
>>>
>>>
>>> *Questions:*
>>>
>>> (1) is the flink-clients dependencies correct?
>>>
>>> (2) I just opened a maven project in Eclipse IDE, and am using the
>>> flink-1.12 version.I used the java code similar to Example Program [1], and
>>> using the above dependencies in pom.xml
>>> I am wondering that are those steps correct? or something missing to
>>> install or add anything in the code/pom.xml?
>>>
>>> Thank you
>>>
>>> Best Regards,
>>> Abdullah
>>>
>>>
>>>
>>>
>>>
>>
>

Re: Compile Error

Posted by Chesnay Schepler <ch...@apache.org>.
I think your confusion is caused by using using "mvn clean", instead of 
"mvn clean package".

"mvn clean" cleans up, deleting jars and such, whereas "mvn package" 
compiles the code and packages a jar.

On 3/4/2021 3:41 PM, Abdullah bin Omar wrote:
> Hi Chesnay,
>
> Thank you for your reply. Sorry for coming up late.
>
> I follow the maven quickstart. when I run the pom.xml in m2Maven clean 
> way. Then it gives me this output in console:
>
> SLF4J: Class path contains multiple SLF4J bindings.
>
> SLF4J: Found binding in 
> [jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>
> SLF4J: Found binding in 
> [file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
>
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings 
> <http://www.slf4j.org/codes.html#multiple_bindings> for an explanation.
>
> SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
>
> SLF4J: Class path contains multiple SLF4J bindings.
>
> SLF4J: Found binding in 
> [jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>
> SLF4J: Found binding in 
> [file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
>
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings 
> <http://www.slf4j.org/codes.html#multiple_bindings> for an explanation.
>
> SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
>
> [INFO] Scanning for projects...
>
> [INFO]
>
> [INFO] ---------------------< org.apache.flink:newinput 
> >----------------------
>
> [INFO] Building newinput 0.0.1-SNAPSHOT
>
> [INFO] --------------------------------[ jar 
> ]---------------------------------
>
> [INFO]
>
> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ newinput ---
>
> [INFO] Deleting /Users/abdullah/Documents/newinput/target
>
> [INFO] 
> ------------------------------------------------------------------------
>
> [INFO] BUILD SUCCESS
>
> [INFO] 
> ------------------------------------------------------------------------
>
> [INFO] Total time:0.281 s
>
> [INFO] Finished at: 2021-03-04T08:10:00-06:00
>
> [INFO] 
> ------------------------------------------------------------------------
>
>
> and now when I run the code, it shows this error:
>
> Error: Could not find or load main class newinput.count
>
> Caused by: java.lang.ClassNotFoundException: newinput.count
>
>
> *_Question:_*
> in quickstarts 
> <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>, 
> it said in build project section,
>
> You will find a JAR file that contains your application, plus 
> connectors and libraries that you may have added as dependencies to 
> the application: |target/<artifact-id>-<version>.jar|.
> If you use a different class than /StreamingJob/ as the application’s 
> main class / entry point, we recommend you change the 
> |mainClass| setting in the |pom.xml| file accordingly.
>
>  I do not Understand the above two lines.
>
> The class name that I used is named "count": so different from a 
> streaming job.
>
> *Is something I missed due to not understanding those two lines?*
> *
> *
> *Thank you!*
>
>
>
>
>
>
>
> On Wed, Mar 3, 2021 at 2:49 PM Chesnay Schepler <chesnay@apache.org 
> <ma...@apache.org>> wrote:
>
>     The flink-clients dependency is correct.
>
>     We will need additional information to debug the Job execution
>     failures, because these can happen due to all kind of reasons.
>     Things like the full stacktrace, or exceptions from the logging
>     output.
>
>     Additionally, I would recommend to base your project on the
>     quickstarts
>     <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>.
>
>     On 3/3/2021 4:55 PM, Abdullah bin Omar wrote:
>>     Hi,
>>
>>     I am running a code (Example Program) from [1], and followed the
>>     [2] for the dependencies. I used this in the pom.xml:
>>
>>     <projectxmlns=/"http://maven.apache.org/POM/4.0.0
>>     <http://maven.apache.org/POM/4.0.0>"/xmlns:xsi=/"http://www.w3.org/2001/XMLSchema-instance
>>     <http://www.w3.org/2001/XMLSchema-instance>"/xsi:schemaLocation=/"http://maven.apache.org/POM/4.0.0
>>     <http://maven.apache.org/POM/4.0.0>
>>     https://maven.apache.org/xsd/maven-4.0.0.xsd
>>     <https://maven.apache.org/xsd/maven-4.0.0.xsd>"/>
>>
>>     <modelVersion>4.0.0</modelVersion>
>>
>>     <groupId>org.apache.flink </groupId>
>>
>>     <artifactId>newinput</artifactId>
>>
>>     <version>0.0.1-SNAPSHOT</version>
>>
>>     <dependencies>
>>
>>     <dependency>
>>
>>     <groupId>org.apache.flink</groupId>
>>
>>     <artifactId>flink-streaming-java_2.11</artifactId>
>>
>>     <version>1.12.0</version>
>>
>>     <scope>provided</scope>
>>
>>     </dependency>
>>
>>
>>
>>
>>     <dependency>
>>
>>     <groupId>org.slf4j</groupId>
>>
>>     <artifactId>slf4j-api</artifactId>
>>
>>     <version>1.7.5</version>
>>
>>     </dependency>
>>
>>     <dependency>
>>
>>     <groupId>org.slf4j</groupId>
>>
>>     <artifactId>slf4j-log4j12</artifactId>
>>
>>     <version>1.7.5</version>
>>
>>     </dependency>
>>
>>     </dependencies>
>>
>>
>>     </project>
>>
>>
>>
>>     I got an error, No Executor Factory Found
>>
>>     After that, I add flink-clients dependencies in the pom.xml
>>
>>     <dependency>
>>
>>     <groupId>org.apache.flink</groupId>
>>
>>     <artifactId>flink-clients_2.11</artifactId>
>>
>>               <type>jar</type>
>>
>>     <version>1.12.0</version>
>>
>>     <scope>provided</scope>
>>
>>     </dependency>
>>
>>
>>     Then the previous error (No Executor Factory Found) was removed.
>>     However, a new bunch of error appeared (like Job execution failed)
>>
>>
>>     [1]
>>     https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/
>>     <https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/>
>>     [2]
>>     https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration
>>     <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration>
>>
>>
>>     */_Questions:_/*
>>
>>     (1) is the flink-clients dependencies correct?
>>
>>     (2) I just opened a maven project in Eclipse IDE, and am using
>>     the flink-1.12 version.I used the java code similar to Example
>>     Program [1], and using the above dependencies in pom.xml
>>     I am wondering that are those steps correct? or something missing
>>     to install or add anything in the code/pom.xml?
>>
>>     Thank you
>>
>>     Best Regards,
>>     Abdullah
>>
>>
>>
>


Re: Compile Error

Posted by Abdullah bin Omar <ab...@gmail.com>.
Hi Chesnay,

Thank you for your reply. Sorry for coming up late.

I follow the maven quickstart. when I run the pom.xml in m2Maven clean way.
Then it gives me this output in console:

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in
[jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in
[jar:file:/Users/abdullah/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[file:/Users/abdullah/eclipse/java-2020-12/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

[INFO] Scanning for projects...

[INFO]

[INFO] ---------------------< org.apache.flink:newinput
>----------------------

[INFO] Building newinput 0.0.1-SNAPSHOT

[INFO] --------------------------------[ jar
]---------------------------------

[INFO]

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ newinput ---

[INFO] Deleting /Users/abdullah/Documents/newinput/target

[INFO]
------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO]
------------------------------------------------------------------------

[INFO] Total time:  0.281 s

[INFO] Finished at: 2021-03-04T08:10:00-06:00

[INFO]
------------------------------------------------------------------------

and now when I run the code, it shows this error:

Error: Could not find or load main class newinput.count

Caused by: java.lang.ClassNotFoundException: newinput.count

*Question:*
in quickstarts
<https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>,
it said in build project section,

You will find a JAR file that contains your application, plus connectors
and libraries that you may have added as dependencies to the application:
target/<artifact-id>-<version>.jar.
If you use a different class than *StreamingJob* as the application’s main
class / entry point, we recommend you change the mainClass setting in the
pom.xml file accordingly.

 I do not Understand the above two lines.

The class name that I used is named "count": so different from a streaming
job.

*Is something I missed due to not understanding those two lines?*

*Thank you!*







On Wed, Mar 3, 2021 at 2:49 PM Chesnay Schepler <ch...@apache.org> wrote:

> The flink-clients dependency is correct.
>
> We will need additional information to debug the Job execution failures,
> because these can happen due to all kind of reasons.
> Things like the full stacktrace, or exceptions from the logging output.
>
> Additionally, I would recommend to base your project on the quickstarts
> <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>
> .
>
> On 3/3/2021 4:55 PM, Abdullah bin Omar wrote:
>
> Hi,
>
> I am running a code (Example Program) from [1], and followed the [2] for
> the dependencies. I used this in the pom.xml:
>
> <project xmlns=*"http://maven.apache.org/POM/4.0.0
> <http://maven.apache.org/POM/4.0.0>"* xmlns:xsi=*"http://www.w3.org/2001/XMLSchema-instance
> <http://www.w3.org/2001/XMLSchema-instance>"* xsi:schemaLocation=*"http://maven.apache.org/POM/4.0.0
> <http://maven.apache.org/POM/4.0.0>
> https://maven.apache.org/xsd/maven-4.0.0.xsd
> <https://maven.apache.org/xsd/maven-4.0.0.xsd>"*>
>
>   <modelVersion>4.0.0</modelVersion>
>
>   <groupId>org.apache.flink </groupId>
>
>   <artifactId>newinput</artifactId>
>
>   <version>0.0.1-SNAPSHOT</version>
>
>
>
>   <dependencies>
>
>   <dependency>
>
> <groupId>org.apache.flink</groupId>
>
>   <artifactId>flink-streaming-java_2.11</artifactId>
>
>   <version>1.12.0</version>
>
>   <scope>provided</scope>
>
> </dependency>
>
>
>
>
> <dependency>
>
>        <groupId>org.slf4j</groupId>
>
>        <artifactId>slf4j-api</artifactId>
>
>        <version>1.7.5</version>
>
>    </dependency>
>
>    <dependency>
>
>        <groupId>org.slf4j</groupId>
>
>        <artifactId>slf4j-log4j12</artifactId>
>
>        <version>1.7.5</version>
>
>    </dependency>
>
> </dependencies>
>
>
> </project>
>
>
>
> I got an error, No Executor Factory Found
>
> After that, I add flink-clients dependencies in the pom.xml
>
> <dependency>
>
> <groupId>org.apache.flink</groupId>
>
>   <artifactId>flink-clients_2.11</artifactId>
>
>           <type>jar</type>
>
>   <version>1.12.0</version>
>
>   <scope>provided</scope>
>
> </dependency>
>
>
> Then the previous error (No Executor Factory Found) was removed. However,
> a new bunch of error appeared (like Job execution failed)
>
> [1]
> https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/
> [2]
> https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration
>
>
> *Questions:*
>
> (1) is the flink-clients dependencies correct?
>
> (2) I just opened a maven project in Eclipse IDE, and am using the
> flink-1.12 version.I used the java code similar to Example Program [1], and
> using the above dependencies in pom.xml
> I am wondering that are those steps correct? or something missing to
> install or add anything in the code/pom.xml?
>
> Thank you
>
> Best Regards,
> Abdullah
>
>
>
>
>

Re: Compile Error

Posted by Chesnay Schepler <ch...@apache.org>.
The flink-clients dependency is correct.

We will need additional information to debug the Job execution failures, 
because these can happen due to all kind of reasons.
Things like the full stacktrace, or exceptions from the logging output.

Additionally, I would recommend to base your project on the quickstarts 
<https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#maven-quickstart>.

On 3/3/2021 4:55 PM, Abdullah bin Omar wrote:
> Hi,
>
> I am running a code (Example Program) from [1], and followed the [2] 
> for the dependencies. I used this in the pom.xml:
>
> <projectxmlns=/"http://maven.apache.org/POM/4.0.0 
> <http://maven.apache.org/POM/4.0.0>"/xmlns:xsi=/"http://www.w3.org/2001/XMLSchema-instance 
> <http://www.w3.org/2001/XMLSchema-instance>"/xsi:schemaLocation=/"http://maven.apache.org/POM/4.0.0 
> <http://maven.apache.org/POM/4.0.0> 
> https://maven.apache.org/xsd/maven-4.0.0.xsd 
> <https://maven.apache.org/xsd/maven-4.0.0.xsd>"/>
>
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>org.apache.flink </groupId>
>
> <artifactId>newinput</artifactId>
>
> <version>0.0.1-SNAPSHOT</version>
>
> <dependencies>
>
> <dependency>
>
> <groupId>org.apache.flink</groupId>
>
> <artifactId>flink-streaming-java_2.11</artifactId>
>
> <version>1.12.0</version>
>
> <scope>provided</scope>
>
> </dependency>
>
>
>
>
> <dependency>
>
> <groupId>org.slf4j</groupId>
>
> <artifactId>slf4j-api</artifactId>
>
> <version>1.7.5</version>
>
> </dependency>
>
> <dependency>
>
> <groupId>org.slf4j</groupId>
>
> <artifactId>slf4j-log4j12</artifactId>
>
> <version>1.7.5</version>
>
> </dependency>
>
> </dependencies>
>
>
> </project>
>
>
>
> I got an error, No Executor Factory Found
>
> After that, I add flink-clients dependencies in the pom.xml
>
> <dependency>
>
> <groupId>org.apache.flink</groupId>
>
> <artifactId>flink-clients_2.11</artifactId>
>
> <type>jar</type>
>
> <version>1.12.0</version>
>
> <scope>provided</scope>
>
> </dependency>
>
>
> Then the previous error (No Executor Factory Found) was removed. 
> However, a new bunch of error appeared (like Job execution failed)
>
>
> [1] 
> https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/ 
> <https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/overview/>
> [2] 
> https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration 
> <https://ci.apache.org/projects/flink/flink-docs-stable/dev/project-configuration.html#project-configuration>
>
>
> */_Questions:_/*
>
> (1) is the flink-clients dependencies correct?
>
> (2) I just opened a maven project in Eclipse IDE, and am using the 
> flink-1.12 version.I used the java code similar to Example Program 
> [1], and using the above dependencies in pom.xml
> I am wondering that are those steps correct? or something missing to 
> install or add anything in the code/pom.xml?
>
> Thank you
>
> Best Regards,
> Abdullah
>
>
>