Liferay ext plugin -- rewriting java class in util-java -


i need overwrite /util-java/src/com/liferay/util/normalizer.java

i found code on git.

i followed this instructions , able ant clean

i read this

putted .java file in my-ext-plugin/docroot/web-inf/ext-util-java/com/liferay/util/normalizer.java

ant build

  build failed `/liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/ext/build-common-ext.xml:122: the` following error occurred while executing line: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/ext/build-common-ext.xml:173: following error occurred while executing line: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/build-common.xml:80: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/ext/normalizer-ext/docroot/web-inf/ext-service/src not exist. 

i know right way create child of normalizer.java , overwrite private methods i'm wondering put files.

i surprised how little information can find this. , liferay gurus acting it's simple. it's not.

update

buld.username.properties

    app.server.dir = /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23     ext.work.dir = /liferay/bundles     app.server.zip = /liferay/portal/liferay-portal-tomcat-6.1.0-ce-ga1.zip 

update 2

i created ext-service/src folder , rewarded build successful.

ant compile , ant deploy working

url-redirect-fix-ext name of ext plugin.

[root@localhost url-redirect-fix-ext]# ant deploy buildfile: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/ext/url-redirect-fix-ext/build.xml  compile:  compile-with-global-class-loader:  compile-java:  compile-with-portal-class-loader:  compile-java:  compile-with-portal-class-loader:  compile-java:  compile-with-portal-class-loader:  compile-java:  compile-with-portal-class-loader:  compile-java:  war:  war-util:  war-util:  war-util:    [delete] deleting: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/dist/url-redirect-fix-ext-6.1.0.1.war       [zip] building zip: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/dist/url-redirect-fix-ext-6.1.0.1.war    [delete] deleting: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/ext/url-redirect-fix-ext/docroot/web-inf/ext-url-redirect-fix-ext.xml  deploy:      [copy] copying 1 file /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/deploy  build successful 

but ant deploy not working

[root@localhost url-redirect-fix-ext]# ant build buildfile: /liferay/plugins/liferay-plugins-sdk-6.1.0-ce-ga1/ext/url-redirect-fix-ext /build.xml  build failed target "build" not exist in project "url-redirect-fix-ext".  

i followed instructions , deployed plug-in, rebooted server.

here tomcat log. guess plug-in deployed successfully.

15:36:18,815 info  [autodeploydir:167] processing url-redirect-fix-ext-6.1.0.1.war 15:36:18,818 info  [extautodeploylistener:43] copying extension environment plugin /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/deploy/url-redirect-fix-ext-6.1.0.1.war   expanding: /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/deploy/url-redirect-fix-ext-6.1.0.1.war /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/temp/20120605153618829   copying 1 file /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/temp/20120605153618829/web-inf   copying 1 file /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/temp/20120605153618829/web-inf/classes   copying 1 file /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/temp/20120605153618829/web-inf/classes   copying 1 file /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/temp/20120605153618829/web-inf   warning: web-inf/ext-impl/classes/com/liferay/portal/deploy/dependencies/ext-url-redirect-fix-ext-util-bridges.jar modified in future.   warning: web-inf/ext-impl/classes/com/liferay/portal/deploy/dependencies/ext-url-redirect-fix-ext-util-java.jar modified in future.   warning: web-inf/ext-impl/classes/com/liferay/portal/deploy/dependencies/ext-url-redirect-fix-ext-util-taglib.jar modified in future.   warning: web-inf/ext-impl/ext-impl.jar modified in future.   warning: web-inf/ext-service/ext-service.jar modified in future.   warning: web-inf/ext-util-bridges/ext-util-bridges.jar modified in future.   warning: web-inf/ext-util-java/ext-util-java.jar modified in future.   warning: web-inf/ext-util-taglib/ext-util-taglib.jar modified in future.   warning: web-inf/ext-web/docroot/web-inf/liferay-portlet-ext.xml modified in future.   warning: web-inf/ext-web/docroot/web-inf/portlet-ext.xml modified in future.   warning: web-inf/ext-web/docroot/web-inf/struts-config-ext.xml modified in future.   warning: web-inf/ext-web/docroot/web-inf/tiles-defs-ext.xml modified in future.   warning: web-inf/liferay-plugin-package.properties modified in future.   warning: web-inf/ext-impl/classes modified in future.   warning: web-inf/ext-impl/classes/com/liferay modified in future.   warning: web-inf/ext-impl/classes/com/liferay/portal modified in future.   warning: web-inf/ext-impl/classes/com/liferay/portal/deploy modified in future.   warning: web-inf/ext-impl/src modified in future.   warning: web-inf/ext-lib modified in future.   warning: web-inf/ext-lib/global modified in future.   warning: web-inf/ext-lib/portal modified in future.   warning: web-inf/ext-service/classes modified in future.   warning: web-inf/ext-service/src modified in future.   warning: web-inf/ext-util-bridges modified in future.   warning: web-inf/ext-util-bridges/classes modified in future.   warning: web-inf/ext-util-bridges/src modified in future.   warning: web-inf/ext-util-java modified in future.   warning: web-inf/ext-util-java/classes modified in future.   warning: web-inf/ext-util-java/com modified in future.   warning: web-inf/ext-util-java/com/liferay modified in future.   warning: web-inf/ext-util-java/com/liferay/util modified in future.   warning: web-inf/ext-util-java/src modified in future.   warning: web-inf/ext-util-taglib modified in future.   warning: web-inf/ext-util-taglib/classes modified in future.   warning: web-inf/ext-util-taglib/src modified in future.   warning: web-inf/ext-web modified in future.   warning: web-inf/ext-web/docroot modified in future.   copying 8 files /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/webapps/url-redirect-fix-ext   copying 2 files /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/webapps/url-redirect-fix-ext   deleting directory /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/tomcat-7.0.23/temp/20120605153618829 15:36:19,062 info  [extautodeploylistener:50] extension environment /liferay/bundles/liferay-portal-6.1.0-ce-ga1-new/deploy/url-redirect-fix-ext-6.1.0.1.war copied successfully. deployment start in few seconds. jun 5, 2012 3:36:25 pm org.apache.catalina.startup.hostconfig checkresources info: reloading context [/url-redirect-fix-ext] 15:36:25,612 info  [pluginpackageutil:1099] reading plugin package url-redirect-fix-ext 15:36:25,618 info  [exthotdeploylistener:226] extension environment url-redirect-fix-ext not undeployed 15:36:26,090 info  [pluginpackageutil:1099] reading plugin package url-redirect-fix-ext 15:36:26,133 info  [exthotdeploylistener:234] registering extension environment url-redirect-fix-ext 15:36:26,133 info  [exthotdeploylistener:152] extension environment url-redirect-fix-ext has been applied. 

not working. there still bug in portal.

so ether solution found on git not handled bug or new normalizer.java not overrided old normalizer.class

how can sure?

update 3

ant deploy

error [exthotdeploylistener:189] extension environment normalizer-ext cannot applied because of detected conflicts: url-redirect-fix-ext:     ext-util-java/com/liferay/util/normalizer.java     ext-web/docroot/web-inf/liferay-portlet-ext.xml     ext-web/docroot/web-inf/portlet-ext.xml     ext-web/docroot/web-inf/struts-config-ext.xml     ext-web/docroot/web-inf/tiles-defs-ext.xml     ext-web/docroot/web-inf/web.xml 

you change code util-java, put util-bridges? try putting in ext-util-java. seems there's no spring autowiring involved calling this, , there static methods in class, need copy existing code , patch like, compile.

edit/added:

from error message looks followed paragraph http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/creating-an-ext-plugin hard:

tip: after creating ext plugin, remove of files added default not necessary extension. important because liferay keeps track of files deployed each ext plugin , won't allow deploying 2 ext plugins if override same file avoid collisions. removing files not necessary ext plugin easier use along other ext plugins.

you should only remove unrequired files in plugin - not directories. errormessage state says

normalizer-ext/docroot/web-inf/ext-service/src not exist

edit 2:

in latest edit "ant deploy" not working command execute "ant build" - ant complaining "build" target not found. try again "ant deploy"

edit 3:

this more interactive debugging session q&a :-)

you can have many ext plugins like, every file can overridden (contained) in 1 ext plugin. error message tells what's wrong: files build process complains modified different ext-plugins. that's why quote (see above in answer, "tip" section) says remove files plugin unless need&override them. files build process complaining files create-script automatically starts ext plugin with.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -