Message Boards

java.lang.IllegalArgumentException in Json parameter api

Pankaj Kumar, modified 3 Years ago.

java.lang.IllegalArgumentException in Json parameter api

Regular Member Posts: 101 Join Date: 7/27/14 Recent Posts
Hi All,I have created the JSON web service which taking  two parameter.While invoking  service i am getting  below issue.java.lang.IllegalArgumentException
at jodd.asm5.ClassReader.<init>(ClassReader.java:170) at jodd.asm5.ClassReader.<init>(ClassReader.java:153) at jodd.asm5.ClassReader.<init>(ClassReader.java:424) at jodd.paramo.Paramo.resolveParameters(Paramo.java:59) at com.liferay.portal.util.MethodParametersResolverImpl.resolveMethodParameters(MethodParametersResolverImpl.java:49)WE are using Liferay DXP 7.2 and Open JDK 11.After debugging i noticed  Liferay use   jodd.asm5 
and I checked Jodd site https://jodd.org/download/ and they are not supporting it after Java 8. 
Please tell if any body faced this issue and able to find  solution.
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: java.lang.IllegalArgumentException in Json parameter api

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
I believe, you need to give more information to the users here.
How did you create the webservice? A rest service using Whiteboard? With the old CXF method? Using Service Builder? Something else?
What kind of parameters do you have?
Did you test it with Java 8? Does it work with Java 8?
Pankaj Kumar, modified 3 Years ago.

RE: java.lang.IllegalArgumentException in Json parameter api

Regular Member Posts: 101 Join Date: 7/27/14 Recent Posts
Hi Christoph
We are not using CXF method.We are generating  JSON Web service using service builder.
It's working fine  in JAVA 8.But in  JAVA 11 we facing IIlgealArgumetnException  while invoking.
Thanks,
Pankaj Semwal 
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: java.lang.IllegalArgumentException in Json parameter api

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
Hmm.It seems, Liferay uses Jodd 3.6.X and that's pretty old, so it is quite possible it won't work with Java 11 at all. I fear, this issue isn't easily solved. Liferay probably needs to upgrade Jodd anyway, but even if they do, they will only do it for 7.3 or 7.4.
Also, it seems even the most current version of Jodd doesn't fully support Java 11. So, even were they to upgrade it, there might still be issues.

But I have used Liferay 7 and Java 11 already, so it should work in general. What kind of parameters do you have for your functions? I mean, I know that trivial parameters work. Could you show us the method signature that doesn't work?
Pankaj Kumar, modified 3 Years ago.

RE: java.lang.IllegalArgumentException in Json parameter api

Regular Member Posts: 101 Join Date: 7/27/14 Recent Posts
Add method in ServiceIml class with two parameter 
e.g
public class  TestServiceImpl extends TestServiceBaseImpl {public JSONObject TestMethod(String param1, final String param2){
}}
thumbnail
Thiago Leão Moreira, modified 3 Years ago.

RE: java.lang.IllegalArgumentException in Json parameter api

Liferay Legend Posts: 1449 Join Date: 10/10/07 Recent Posts
It is a bug. I just reported it on https://issues.liferay.com/browse/LPS-120538