我正在开发 Liferay 7。我是 Liferay 的新手,我遇到了一个我花了太多时间处理的问题。
我有一个portlet,我决定创建一个Service Builder(名为“Employee”)。这是我的 service.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 7.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_7_0_0.dtd">
<service-builder package-path="com.test">
<author>sachin.singh</author>
<namespace>crud</namespace>
<entity name="Employee" table="user" local-service="true" remote-service="true">
<column name="iduser" type="int" primary="true" id-type="increment"/>
<column name="name" type="String" />
<column name="secret_code" type="String" />
</entity>
</service-builder>
当我使用 liferay 服务构建器进行构建时,我收到了这个错误
[copy] Copying 1 file to D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\docroot\WEB-INF\classes
[copy] Copied 3 empty directories to 2 empty directories under D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\docroot\WEB-INF\classes
[jar] Building MANIFEST-only jar: D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\service-builder-classpath.jar
[delete] Deleting: D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\service-builder-classpath.jar.manifest
[java] Java Result: 1
[delete] Deleting: D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\service-builder-classpath.jar
[echo] java.lang.NoClassDefFoundError: com/thoughtworks/qdox/model/JavaMethod
[echo] at java.lang.Class.getDeclaredMethods0(Native Method)
[echo] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
[echo] at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
[echo] at java.lang.Class.getMethod0(Class.java:3018)
[echo] at java.lang.Class.getMethod(Class.java:1784)
[echo] at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
[echo] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
[echo] Caused by: java.lang.ClassNotFoundException: com.thoughtworks.qdox.model.JavaMethod
[echo] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[echo] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
[echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[echo] ... 7 more
[echo] Error: A JNI error has occurred, please check your installation and try again
[echo] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
[echo] Exception in thread "main"
我检查并交叉验证,所有 jar 都在 jar 库中。