You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Sebastián Magrí <se...@gmail.com> on 2021/01/22 15:03:36 UTC

[Flink SQL] CompilerFactory cannot be cast error when executing statement

Hi!

I'm trying out Flink SQL with the attached docker-compose file.

It starts up and then I create a table with the following statement:

CREATE TABLE mytable_simple (
  `customer_id` INT
) WITH (
  'connector' = 'jdbc',
  'url' = 'jdbc:postgresql://pgusr:pgpwd@postgres/pdgb',
  'table-name' = 'mytable'
);

However when I try to run this:

select * from mytable_simple;

I get the following error in the client:

[ERROR] Could not execute SQL statement. Reason:
java.lang.ClassCastException: org.codehaus.janino.CompilerFactory cannot be
cast to org.codehaus.commons.compiler.ICompilerFactory

At first I thought it could be an incompatibility issue with the libraries
I was putting in, like the postgres-cdc library version, but even after
leaving only the JDBC libraries in I still get the same error.

It'd be great if you could give me some pointers here.

Thanks!

-- 
Sebastián Ramírez Magrí

Re: [Flink SQL] CompilerFactory cannot be cast error when executing statement

Posted by Sebastián Magrí <se...@gmail.com>.
Hi Timo!

I've been building my jobs instead of using the binaries to avoid this
issue, hence I've not looked at this again. But I'd say it's still an issue
since nothing from the set up have changed in the meantime.

Thanks!

On Tue, 2 Feb 2021 at 08:51, Timo Walther <tw...@apache.org> wrote:

> Hi Sebastian,
>
> sorry for the late reply. Could you solve the problem in the meantime?
> It definitely looks like a dependency conflict.
>
> Regards,
> Timo
>
>
> On 22.01.21 18:18, Sebastián Magrí wrote:
> > Thanks a lot Matthias!
> >
> > In the meantime I'm trying out something with the scala quickstart.
> >
> >
> > On Fri, 22 Jan 2021 at 17:12, Matthias Pohl <matthias@ververica.com
> > <ma...@ververica.com>> wrote:
> >
> >     Ok, to be fair, I just did some research on the error message and
> >     didn't realize that you're working with binaries only.
> >
> >     I tried to set it up on my machine to be able to reproduce your
> >     error. Unfortunately, I wasn't able to establish the connection
> >     between Flink and Postgres using your docker-compose.yml.
> >     I'm going to cc Timo. Maybe, he has a guess what's causing this
> error.
> >
> >     Best,
> >     Matthias
> >
> >     On Fri, Jan 22, 2021 at 4:35 PM Sebastián Magrí
> >     <sebasmagri@gmail.com <ma...@gmail.com>> wrote:
> >
> >         Hi Matthias!
> >
> >         I went through that thread but as I'm just using the
> >         `apache/flink` docker image for testing I honestly couldn't
> >         figure out how I would do that since I don't have a pom file to
> >         edit. If it's possible to do it through the configuration I'd be
> >         glad if you could point me out in the right direction.
> >
> >         Pretty evident I don't have a lot of experience with mvn or
> >         "modern" Java in general.
> >
> >         :-)
> >
> >         Thanks!
> >
> >         On Fri, 22 Jan 2021 at 15:19, Matthias Pohl
> >         <matthias@ververica.com <ma...@ververica.com>> wrote:
> >
> >             Hi Sebastián,
> >             have you tried changing the dependency scope to provided
> >             for flink-table-planner-blink as it is suggested in [1]?
> >
> >             Best,
> >             Matthias
> >
> >             [1]
> >
> http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html
> >             <
> http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html
> >
> >
> >             On Fri, Jan 22, 2021 at 4:04 PM Sebastián Magrí
> >             <sebasmagri@gmail.com <ma...@gmail.com>> wrote:
> >
> >                 Hi!
> >
> >                 I'm trying out Flink SQL with the attached
> >                 docker-compose file.
> >
> >                 It starts up and then I create a table with the
> >                 following statement:
> >
> >                 CREATE TABLE mytable_simple (
> >                    `customer_id` INT
> >                 ) WITH (
> >                    'connector' = 'jdbc',
> >                    'url' = 'jdbc:postgresql://pgusr:pgpwd@postgres
> /pdgb',
> >                    'table-name' = 'mytable'
> >                 );
> >
> >                 However when I try to run this:
> >
> >                 select * from mytable_simple;
> >
> >                 I get the following error in the client:
> >
> >                 [ERROR] Could not execute SQL statement. Reason:
> >                 java.lang.ClassCastException:
> >                 org.codehaus.janino.CompilerFactory cannot be cast to
> >                 org.codehaus.commons.compiler.ICompilerFactory
> >
> >                 At first I thought it could be an incompatibility issue
> >                 with the libraries I was putting in, like the
> >                 postgres-cdc library version, but even after leaving
> >                 only the JDBC libraries in I still get the same error.
> >
> >                 It'd be great if you could give me some pointers here.
> >
> >                 Thanks!
> >
> >                 --
> >                 Sebastián Ramírez Magrí
> >
> >
> >
> >         --
> >         Sebastián Ramírez Magrí
> >
> >
> >     Managing Directors: Yip Park Tung Jason, Jinwei (Kevin) Zhang, Karl
> >     Anton Wehner
> >
> >
> >
> > --
> > Sebastián Ramírez Magrí
>
>

-- 
Sebastián Ramírez Magrí

Re: [Flink SQL] CompilerFactory cannot be cast error when executing statement

Posted by Timo Walther <tw...@apache.org>.
Hi Sebastian,

sorry for the late reply. Could you solve the problem in the meantime? 
It definitely looks like a dependency conflict.

Regards,
Timo


On 22.01.21 18:18, Sebastián Magrí wrote:
> Thanks a lot Matthias!
> 
> In the meantime I'm trying out something with the scala quickstart.
> 
> 
> On Fri, 22 Jan 2021 at 17:12, Matthias Pohl <matthias@ververica.com 
> <ma...@ververica.com>> wrote:
> 
>     Ok, to be fair, I just did some research on the error message and
>     didn't realize that you're working with binaries only.
> 
>     I tried to set it up on my machine to be able to reproduce your
>     error. Unfortunately, I wasn't able to establish the connection
>     between Flink and Postgres using your docker-compose.yml.
>     I'm going to cc Timo. Maybe, he has a guess what's causing this error.
> 
>     Best,
>     Matthias
> 
>     On Fri, Jan 22, 2021 at 4:35 PM Sebastián Magrí
>     <sebasmagri@gmail.com <ma...@gmail.com>> wrote:
> 
>         Hi Matthias!
> 
>         I went through that thread but as I'm just using the
>         `apache/flink` docker image for testing I honestly couldn't
>         figure out how I would do that since I don't have a pom file to
>         edit. If it's possible to do it through the configuration I'd be
>         glad if you could point me out in the right direction.
> 
>         Pretty evident I don't have a lot of experience with mvn or
>         "modern" Java in general.
> 
>         :-)
> 
>         Thanks!
> 
>         On Fri, 22 Jan 2021 at 15:19, Matthias Pohl
>         <matthias@ververica.com <ma...@ververica.com>> wrote:
> 
>             Hi Sebastián,
>             have you tried changing the dependency scope to provided
>             for flink-table-planner-blink as it is suggested in [1]?
> 
>             Best,
>             Matthias
> 
>             [1]
>             http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html
>             <http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html>
> 
>             On Fri, Jan 22, 2021 at 4:04 PM Sebastián Magrí
>             <sebasmagri@gmail.com <ma...@gmail.com>> wrote:
> 
>                 Hi!
> 
>                 I'm trying out Flink SQL with the attached
>                 docker-compose file.
> 
>                 It starts up and then I create a table with the
>                 following statement:
> 
>                 CREATE TABLE mytable_simple (
>                    `customer_id` INT
>                 ) WITH (
>                    'connector' = 'jdbc',
>                    'url' = 'jdbc:postgresql://pgusr:pgpwd@postgres/pdgb',
>                    'table-name' = 'mytable'
>                 );
> 
>                 However when I try to run this:
> 
>                 select * from mytable_simple;
> 
>                 I get the following error in the client:
> 
>                 [ERROR] Could not execute SQL statement. Reason:
>                 java.lang.ClassCastException:
>                 org.codehaus.janino.CompilerFactory cannot be cast to
>                 org.codehaus.commons.compiler.ICompilerFactory
> 
>                 At first I thought it could be an incompatibility issue
>                 with the libraries I was putting in, like the
>                 postgres-cdc library version, but even after leaving
>                 only the JDBC libraries in I still get the same error.
> 
>                 It'd be great if you could give me some pointers here.
> 
>                 Thanks!
> 
>                 -- 
>                 Sebastián Ramírez Magrí
> 
> 
> 
>         -- 
>         Sebastián Ramírez Magrí
> 
> 
>     Managing Directors: Yip Park Tung Jason, Jinwei (Kevin) Zhang, Karl
>     Anton Wehner
> 
> 
> 
> -- 
> Sebastián Ramírez Magrí


Re: [Flink SQL] CompilerFactory cannot be cast error when executing statement

Posted by Sebastián Magrí <se...@gmail.com>.
Thanks a lot Matthias!

In the meantime I'm trying out something with the scala quickstart.


On Fri, 22 Jan 2021 at 17:12, Matthias Pohl <ma...@ververica.com> wrote:

> Ok, to be fair, I just did some research on the error message and didn't
> realize that you're working with binaries only.
>
> I tried to set it up on my machine to be able to reproduce your error.
> Unfortunately, I wasn't able to establish the connection between Flink and
> Postgres using your docker-compose.yml.
> I'm going to cc Timo. Maybe, he has a guess what's causing this error.
>
> Best,
> Matthias
>
> On Fri, Jan 22, 2021 at 4:35 PM Sebastián Magrí <se...@gmail.com>
> wrote:
>
>> Hi Matthias!
>>
>> I went through that thread but as I'm just using the `apache/flink`
>> docker image for testing I honestly couldn't figure out how I would do that
>> since I don't have a pom file to edit. If it's possible to do it through
>> the configuration I'd be glad if you could point me out in the right
>> direction.
>>
>> Pretty evident I don't have a lot of experience with mvn or "modern" Java
>> in general.
>>
>> :-)
>>
>> Thanks!
>>
>> On Fri, 22 Jan 2021 at 15:19, Matthias Pohl <ma...@ververica.com>
>> wrote:
>>
>>> Hi Sebastián,
>>> have you tried changing the dependency scope to provided
>>> for flink-table-planner-blink as it is suggested in [1]?
>>>
>>> Best,
>>> Matthias
>>>
>>> [1]
>>> http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html
>>>
>>> On Fri, Jan 22, 2021 at 4:04 PM Sebastián Magrí <se...@gmail.com>
>>> wrote:
>>>
>>>> Hi!
>>>>
>>>> I'm trying out Flink SQL with the attached docker-compose file.
>>>>
>>>> It starts up and then I create a table with the following statement:
>>>>
>>>> CREATE TABLE mytable_simple (
>>>>   `customer_id` INT
>>>> ) WITH (
>>>>   'connector' = 'jdbc',
>>>>   'url' = 'jdbc:postgresql://pgusr:pgpwd@postgres/pdgb',
>>>>   'table-name' = 'mytable'
>>>> );
>>>>
>>>> However when I try to run this:
>>>>
>>>> select * from mytable_simple;
>>>>
>>>> I get the following error in the client:
>>>>
>>>> [ERROR] Could not execute SQL statement. Reason:
>>>> java.lang.ClassCastException: org.codehaus.janino.CompilerFactory
>>>> cannot be cast to org.codehaus.commons.compiler.ICompilerFactory
>>>>
>>>> At first I thought it could be an incompatibility issue with the
>>>> libraries I was putting in, like the postgres-cdc library version, but even
>>>> after leaving only the JDBC libraries in I still get the same error.
>>>>
>>>> It'd be great if you could give me some pointers here.
>>>>
>>>> Thanks!
>>>>
>>>> --
>>>> Sebastián Ramírez Magrí
>>>>
>>>
>>
>> --
>> Sebastián Ramírez Magrí
>>
>
> Managing Directors: Yip Park Tung Jason, Jinwei (Kevin) Zhang, Karl Anton
> Wehner
>


-- 
Sebastián Ramírez Magrí

Re: [Flink SQL] CompilerFactory cannot be cast error when executing statement

Posted by Matthias Pohl <ma...@ververica.com>.
Ok, to be fair, I just did some research on the error message and didn't
realize that you're working with binaries only.

I tried to set it up on my machine to be able to reproduce your error.
Unfortunately, I wasn't able to establish the connection between Flink and
Postgres using your docker-compose.yml.
I'm going to cc Timo. Maybe, he has a guess what's causing this error.

Best,
Matthias

On Fri, Jan 22, 2021 at 4:35 PM Sebastián Magrí <se...@gmail.com>
wrote:

> Hi Matthias!
>
> I went through that thread but as I'm just using the `apache/flink` docker
> image for testing I honestly couldn't figure out how I would do that since
> I don't have a pom file to edit. If it's possible to do it through the
> configuration I'd be glad if you could point me out in the right direction.
>
> Pretty evident I don't have a lot of experience with mvn or "modern" Java
> in general.
>
> :-)
>
> Thanks!
>
> On Fri, 22 Jan 2021 at 15:19, Matthias Pohl <ma...@ververica.com>
> wrote:
>
>> Hi Sebastián,
>> have you tried changing the dependency scope to provided
>> for flink-table-planner-blink as it is suggested in [1]?
>>
>> Best,
>> Matthias
>>
>> [1]
>> http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html
>>
>> On Fri, Jan 22, 2021 at 4:04 PM Sebastián Magrí <se...@gmail.com>
>> wrote:
>>
>>> Hi!
>>>
>>> I'm trying out Flink SQL with the attached docker-compose file.
>>>
>>> It starts up and then I create a table with the following statement:
>>>
>>> CREATE TABLE mytable_simple (
>>>   `customer_id` INT
>>> ) WITH (
>>>   'connector' = 'jdbc',
>>>   'url' = 'jdbc:postgresql://pgusr:pgpwd@postgres/pdgb',
>>>   'table-name' = 'mytable'
>>> );
>>>
>>> However when I try to run this:
>>>
>>> select * from mytable_simple;
>>>
>>> I get the following error in the client:
>>>
>>> [ERROR] Could not execute SQL statement. Reason:
>>> java.lang.ClassCastException: org.codehaus.janino.CompilerFactory cannot
>>> be cast to org.codehaus.commons.compiler.ICompilerFactory
>>>
>>> At first I thought it could be an incompatibility issue with the
>>> libraries I was putting in, like the postgres-cdc library version, but even
>>> after leaving only the JDBC libraries in I still get the same error.
>>>
>>> It'd be great if you could give me some pointers here.
>>>
>>> Thanks!
>>>
>>> --
>>> Sebastián Ramírez Magrí
>>>
>>
>
> --
> Sebastián Ramírez Magrí
>

Managing Directors: Yip Park Tung Jason, Jinwei (Kevin) Zhang, Karl Anton
Wehner

Re: [Flink SQL] CompilerFactory cannot be cast error when executing statement

Posted by Sebastián Magrí <se...@gmail.com>.
Hi Matthias!

I went through that thread but as I'm just using the `apache/flink` docker
image for testing I honestly couldn't figure out how I would do that since
I don't have a pom file to edit. If it's possible to do it through the
configuration I'd be glad if you could point me out in the right direction.

Pretty evident I don't have a lot of experience with mvn or "modern" Java
in general.

:-)

Thanks!

On Fri, 22 Jan 2021 at 15:19, Matthias Pohl <ma...@ververica.com> wrote:

> Hi Sebastián,
> have you tried changing the dependency scope to provided
> for flink-table-planner-blink as it is suggested in [1]?
>
> Best,
> Matthias
>
> [1]
> http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html
>
> On Fri, Jan 22, 2021 at 4:04 PM Sebastián Magrí <se...@gmail.com>
> wrote:
>
>> Hi!
>>
>> I'm trying out Flink SQL with the attached docker-compose file.
>>
>> It starts up and then I create a table with the following statement:
>>
>> CREATE TABLE mytable_simple (
>>   `customer_id` INT
>> ) WITH (
>>   'connector' = 'jdbc',
>>   'url' = 'jdbc:postgresql://pgusr:pgpwd@postgres/pdgb',
>>   'table-name' = 'mytable'
>> );
>>
>> However when I try to run this:
>>
>> select * from mytable_simple;
>>
>> I get the following error in the client:
>>
>> [ERROR] Could not execute SQL statement. Reason:
>> java.lang.ClassCastException: org.codehaus.janino.CompilerFactory cannot
>> be cast to org.codehaus.commons.compiler.ICompilerFactory
>>
>> At first I thought it could be an incompatibility issue with the
>> libraries I was putting in, like the postgres-cdc library version, but even
>> after leaving only the JDBC libraries in I still get the same error.
>>
>> It'd be great if you could give me some pointers here.
>>
>> Thanks!
>>
>> --
>> Sebastián Ramírez Magrí
>>
>

-- 
Sebastián Ramírez Magrí

Re: [Flink SQL] CompilerFactory cannot be cast error when executing statement

Posted by Matthias Pohl <ma...@ververica.com>.
Hi Sebastián,
have you tried changing the dependency scope to provided
for flink-table-planner-blink as it is suggested in [1]?

Best,
Matthias

[1]
http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Flink-1-10-exception-Unable-to-instantiate-java-compiler-td38221.html

On Fri, Jan 22, 2021 at 4:04 PM Sebastián Magrí <se...@gmail.com>
wrote:

> Hi!
>
> I'm trying out Flink SQL with the attached docker-compose file.
>
> It starts up and then I create a table with the following statement:
>
> CREATE TABLE mytable_simple (
>   `customer_id` INT
> ) WITH (
>   'connector' = 'jdbc',
>   'url' = 'jdbc:postgresql://pgusr:pgpwd@postgres/pdgb',
>   'table-name' = 'mytable'
> );
>
> However when I try to run this:
>
> select * from mytable_simple;
>
> I get the following error in the client:
>
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.ClassCastException: org.codehaus.janino.CompilerFactory cannot
> be cast to org.codehaus.commons.compiler.ICompilerFactory
>
> At first I thought it could be an incompatibility issue with the libraries
> I was putting in, like the postgres-cdc library version, but even after
> leaving only the JDBC libraries in I still get the same error.
>
> It'd be great if you could give me some pointers here.
>
> Thanks!
>
> --
> Sebastián Ramírez Magrí
>