cancel
Showing results for 
Search instead for 
Did you mean: 

Getting java.lang.NoClassDefFoundError in Ready API

SOLVED
Highlighted
Occasional Contributor

Getting java.lang.NoClassDefFoundError in Ready API

HI all,

I have a need where I need to come up with a function which with return a Jason to map

Json

{ "a":

  { "b": 1,

    "c": null,

    "d": [false, true]

  },

  "e": "f",

  "g": 2.3

}

 Map

Key

Value

a.b

1

a.c

null

a.d[0]

false

a.d[1]

true

e

f

g

2.3

 

This can be done using JsonFlattener jar and was implemented in Eclipse, so added that external Jar in Ready API under “Custom Java libraries” but on executing this function it error out with message “java.lang.NoClassDefFoundError”, can some one please help me how this can be resolved.

 

Below is the code

import com.github.wnameless.json.flattener.JsonFlattener;

 

public def func1(def expected){

def resultMap = [ : ];

resultMap = JsonFlattener.flattenAsMap(expected)

return resultMap;

}

 

 

Tags (2)
3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Leader

Re: Getting java.lang.NoClassDefFoundError in Ready API

@vpnkumar : Put the desired jars into :

 

1. bin/ext and

2. /lib

 

both the folder and then re-start the readyapi. Hope it will resolve the issue

 

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

Highlighted
Community Hero

Re: Getting java.lang.NoClassDefFoundError in Ready API

@vpnkumar,

Can you please confirm the directory you saved your .jar file to?

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

Highlighted
Community Hero

Re: Getting java.lang.NoClassDefFoundError in Ready API

Sorry. I didnt see HimanshuTayal's response when i posted mine.

@HimanshuTayal. I think he only has to copy the file to bin/ext rather than lib as well though, right?

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

5 REPLIES 5
Highlighted
Community Leader

Re: Getting java.lang.NoClassDefFoundError in Ready API

@vpnkumar : Put the desired jars into :

 

1. bin/ext and

2. /lib

 

both the folder and then re-start the readyapi. Hope it will resolve the issue

 

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

Highlighted
Community Hero

Re: Getting java.lang.NoClassDefFoundError in Ready API

@vpnkumar,

Can you please confirm the directory you saved your .jar file to?

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

Highlighted
Community Hero

Re: Getting java.lang.NoClassDefFoundError in Ready API

Sorry. I didnt see HimanshuTayal's response when i posted mine.

@HimanshuTayal. I think he only has to copy the file to bin/ext rather than lib as well though, right?

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

Highlighted
Occasional Contributor

Re: Getting java.lang.NoClassDefFoundError in Ready API

I tried same copying jar files "C:\Program Files\SmartBear\ReadyAPI-3.3.2\bin\ext" but still running into same issue 

Highlighted
Occasional Contributor

Re: Getting java.lang.NoClassDefFoundError in Ready API

it was my mistake I forget to copy one of the dependencies, after coping it it is resolved now thanks 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors