Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-103263

Fix SampleSQLBuilder according to LPS-102202

    Details

      Description

      The root cause of the NoSuchMethodException is after LPS-102202, the correct method name is getMasterLayoutPageTemplateEntryId instead of getMLayoutPageTemplateEntryId

      Error Message
      java.lang.Exception: Unable to process FreeMarker template 
      Stacktrace
      java.lang.Exception: Unable to process FreeMarker template 
      	at com.liferay.portal.tools.sample.sql.builder.SampleSQLBuilder.compressSQL(SampleSQLBuilder.java:243)
      	at com.liferay.portal.tools.sample.sql.builder.SampleSQLBuilder.<init>(SampleSQLBuilder.java:115)
      	at com.liferay.portal.tools.sample.sql.builder.SampleSQLBuilderTest.testGenerateAndInsertSampleSQL(SampleSQLBuilderTest.java:88)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
      	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
      	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
      	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
      	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
      	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:117)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
      	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
      	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
      	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
      	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: freemarker.core._TemplateModelException: Java method "com.liferay.portal.tools.sample.sql.builder.DataFactory.toInsertSQL(com.liferay.portal.kernel.model.BaseModel)" threw an exception when invoked on com.liferay.portal.tools.sample.sql.builder.DataFactory object "com.liferay.portal.tools.sample.sql.builder.DataFactory@2d748df3"; see cause exception in the Java stack trace.
      
      ----
      FTL stack trace ("~" means nesting-related):
      	- Failed at: ${dataFactory.toInsertSQL(_layoutModel)}  [in template "com/liferay/portal/tools/sample/sql/builder/dependencies/macro.ftl" in macro "insertLayout" at line 135, column 9]
      	- Reached through: @insertLayout _layoutModel=layoutModel  [in template "com/liferay/portal/tools/sample/sql/builder/dependencies/default_user.ftl" at line 34, column 1]
      	- Reached through: #include "default_user.ftl"  [in template "com/liferay/portal/tools/sample/sql/builder/dependencies/sample.ftl" at line 11, column 1]
      ----
      	at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:311)
      	at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:275)
      	at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:80)
      	at freemarker.core.MethodCall._eval(MethodCall.java:62)
      	at freemarker.core.Expression.eval(Expression.java:78)
      	at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)
      	at freemarker.core.DollarVariable.accept(DollarVariable.java:41)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.MixedContent.accept(MixedContent.java:54)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.Macro$Context.runMacro(Macro.java:184)
      	at freemarker.core.Environment.invoke(Environment.java:701)
      	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.MixedContent.accept(MixedContent.java:54)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.Environment.include(Environment.java:2072)
      	at freemarker.core.Include.accept(Include.java:167)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.MixedContent.accept(MixedContent.java:54)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.Environment.process(Environment.java:302)
      	at freemarker.template.Template.process(Template.java:325)
      	at com.liferay.portal.freemarker.FreeMarkerUtil.process(FreeMarkerUtil.java:47)
      	at com.liferay.portal.tools.sample.sql.builder.SampleSQLBuilder$2.run(SampleSQLBuilder.java:309)
      Caused by: java.lang.NoSuchMethodException: com.liferay.portal.model.impl.LayoutModelImpl.getMLayoutPageTemplateEntryId()
      	at java.lang.Class.getMethod(Class.java:1786)
      	at com.liferay.portal.tools.sample.sql.builder.DataFactory.toInsertSQL(DataFactory.java:3784)
      	at com.liferay.portal.tools.sample.sql.builder.DataFactory.toInsertSQL(DataFactory.java:2938)
      	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1458)
      	at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:71)
      	... 22 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lily.chi Lily Chi
                Reporter:
                lily.chi Lily Chi
                Participants of an Issue:
                Recent user:
                Lily Chi
                Engineering Assignee:
                Lily Chi
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  38 weeks, 6 days ago

                  Packages

                  Version Package
                  Master