當我這樣做時,它不會編譯時,我運行build.xml和部署,是否有可能實例化Journal Article對象並設置每個屬性都沒有構造器?
我想這樣做,因爲它看起來比使用JournalArticleLocalServiceUtil.addArticle巨大的方法調用好得多。
JournalArticle journalArticle = new JournalArticleImpl();
journalArticle.setDescription(description);
有沒有人知道它是否有可能在Liferay 6中?
編輯:這是輸出我得到:
Buildfile: C:\opt\liferay-six1-dev\code\portlets\migration-portlet\build.xml
compile:
merge:
compile-java:
[javac] Compiling 1 source file to C:\opt\liferay-six1-dev\code\portlets\migration-portlet\docroot\WEB-INF\classes
[javac] C:\opt\liferay-six1-dev\code\portlets\migration-portlet\docroot\WEB-INF\src\com\liferay\migration\importdata\JournalArticleImport.java:138: cannot find symbol
[javac] symbol : class JournalArticle
[javac] location: class com.liferay.migration.importdata.JournalArticleImport
[javac] private JournalArticle createJournalArticle(ExportedJournalArticle article) {
[javac] ^
[javac] C:\opt\liferay-six1-dev\code\portlets\migration-portlet\docroot\WEB-INF\src\com\liferay\migration\importdata\JournalArticleImport.java:142: cannot find symbol
[javac] symbol : class JournalArticle
[javac] location: class com.liferay.migration.importdata.JournalArticleImport
[javac] JournalArticle journalArticle = new JournalArticleImpl();
[javac] ^
[javac] C:\opt\liferay-six1-dev\code\portlets\migration-portlet\docroot\WEB-INF\src\com\liferay\migration\importdata\JournalArticleImport.java:142: cannot find symbol
[javac] symbol : class JournalArticleImpl
[javac] location: class com.liferay.migration.importdata.JournalArticleImport
[javac] JournalArticle journalArticle = new JournalArticleImpl();
[javac] ^
[javac] 3 errors
BUILD FAILED
C:\opt\liferay-six1-dev\code\build-common-plugin.xml:403: The following error occurred while executing this line:
C:\opt\liferay-six1-dev\code\build-common.xml:94: Compile failed; see the compiler error output for details.
Total time: 1 second
你要求它不能編譯,但它看起來對我來說,它應該。當你嘗試時會發生什麼? –
編輯的問題,當我運行build.xml並部署 –
你還沒有說過會發生什麼*或者你是否能夠以其他方式編譯。請閱讀http://tinyurl.com/so-hints - 如果你能避免我們不得不猜測這是怎麼回事,你一定會更快地得到答案... –