Forums

Home » Liferay Portal » English » Liferay Legacy »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Deploying liferay war under different context than ROOT Alberto Labarga December 21, 2006 8:14 AM
RE: Deploying liferay war under different context than ROOT Jorge Ferrer December 22, 2006 1:04 PM
RE: Deploying liferay war under different context than ROOT Stephen More January 9, 2007 7:46 AM
RE: Deploying liferay war under different context than ROOT Amokrane Belloui December 24, 2006 8:07 AM
RE: Deploying liferay war under different context than ROOT Glenn Michael Keith December 26, 2006 6:14 AM
RE: Deploying liferay war under different context than ROOT Borxa Varela Bouzas December 26, 2006 12:19 PM
RE: Deploying liferay war under different context than ROOT Glenn Michael Keith December 27, 2006 11:09 AM
RE: Deploying liferay war under different context than ROOT Jorge Ferrer December 29, 2006 11:06 AM
RE: Deploying liferay war under different context than ROOT Ivano Carrara January 9, 2007 7:33 AM
RE: Deploying liferay war under different context than ROOT Jorge Ferrer January 11, 2007 4:52 AM
RE: Deploying liferay war under different context than ROOT Ivano Carrara January 11, 2007 7:44 AM
RE: Deploying liferay war under different context than ROOT Andre Kreienbring January 21, 2007 8:07 AM
RE: Deploying liferay war under different context than ROOT Stephen More January 19, 2007 8:00 AM
RE: Deploying liferay war under different context than ROOT Andre Kreienbring January 19, 2007 12:46 PM
RE: Deploying liferay war under different context than ROOT Vincent Wong January 20, 2007 9:50 AM
RE: Deploying liferay war under different context than ROOT Andre Kreienbring January 21, 2007 8:06 AM
RE: Deploying liferay war under different context than ROOT Brian Chan January 22, 2007 11:11 AM
RE: Deploying liferay war under different context than ROOT Miche Pitt February 4, 2007 12:48 PM
RE: Deploying liferay war under different context than ROOT Andre Kreienbring February 5, 2007 3:05 AM
RE: Deploying liferay war under different context than ROOT Marshall Thompson February 6, 2007 5:12 AM
RE: Deploying liferay war under different context than ROOT stephane Manou February 7, 2007 8:12 AM
RE: Deploying liferay war under different context than ROOT Marshall Thompson February 7, 2007 8:09 AM
RE: Deploying liferay war under different context than ROOT Marshall Thompson February 8, 2007 7:38 AM
RE: Deploying liferay war under different context than ROOT Andres Gutierrez February 15, 2007 12:35 PM
RE: Deploying liferay war under different context than ROOT Andre Kreienbring February 16, 2007 2:19 AM
RE: Deploying liferay war under different context than ROOT Andres Gutierrez February 16, 2007 6:33 AM
RE: Deploying liferay war under different context than ROOT Andre Kreienbring February 16, 2007 9:01 AM
RE: Deploying liferay war under different context than ROOT Vincent Wong February 21, 2007 7:14 AM
RE: Deploying liferay war under different context than ROOT Andres Gutierrez March 14, 2007 2:14 PM
RE: Deploying liferay war under different context than ROOT Pier Paolo Bortone March 15, 2007 2:46 AM
RE: Deploying liferay war under different context than ROOT Pier Paolo Bortone March 15, 2007 3:32 AM
RE: Deploying liferay war under different context than ROOT Marcus Schmidke March 16, 2007 1:03 AM
RE: Deploying liferay war under different context than ROOT Marcus Schmidke March 16, 2007 3:21 AM
RE: Deploying liferay war under different context than ROOT Marcus Schmidke March 16, 2007 6:10 AM
RE: Deploying liferay war under different context than ROOT Jamal Najmi March 18, 2007 5:52 PM
RE: Deploying liferay war under different context than ROOT Stephen More March 20, 2007 9:55 AM
RE: Deploying liferay war under different context than ROOT Jamal Najmi March 20, 2007 6:37 PM
RE: Deploying liferay war under different context than ROOT Andres Gutierrez March 21, 2007 8:07 AM
Alberto Labarga
Deploying liferay war under different context than ROOT
December 21, 2006 8:14 AM
Answer

Alberto Labarga

Rank: New Member

Posts: 1

Join Date: December 21, 2006

Recent Posts

Hi,

for what I have read, this may not be possible, but can I deploy the liferay-portal-4.2.0.war under a different context PATH than ROOT?

if possible, how should I configure that? ideally, I would like to use an external file, do not wnat to mess up with the war contents

thank you very much

Alberto
Jorge Ferrer
RE: Deploying liferay war under different context than ROOT
December 22, 2006 1:04 PM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2662

Join Date: August 31, 2006

Recent Posts

Hi Alberto,

You'll be glad to hear that it is possible. You can see how in the following FAQ entry in LiferayPedia:

http://wiki.liferay.com/index.php/Liferay_FAQ#How_do_I_deploy_Liferay_to_a_context_different_than_the_root_one
Stephen More
RE: Deploying liferay war under different context than ROOT
January 9, 2007 7:46 AM
Answer

Stephen More

Rank: Junior Member

Posts: 73

Join Date: August 16, 2006

Recent Posts

This is how I have deployed multiple wars of version 4.1.3 to 1 tomcat.


A. Configure tomcat
1. create conf/jaas.config

PortalRealm {
    com.liferay.portal.kernel.security.jaas.PortalLoginModule required;
};

2. modify bin/catalina.sh to include

JAVA_OPTS="-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=EST -Djava.security.auth.login.config=$CATALINA_BASE/conf/jaas.config"


3. Copy Libs   
     cp mysql-connector-java-3.1.13-bin.jar $CATALINA_HOME/common/lib

    ( From liferay-portal-dependencies-4.1.3.zip )
    cp portlet.jar $CATALINA_HOME/common/lib
    cp portal-kernel.jar $CATALINA_HOME/common/lib

    ( From liferay-portal-4.1.3.war )
    mv liferay-portal-4.1.3/WEB-INF/lib/* into $CATALINA_HOME/shared/lib

B. Configure the war
1. mkdir myPortal

2. cd myPortal

3. jar -xvf ../liferay-portal-4.1.3.war

4. rm index.html

5. create META-INF/context.xml
    <Context path="/myPortal" reloadable="true" >
   
    <Resource
        name="jdbc/LiferayPool"
        auth="Container"
        type="javax.sql.DataSource"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8"
        username="root"
        password=""
        maxActive="100"
        maxIdle="30"
        maxWait="10000"
    />

    <Resource
                name="mail/MailSession"
                auth="Container"
                type="javax.mail.Session"
                mail.transport.protocol="smtp"
                mail.smtp.host="localhost"
    />

    <Realm
                className="org.apache.catalina.realm.JAASRealm"
                appName="PortalRealm"
                userClassNames="com.liferay.portal.security.jaas.PortalPrincipal"
                roleClassNames="com.liferay.portal.security.jaas.PortalRole"
                debug="99"
                useContextClassLoader="false"
    />
</Context>



6. modify WEB-INF/web.xml
    - change company_id
    - change root_path

7. mkdir WEB-INF/classes

8. cd classes

9. create WEB-INF/classes/portal-ext.properties
   portal.release=professional

   portal.ctx=/myPortal

   auto.deploy.dest.dir=../webapps

   portal.instances=1

   lucene.dir=/var/liferay/lucene/

   jcr.jackrabbit.repository.root=/var/liferay/jackrabbit

   omniadmin.users=

10. jar -cvf ../myPortal.war *

11. copy myPortal.war to tomcats webapp directory



Now http://localhost:8080/myPortal/c should now work.

If you want to create a second instance, change the items in red
to yourPortal.

Remove the items in blue

Now you can deploy yourPortal.war to tomcat.
Amokrane Belloui
RE: Deploying liferay war under different context than ROOT
December 24, 2006 8:07 AM
Answer

Amokrane Belloui

Rank: New Member

Posts: 7

Join Date: December 24, 2006

Recent Posts

Hi everybody,

Had been working for version 4.1.2,

But without success for version 4.2.0

The problem is :
on the main page the portlets are not visible, keeps loading without success,

Has anyone faced this problem with version 4.2.0

Br,
Amokrane,
Glenn Michael Keith
RE: Deploying liferay war under different context than ROOT
December 26, 2006 6:14 AM
Answer

Glenn Michael Keith

Rank: New Member

Posts: 2

Join Date: December 26, 2006

Recent Posts

I've got the same problem, looks like the portlets are still trying to access from the ROOT context instead of the new portal context: http://localhost:8080/c/portal/render_portlet
instead of what it should be
http://localhost:8080/myportal/c/portal/render_portlet

Any liferay guru's know where the config for that is? Or is just a version bug?

Thanx
Borxa Varela Bouzas
RE: Deploying liferay war under different context than ROOT
December 26, 2006 12:19 PM
Answer

Borxa Varela Bouzas

Rank: Junior Member

Posts: 58

Join Date: December 26, 2006

Recent Posts

I think that is a bug. I have the same problem and i haven't it with previous versions.

I investigate the bug, and detect in the file portal-web/docroot/html/portal/load_render_portlet.jsp in the 4.2.0 source code this fragment of code for the javascript render:


...
function <%= namespace %>loadPortlet() {
var path = "/c/portal/render_portlet";
var queryString = "p_l_id=<%= plid %>&p_p_id=<%= portlet.getPortletId() %>&p_p_action=0&p_p_state=normal&p_p_mode=view&p_p_col_id=<%= columnId %>&p_p_col_pos=<%= columnPos %>&p_p_col_count=<%= columnCount %>";
...


I find this file only in the last version 4.2.0, you see the variable path, which don't use our context path modified. I solve it patching the file like this:


...
function <%= namespace %>loadPortlet() {
var path = "<%=PropsUtil.get(PropsUtil.PORTAL_CTX)%>/c/portal/render_portlet";
var queryString = "p_l_id=<%= plid %>&p_p_id=<%= portlet.getPortletId() %>&p_p_action=0&p_p_state=normal&p_p_mode=view&p_p_col_id=<%= columnId %>&p_p_col_pos=<%= columnPos %>&p_p_col_count=<%= columnCount %>";
...


I add PropsUtil.get(PropsUtil.PORTAL_CTX) in the definition of var path, for add property portal.ctx, which we have modified previously.

For solve the problem if you don't use source code, you go to the webapps directory in the server, navigate in your webapp to ...html/portal/load_render_portlet.jsp, find the var path and change it.
Glenn Michael Keith
RE: Deploying liferay war under different context than ROOT
December 27, 2006 11:09 AM
Answer

Glenn Michael Keith

Rank: New Member

Posts: 2

Join Date: December 26, 2006

Recent Posts

I found, a similiar solution by simply finding the load_render_portlet.jsp file and hardcoding the new context.

I thought I'd add a little note here as well for newbie's to liferay like myself. When you modify the company_id in the WEB.xml you'll notice that you will loose the default communities and pages inside liferays orignal configuration.

If you want to keep these setting and still change the company_id you'll need to go digging inside the lportal database create script to alter the primary key inside the insert statement into the table company from the liferay.com to your new company_id.
Jorge Ferrer
RE: Deploying liferay war under different context than ROOT
December 29, 2006 11:06 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2662

Join Date: August 31, 2006

Recent Posts

Hi,

This issue is already solved in SVN and will be included in 4.2.1. Thanks for noticing emoticon
Ivano Carrara
RE: Deploying liferay war under different context than ROOT
January 9, 2007 7:33 AM
Answer

Ivano Carrara

Rank: Regular Member

Posts: 201

Join Date: July 2, 2005

Recent Posts

Dear Jorge,

please, could you help me to understand if Liferay can run in multiple instances on one Tomcat server, each Liferay instance poiting to a separate database?

Since many times I'm running three separate Liferay servers on three separate Tomcat 5.5 servers.

Each portal points to a separate database in one MySql server instance. I don't used 'lportal' unique database, but 'companyA' 'companyB' 'companyC' databases running on a MySql 5 server.

Now I have to setup more Liferay portals so I'm trying to run one only Tomcat server and multiple Liferay instances.

I successfully setup three instances of Liferay following the High Availability Guide published on wiki.liferay.com

Then I changed:

C:\Java\tomcat-liferay\conf\Catalina\localhost\ROOT.xml to point to the 'companyA' MySql database

C:\Java\tomcat-liferay\conf\Catalina\localhost2\ROOT.xml to point to the 'companyB' MySql database

C:\Java\tomcat-liferay\conf\Catalina\localhost3\ROOT.xml to point to the 'companyC' MySql database

To do the above I changed:
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
-----> url="jdbc:mysql://localhost/companyA / companyB / companyC <--
....
...
/>

But now I understand that Liferay use the "jdbc/LiferayPool" of the first instance (localhost) for the all instances, so it point only to the 'companyA' database!!

Please, could you tell me if different instance of Liferay can read data from different jdbc/LiferayPool sources?

In professional and/or ASP environment, a Company can ask to separate their corporate data from other Companies.

If this is impossible, there is a path to follow to merge the contents of the actual 'companyA' 'companyB' 'companyC' databases?

Thank you in advance for your help!

Ivano C.
Jorge Ferrer
RE: Deploying liferay war under different context than ROOT
January 11, 2007 4:52 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2662

Join Date: August 31, 2006

Recent Posts

Liferay has support for Application Server Provider hosting environments. The data of each company (called Enterprise in the web interface) is isolated from each other although only one database is required. Addition of new companies is done by deploying new portal WARS and changing the company_id parameter in the web.xml. The exact procedure depends on the application server.

If the databases must be different the best way to do it is to have several Tomcat instances.
Ivano Carrara
RE: Deploying liferay war under different context than ROOT
January 11, 2007 7:44 AM
Answer

Ivano Carrara

Rank: Regular Member

Posts: 201

Join Date: July 2, 2005

Recent Posts

Jorge, thank you for your reply!

Also, I wrote the multiple-db problem in the Support site - see LEP-1975.

Brian Chan updated the record setting in Version 4.2.2 a probable fix of the problem, as you can see here: http://support.liferay.com/browse/LEP-1975?page=all

Thank you for your valuable support!

Ivano C.
Andre Kreienbring
RE: Deploying liferay war under different context than ROOT
January 21, 2007 8:07 AM
Answer

Andre Kreienbring

Rank: Junior Member

Posts: 82

Join Date: December 18, 2006

Recent Posts

In this other Post there's also information to this topic

Portlets not rendered when running liferay on other context than root

This one is fixed in liferay 4.2.1

BUT:
I think I encountered another Problem:
When using a different context than root no images are shown in articles based on Structure/Template Basic-Image-Text emoticon

Here's what I have done to change context from Root to myPortal. As soon as I can confirm my eMail adress I will also change the Wiki Article Jorge mentioned.

1. stop tomcat and change $CATALINA_HOME/webapps/ROOT to $CATALINA_HOME/webapps/myportal

2. (TOMCAT 5.5) change $CATALINA_HOME/conf/localhost/ROOT.xml to $CATALINA_HOME/conf/localhost/myportal.xml

3. In myportal.xml change/add ...Context ... docBase="/myportal" ...

4. In $CATALINA_HOME/webapps/myportal/index.html redirect to /myportal/c instead of /c

5. In portal-ext.properties add portal.ctx=/myportal

6. modify $CATALINA_HOME/webapps/myportal/WEB_INF/web.xml:
change the root_path from / to /myportal

7. start tomcat

By the way: Uploading the Images again AFTER changing the context did not help.

The source of the rendered HTML Page shows: ...img src="/image/journal/article?...

My System:
Tomcat 5.5.20
Liferay 4.2.1 with classic theme
MySQL 5
Stephen More
RE: Deploying liferay war under different context than ROOT
January 19, 2007 8:00 AM
Answer

Stephen More

Rank: Junior Member

Posts: 73

Join Date: August 16, 2006

Recent Posts

Andre Kreienbring:

This one is fixed in liferay 4.2.1

BUT:
When using a different context than root no images are shown in articles based on Structure/Template Basic-Image-Text emoticon



Has this been documented in JIRA ?

I looked but did not see one....

If you are running apache httpd infront of tomcat there is a workaround:


      RewriteEngine On
      RewriteRule ^/image/(.*)$   /myportal/image/$1 [PT]
Andre Kreienbring
RE: Deploying liferay war under different context than ROOT
January 19, 2007 12:46 PM
Answer

Andre Kreienbring

Rank: Junior Member

Posts: 82

Join Date: December 18, 2006

Recent Posts

Not sure if this is a misconfiguration or a bug!

Thats why I not reported it to Jira.

André
Vincent Wong
RE: Deploying liferay war under different context than ROOT
January 20, 2007 9:50 AM
Answer

Vincent Wong

Rank: New Member

Posts: 7

Join Date: January 20, 2007

Recent Posts

Stephen More:
Andre Kreienbring:

This one is fixed in liferay 4.2.1

BUT:
When using a different context than root no images are shown in articles based on Structure/Template Basic-Image-Text emoticon



Has this been documented in JIRA ?

I looked but did not see one....

If you are running apache httpd infront of tomcat there is a workaround:


      RewriteEngine On
      RewriteRule ^/image/(.*)$   /myportal/image/$1 [PT]


No need, just tweak the journal.transformer.listener in portal-ext.properties with the following line

journal.transformer.listener=com.liferay.portlet.journal.util.TokensTransformerListener,com.liferay.portlet.journal.util.PropertiesTransformerListener,com.liferay.portlet.journal.util.ContentTransformerListener,com.liferay.portlet.journal.util.LocaleTransformerListener


It is found that the default active journal.transformer.listener in portal.properties omits the ContentTransformerListener in the chain, while the correct one is commented out. Therefore the /image/ token is not updated correctly in the web page.

Liferay guys, please double check and accept the fix.
Andre Kreienbring
RE: Deploying liferay war under different context than ROOT
January 21, 2007 8:06 AM
Answer

Andre Kreienbring

Rank: Junior Member

Posts: 82

Join Date: December 18, 2006

Recent Posts

YES!

This was only the second Post of this guy. Man, you should post more often...

Great!

André
Brian Chan
RE: Deploying liferay war under different context than ROOT
January 22, 2007 11:11 AM
Answer

Brian Chan

LIFERAY STAFF

Rank: Liferay Master

Posts: 748

Join Date: August 4, 2004

Recent Posts

See http://support.liferay.com/browse/LEP-2075

Thanks Vincent.
Miche Pitt
RE: Deploying liferay war under different context than ROOT
February 4, 2007 12:48 PM
Answer

Miche Pitt

Rank: New Member

Posts: 1

Join Date: February 4, 2007

Recent Posts

YESS !!! It works !
Thanks Vincent and other guys ;)

emoticon

just another throuble on this theme:
When pointing the browser to :
http://localhost:8080/portal

(my context path)

it redirects to:
http://localhost:8080/c

instead of :
http://localhost:8080/portal/c

Anyone has an hint to solve this problem ?

emoticon


[I applyed all the above fix , and followed the installation guide ... I run on Tomcat 6]
Andre Kreienbring
RE: Deploying liferay war under different context than ROOT
February 5, 2007 3:05 AM
Answer

Andre Kreienbring

Rank: Junior Member

Posts: 82

Join Date: December 18, 2006

Recent Posts

Please check Step 4 in my list above!

André
Marshall Thompson
RE: Deploying liferay war under different context than ROOT
February 6, 2007 5:12 AM
Answer

Marshall Thompson

Rank: New Member

Posts: 22

Join Date: March 23, 2005

Recent Posts

Following above works. I deployed to myportal context under tomcat 5.5.20. After signing in, portal looks like is functioning fine.
On start though, I get the following errors. Are these by design, or did I miss a step somewhere? I assume such content is not bundled in the .war - and this is the expected?

[JournalContentUtil:82] Uanble to get content for liferay.com 1 FRONTPA
GE-AD en_US
com.liferay.portlet.journal.NoSuchArticleException

...


12:59:41,137 ERROR [JournalContentUtil:82] Uanble to get content for liferay.com 1 ABOUT-L
IFERAY en_US
com.liferay.portlet.journal.NoSuchArticleException

.....

Along with a few others.
stephane Manou
RE: Deploying liferay war under different context than ROOT
February 7, 2007 8:12 AM
Answer

stephane Manou

Rank: New Member

Posts: 13

Join Date: February 2, 2007

Recent Posts

Hello,

i´ve got the same problem, i read there´s a Problem with Clob datatype and/or with the sql scripts.

In this forum, category:installation.database is explained that the use of ojdbc14.jar (10g) will solve this Problem.

I have to proof it, but have no time for, maybe can you try it.

An other Problem by me is the characterEncoding=UTF-8, specials characters in french or german and other languages are out of order...
Do you have this Problem too?
Marshall Thompson
RE: Deploying liferay war under different context than ROOT
February 7, 2007 8:09 AM
Answer

Marshall Thompson

Rank: New Member

Posts: 22

Join Date: March 23, 2005

Recent Posts

I already use oracle 10 (oracle xe) and the ojdbc14.jar. Had not noticed any issues with other languages since only using english at the moment.
Marshall Thompson
RE: Deploying liferay war under different context than ROOT
February 8, 2007 7:38 AM
Answer

Marshall Thompson

Rank: New Member

Posts: 22

Join Date: March 23, 2005

Recent Posts

ah, for those of us using oracle instead of the hypersonic db. The create-oracle.sql script does not populate the JournalArticle table with data. The hypersonic sql script does. There may be other tables that would need to be populated. Have not done an in-depth analysis.

Liferay guys, do you update all the sql scripts in the bundle when you add data for the bundle demo?
Andres Gutierrez
RE: Deploying liferay war under different context than ROOT
February 15, 2007 12:35 PM
Answer

Andres Gutierrez

Rank: New Member

Posts: 19

Join Date: February 6, 2007

Recent Posts

Andre, I used your guide to install liferay but when I start tomcat and access the link http://localhost8080/myPortal/c/ it throws me this exception in the log file:

2007-02-15 18:14:44 StandardWrapperValve[MainServlet]: Servlet.service() for servlet MainServlet threw exception
java.lang.NullPointerException
    at com.liferay.portal.struts.StrutsUtil.forward(StrutsUtil.java:72)
    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:865)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:143)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:152)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)


do you or someone have any idea of what Im missing? I have tried many times and always the same error.
Andre Kreienbring
RE: Deploying liferay war under different context than ROOT
February 16, 2007 2:19 AM
Answer

Andre Kreienbring

Rank: Junior Member

Posts: 82

Join Date: December 18, 2006

Recent Posts

Andres

are you sure that your liferay runs smoothly in the root context?

You get a NullPointer in the Struts forward.

Did you make any changes to struts-config.xml or other configuration files?

André
Andres Gutierrez
RE: Deploying liferay war under different context than ROOT
February 16, 2007 6:33 AM
Answer

Andres Gutierrez

Rank: New Member

Posts: 19

Join Date: February 6, 2007

Recent Posts

emoticon

Hi Andre,

I first use the bundle version and work on it, then I needed to install it in a server in where the tomcat have more applications, so I need that liferay work in a different context than ROOT, thats why I use the guide yo posted, but I havent done any thing different from what you post (didnt change struts-config.xml or other configuration file), so I'm kind of confuse, am I missing some basic configurations. I already read the tutorial for installing the war in tomcat but I recieve the same response (Null Pointer Exception in the forward).

emoticon help haaaaaaaaaaaa
Andre Kreienbring
RE: Deploying liferay war under different context than ROOT
February 16, 2007 9:01 AM
Answer

Andre Kreienbring

Rank: Junior Member

Posts: 82

Join Date: December 18, 2006

Recent Posts

Sorry,

I can't help you with this. I've no idea where this comes from.

Maybe anybody else?

André
Vincent Wong
RE: Deploying liferay war under different context than ROOT
February 21, 2007 7:14 AM
Answer

Vincent Wong

Rank: New Member

Posts: 7

Join Date: January 20, 2007

Recent Posts

Brian Chan:
See http://support.liferay.com/browse/LEP-2075

Thanks Vincent.


Thanks Brian.
I find the Journal's content editor does not display image correctly in its editor because the image's url doesn't take the web context into account. Here is my guess to fix to the issue. Hope it helps others as well. I'm new to Liferay so not sure if it is the best fix to the problem, please double-check.

Locate the following lines in ROOT/html/portlet/journal/edit_article_content_xsd_el.jsp:
<%@ include file="/html/portlet/journal/init.jsp" %>
<%
String languageId = LanguageUtil.getLanguageId(request);

String groupId = (String)request.getAttribute(WebKeys.JOURNAL_ARTICLE_GROUP_ID);

Element el = (Element)request.getAttribute(WebKeys.JOURNAL_STRUCTURE_EL);

Add the second line of code
String groupId = (String)request.getAttribute(WebKeys.JOURNAL_ARTICLE_GROUP_ID);
String portalCTX = PropsUtil.get(PropsUtil.PORTAL_CTX).trim();


Then find the following fragment in the same file:
            if ((i + 1) == elPathNames.length) {
                elContent = GetterUtil.getString(tempEl.elementText("dynamic-content"));

                if (!elType.equals("text_area")) {
                    elContent = Html.toInputSafe(elContent);
                }

                Element dynConEl = tempEl.element("dynamic-content");

                if (dynConEl != null) {
                    elLanguageId = dynConEl.attributeValue("language-id", StringPool.BLANK);
                }
                else {
                    elLanguageId = languageId;
                }
            }

Add the following first 3 lines of code to fix the URL.
                if (elType.equals("image")) {
                    elContent = portalCTX + elContent;
                }

                if (!elType.equals("text_area")) {
                    elContent = Html.toInputSafe(elContent);
                }
Andres Gutierrez
RE: Deploying liferay war under different context than ROOT
March 14, 2007 2:14 PM
Answer

Andres Gutierrez

Rank: New Member

Posts: 19

Join Date: February 6, 2007

Recent Posts

Vincent I used your guess but it didnt work well, it generated an error and didnt show the information in the Home page, it just appeared the language options and the menu in the top side of the page.
Pier Paolo Bortone
RE: Deploying liferay war under different context than ROOT
March 15, 2007 2:46 AM
Answer

Pier Paolo Bortone

Rank: New Member

Posts: 9

Join Date: November 23, 2006

Recent Posts

Hi Vincent,
your contribution is truly precious.

I have a new questions.

In the multi-contex configuration on same Tomcat I have a problem with locales configured in the portlet-ext.properties or portlet-(companyId).properties.
I have the company “A” with locales=en_US,it_IT and company “B” with locales=it_IT.

Being LanguageUtil a Singleton, the locales visualized by the Language Portlet will depend on the context used for first. And this status not change until restart tomcat.

How I can resolve this problem? This is a BUG? Exists a way in order to by-pass the problem?

Thanks in advance for your help.

Cheers,
Pier Paolo
Pier Paolo Bortone
RE: Deploying liferay war under different context than ROOT
March 15, 2007 3:32 AM
Answer

Pier Paolo Bortone

Rank: New Member

Posts: 9

Join Date: November 23, 2006

Recent Posts

Hi all,
I have an other problem with the locales, this time with the “local” property in the file system-ext.properties.

In this configuration multi-site the file system-ext.properties does not come loaded.

I have had to directly injected the modification of “local” property in the file system.properties in the jar portal-ejb.jar.

Is there an other solution?

Thanks in advance.

Cheers,
Pier Paolo.
Marcus Schmidke
RE: Deploying liferay war under different context than ROOT
March 16, 2007 1:03 AM
Answer

Marcus Schmidke

Rank: New Member

Posts: 15

Join Date: March 1, 2007

Recent Posts

Vincent Wong:

No need, just tweak the journal.transformer.listener in portal-ext.properties with the following line


But ... this fix only seems to work for "the" Content Image ("/image/journal..."), not for images from the image gallery I embed using the html editor ("/image/image_gallery") ...

Is this a bug too or am I doing something wrong?

Regards,

Marcus.
Marcus Schmidke
RE: Deploying liferay war under different context than ROOT
March 16, 2007 3:21 AM
Answer

Marcus Schmidke

Rank: New Member

Posts: 15

Join Date: March 1, 2007

Recent Posts

Marcus Schmidke:

not for images from the image gallery I embed using the html editor ("/image/image_gallery") ...


As an workaround, I patched ImageCommandReceiver.java:

in method _getFiles(), I changed the following lines:

fileEl.setAttribute("size", getSize(image.getSize()));
String ctx=PropsUtil.get(PropsUtil.PORTAL_CTX).trim();
fileEl.setAttribute(
"url", ctx+"/image/image_gallery?img_id=" + image.getImageId());

For now, it works, but the result is having the absolute image path in the journal article object so that after eventually changing the root context path, all images are lost once again.
Marcus Schmidke
RE: Deploying liferay war under different context than ROOT
March 16, 2007 6:10 AM
Answer

Marcus Schmidke

Rank: New Member

Posts: 15

Join Date: March 1, 2007

Recent Posts

Marcus Schmidke:
but the result is having the absolute image path in the journal article object


Now I've found a solution for this, but I am not sure if it is a bad hack.

It took the following steps:

Once again, I've changed ImageCommandReceiver.


fileEl.setAttribute("size", getSize(image.getSize()));
fileEl.setAttribute(
    "url", "image/image_gallery?img_id=" + image.getImageId());


Actually, yet the only difference to the original version is the removed slash at the beginning of the url.

Then, I've changed the fckconfig.js to have a BaseHref:

FCKConfig.BaseHref = 'http://localhost:8080/mycontext/' ;

(Perhaps this could be coded in some dynamic way sice it's JavaScript). With these changes, the editor works fine, and the URLs in the journal database are relative to the context root.

Lastly, I had to write another TransformerListener and appended it to the journal.transformer.listener property containing code like the following:

    @Override
    public String onXml(String s) {
        StringBuffer r=new StringBuffer(s.length());
        if (s!=null) {
            String context_root=PropsUtil.get(PropsUtil.PORTAL_CTX);
            int start=0;
            int pos;
            while (start<s.length()) {
                pos=s.indexOf("src=\"image/",start);
                if (pos>=0) {
                    r.append(s.substring(start,pos));
                    r.append("src=\"");
                    r.append(context_root);
                    r.append("/");
                    start=pos+5;
                } else break;
            }
            r.append(s.substring(start));
        }
        return r.toString();
    }
Jamal Najmi
RE: Deploying liferay war under different context than ROOT
March 18, 2007 5:52 PM
Answer

Jamal Najmi

Rank: Junior Member

Posts: 34

Join Date: December 11, 2006

Recent Posts

Stephen,

What about configuring Tomcat so that it has multiple instances, each instance running in its own JVM, then installing one Liferay instance per Tomcat instance? This will give the benefit of managing each Liferay instance independent of the other instances, such as starting, stopping, allocating JVM heap size, etc.

I have been trying to do this with some luck. I created multiple instances of Tomcat and now having trouble with Liferay.

Thanks!

Jamal


Stephen More:
This is how I have deployed multiple wars of version 4.1.3 to 1 tomcat.


A. Configure tomcat
1. create conf/jaas.config

PortalRealm {
    com.liferay.portal.kernel.security.jaas.PortalLoginModule required;
};

2. modify bin/catalina.sh to include

JAVA_OPTS="-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=EST -Djava.security.auth.login.config=$CATALINA_BASE/conf/jaas.config"


3. Copy Libs   
     cp mysql-connector-java-3.1.13-bin.jar $CATALINA_HOME/common/lib

    ( From liferay-portal-dependencies-4.1.3.zip )
    cp portlet.jar $CATALINA_HOME/common/lib
    cp portal-kernel.jar $CATALINA_HOME/common/lib

    ( From liferay-portal-4.1.3.war )
    mv liferay-portal-4.1.3/WEB-INF/lib/* into $CATALINA_HOME/shared/lib

B. Configure the war
1. mkdir myPortal

2. cd myPortal

3. jar -xvf ../liferay-portal-4.1.3.war

4. rm index.html

5. create META-INF/context.xml
    <Context path="/myPortal" reloadable="true" >
   
    <Resource
        name="jdbc/LiferayPool"
        auth="Container"
        type="javax.sql.DataSource"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8"
        username="root"
        password=""
        maxActive="100"
        maxIdle="30"
        maxWait="10000"
    />

    <Resource
                name="mail/MailSession"
                auth="Container"
                type="javax.mail.Session"
                mail.transport.protocol="smtp"
                mail.smtp.host="localhost"
    />

    <Realm
                className="org.apache.catalina.realm.JAASRealm"
                appName="PortalRealm"
                userClassNames="com.liferay.portal.security.jaas.PortalPrincipal"
                roleClassNames="com.liferay.portal.security.jaas.PortalRole"
                debug="99"
                useContextClassLoader="false"
    />
</Context>



6. modify WEB-INF/web.xml
    - change company_id
    - change root_path

7. mkdir WEB-INF/classes

8. cd classes

9. create WEB-INF/classes/portal-ext.properties
   portal.release=professional

   portal.ctx=/myPortal

   auto.deploy.dest.dir=../webapps

   portal.instances=1

   lucene.dir=/var/liferay/lucene/

   jcr.jackrabbit.repository.root=/var/liferay/jackrabbit

   omniadmin.users=

10. jar -cvf ../myPortal.war *

11. copy myPortal.war to tomcats webapp directory



Now http://localhost:8080/myPortal/c should now work.

If you want to create a second instance, change the items in red
to yourPortal.

Remove the items in blue

Now you can deploy yourPortal.war to tomcat.
Stephen More
RE: Deploying liferay war under different context than ROOT
March 20, 2007 9:55 AM
Answer

Stephen More

Rank: Junior Member

Posts: 73

Join Date: August 16, 2006

Recent Posts

Jamal Najmi:

What about configuring Tomcat so that it has multiple instances, each instance running in its own JVM, then installing one Liferay instance per Tomcat instance? This will give the benefit of managing each Liferay instance independent of the other instances, such as starting, stopping, allocating JVM heap size, etc.

I have been trying to do this with some luck. I created multiple instances of Tomcat and now having trouble with Liferay.

I would think this would be very easy to do....what type of errors are you getting ?
Jamal Najmi
RE: Deploying liferay war under different context than ROOT
March 20, 2007 6:37 PM
Answer

Jamal Najmi

Rank: Junior Member

Posts: 34

Join Date: December 11, 2006

Recent Posts

Well,

To give you a little bit of a background. I installed tomcat 5.5.20 on Linux. I followed instructions at http://www.linuxjournal.com/article/8561 to configure two tomcat instances listening on different ports.

Then I borrowed instructions from http://wiki.liferay.com/index.php/High_Availability_Guide to install and configure Liferay. There were some differences though. For example there is one server.xml per Tomcat instance.

One thing I have noticed is that if I place Liferay jar files in CATALINA_HOME/common/lib/ext, these jar files are not picked up by tomcat and tomcat throws class not found exception. So I had to keep all jars in their own liferay WEB-INF/lib folders.

And here is the error I am getting. I am not sure if this error has anything to do with the fact that I am running tomcat instances. I will appreciate any help I can get.

Thanks!

Jamal


Mar 19, 2007 11:49:35 PM org.apache.catalina.realm.JAASRealm setUseContextClass
Loader
INFO: Setting useContextClassLoader = false
log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.
TldConfig).
log4j:WARN Please initialize the log4j system properly.
Mar 19, 2007 11:49:37 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Mar 19, 2007 11:49:37 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
Mar 19, 2007 11:49:37 PM org.apache.catalina.core.StandardContext processTlds
SEVERE: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.log4j.Category.isEnabledFor(Category.java:746)
at org.apache.commons.logging.impl.Log4JLogger.isTraceEnabled(Log4JLogg
er.java:327)
at org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig
.java:581)
at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:282)
at org.apache.catalina.core.StandardContext.processTlds(StandardContext
.java:4302)
Andres Gutierrez
RE: Deploying liferay war under different context than ROOT
March 21, 2007 8:07 AM
Answer

Andres Gutierrez

Rank: New Member

Posts: 19

Join Date: February 6, 2007

Recent Posts

Hi

Jamal Najmi:
One thing I have noticed is that if I place Liferay jar files in CATALINA_HOME/common/lib/ext, these jar files are not picked up by tomcat and tomcat throws class not found exception. So I had to keep all jars in their own liferay WEB-INF/lib folders.


If you want them to be in the directory "CATALINA_HOME/common/lib/ext" you have to configure the file "CATALINA_HOME/conf/catalina.properties" and in this line:

common.loader= ${catalina.home}/common/classes, ...

add in the last part this code:

${catalina.home}/common/lib/ext/*.jar

this makes that the server also search for .jar's in the ext/ directory.

For the error, it looks like the problem is the context.xml of your liferay instance, where do you have your context, in conf/Catalina/localhost/ or in webapp/"your portal"/META-INF/ ? and what info does this file have ?

I also recommend you to read the liferay 4 installation guide that can be downloaded from this page.

hf

Andres G