You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Greg Reddin <gr...@apache.org> on 2006/07/23 23:47:52 UTC

Myfaces Portlets With Liferay and Maven

Hi,

I'm trying to build a strategy for developing MyFaces portlets with  
Maven for deployment into Liferay.  I've posted a thread on the  
Liferay forum but so far no one has responded.  I wonder if anyone  
here has any experience or insight.  Here's a link to the thread:

	http://forums.liferay.com/index.php?showtopic=5957

I'm not having problems deploying Myfaces as a portlet.  The problem  
seems to be in using m2 as my build mechanism.  I'm using Myfaces  
1.1.1.  It is declared as a dependency in my pom.xml.  Liferay ships  
with a sample MyFaces war file.  The myfaces jars in that war file  
appear to be 1.1.1 based on the MANIFEST file.  But the war that  
ships with Liferay contains different jar files than what I get if I  
declare myfaces as a dependency in Maven.  So I don't know if the war  
is "custom-built" or if it contains a set of jars from the myfaces  
distribution.  Either way, their war file does not contain a commons- 
logging.jar while mine does.  Mine seems to conflict with a commons- 
logging.jar distributed with Liferay, but I haven't been able to  
determine exactly where.  Anyway my deployment works if I remove  
commons-logging-1.0.4.jar form WEB-INF/lib and add Liferay's util- 
jsf.jar.  So...  any advice on how I can make my deployment  
successful?  Do I need to change something in Liferay's deployment or  
is an M2-built war not an option?  Also, does anyone know if the  
Liferay jars are available on a public Maven repo somewhere or will I  
have to set up a private repo somewhere?

Thanks,
Greg

RE: Myfaces Portlets With Liferay and Maven

Posted by "Papaioannou, Todd" <tp...@ncr.com>.
Sure, I'll put something up when I get a chance. On the road at the
minute.. 

> -----Original Message-----
> From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On 
> Behalf Of Matthias Wessendorf
> Sent: Tuesday, July 25, 2006 7:08 PM
> To: MyFaces Discussion
> Subject: Re: Myfaces Portlets With Liferay and Maven
> 
> Todd-
> 
> maybe I can ask you to provide a bit of your Liferay solution 
> on the myfaces wiki?
> 
> http://wiki.apache.org/myfaces/Using_Portlets
> 
> I swa several posts in the past regarding that container.
> 
> Thanks,
> 
> On 7/25/06, Papaioannou, Todd <tp...@ncr.com> wrote:
> > I have one there too, and also commons-logging-1.0.4.jar in my 
> > WEB-INF/lib folder. Everything works fine. Is there some 
> exception you 
> > are getting that might shed some more light?
> >
> > Todd
> >
> > > -----Original Message-----
> > > From: Greg Reddin [mailto:greddin@apache.org]
> > > Sent: Monday, July 24, 2006 3:18 PM
> > > To: MyFaces Discussion
> > > Subject: Re: Myfaces Portlets With Liferay and Maven
> > >
> > >
> > > On Jul 24, 2006, at 4:33 PM, Papaioannou, Todd wrote:
> > >
> > > > What version of Liferay are you using? With the LEP 4.0 you
> > > shouldn't
> > > > have to worry about the version of Myfaces LEP is using
> > > since this is
> > > > segrated into a different classloader. You are free to put 
> > > > whatever version you want in your WEB-INF/lib folder. I 
> am using 
> > > > MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2 with no problems.
> > >
> > > I'm using Liferay Professional 4.0 - Tomcat version.  I found a 
> > > commons-logging.jar (version 1.0.4 according to the
> > > Manifest) in common/lib/ext.  If I remove it Liferay won't start 
> > > because some portlets die (including the main CMS portlet).
> > >
> > > Greg
> > >
> > >
> >
> 
> 
> --
> Matthias Wessendorf
> 
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
> 

Re: Myfaces Portlets With Liferay and Maven

Posted by Matthias Wessendorf <ma...@apache.org>.
Todd-

maybe I can ask you to provide a bit of your Liferay solution on the
myfaces wiki?

http://wiki.apache.org/myfaces/Using_Portlets

I swa several posts in the past regarding that container.

Thanks,

On 7/25/06, Papaioannou, Todd <tp...@ncr.com> wrote:
> I have one there too, and also commons-logging-1.0.4.jar in my
> WEB-INF/lib folder. Everything works fine. Is there some
> exception you are getting that might shed some more light?
>
> Todd
>
> > -----Original Message-----
> > From: Greg Reddin [mailto:greddin@apache.org]
> > Sent: Monday, July 24, 2006 3:18 PM
> > To: MyFaces Discussion
> > Subject: Re: Myfaces Portlets With Liferay and Maven
> >
> >
> > On Jul 24, 2006, at 4:33 PM, Papaioannou, Todd wrote:
> >
> > > What version of Liferay are you using? With the LEP 4.0 you
> > shouldn't
> > > have to worry about the version of Myfaces LEP is using
> > since this is
> > > segrated into a different classloader. You are free to put whatever
> > > version you want in your WEB-INF/lib folder. I am using
> > > MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2 with no problems.
> >
> > I'm using Liferay Professional 4.0 - Tomcat version.  I found
> > a commons-logging.jar (version 1.0.4 according to the
> > Manifest) in common/lib/ext.  If I remove it Liferay won't
> > start because some portlets die (including the main CMS portlet).
> >
> > Greg
> >
> >
>


-- 
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Myfaces Portlets With Liferay and Maven

Posted by Greg Reddin <gr...@apache.org>.
Sorry it took me so long to respond, but thanks for your help.  This  
seems to have fixed my problem :-)

Greg

On Jul 26, 2006, at 1:28 PM, Papaioannou, Todd wrote:

> Greg,
>
> Try this: create a commons-logging.properties file somewhere in the
> classpath
> of your portlet. WEB-INF/class is favorite. Put this in there:
>
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLo 
> gg
> er
>
> Todd
>
>> -----Original Message-----
>> From: Greg Reddin [mailto:greddin@apache.org]
>> Sent: Tuesday, July 25, 2006 8:31 PM
>> To: MyFaces Discussion
>> Subject: Re: Myfaces Portlets With Liferay and Maven
>>
>> Thanks, Todd.  Here's the stack trace:
>>
>> 03:23:44,545 ERROR [org.apache.catalina.core.ContainerBase]
>> Exception invoking periodic operation:
>> java.lang.NoSuchMethodError: org.apache.log4j.Category.log(Ljava/ 
>> lang/
>> String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Th
>> rowable;)V
>>          at org.apache.commons.logging.impl.Log4JCategoryLog.error
>> (Log4JCategoryLog.java:149)
>>          at org.apache.catalina.core.StandardContext.listenerStart
>> (StandardContext.java:3733)
>>          at org.apache.catalina.core.StandardContext.start
>> (StandardContext.java:4187)
>>          at org.apache.catalina.startup.HostConfig.checkResources
>> (HostConfig.java:1089)
>>          at org.apache.catalina.startup.HostConfig.check
>> (HostConfig.java:1187)
>>          at org.apache.catalina.startup.HostConfig.lifecycleEvent
>> (HostConfig.java:292)
>>          at
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
>> (LifecycleSupport.java:119)
>>          at org.apache.catalina.core.ContainerBase.backgroundProcess
>> (ContainerBase.java:1305)
>>          at org.apache.catalina.core.ContainerBase
>> $ContainerBackgroundProcessor.processChildren(ContainerBase.java: 
>> 1569)
>>          at org.apache.catalina.core.ContainerBase
>> $ContainerBackgroundProcessor.processChildren(ContainerBase.java: 
>> 1578)
>>          at org.apache.catalina.core.ContainerBase
>> $ContainerBackgroundProcessor.run(ContainerBase.java:1558)
>>          at java.lang.Thread.run(Thread.java:613)
>>
>> This is what I have in WEB-INF/lib:
>>
>> commons-beanutils-1.7.0.jar
>> commons-codec-1.3.jar
>> commons-collections-3.1.jar
>> commons-digester-1.7.jar
>> commons-el-1.0.jar
>> commons-fileupload-1.0.jar
>> commons-lang-2.1.jar
>> commons-logging-1.0.4.jar
>> commons-validator-1.1.4.jar
>> jstl-1.1.2.jar
>> myfaces-api-1.1.1.jar
>> myfaces-impl-1.1.1.jar
>> oro-2.0.8.jar
>> tomahawk-1.1.1.jar
>> util-jsf.jar
>> xml-apis-1.0.b2.jar
>>
>> It looks like the problem is with an incompatible version of log4j.
>> I have log4j 1.2.12 in common/lib/ext.
>>
>> Greg
>>
>> On Jul 25, 2006, at 1:34 PM, Papaioannou, Todd wrote:
>>
>>> I have one there too, and also commons-logging-1.0.4.jar in my
>>> WEB-INF/lib folder. Everything works fine. Is there some
>> exception you
>>> are getting that might shed some more light?
>>>
>>> Todd
>>>
>>>> -----Original Message-----
>>>> From: Greg Reddin [mailto:greddin@apache.org]
>>>> Sent: Monday, July 24, 2006 3:18 PM
>>>> To: MyFaces Discussion
>>>> Subject: Re: Myfaces Portlets With Liferay and Maven
>>>>
>>>>
>>>> On Jul 24, 2006, at 4:33 PM, Papaioannou, Todd wrote:
>>>>
>>>>> What version of Liferay are you using? With the LEP 4.0 you
>>>> shouldn't
>>>>> have to worry about the version of Myfaces LEP is using
>>>> since this is
>>>>> segrated into a different classloader. You are free to
>> put whatever
>>>>> version you want in your WEB-INF/lib folder. I am using
>>>>> MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2 with no problems.
>>>>
>>>> I'm using Liferay Professional 4.0 - Tomcat version.  I found a
>>>> commons-logging.jar (version 1.0.4 according to the
>>>> Manifest) in common/lib/ext.  If I remove it Liferay won't start
>>>> because some portlets die (including the main CMS portlet).
>>>>
>>>> Greg
>>>>
>>>>
>>>
>>
>>
>


RE: Myfaces Portlets With Liferay and Maven

Posted by "Papaioannou, Todd" <tp...@ncr.com>.
Greg,

Try this: create a commons-logging.properties file somewhere in the
classpath
of your portlet. WEB-INF/class is favorite. Put this in there:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
er

Todd 

> -----Original Message-----
> From: Greg Reddin [mailto:greddin@apache.org] 
> Sent: Tuesday, July 25, 2006 8:31 PM
> To: MyFaces Discussion
> Subject: Re: Myfaces Portlets With Liferay and Maven
> 
> Thanks, Todd.  Here's the stack trace:
> 
> 03:23:44,545 ERROR [org.apache.catalina.core.ContainerBase] 
> Exception invoking periodic operation:
> java.lang.NoSuchMethodError: org.apache.log4j.Category.log(Ljava/lang/
> String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Th
> rowable;)V
>          at org.apache.commons.logging.impl.Log4JCategoryLog.error
> (Log4JCategoryLog.java:149)
>          at org.apache.catalina.core.StandardContext.listenerStart
> (StandardContext.java:3733)
>          at org.apache.catalina.core.StandardContext.start
> (StandardContext.java:4187)
>          at org.apache.catalina.startup.HostConfig.checkResources
> (HostConfig.java:1089)
>          at org.apache.catalina.startup.HostConfig.check
> (HostConfig.java:1187)
>          at org.apache.catalina.startup.HostConfig.lifecycleEvent
> (HostConfig.java:292)
>          at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
> (LifecycleSupport.java:119)
>          at org.apache.catalina.core.ContainerBase.backgroundProcess
> (ContainerBase.java:1305)
>          at org.apache.catalina.core.ContainerBase
> $ContainerBackgroundProcessor.processChildren(ContainerBase.java:1569)
>          at org.apache.catalina.core.ContainerBase
> $ContainerBackgroundProcessor.processChildren(ContainerBase.java:1578)
>          at org.apache.catalina.core.ContainerBase
> $ContainerBackgroundProcessor.run(ContainerBase.java:1558)
>          at java.lang.Thread.run(Thread.java:613)
> 
> This is what I have in WEB-INF/lib:
> 
> commons-beanutils-1.7.0.jar
> commons-codec-1.3.jar
> commons-collections-3.1.jar
> commons-digester-1.7.jar
> commons-el-1.0.jar
> commons-fileupload-1.0.jar
> commons-lang-2.1.jar
> commons-logging-1.0.4.jar
> commons-validator-1.1.4.jar
> jstl-1.1.2.jar
> myfaces-api-1.1.1.jar
> myfaces-impl-1.1.1.jar
> oro-2.0.8.jar
> tomahawk-1.1.1.jar
> util-jsf.jar
> xml-apis-1.0.b2.jar
> 
> It looks like the problem is with an incompatible version of log4j.   
> I have log4j 1.2.12 in common/lib/ext.
> 
> Greg
> 
> On Jul 25, 2006, at 1:34 PM, Papaioannou, Todd wrote:
> 
> > I have one there too, and also commons-logging-1.0.4.jar in my 
> > WEB-INF/lib folder. Everything works fine. Is there some 
> exception you 
> > are getting that might shed some more light?
> >
> > Todd
> >
> >> -----Original Message-----
> >> From: Greg Reddin [mailto:greddin@apache.org]
> >> Sent: Monday, July 24, 2006 3:18 PM
> >> To: MyFaces Discussion
> >> Subject: Re: Myfaces Portlets With Liferay and Maven
> >>
> >>
> >> On Jul 24, 2006, at 4:33 PM, Papaioannou, Todd wrote:
> >>
> >>> What version of Liferay are you using? With the LEP 4.0 you
> >> shouldn't
> >>> have to worry about the version of Myfaces LEP is using
> >> since this is
> >>> segrated into a different classloader. You are free to 
> put whatever 
> >>> version you want in your WEB-INF/lib folder. I am using 
> >>> MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2 with no problems.
> >>
> >> I'm using Liferay Professional 4.0 - Tomcat version.  I found a 
> >> commons-logging.jar (version 1.0.4 according to the
> >> Manifest) in common/lib/ext.  If I remove it Liferay won't start 
> >> because some portlets die (including the main CMS portlet).
> >>
> >> Greg
> >>
> >>
> >
> 
> 

Re: Myfaces Portlets With Liferay and Maven

Posted by Greg Reddin <gr...@apache.org>.
Thanks, Todd.  Here's the stack trace:

03:23:44,545 ERROR [org.apache.catalina.core.ContainerBase] Exception  
invoking periodic operation:
java.lang.NoSuchMethodError: org.apache.log4j.Category.log(Ljava/lang/ 
String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Throwable;)V
         at org.apache.commons.logging.impl.Log4JCategoryLog.error 
(Log4JCategoryLog.java:149)
         at org.apache.catalina.core.StandardContext.listenerStart 
(StandardContext.java:3733)
         at org.apache.catalina.core.StandardContext.start 
(StandardContext.java:4187)
         at org.apache.catalina.startup.HostConfig.checkResources 
(HostConfig.java:1089)
         at org.apache.catalina.startup.HostConfig.check 
(HostConfig.java:1187)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent 
(HostConfig.java:292)
         at  
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent 
(LifecycleSupport.java:119)
         at org.apache.catalina.core.ContainerBase.backgroundProcess 
(ContainerBase.java:1305)
         at org.apache.catalina.core.ContainerBase 
$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1569)
         at org.apache.catalina.core.ContainerBase 
$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1578)
         at org.apache.catalina.core.ContainerBase 
$ContainerBackgroundProcessor.run(ContainerBase.java:1558)
         at java.lang.Thread.run(Thread.java:613)

This is what I have in WEB-INF/lib:

commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-digester-1.7.jar
commons-el-1.0.jar
commons-fileupload-1.0.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
commons-validator-1.1.4.jar
jstl-1.1.2.jar
myfaces-api-1.1.1.jar
myfaces-impl-1.1.1.jar
oro-2.0.8.jar
tomahawk-1.1.1.jar
util-jsf.jar
xml-apis-1.0.b2.jar

It looks like the problem is with an incompatible version of log4j.   
I have log4j 1.2.12 in common/lib/ext.

Greg

On Jul 25, 2006, at 1:34 PM, Papaioannou, Todd wrote:

> I have one there too, and also commons-logging-1.0.4.jar in my
> WEB-INF/lib folder. Everything works fine. Is there some
> exception you are getting that might shed some more light?
>
> Todd
>
>> -----Original Message-----
>> From: Greg Reddin [mailto:greddin@apache.org]
>> Sent: Monday, July 24, 2006 3:18 PM
>> To: MyFaces Discussion
>> Subject: Re: Myfaces Portlets With Liferay and Maven
>>
>>
>> On Jul 24, 2006, at 4:33 PM, Papaioannou, Todd wrote:
>>
>>> What version of Liferay are you using? With the LEP 4.0 you
>> shouldn't
>>> have to worry about the version of Myfaces LEP is using
>> since this is
>>> segrated into a different classloader. You are free to put whatever
>>> version you want in your WEB-INF/lib folder. I am using
>>> MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2 with no problems.
>>
>> I'm using Liferay Professional 4.0 - Tomcat version.  I found
>> a commons-logging.jar (version 1.0.4 according to the
>> Manifest) in common/lib/ext.  If I remove it Liferay won't
>> start because some portlets die (including the main CMS portlet).
>>
>> Greg
>>
>>
>


RE: Myfaces Portlets With Liferay and Maven

Posted by "Papaioannou, Todd" <tp...@ncr.com>.
I have one there too, and also commons-logging-1.0.4.jar in my
WEB-INF/lib folder. Everything works fine. Is there some
exception you are getting that might shed some more light?

Todd 

> -----Original Message-----
> From: Greg Reddin [mailto:greddin@apache.org] 
> Sent: Monday, July 24, 2006 3:18 PM
> To: MyFaces Discussion
> Subject: Re: Myfaces Portlets With Liferay and Maven
> 
> 
> On Jul 24, 2006, at 4:33 PM, Papaioannou, Todd wrote:
> 
> > What version of Liferay are you using? With the LEP 4.0 you 
> shouldn't 
> > have to worry about the version of Myfaces LEP is using 
> since this is 
> > segrated into a different classloader. You are free to put whatever 
> > version you want in your WEB-INF/lib folder. I am using  
> > MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2 with no problems.
> 
> I'm using Liferay Professional 4.0 - Tomcat version.  I found 
> a commons-logging.jar (version 1.0.4 according to the 
> Manifest) in common/lib/ext.  If I remove it Liferay won't 
> start because some portlets die (including the main CMS portlet).
> 
> Greg
> 
> 

Re: Myfaces Portlets With Liferay and Maven

Posted by Greg Reddin <gr...@apache.org>.
On Jul 24, 2006, at 4:33 PM, Papaioannou, Todd wrote:

> What version of Liferay are you using? With the LEP 4.0 you shouldn't
> have to worry about the version of Myfaces LEP is using since
> this is segrated into a different classloader. You are free to put
> whatever version you want in your WEB-INF/lib folder. I
> am using  MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2
> with no problems.

I'm using Liferay Professional 4.0 - Tomcat version.  I found a  
commons-logging.jar (version 1.0.4 according to the Manifest) in  
common/lib/ext.  If I remove it Liferay won't start because some  
portlets die (including the main CMS portlet).

Greg


RE: Myfaces Portlets With Liferay and Maven

Posted by "Papaioannou, Todd" <tp...@ncr.com>.
What version of Liferay are you using? With the LEP 4.0 you shouldn't
have to worry about the version of Myfaces LEP is using since 
this is segrated into a different classloader. You are free to put
whatever version you want in your WEB-INF/lib folder. I
am using  MyFaces-1.1.4-SNAPSHOT and tomhawk-1.1.2
with no problems. 

You DO need util-jsf.jar however, so make sure this is in
your portlet's classpath somewhere. Again, WEB-INF/lib
is favorite. 

I also include commons-logging-1.0.4.jar since I'm using it
to log in my portlet. 

Todd



> -----Original Message-----
> From: Greg Reddin [mailto:greddin@apache.org] 
> Sent: Sunday, July 23, 2006 2:48 PM
> To: MyFaces Discussion
> Subject: Myfaces Portlets With Liferay and Maven
> 
> Hi,
> 
> I'm trying to build a strategy for developing MyFaces 
> portlets with Maven for deployment into Liferay.  I've posted 
> a thread on the Liferay forum but so far no one has 
> responded.  I wonder if anyone here has any experience or 
> insight.  Here's a link to the thread:
> 
> 	http://forums.liferay.com/index.php?showtopic=5957
> 
> I'm not having problems deploying Myfaces as a portlet.  The 
> problem seems to be in using m2 as my build mechanism.  I'm 
> using Myfaces 1.1.1.  It is declared as a dependency in my 
> pom.xml.  Liferay ships with a sample MyFaces war file.  The 
> myfaces jars in that war file appear to be 1.1.1 based on the 
> MANIFEST file.  But the war that ships with Liferay contains 
> different jar files than what I get if I declare myfaces as a 
> dependency in Maven.  So I don't know if the war is 
> "custom-built" or if it contains a set of jars from the 
> myfaces distribution.  Either way, their war file does not 
> contain a commons- logging.jar while mine does.  Mine seems 
> to conflict with a commons- logging.jar distributed with 
> Liferay, but I haven't been able to determine exactly where.  
> Anyway my deployment works if I remove 
> commons-logging-1.0.4.jar form WEB-INF/lib and add Liferay's 
> util- jsf.jar.  So...  any advice on how I can make my 
> deployment successful?  Do I need to change something in 
> Liferay's deployment or is an M2-built war not an option?  
> Also, does anyone know if the Liferay jars are available on a 
> public Maven repo somewhere or will I have to set up a 
> private repo somewhere?
> 
> Thanks,
> Greg
>