Fórumok

build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

thumbnail
Harish Kumar, módosítva 13 év-val korábban

build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Expert Bejegyzések: 483 Csatlakozás dátuma: 2010.07.31. Legújabb bejegyzések
hello,

I am using Liferay 6.0.4 . I have added the portal src to the eclipse and pluginsdk to the Preferences -> Lifeeray -> installed SDKs. I am also attaching a screenshot of Eclipse development environment..
Its working fine but when i started a new plugin project and choose portlet.
I have created a service docroot/WEB-INF/service.xml with content:

----------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC
"-//Liferay//DTD Service Builder 6.0.0//EN"
"http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
<service-builder package-path='petcatalog'>
<namespace>PetCatalog</namespace>

<!-- Project -->
<entity name='Item' table='PETS_ITEM' local-service='true' remote-service='false'>
<!-- PK fields -->
<column name='itemId' type='long' primary='true'/>

<column name="productId" type="String" />
<column name="name" type="String" />
<column name="description" type="String" />
<column name="imageUrl" type="String" />
<column name="imageThumbUrl" type="String" />
<column name="price" type="double" />
</entity>
</service-builder>
--------------

but when i building the service using target build-service, its giving the following error message..

-------------
Buildfile: G:\Liferay6\liferay-plugins-sdk-6.0.4\portlets\DemoPortlet-portlet\build.xml
build-service:

BUILD FAILED
G:\Liferay6\liferay-plugins-sdk-6.0.4\build-common-plugin.xml:332: G:\Liferay6\bundles\tomcat-6.0.26\lib\ext not found.

Total time: 1 second
------------

Please let me know whats wrong is happening..
Antti Kokko, módosítva 13 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

New Member Bejegyzések: 7 Csatlakozás dátuma: 2010.08.18. Legújabb bejegyzések
I have the same problem with 6.0.5. I´m desperate to find an answer.

Here is my output:

build-service:
[echo]
[echo] .
[echo]
[echo] WARNING: Support for ServiceBuilder in EXT plugins will be deprecate
d in future
[echo] versions. EXT plugins are designed to override the portal's core cod
e that
[echo] cannot be done with hooks, layout templates, portlets, or themes. EX
T plugins
[echo] are not meant to contain new custom services. Please migrate your se
rvice.xml to
[echo] a portlet plugin.
[echo]
[java] Loading jar:file:/C:/liferay-portal-6.0.5/tomcat-6.0.26/webapps/ROOT
/WEB-INF/lib/portal-impl.jar!/system.properties
[java] Loading jar:file:/C:/liferay-portal-6.0.5/tomcat-6.0.26/webapps/ROOT
/WEB-INF/lib/portal-impl.jar!/portal.properties
[java] Loading file:/C:/liferay-portal-6.0.5/tomcat-6.0.26/webapps/ROOT/WEB
-INF/classes/portal-ext.properties
[java] Loading jar:file:/C:/liferay-portal-6.0.5/tomcat-6.0.26/webapps/ROOT
/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools
.properties
[java] com.liferay.portal.kernel.xml.DocumentException: ${service.file} (Th
e system cannot find the file specified) Nested exception: ${service.file} (The
system cannot find the file specified)
[java] at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:
338)
[java] at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUti
l.java:115)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>
(ServiceBuilder.java:519)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>
(ServiceBuilder.java:404)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(S
erviceBuilder.java:176)
[java] Caused by: org.dom4j.DocumentException: ${service.file} (The system
cannot find the file specified) Nested exception: ${service.file} (The system ca
nnot find the file specified)
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:266)
[java] at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:
335)
[java] ... 4 more
[java] 10:33:28,776 INFO [PortalImpl:277] Global lib directory /C:/liferay
-portal-6.0.5/tomcat-6.0.26/lib/ext/
[java] 10:33:28,779 INFO [PortalImpl:297] Portal lib directory /C:/liferay
-portal-6.0.5/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/

BUILD SUCCESSFUL
Total time: 4 seconds
thumbnail
ranga rao b, módosítva 13 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Regular Member Bejegyzések: 152 Csatlakozás dátuma: 2007.07.20. Legújabb bejegyzések
Hi

i have resolved in 6.0.4 version.Using below solution

Please find the <jvmarg value="-Dservice.input.file=${service.file}" /> in build-common-ext.xml. and give your service.xml path(ex: <jvmarg value="-Dservice.input.file=docroot/WEB-INF/ext-service/src/service.xml" />)

Regards,
Ranga Rao
ASIF MOHAMMED, módosítva 13 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

New Member Bejegyzés: 1 Csatlakozás dátuma: 2010.08.23. Legújabb bejegyzések
Thanks Ranga, for your solution. It helped me.
thumbnail
Raja Nagendra Kumar, módosítva 13 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Expert Bejegyzések: 484 Csatlakozás dátuma: 2006.03.02. Legújabb bejegyzések
another approach without touching the ant script is to invoke the ant

ant -Dservice.file=docroot/WEB-INF/ext-service/src/service.xml build-service

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
-Liferay Adoption Excellence
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
I know this is an older thread, but I am going to recycle it. I'm using 6.2 EE (SP10) and I am trying to use this approach to introduce a customization to the portal. I have added to the ext-impl folder com/liferay/portlet/virtualhostalias/service.xml.

When I run my ant command from the command line I am using --


 ant build-service -DserviceFileName=docroot/WEB-INF/ext-impl/src/com/liferay/portlet/virtualhostalias/service.xml


But then I am getting the following output --


build-service:
     [echo] 
     [echo] .
     [echo] 
     [echo] WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
     [echo] versions. EXT plugins are designed to override the portal's core code that
     [echo] cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
     [echo] are not meant to contain new custom services. Please migrate your service.xml to
     [echo] a portlet plugin.
     [echo] 		
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal-patched.properties
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
     [java] java.lang.NullPointerException
     [java] 	at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:34)
     [java] 	at com.liferay.util.xml.XMLSafeReader.<init>(XMLSafeReader.java:25)
     [java] 	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:437)
     [java] 	at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:155)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContentDocument(ServiceBuilder.java:1734)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.getContent(ServiceBuilder.java:121)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:631)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:229)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:606)
     [java] 	at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java] 	at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java] 	at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
     [java] 	at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
     [java] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
     [java] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:606)
     [java] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java] 	at org.apache.tools.ant.Task.perform(Task.java:348)
     [java] 	at org.apache.tools.ant.Target.execute(Target.java:435)
     [java] 	at org.apache.tools.ant.Target.performTasks(Target.java:456)
     [java] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
     [java] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
     [java] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
     [java] 	at org.apache.tools.ant.Main.runBuild(Main.java:851)
     [java] 	at org.apache.tools.ant.Main.startAnt(Main.java:235)
     [java] 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
     [java] 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

BUILD SUCCESSFUL
Total time: 1 minute 20 seconds
</init></init></init>


It says build successful, but it's not -- or at least I don't think it is -- I don't have the service files that are supposed to be output. It looks from the stacktrace as if perhaps it is not finding the service file but I'm not sure why that is. I've specified the way I wrote above and also a full path from the root of the file system -- in both cases I get the same result.

Any pointers would be appreciated.
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Aha! it seems the jvm arg has changed names. I added a -v to the original line and found that the parameter it was looking for was service.file -- so changed it to


ant -v build-service -Dservice.file=docroot/WEB-INF/ext-impl/src/com/liferay/portlet/virtualhostalias/service.xml


.. but I am getting a different error now.


build-service:
     [echo] 
     [echo] .
     [echo] 
     [echo] WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
     [echo] versions. EXT plugins are designed to override the portal's core code that
     [echo] cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
     [echo] are not meant to contain new custom services. Please migrate your service.xml to
     [echo] a portlet plugin.
     [echo] 		
     [java] running com.liferay.portal.tools.servicebuilder.ServiceBuilder with default permissions (exit forbidden)
     [java] Running in same VM Executing 'com.liferay.portal.tools.servicebuilder.ServiceBuilder' with arguments:
     [java] '-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties'
     [java] '-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger'
     [java] 'service.input.file=docroot/WEB-INF/ext-impl/src/com/liferay/portlet/virtualhostalias/service.xml'
     [java] 'service.hbm.file=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/ext-impl/src/META-INF/ext-hbm.xml'
     [java] 'service.orm.file=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/ext-impl/src/META-INF/ext-orm.xml'
     [java] 'service.model.hints.file=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/ext-impl/src/META-INF/ext-model-hints.xml'
     [java] 'service.spring.file=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/ext-impl/src/META-INF/ext-spring.xml'
     [java] 'service.api.dir=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/ext-service/src'
     [java] 'service.impl.dir=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/ext-impl/src'
     [java] 'service.remoting.file=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/ext-web/docroot/WEB-INF/remoting-servlet-ext.xml'
     [java] 'service.sql.dir=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/sql'
     [java] 'service.sql.file=portal-tables.sql'
     [java] 'service.sql.indexes.file=indexes.sql'
     [java] 'service.sql.indexes.properties.file=indexes.properties'
     [java] 'service.sql.sequences.file=sequences.sql'
     [java] 'service.bean.locator.util=com.liferay.portal.kernel.bean.PortalBeanLocatorUtil'
     [java] 'service.props.util=com.liferay.portal.util.PropsUtil'
     [java] 
     [java] The ' characters around the executable and arguments are
     [java] not part of the command.
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal-patched.properties
     [java] Loading jar:file:/home/aj/projects/ypg/liferay/liferay-portal-6.2-ee-sp10/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
     [java] java.lang.RuntimeException: Column name not found
     [java] 	at com.liferay.portal.tools.servicebuilder.Entity.getColumn(Entity.java:63)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder._parseEntity(ServiceBuilder.java:4802)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:708)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:229)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:606)
     [java] 	at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java] 	at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java] 	at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
     [java] 	at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
     [java] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
     [java] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:606)
     [java] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java] 	at org.apache.tools.ant.Task.perform(Task.java:348)
     [java] 	at org.apache.tools.ant.Target.execute(Target.java:435)
     [java] 	at org.apache.tools.ant.Target.performTasks(Target.java:456)
     [java] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
     [java] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
     [java] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
     [java] 	at org.apache.tools.ant.Main.runBuild(Main.java:851)
     [java] 	at org.apache.tools.ant.Main.startAnt(Main.java:235)
     [java] 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
     [java] 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
   [delete] Could not find file /home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/ServiceBuilder.temp to delete.

BUILD SUCCESSFUL
</init>


It seems like possibly a typo in my service.xml file? Though I have now stripped it back to the following and am still seeing the error --


<!--?xml version="1.0"?-->


<service-builder package-path="com.liferay.portlet.virtualhostalias">
	<namespace>VirtualHostAlias</namespace>
	<entity name="VirtualHostAlias" uuid="true" local-service="true" remote-service="false" trash-enabled="false">

		<!-- PK fields -->

		<column name="virtualHostAliasId" type="long" primary="true" />
	</entity>
</service-builder>
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Hey, Andrew. Pay attention to the whole "service in EXT plugin is deprecated" message. It really is deprecated, it may not work in future versions, and honestly it is not really necessary.

You can bundle this up as a separate portlet and still leverage it in the core (if necessary) by sharing the service jar.

That said, the failure is due to an <order-column /> column name that does not exist as a column in the entity. You may actually need to not only do an "ant clean" but also purge any of the generated java and xml files that might have been created before the failure.
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hey David --

Couldn't agree more and I NEVER put this stuff in an EXT pluging -- part of the reason I am struggling with it emoticon. Let me give you the whole background.

I have a requirement where multiple domain names map to the same company. Right now the approach in place requirs some hook magic, but worse, removing a constraint on the VirtualHost table so that we can have two hostnames pointing to the same companyId. We've tried a few other things including vanity urls and an attempt to do search and replace on the response stream -- searching for the "internal" name and replacing with the appropriate external name (based on locale). Sadly, with OWASP and encoding -- we're unable to get all the urls.

This lead me down the path to determine that the only way to manage this is to affect the URLs created by the portal. In the PortalImpl class the getPortalURL seems to be the nexus of the universe. I did a poc using the LocaleUtil.getMostReleveantLocale() to grab the locale from the LocaleThreadLocal -- and found that I consistently get the correct value. I also added the logic to replace the serverName passed into that method (which appears to always be the hostname from the VirtualHost table) with the domain we need. Everything looks good.

The next step now is to introduce what I am calling VirtualHost aliases. So, in tha getPortalURL method I plan to check for a configuration as to whether or not virtual host aliases are enabled. If they are, then I want to use a VirtualHostAliasLocalServiceUtil class to retieve the alias to be used based on the companyId, hostname (serverName) and locale. If one is found, then replace the serverName value with the alias.

I plan on then adding a control panel portlet to the Configuration section so that aliases can be managed in there.

So -- I tried to provide the VirtualHostAlias service in an external portlet, but then found that I could not build the PortalImpl class because it was missing references. I added the *-service.jar to the TOMCAT/lib/ext as well as my project definition, but no joy. Truth be told, if I get this all working I plan to submit it to Liferay as a pull request as I think that this is a good improvement and might help solve some people complaints about the full urls values that Liferay returns (gives them an additional level of control).

So -- with that said, I just tried an ant clean first followed by my other command, but I am still getting the --

[java] java.lang.RuntimeException: Column name not found
[java] at com.liferay.portal.tools.servicebuilder.Entity.getColumn(Entity.java:63)

I'll keep digging, but if you have any other thoughts, happy to listen.
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Pfft.. I'm such a boner. I was making the correct changes to my service.xml -- but I was changing the wrong file lol. Once I changed the correct file it worked. Thanks guys emoticon
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
I think in general the aliases sound like a good idea, but most people want multiple virtual hosts pointing at the same server, i.e. alpha.example.com and beta.example.com both running out of myserver.myinternalnetwork.example.com, and the problem comes in building the right URLs given what they provide. If I go to alpha.example.com I'd hope that all URLs also say alpha.example.com and same with the beta.example.com, but if both are aliases for the same host how do you pick the right one within the context of the getPortalURL() method?

I think that's why there's only one vhost allowed, it simplifies generating the response URL because you don't have to pick.

I also think that's why most times this kind of thing gets solved with httpd rewrite rules.

But your case seems to be different than the multiple aliases per concept so maybe you'll be fine.
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hey David,

In our case it's a language thing. The client wants distinct urls per language. So if I have french.external.com and english.external.com, then, as you say, I want links in the resulting response body to be set accordingly. Right now there is no way to do that, even with the httpd. We tried that with our F5 but no dice. To the alias thing that we're doing provides you the ability to say both french.external.com and english.external.com ---> internal.com, with the accept-language in the request header set accordingly (I know that if you are coming in from french.external.com, you should have that value set to fr). This works for masking the domains and ensuring the correct language is in place. However, when the getPortalURL method is called, it generates all the links with internal.com. Search and replace on the response stream would have been nice -- but it's too difficult to manage for things like --


Liferay.currentURL="\x2fcommunity\x2fforums\x3fp_p_id\x3d19\x26p_p_lifecycle\x3d0\x26p_p_state\x3dnormal\x26p_p_mode\x3dview\x26p_p_col_id\x3dcolumn-1\x26p_p_col_count\x3d1\x26_19_struts_action\x3d\x252Fmessage_boards\x252Fedit_message\x26_19_redirect\x3dhttps\x253A\x252F\x252Fwww\x2eliferay\x2ecom\x252Fcommunity\x252Fforums\x252F-\x252Fmessage_boards\x252Fmessage\x252F52157276\x26_19_mbCategoryId\x3d239390\x26_19_threadId\x3d5464305\x26_19_parentMessageId\x3d52156559";Liferay.currentURLEncoded="%2Fcommunity%2Fforums%3Fp_p_id%3D19%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D1%26_19_struts_action%3D%252Fmessage_boards%252Fedit_message%26_19_redirect%3Dhttps%253A%252F%252Fwww.liferay.com%252Fcommunity%252Fforums%252F-


.. which you will find in the bottom of this page. Removing the url encoding seemed like a bad idea emoticon. So our logic is to use the locale to swap out the language.

Now with all that said, my next question on this would be -- if I want to add finder methods to my EXT, where should I place the custom-sql folder? in the ext-eb/docroot/WEB-INF? I also don't see where the SQL file generated with the logic to build the tables on deploy has been placed.. do you know where it is hiding?
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Not sure where it would hide, but I know when you do an EXT plugin you get an ext-service along with the ext-impl directory. I don't know where the build service command you issued dumped the files, but you may need to partition manually... EXTs can be fun to play around with.
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hey David,

I followed the same convention that Liferay does in their source. My namespace is com.liferay.portlet.virtualhostsalias which results in code generated under --

[indent]ext-impl/com.liferay.portlet.virtualhostalias[/indent]
and
[indent]ext-service/com.liferay.portlet.virtualhostalias.service[/indent]

.. I found the sprint generated files in teh META-INF folder of the ext-impl project, but this is most unorthodox when compared to a service builder portlet plugin emoticon. I need a map!
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Aha! I noticed this line in the output with a verbos ant run --


     [java] 'service.sql.dir=/home/aj/projects/ypg/liferay/sdk/ext/yp-liferay-ext/docroot/WEB-INF/sql'
     [java] 'service.sql.file=portal-tables.sql'
     [java] 'service.sql.indexes.file=indexes.sql'
     [java] 'service.sql.indexes.properties.file=indexes.properties'
     [java] 'service.sql.sequences.file=sequences.sql'
     [java] 'service.bean.locator.util=com.liferay.portal.kernel.bean.PortalBeanLocatorUtil'
     [java] 'service.props.util=com.liferay.portal.util.PropsUtil'


.. but the first line referencing the sql folder, was not created. I created it by hand and ran the build-service command again and this time it generated the .sql stuff for me.
thumbnail
Sushil Patidar, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Expert Bejegyzések: 467 Csatlakozás dátuma: 2011.10.31. Legújabb bejegyzések
Hi,
It may be due to the fact that you are building the service again after changing the column name.
Delete <portlet-name>-service.jar and build the service again.
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Sushil Patidar:
It may be due to the fact that you are building the service again after changing the column name.
Delete <portlet-name>-service.jar and build the service again.


Um, he's trying to build services and has been unsuccessful so far. Given that, he's not at the point where he'd have a service jar yet.
thumbnail
Hajri Mohamed, módosítva 13 év-val korábban

RE: build-service failed in PluginSdk Portlet Project in Liferay 6.0.4

Junior Member Bejegyzések: 71 Csatlakozás dátuma: 2011.03.02. Legújabb bejegyzések
thank you Ranga Rao Bobbili, it helped me too with liferay 6.0.5