Message Boards
JSON WebService questions
Robert Paul Meissner, modified 3 Years ago.
JSON WebService questions
New Member Posts: 12 Join Date: 2/7/20 Recent Posts
Hi,
i am following this tutorial for Liferay 7.2: https://help.liferay.com/hc/en-us/articles/360032887552-Introduction-to-Developing-a-Web-Application
Now, i want to skip the guestbook-web portlet and use the guestbook-service as a remote JSON WebService only. (Afterwards I want to use a Vue Portlet instead to consumes the JSON WebService, but thats not the topic here.) However, I found issues while creating the JSON WebService.
After the LocalServiceImpl I have implemented the ServiceImpl classes for the methods, that get exposed remotely. (They simply call the LocalService methods.) Hit buildService and deployed it. They appear underhttp://localhost:8080/api/jsonws?contextName=gb but when I click on them, i get
2020-09-17 09:25:12.782 ERROR [http-nio-8080-exec-9][IncludeTag:128] Current URL /api/jsonws?contextName=gb&signature=%2Fgb.guestbook%2Fget-guestbooks-1-long generates exception: null
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)
at com.liferay.portal.kernel.util.MethodParametersResolverUtil.resolveMethodParameters(MethodParametersResolverUtil.java:29)
at com.liferay.portal.jsonwebservice.JSONWebServiceActionConfig.getMethodParameters(JSONWebServiceActionConfig.java:185)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:201)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:406)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:382)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:217)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
Now I am not sure, if i missed something. Please help!
Best regards
i am following this tutorial for Liferay 7.2: https://help.liferay.com/hc/en-us/articles/360032887552-Introduction-to-Developing-a-Web-Application
Now, i want to skip the guestbook-web portlet and use the guestbook-service as a remote JSON WebService only. (Afterwards I want to use a Vue Portlet instead to consumes the JSON WebService, but thats not the topic here.) However, I found issues while creating the JSON WebService.
After the LocalServiceImpl I have implemented the ServiceImpl classes for the methods, that get exposed remotely. (They simply call the LocalService methods.) Hit buildService and deployed it. They appear underhttp://localhost:8080/api/jsonws?contextName=gb but when I click on them, i get
2020-09-17 09:25:12.782 ERROR [http-nio-8080-exec-9][IncludeTag:128] Current URL /api/jsonws?contextName=gb&signature=%2Fgb.guestbook%2Fget-guestbooks-1-long generates exception: null
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)
at com.liferay.portal.kernel.util.MethodParametersResolverUtil.resolveMethodParameters(MethodParametersResolverUtil.java:29)
at com.liferay.portal.jsonwebservice.JSONWebServiceActionConfig.getMethodParameters(JSONWebServiceActionConfig.java:185)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:201)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:406)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:382)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:217)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
Now I am not sure, if i missed something. Please help!
Best regards