<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Remote service builder in Liferay 7.3</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120754583" />
  <subtitle>Remote service builder in Liferay 7.3</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120754583</id>
  <updated>2026-10-15T10:47:54Z</updated>
  <dc:date>2026-10-15T10:47:54Z</dc:date>
  <entry>
    <title>RE: Remote service builder in Liferay 7.3</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120785883" />
    <author>
      <name>Purvesh Kachhiya</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120785883</id>
    <updated>2021-05-17T17:27:42Z</updated>
    <published>2021-05-17T17:17:43Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Need to add &lt;code&gt;remote-service&lt;/code&gt; attribute
  to &lt;code&gt;true&lt;/code&gt; for an entity.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;entity name=&amp;quot;Student&amp;quot; local-service=&amp;quot;true&amp;quot; remote-service=&amp;quot;true&amp;quot; &amp;gt;
        &amp;lt;column name=&amp;quot;studentId&amp;quot; type=&amp;quot;long&amp;quot; primary=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/column&amp;gt;
        &amp;lt;column name=&amp;quot;name&amp;quot; type=&amp;quot;String&amp;quot;&amp;gt;&amp;lt;/column&amp;gt;
    &amp;lt;/entity&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Purvesh Kachhiya</dc:creator>
    <dc:date>2021-05-17T17:17:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Remote service builder in Liferay 7.3</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120775166" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120775166</id>
    <updated>2021-05-07T07:33:53Z</updated>
    <published>2021-05-07T07:33:53Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Yes, I've got a error 500. I was investigating and I think that is
  due to jdk11 compatiblity. I've tried to add this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;tasks.withType(JavaCompile) {

	// Generated classes using Jodd library are unable to be read when compiled against JDK 11

	sourceCompatibility = JavaVersion.VERSION_1_8
	targetCompatibility = JavaVersion.VERSION_1_8
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but I can't compile due to this error&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Could not determine the dependencies of task ':modules:ServiceTest:ServiceTest-service:jar'.
&amp;gt; Could not resolve all task dependencies for configuration ':modules:ServiceTest:ServiceTest-service:compileClasspath'.
   &amp;gt; Could not resolve project :modules:ServiceTest:ServiceTest-api.
     Required by:
         project :modules:ServiceTest:ServiceTest-service
      &amp;gt; No matching variant of project :modules:ServiceTest:ServiceTest-api was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, and its dependencies declared externally but:
          - Variant 'apiElements' capability Eulen_7_3_workspace.modules.ServiceTest:ServiceTest-api:1.0.0 declares an API of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
          - Variant 'runtimeElements' capability Eulen_7_3_workspace.modules.ServiceTest:ServiceTest-api:1.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2021-05-07T07:33:53Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Remote service builder in Liferay 7.3</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120756750" />
    <author>
      <name>Mirko Romstadt</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120756750</id>
    <updated>2021-05-05T13:54:20Z</updated>
    <published>2021-05-05T13:54:20Z</published>
    <summary type="html">&lt;p&gt;So you get the same error message for a GET request? What do you get
  if you try to do the call in e.g. Postman for
  /api/jsonws/student.student/get-student-by-id-1-long/1234 ?&lt;/p&gt;</summary>
    <dc:creator>Mirko Romstadt</dc:creator>
    <dc:date>2021-05-05T13:54:20Z</dc:date>
  </entry>
  <entry>
    <title>RE: Remote service builder in Liferay 7.3</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120756689" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120756689</id>
    <updated>2021-05-05T12:26:22Z</updated>
    <published>2021-05-05T12:26:22Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;First of all, thanks for your answer.&lt;/p&gt;
&lt;p&gt;I tried to make a get request, but when it didn't work, I tried with
  a post request but it didn't work neither&lt;/p&gt;
&lt;p&gt;I've investigated more and the issue is with the parameter of the
  function. If I make a function with no parameters it works fine. If I
  add a parameter like the long one, it fails.&lt;br /&gt; &lt;/p&gt;
&lt;p&gt;Reagrds&lt;/p&gt;</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2021-05-05T12:26:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: Remote service builder in Liferay 7.3</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120754644" />
    <author>
      <name>Mirko Romstadt</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120754644</id>
    <updated>2021-05-05T11:37:22Z</updated>
    <published>2021-05-05T11:37:22Z</published>
    <summary type="html">&lt;p&gt;Why do you make this a POST request and not a GET request?&lt;/p&gt;</summary>
    <dc:creator>Mirko Romstadt</dc:creator>
    <dc:date>2021-05-05T11:37:22Z</dc:date>
  </entry>
  <entry>
    <title>Remote service builder in Liferay 7.3</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120754582" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120754582</id>
    <updated>2021-05-05T10:14:06Z</updated>
    <published>2021-05-05T10:13:38Z</published>
    <summary type="html">&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I am trying to create a remote service builder. I was trying to
  create and deploy it, but once I try to access from /api/jsonws  I
  receive this error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Current URL /api/jsonws?contextName=studentname&amp;amp;signature=%2Fstudent.student%2Fget-student-by-id-1-long generates exception: null
java.lang.IllegalArgumentException
        at jodd.asm5.ClassReader.&amp;lt;init&amp;gt;(ClassReader.java:170)
        at jodd.asm5.ClassReader.&amp;lt;init&amp;gt;(ClassReader.java:153)
        at jodd.asm5.ClassReader.&amp;lt;init&amp;gt;(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.jsp.html.portal.api.jsonws.action_jsp._jspService(action_jsp.java:871)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
        at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
        at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:190)
        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:407)
        at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:383)
        at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:217)
        at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:88)
        at org.apache.jsp.html.portal.api.jsonws.index_jsp._jspx_meth_liferay_002dutil_005finclude_005f1(index_jsp.java:1065)
        at org.apache.jsp.html.portal.api.jsonws.index_jsp._jspService(index_jsp.java:966)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is my service.xml&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-html"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;
&amp;lt;!DOCTYPE service-builder PUBLIC &amp;quot;-//Liferay//DTD Service Builder 7.3.0//EN&amp;quot; &amp;quot;http://www.liferay.com/dtd/liferay-service-builder_7_3_0.dtd&amp;quot;&amp;gt;

&amp;lt;service-builder dependency-injector=&amp;quot;ds&amp;quot; package-path=&amp;quot;remote.portlet&amp;quot;&amp;gt;
	&amp;lt;namespace&amp;gt;student&amp;lt;/namespace&amp;gt;
    &amp;lt;entity name=&amp;quot;Student&amp;quot; local-service=&amp;quot;true&amp;quot;&amp;gt;
        &amp;lt;column name=&amp;quot;studentId&amp;quot; type=&amp;quot;long&amp;quot; primary=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/column&amp;gt;
        &amp;lt;column name=&amp;quot;name&amp;quot; type=&amp;quot;String&amp;quot;&amp;gt;&amp;lt;/column&amp;gt;
    &amp;lt;/entity&amp;gt;
&amp;lt;/service-builder&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;and this is the method:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;@Component(
	property = {
		&amp;quot;json.web.service.context.name=student&amp;quot;,
		&amp;quot;json.web.service.context.path=student&amp;quot;
	},
	service = AopService.class
)
public class StudentServiceImpl extends StudentServiceBaseImpl {

    @JSONWebService( method = &amp;quot;POST&amp;quot;)
	@Override
	public Student getStudentById(long id) {
		try {
			return studentLocalService.getStudent(id);
		} catch (PortalException e) {
			// TODO Auto-generated catch block
			return null;
		}
	}
	
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If I try to call it from javascript console, or from a method, I see
  this error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ERROR [http-nio-8080-exec-10][JSONWebServiceServiceAction:126] java.lang.IllegalArgumentException&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Does anyone has any idea what I'm doing wrong? I've tried to make the
  simplest service but I can't make it work&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks in advance! Any help would be very appreciated&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2021-05-05T10:13:38Z</dc:date>
  </entry>
</feed>
