flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinay Patil <vinay18.pa...@gmail.com>
Subject Re: [Issue] No Class Definition Found Error
Date Sat, 11 Jun 2016 19:07:43 GMT
Issue resolved.

Created the uber jar (fat jar) as shown in the flink-quickstart guide.
My bad, I should have checked that first.

However now I am facing NullPointerException , consider the following
example (this is the dummy code , since I cannot share the actual code):

public class App implements MapFunction<String, List<String>> {
     private static TempClass tempClass;

     public App() {
          tempClass = new TempClass();
     }

     @Override
public List<String> map(String dummyString) throws Exception {
                 *tempClass.doSomething(dummyString); // getting NPE here*
      }
}

I am not getting NPE when I run it on a single machine, however when I run
on a cluster , it gives me NPE.
Instantiating tempClass inside the map function will fix the issue ,
however my reviewer suggested not to initialize it inside the operator as
it will get initialized always, so did it in the constructor.


Also, when I looked at the flink examples, you have used static classes and
accessed the functions inside operators, so which is the better approach
instantiating inside the operators or use static class ?



Regards,
Vinay Patil

*+91-800-728-4749*

On Sat, Jun 11, 2016 at 9:32 AM, Vinay Patil <vinay18.patil@gmail.com>
wrote:

> Hi Robert,
>
> Yes we are using maven for building the jar, I have deployed both jar with
> dependencies  and without dependencies.
>
> I actually cannot share the pom since it is on the client machine.
> But all the dependencies required are there, I have attached a sample pom
> file which is similar to the pom we are using
>
> Regards,
> Vinay Patil
>
> *+91-800-728-4749*
>
> On Sat, Jun 11, 2016 at 1:36 AM, Robert Metzger <rmetzger@apache.org>
> wrote:
>
>> Are you using Maven for building your job jar?
>> If yes, can you post your pom file on the mailing list?
>>
>> On Fri, Jun 10, 2016 at 7:16 PM, THORMAN, ROBERT D <rt2357@att.com>
>> wrote:
>>
>> > How did you “provide” the dependencies?  Did you use the –C <URL>
>> > parameter when you submitted your job?
>> >
>> > On 6/10/16, 11:35 AM, "Vinay Patil" <vinay18.patil@gmail.com> wrote:
>> >
>> > >Hi Guys,
>> > >
>> > >I have deployed my application on a cluster, however when I try to run
>> the
>> > >application it throws *NoClassDefFoundError for
>> > KeyedDeserializationSchema*,
>> > >all the dependencies are provided correctly since I have run it on a
>> > >different standalone node.
>> > >
>> > >Please Help
>> > >
>> > >Regards,
>> > >Vinay Patil
>> >
>> >
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message