留言板

Problem with creating fragment module in liferay dxp 7.0sp3

旻 吴,修改在1 个月前。

Problem with creating fragment module in liferay dxp 7.0sp3

Junior Member 帖子: 56 加入日期: 17-5-17 最近的帖子
Hello all,

I am trying to create a fragment module to override Dynamic Data Lists Web's view_records.jsp. I followed the instruction on
https://dev.liferay.com/zh/develop/tutorials/-/knowledge_base/7-0/overriding-a-modules-jsps
to write bnd.bnd file as:
Bundle-SymbolicName: jp.co.ahresty.proto.customizeviewrecordsjsp
Bundle-Version: 1.0.0

Fragment-Host: com.liferay.dynamic.data.lists.web;bundle-version="1.1.22"

-sources: true
-jsp: *.jsp, *.jspf
-plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin

and build.gradle as:
dependencies {
	compileOnly 'com.liferay.portal:com.liferay.portal.kernel:2.0.0'
	compileOnly 'javax.portlet:portlet-api:2.0'
	compileOnly 'org.osgi:org.osgi.service.component.annotations:1.3.0'
}

Then I put new view_records under: src/main/resources/META-INF/resources/view_records.jsp, run gradle.build and deploy the jar bag.

However in gogo shell I got bundle installed but not resolved:
 1120|Installed  |    1|jp.co.ahresty.proto.customizeviewrecordsjsp (1.0.0)
g! diag 1120
jp.co.ahresty.proto.customizeviewrecordsjsp [1120]
  Unresolved requirement: Fragment-Host: com.liferay.dynamic.data.lists.web; bundle-version="1.1.22"

But the module name and version are corrent:
g! lb | grep "Dynamic Data Lists"
  643|Active     |   10|Liferay Dynamic Data Lists API (2.1.2)
  644|Active     |   10|Liferay Dynamic Data Lists Form Web (1.1.9)
  645|Active     |   10|Liferay Dynamic Data Lists Service (1.1.25)
  646|Active     |   10|Liferay Dynamic Data Lists Web (1.1.22)

g! headers 646 | grep Name
Bundle-Name = Liferay Dynamic Data Lists Web
Bundle-SymbolicName = com.liferay.dynamic.data.lists.web

Product information is:
Loading product and patch information...
Product information:
  * installation type: binary
  * build number: 7010
  * service pack version:
    - available SP version: 3
    - installable SP version: 3
  * patching-tool version: 2.0.6
  * time: 2017-05-17 09:57Z
  * plugins: no plugins detected

Currently installed patches: de-15-7010

Available patches: de-15-7010

Detailed patch list: 
  [*I] de-15-7010 :: Installed; Will be installed. :: Built for LIFERAY

Actually back to 7.0sp2, I succeed in login.web practice. I am wondering what's wrong with my code or is there anything new?

Thank you very much and best regards.

Min Wu
thumbnail
David H Nebinger,修改在6 年前。

RE: Problem with creating fragment module in liferay dxp 7.0sp3

Liferay Legend 帖子: 14915 加入日期: 06-9-2 最近的帖子
If you've been redeploying this often during development, try purging the osgi/state and $LIFERAY_HOME/work directories and test after starting.









Come meet me at the 2017 LSNA!
旻 吴,修改在1 个月前。

RE: Problem with creating fragment module in liferay dxp 7.0sp3

Junior Member 帖子: 56 加入日期: 17-5-17 最近的帖子
Thanks very much for your help. Unfortunately it didn't work for me.

However, finally I found that if I drag-and-drop the package to server in liferay developemnt studio, the package would remain installed but if I manually deploy the built .jar file ( copy to $LIFERAY_HOME/deploy ) it would be resolved normally.

It can be mentioned that by manual deploying, liferay log will show:
03:17:46,484 INFO  [Thread-38][BundleStartStopLogger:38] STOPPED com.liferay.dynamic.data.lists.web_1.1.22 [685]
03:17:48,368 INFO  [Thread-38][BundleStartStopLogger:35] STARTED com.liferay.dynamic.data.lists.web_1.1.22 [685]

but by drag-and-drop depoly it shows nothing.

Is there any configuration wrong in liferay development studio? Thanks.