Railo on Lifeary

39 views
Skip to first unread message

Andrea Campolonghi

unread,
Jan 13, 2010, 12:05:52 PM1/13/10
to Railo
Hi,

I have a Liferay install on Tomcat. I am testing the option to
install Railo on the same Tomcat install and start using cfm in place
of jsp for managing the portlets output.
Basically the plan is to produce liferay portlets but ..... skip
jsp ......

So I have added a railo folder ( with all railo jar ) to the tomcat
classpath.
Anything loads but I think I have a conflict in an xml parser jar:

Liferay restart and I can see install homepage.
When I try to open railo-context I get this:

javax.servlet.ServletException:
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be
cast to org.apache.xerces.xni.parser.XMLParserConfiguration
org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
railo.runtime.config.ConfigWebFactory.loadDocument
(ConfigWebFactory.java:677)
railo.runtime.config.ConfigWebFactory.loadDocument
(ConfigWebFactory.java:662)
railo.runtime.config.ConfigWebFactory.newInstance
(ConfigWebFactory.java:192)
railo.runtime.engine.CFMLEngineImpl.loadJSPFactory
(CFMLEngineImpl.java:153)
railo.runtime.engine.CFMLEngineImpl.addServletConfig
(CFMLEngineImpl.java:122)
railo.loader.engine.CFMLEngineFactory.getInstance
(CFMLEngineFactory.java:119)
railo.loader.servlet.CFMLServlet.init(CFMLServlet.java:26)
org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:433)
org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
845)
org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
java.lang.Thread.run(Thread.java:619)

In the logs during installs I find :

Wed Jan 13 16:57:03 GMT 2010-578 Start CFML Controller
===================================================================
SERVER CONTEXT
-------------------------------------------------------------------
- config:/opt/liferay/railo/railo-server/context
===================================================================

Wed Jan 13 16:57:03 GMT 2010-652 write file:/opt/liferay/railo/railo-
server/context/railo-server.xml
java.lang.ClassCastException:
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be
cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at railo.runtime.config.ConfigWebFactory.loadDocument
(ConfigWebFactory.java:677)
at railo.runtime.config.ConfigServerFactory.newInstance
(ConfigServerFactory.java:68)
at railo.runtime.engine.CFMLEngineImpl.getConfigServerImpl
(CFMLEngineImpl.java:134)
at railo.runtime.engine.CFMLEngineImpl.<init>(CFMLEngineImpl.java:86)
at railo.runtime.engine.CFMLEngineImpl.getInstance
(CFMLEngineImpl.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)


And:

===================================================================
WEB CONTEXT
-------------------------------------------------------------------
- config:/opt/liferay/railo/web-config/
a7dc2f749325f2363e2fef35033bf503
- webroot:/opt/liferay/tomcat-6.0.18/webapps/ROOT/
===================================================================

Wed Jan 13 16:57:51 GMT 2010-567 config file /opt/liferay/railo/web-
config/a7dc2f749325f2363e2fef35033bf503/railo-web.xml.cfm was not
valid and has been replaced
Wed Jan 13 16:57:51 GMT 2010-568 write file:/opt/liferay/railo/web-
config/a7dc2f749325f2363e2fef35033bf503/railo-web.xml.cfm
java.lang.NullPointerException
at railo.runtime.type.scope.ScopeContext.getClusterScope
(ScopeContext.java:99)
at railo.runtime.engine.Controler.run(Controler.java:81)
at railo.runtime.op.Caster.toPageException(Caster.java:2928)
at railo.runtime.type.scope.ScopeContext.getClusterScope
(ScopeContext.java:119)
at railo.runtime.engine.Controler.run(Controler.java:81)


Any suggestion ??

Thanks

Andrea

denstar

unread,
Jan 13, 2010, 12:41:52 PM1/13/10
to ra...@googlegroups.com
On Wed, Jan 13, 2010 at 10:05 AM, Andrea Campolonghi wrote:
> Hi,
>
> I have a Liferay install on Tomcat. I am testing the option to
> install Railo on the same Tomcat install and start using cfm in place
> of jsp for managing the portlets output.
> Basically the plan is to produce liferay portlets but ..... skip
> jsp ......


Delete these jars from the railo lib folder:

* apache-xml-xerces.jar
* xml-apis.jar
* ss_css2.jar
* tagsoup.jar
* serializer.jar
* w3c-dom.jar

And theoretically you should be good to go. There might be one
other-- I guess I should have left my old "not so 'leet" blog post
un-edited and linked to a new one instead. Eh. You live, you learn.
:)

Force be with you, esse!

:den

--
The path of least resistance and least trouble is a mental rut already
made. It requires troublesome work to undertake the alternation of old
beliefs.
John Dewey

Andrea Campolonghi

unread,
Jan 13, 2010, 3:09:46 PM1/13/10
to ra...@googlegroups.com
I tried with no success but I guess that was a trick for jBoss incompatibility.
My Liferay install run simply on Tomcat with no Jboss involved.

Must be something else....

Thanks in any case

Andrea

2010/1/13 denstar <vallia...@gmail.com>



--
Andrea Campolonghi
and...@getrailo.org

Adam Haskell

unread,
Jan 13, 2010, 3:50:40 PM1/13/10
to ra...@googlegroups.com
Funny thing how both of them use Tomcat... Are you getting the same error or a new one?


Adam

Andrea Campolonghi

unread,
Jan 13, 2010, 4:04:04 PM1/13/10
to ra...@googlegroups.com
Same.

I will now try to play a bit with the classpath.
I will try to load before railo and then liferay to see what happen.

I will post here the results.

Andrea

2010/1/13 Adam Haskell <a.ha...@gmail.com>



--
Andrea Campolonghi
and...@getrailo.org

Andrea Campolonghi

unread,
Jan 13, 2010, 4:16:53 PM1/13/10
to ra...@googlegroups.com
There is no change.
The same main error on railo-context loading:

Wed Jan 13 21:14:41 GMT 2010-718 Start CFML Controller
===================================================================
SERVER CONTEXT
-------------------------------------------------------------------
- config:/opt/liferay/railo/railo-server/context
===================================================================

java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at railo.runtime.config.ConfigWebFactory.loadDocument(ConfigWebFactory.java:677)
at railo.runtime.config.ConfigServerFactory.newInstance(ConfigServerFactory.java:68)
at railo.runtime.engine.CFMLEngineImpl.getConfigServerImpl(CFMLEngineImpl.java:134)



Micha.
If you read this. Any suggestion?

Thanks

Andrea

2010/1/13 Andrea Campolonghi <and...@getrailo.org>



--
Andrea Campolonghi
and...@getrailo.org

Adam Haskell

unread,
Jan 13, 2010, 5:03:20 PM1/13/10
to ra...@googlegroups.com
I can not remember the other places liferay hides Jar's but your best bet is to scan the liferay install for all jars and eliminate all duplicates from Railo's install.

Adam

seyi

unread,
Jan 13, 2010, 6:01:35 PM1/13/10
to Railo
Hi Andrea,

You might want to try this all over again with a new Liferay instance
and place the railo war file in ../liferay_install_dir/deploy/ then
start up liferay. You should be able to go to the Railo admin page
once liferay starts up, however you still need some other extra steps
before you can start writing CF portlets. I haven't had success
creating portlets with Railo using CFML and a free open source code
that Adam wrote to make any CF container utilize a portal engine, I
tried this for Adobe's CF and can build portlets.

Adam,
Thanks for your work on this, I tried using cfportlets version 1 that
you have up on http://wiki.cfinnovate.com/display/cfmlportlets/Home,
Liferay was able to see the portlet I created and loaded it on startup
but keeps coming up blank when I try to place the portlet into a
portal page. Just checked the site and it seems it's down, are you
still working actively on this or has it been abandoned?

On Jan 13, 5:03 pm, Adam Haskell <a.hask...@gmail.com> wrote:
> I can not remember the other places liferay hides Jar's but your best bet is
> to scan the liferay install for all jars and eliminate all duplicates from
> Railo's install.
>
> Adam
>
> On Wed, Jan 13, 2010 at 4:16 PM, Andrea Campolonghi <and...@getrailo.org>wrote:
>
>
>
> > There is no change.
> > The same main error on railo-context loading:
>
> > Wed Jan 13 21:14:41 GMT 2010-718 Start CFML Controller
> > ===================================================================
> > SERVER CONTEXT
> > -------------------------------------------------------------------
> > - config:/opt/liferay/railo/railo-server/context
> > ===================================================================
>
> > java.lang.ClassCastException:
> > org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to
> > org.apache.xerces.xni.parser.XMLParserConfiguration
> > at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
> >  at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
> > at
> > railo.runtime.config.ConfigWebFactory.loadDocument(ConfigWebFactory.java:67 7)
> >  at

> > railo.runtime.config.ConfigServerFactory.newInstance(ConfigServerFactory.ja va:68)


> > at
> > railo.runtime.engine.CFMLEngineImpl.getConfigServerImpl(CFMLEngineImpl.java :134)
>
> > Micha.
> > If you read this. Any suggestion?
>
> > Thanks
>
> > Andrea
>
> > 2010/1/13 Andrea Campolonghi <and...@getrailo.org>
>
> > Same.
>
> >> I will now try to play a bit with the classpath.
> >> I will try to load before railo and then liferay to see what happen.
>
> >> I will post here the results.
>
> >> Andrea
>

> >> 2010/1/13 Adam Haskell <a.hask...@gmail.com>


>
> >> Funny thing how both of them use Tomcat... Are you getting the same error
> >>> or a new one?
>
> >>> Adam
>
> >>> On Wed, Jan 13, 2010 at 3:09 PM, Andrea Campolonghi <and...@getrailo.org
> >>> > wrote:
>
> >>>> I tried with no success but I guess that was a trick for jBoss
> >>>> incompatibility.
> >>>> My Liferay install run simply on Tomcat with no Jboss involved.
>
> >>>> Must be something else....
>
> >>>> Thanks in any case
>
> >>>> Andrea
>

> >>>> 2010/1/13 denstar <valliants...@gmail.com>

Adam Haskell

unread,
Jan 13, 2010, 8:04:25 PM1/13/10
to ra...@googlegroups.com
Oh hey thanks Seyi! I'll look at liferay tonight, it's been a while, I'm using it on Websphere and JBoss never used it on Liferay. As for the website something sort of auto updated and kinda killed everything :) Trying to figure it out tonight.

Adam

On Wed, Jan 13, 2010 at 6:01 PM, seyi <seyi...@gmail.com> wrote:
Hi Andrea,

You might want to try this all over again with a new Liferay instance
and place the railo war file in ../liferay_install_dir/deploy/ then
start up liferay. Yo  u should be able to go to the Railo admin page

seyi

unread,
Jan 13, 2010, 9:54:15 PM1/13/10
to Railo
Adam,

Thanks Adam, would appreciate it. I'm trying Liferay bundled with
Tomcat. Also from what I can tell it seems cfmlportlets would only
work using .cfm files and not cfcs. Would I be right in that
assumption?

On Jan 13, 8:04 pm, Adam Haskell <a.hask...@gmail.com> wrote:
> Oh hey thanks Seyi! I'll look at liferay tonight, it's been a while, I'm
> using it on Websphere and JBoss never used it on Liferay. As for the website
> something sort of auto updated and kinda killed everything :) Trying to
> figure it out tonight.
>
> Adam
>

> On Wed, Jan 13, 2010 at 6:01 PM, seyi <seyilo...@gmail.com> wrote:
> > Hi Andrea,
>
> > You might want to try this all over again with a new Liferay instance
> > and place the railo war file in ../liferay_install_dir/deploy/ then
> > start up liferay. Yo  u should be able to go to the Railo admin page
> > once liferay starts up, however  you still need some other extra steps
> > before you can start writing CF portlets. I haven't had success
> > creating portlets with Railo using CFML and a free open source code
> > that Adam wrote to make any CF container utilize a portal engine, I
> > tried this for Adobe's CF and can build portlets.
>
> > Adam,
> > Thanks for your work on this, I tried using cfportlets version 1 that

> > you have up onhttp://wiki.cfinnovate.com/display/cfmlportlets/Home,

Andrea Campolonghi

unread,
Jan 14, 2010, 3:02:36 AM1/14/10
to ra...@googlegroups.com
Seyl,

my base idea was not to create cfml protlets but invoke railo from a regular portlet so to just process the output via cfml.
In this case my idea was to render railo globally available to any liferay portlet.

Some question:

1) Implementing a portlet via cfml will I still be able to access to the liferay context ??
2) What are for you the pro and cons of the approaches
3) Do you have a sample of a cfml portlet ?
4) How do you involke Railo if is not globally available ?

Thanks

Andrea

2010/1/14 seyi <seyi...@gmail.com>



--
Andrea Campolonghi
and...@getrailo.org

Michael Offner-Streit

unread,
Jan 14, 2010, 9:33:26 AM1/14/10
to ra...@googlegroups.com
i'm not familiar with liferay, but simply deleting jars from railo lib folder, will not sollve the problem.
the problem is a version conflict with different versions of the jar apache-xml-xerces.jar i think.

/micha


denstar schrieb:
On Wed, Jan 13, 2010 at 10:05 AM, Andrea Campolonghi wrote:
  
Hi,

I have a Liferay install on Tomcat. I am testing  the option to
install Railo on the same Tomcat install and start using cfm in place
of jsp for managing the portlets output.
Basically the plan is to produce liferay portlets but ..... skip
jsp ......
    

Delete these jars from the railo lib folder:

    * apache-xml-xerces.jar
    * xml-apis.jar
    * ss_css2.jar
    * tagsoup.jar
    * serializer.jar
    * w3c-dom.jar

And theoretically you should be good to go.  There might be one
other-- I guess I should have left my old "not so 'leet" blog post
un-edited and linked to a new one instead.  Eh.  You live, you learn.
:)

Force be with you, esse!

:den

  


Adam Haskell

unread,
Jan 14, 2010, 10:18:30 AM1/14/10
to ra...@googlegroups.com
Nothing is keeping you from implementing a cfm that calls CFCs, but there is not a CFC interface like Adobe's CF9 implementation, yet. I have another developer using it right now that has some updates so I should have those committed soon, I'll also add some stuff, one of which will probably include a CFC interface following Adobe's implementation.

Adam

Adam Haskell

unread,
Jan 14, 2010, 10:29:00 AM1/14/10
to ra...@googlegroups.com
On Thu, Jan 14, 2010 at 3:02 AM, Andrea Campolonghi <and...@getrailo.org> wrote:
Some question:
1) Implementing a portlet via cfml will I still be able to access to the liferay context ??

Yep, everything is exposed through the portlet bridge, if it is not let me know and it can easily be done.

2) What are for you the pro and cons of the approaches

On the pro side all your development is in a familiar technology and you can leverage your entire backend pretty easily (assuming it is CFML based already). Also the cfmlportlets bridge allows for the full lifecycle of a CFML application, including application & session lifecycle. One additional pro is Railo/the bridge handle all the crap of the application not truly running in the HTTPServletRequest paradigm most of us are familiar with so you have less of a learning curve. On the con side, its one more layer of indirection between the portal and your code, so debugging can get hairier (though I have yet to see a situation where this impedes development the possibility is there). 
 
3) Do you have a sample of a cfml portlet ?

Website is back up http://cfmlportlet.cfinnovate.com  Pretty easy, all you do is made a view.cfm and configure and hello world is done. You can of course get much more complicated than that if you choose.
 
4) How do you involke Railo if is not globally available ?

You could still make Railo globally available, I think. The protlet bridge does make use of a selfinstalled customtag which might need to be corrected for Railo (not sure) but everything else should work. Typically I just run my CF engine in the war as part of my portlet deployment. In this case you just configure your portlet as described on the  wiki and it works :)


Adam

Andrea Campolonghi

unread,
Jan 14, 2010, 11:13:48 AM1/14/10
to ra...@googlegroups.com
Adam,

I will have some test and I will let you know.

Andrea

2010/1/14 Adam Haskell <a.ha...@gmail.com>



--
Andrea Campolonghi
and...@getrailo.org
Reply all
Reply to author
Forward
0 new messages