You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Irv Salisbury <ir...@gmail.com> on 2005/06/21 22:14:54 UTC

Cocoon 2.1.7 in Weblogic 8.1.4

We already asked this on the users list, but we are having the worst
time getting Cocoon 2.1.7 running in Weblogic 8.1.4.  We have only
tried on Windows XP at this point.

We are getting ClassCastExceptions in xalan at the moment.  We have
tried various combinations of the ParanoidClassLoader,
init-classloader param, moving around xalan and xerces jar files to
endorsed, etc.  We have also set the Weblogic parameter
prefer-web-inf-classes to true.

So, has anyone successfully run Cocoon 2.1.7 in Weblogic 8.1.4?

If so, any pointers or help would be greatly appreciated.

Irv

Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Ralph Goers <Ra...@dslextreme.com>.
You can try adding Cocoon's version of Rhino to the classpath before 
weblogic.jar.  However, this may very well cause weblogic itself to have 
errors, depending on what you are doing. I only experienced problems 
when I was trying to use weblogic portal (8.1.2).

As Tony suggested, you will probably need to use Javaflow instead.

Ralph

Irv Salisbury wrote:

>Just some more notes on this.  It all seems to be happening at the
>rhino level.  The standard off the shelf cocoon works fine until we do
>anything in flowscript (with our without forms)  We get two main
>errors:
>
>1. java.lang.ClassCastException: inv1
>2. function FOM_WebContinuation() {
>	[native code]
>}
> is not a function.
>
>This has become increasingly frustrating.
>
>Thanks,
>
>Irv
>
>On 6/21/05, Irv Salisbury <ir...@gmail.com> wrote:
>  
>
>>We already asked this on the users list, but we are having the worst
>>time getting Cocoon 2.1.7 running in Weblogic 8.1.4.  We have only
>>tried on Windows XP at this point.
>>
>>We are getting ClassCastExceptions in xalan at the moment.  We have
>>tried various combinations of the ParanoidClassLoader,
>>init-classloader param, moving around xalan and xerces jar files to
>>endorsed, etc.  We have also set the Weblogic parameter
>>prefer-web-inf-classes to true.
>>
>>So, has anyone successfully run Cocoon 2.1.7 in Weblogic 8.1.4?
>>
>>If so, any pointers or help would be greatly appreciated.
>>
>>Irv
>>
>>    
>>


Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Jason Johnston <ja...@Intrado.com>.
On Tue, 2005-06-21 at 17:48 -0400, Irv Salisbury wrote:
> On 6/21/05, Tony Collen <co...@umn.edu> wrote:
> > Irv Salisbury wrote:
> > > Just some more notes on this.  It all seems to be happening at the
> > > rhino level.  The standard off the shelf cocoon works fine until we do
> > > anything in flowscript (with our without forms)  We get two main
> > > errors:
> > >
> > > 1. java.lang.ClassCastException: inv1
> > > 2. function FOM_WebContinuation() {
> > >       [native code]
> > > }
> > >  is not a function.
> > >
> > > This has become increasingly frustrating.
> > 
> > Yep, Weblogic ships with it's own version of Rhino.  The solution is to
> > use JavaFlow, I believe.
> > 
> > 
> > Tony
> > 
> > 
> 
> Ok, that would be a great solution, but we already have a bunch of
> javascript based flow.  Is there any way to override rhino from
> weblogic?
> 
> Irv

It's horribly (HORRIBLY!) ugly, but our way around this was to pull down
both the Rhino and Cocoon sources, and run a shell script (see below) on
all the source files to change the Rhino package name from org.mozilla.*
to org.nozilla.* before building.  This prevents the collision with
Weblogic's version of Rhino.

Maybe a little less painful than converting to Javaflow?

I'd definitely be interested in any other solutions people have found.
This still makes me cringe.
--Jason

#!/bin/sh

for lsFile in `find . -type f -exec grep -q org.mozilla {} \; -print` ; do
    echo "Editing "$lsFile
    mv $lsFile $lsFile.moz-old
    sed -r 's/org(.)mozilla/org\1nozilla/g' $lsFile.moz-old > $lsFile
    diff $lsFile.moz-old $lsFile
done

for lsDir in `find . -type d -name mozilla` ; do
    echo "Renaming "$lsDir" "`dirname $lsDir`/nozilla
    mv $lsDir `dirname $lsDir`/nozilla
done



Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Ralph Goers <Ra...@dslextreme.com>.
One other thing.  The version of Rhino in 2.1.x almost certainly won't 
work with weblogic.  However, I believe the Rhino version in 2.2 might 
work better since it comes straight from mozilla.  Give that a try (you 
still need to override weblogics Rhino).  Let us know how it goes.

Ralph

Irv Salisbury wrote:

>
>Ok, that would be a great solution, but we already have a bunch of
>javascript based flow.  Is there any way to override rhino from
>weblogic?
>
>Irv
>  
>


Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Irv Salisbury <ir...@gmail.com>.
On 6/21/05, Tony Collen <co...@umn.edu> wrote:
> Irv Salisbury wrote:
> > Just some more notes on this.  It all seems to be happening at the
> > rhino level.  The standard off the shelf cocoon works fine until we do
> > anything in flowscript (with our without forms)  We get two main
> > errors:
> >
> > 1. java.lang.ClassCastException: inv1
> > 2. function FOM_WebContinuation() {
> >       [native code]
> > }
> >  is not a function.
> >
> > This has become increasingly frustrating.
> 
> Yep, Weblogic ships with it's own version of Rhino.  The solution is to
> use JavaFlow, I believe.
> 
> 
> Tony
> 
> 

Ok, that would be a great solution, but we already have a bunch of
javascript based flow.  Is there any way to override rhino from
weblogic?

Irv

Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Ralph Goers <Ra...@dslextreme.com>.
Torsten Curdt wrote:

>Sorry, nothing but the javadocs and samples in 2.1.
>It's not considered stable yet. Although changes
>will probably not affect the users point of view
>...more under the hood.
>
>The javaflow API is meant to mime the javascript
>flow API as close as possible.
>
>Seems like some people are already using it in
>production.
>
>  
>
And now you know why (among other reasons).

Ralph


Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Irv Salisbury <ir...@gmail.com>.
On 6/23/05, Antonio Gallardo <ag...@agssa.net> wrote:
> >> Ok, so this is really turning out to be a pain.
> >>
> >> For Jason, do you still have the nozilla built rhino jars?  If not,
> >> where did you get the rhino source from that works with cocoon 2.1.7.
> >> It didn't jump out at us as to which version exactly was done with
> >> 2.1.7.
> 
> Dunno if this was already answered. Anyway, ...
> 
> The rhino inside cocoon is a temporaly fork. It was forked to support
> continuations. Initially, it was done as a proof of concept and later
> adopted in cocoon trunk. The sources are in cocoondev.org:
> 
> http://cocoondev.org/main/117/31.html
> 
> This temporaly fork was one long time ago sometime between 2002 and 2003.
> Sorry, I don't remember exactly the date nor month. :-(
> 
> In 2004, thanks to the talks between both communities (Cocoon and Rhino),
> the Mozilla Rhino project added continuations functionality to the Rhino
> trunk. The continuations support in Mozilla Rhino was officially released
> in version 1.6R1 (Nov, 29th 2004). At that time, the cocoon community had
> some 2.1 versions on the street using the temporaly forked version.
> 
> The Mozilla continuation implementation was mainly based on the code of
> the temporaly fork, but not exactly with the same behavior. There are
> small differences. Note that, it is almost the same with just some
> features are differents. Some tests, showed that most Flowscript code can
> run without modifications any of the jars.... I think Reinhard can explain
> a lot better this. Note, this another long history. You can search the
> devel maillist archives for more info. Sorry, I have no time now to search
> for it right now. ;-)
> 
> Well, given the small diferences in continuations implementation between
> the temporaly forked and the main rhino jar, we (cocoon developers)
> decided to stick with the temporaly forked Rhino version in cocoon 2.1.x
> branch. We also decided to start using the Mozilla Rhino jar with
> continuations support in the main trunk (where we develop cocooon 2.2).
> 
> Also, is important to know, that is posible to use Mozilla Rhino 1.6R1 in
> cocoon 2.1.x. AFAIK, it is only a configuration matter.
> 
> I hope this explain some of the "why and where" related to the temporaly
> forked rhino. ;-)
> 
> Best Regards,
> 
> Antonio Gallardo.
> 

Thank you.  That is very helpful.  This will at least get us started.

Irv

Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Antonio Gallardo <ag...@agssa.net>.
>> Ok, so this is really turning out to be a pain.
>>
>> For Jason, do you still have the nozilla built rhino jars?  If not,
>> where did you get the rhino source from that works with cocoon 2.1.7.
>> It didn't jump out at us as to which version exactly was done with
>> 2.1.7.

Dunno if this was already answered. Anyway, ...

The rhino inside cocoon is a temporaly fork. It was forked to support
continuations. Initially, it was done as a proof of concept and later
adopted in cocoon trunk. The sources are in cocoondev.org:

http://cocoondev.org/main/117/31.html

This temporaly fork was one long time ago sometime between 2002 and 2003.
Sorry, I don't remember exactly the date nor month. :-(

In 2004, thanks to the talks between both communities (Cocoon and Rhino),
the Mozilla Rhino project added continuations functionality to the Rhino
trunk. The continuations support in Mozilla Rhino was officially released
in version 1.6R1 (Nov, 29th 2004). At that time, the cocoon community had
some 2.1 versions on the street using the temporaly forked version.

The Mozilla continuation implementation was mainly based on the code of
the temporaly fork, but not exactly with the same behavior. There are
small differences. Note that, it is almost the same with just some
features are differents. Some tests, showed that most Flowscript code can
run without modifications any of the jars.... I think Reinhard can explain
a lot better this. Note, this another long history. You can search the
devel maillist archives for more info. Sorry, I have no time now to search
for it right now. ;-)

Well, given the small diferences in continuations implementation between
the temporaly forked and the main rhino jar, we (cocoon developers)
decided to stick with the temporaly forked Rhino version in cocoon 2.1.x
branch. We also decided to start using the Mozilla Rhino jar with
continuations support in the main trunk (where we develop cocooon 2.2).

Also, is important to know, that is posible to use Mozilla Rhino 1.6R1 in
cocoon 2.1.x. AFAIK, it is only a configuration matter.

I hope this explain some of the "why and where" related to the temporaly
forked rhino. ;-)

Best Regards,

Antonio Gallardo.

Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Torsten Curdt <tc...@apache.org>.
> Ok, so this is really turning out to be a pain.
> 
> For Jason, do you still have the nozilla built rhino jars?  If not,
> where did you get the rhino source from that works with cocoon 2.1.7. 
> It didn't jump out at us as to which version exactly was done with
> 2.1.7.
> 
> Also, is there any documentation on using JavaFlow and/or switching
> from flowscript to JavaFlow?

Sorry, nothing but the javadocs and samples in 2.1.
It's not considered stable yet. Although changes
will probably not affect the users point of view
...more under the hood.

The javaflow API is meant to mime the javascript
flow API as close as possible.

Seems like some people are already using it in
production.

HTH

cheers
--
Torsten

Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Irv Salisbury <ir...@gmail.com>.
On 6/21/05, Irv Salisbury <ir...@gmail.com> wrote:
> Wow, this all sounds like lots of fun.  We already tried to put
> cocoon's rhino in the classpath first.  I am writing a simple
> transformer to call the ProtectionDomain stuff to verify where the URL
> of the jar file it is loading the class from.  (Unless someone has
> already done that)  Even though our Rhino jar file is in front of
> weblogic's it still gets the casting errors.  I will try the 2.2
> version as well to see if that makes a difference.  After that, we'll
> have to try the "nozilla" approach (yuck!)
> 
> Hopefully we don't hit a ton of other issues.  We don't have a few
> months to get this running :-)
> 
> Was there something we need to do with the Paranoid classloader to
> work in the exploded war directory, or is that already in 2.1.7?
> (Would hate to have to duplicate that effort)
> 
> Thanks for all the help guys!
> 
> Irv
> 
> On 6/21/05, Gregor J. Rothfuss <gr...@apache.org> wrote:
> > Tony Collen wrote:
> >
> > > Yep, Weblogic ships with it's own version of Rhino.  The solution is to
> > > use JavaFlow, I believe.
> >
> > we ended up doing this for WL. i took us about 2 months to get WL
> > working properly, with detours into patching the paranoid classloader to
> > work in an unexploded war [1], various javaflow problems [2], etc [3].
> >
> > writing / converting to javaflow was the least of our worries. when we
> > were done, we decided to have even more fun by playing with shared/lib
> > (we had libraries that needed to be shared across webapps, but not endorsed)
> >
> > in summary, i hope you have a good reason / get paid well to deal with
> > this POS.
> >
> > -gregor
> >
> > [1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110624700718014&w=2
> > [2] http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=110686299727034&w=2
> > [3] http://marc.theaimsgroup.com/?l=xml-cocoon-users&w=2&r=1&s=Weblogic&q=b
> >
> >
> 

Ok, so this is really turning out to be a pain.

For Jason, do you still have the nozilla built rhino jars?  If not,
where did you get the rhino source from that works with cocoon 2.1.7. 
It didn't jump out at us as to which version exactly was done with
2.1.7.

Also, is there any documentation on using JavaFlow and/or switching
from flowscript to JavaFlow?

Thanks

Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Irv Salisbury <ir...@gmail.com>.
Wow, this all sounds like lots of fun.  We already tried to put
cocoon's rhino in the classpath first.  I am writing a simple
transformer to call the ProtectionDomain stuff to verify where the URL
of the jar file it is loading the class from.  (Unless someone has
already done that)  Even though our Rhino jar file is in front of
weblogic's it still gets the casting errors.  I will try the 2.2
version as well to see if that makes a difference.  After that, we'll
have to try the "nozilla" approach (yuck!)

Hopefully we don't hit a ton of other issues.  We don't have a few
months to get this running :-)

Was there something we need to do with the Paranoid classloader to
work in the exploded war directory, or is that already in 2.1.7? 
(Would hate to have to duplicate that effort)

Thanks for all the help guys!

Irv

On 6/21/05, Gregor J. Rothfuss <gr...@apache.org> wrote:
> Tony Collen wrote:
> 
> > Yep, Weblogic ships with it's own version of Rhino.  The solution is to
> > use JavaFlow, I believe.
> 
> we ended up doing this for WL. i took us about 2 months to get WL
> working properly, with detours into patching the paranoid classloader to
> work in an unexploded war [1], various javaflow problems [2], etc [3].
> 
> writing / converting to javaflow was the least of our worries. when we
> were done, we decided to have even more fun by playing with shared/lib
> (we had libraries that needed to be shared across webapps, but not endorsed)
> 
> in summary, i hope you have a good reason / get paid well to deal with
> this POS.
> 
> -gregor
> 
> [1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110624700718014&w=2
> [2] http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=110686299727034&w=2
> [3] http://marc.theaimsgroup.com/?l=xml-cocoon-users&w=2&r=1&s=Weblogic&q=b
> 
>

Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Tony Collen wrote:

> Yep, Weblogic ships with it's own version of Rhino.  The solution is to 
> use JavaFlow, I believe.

we ended up doing this for WL. i took us about 2 months to get WL 
working properly, with detours into patching the paranoid classloader to 
work in an unexploded war [1], various javaflow problems [2], etc [3].

writing / converting to javaflow was the least of our worries. when we 
were done, we decided to have even more fun by playing with shared/lib 
(we had libraries that needed to be shared across webapps, but not endorsed)

in summary, i hope you have a good reason / get paid well to deal with 
this POS.

-gregor

[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110624700718014&w=2
[2] http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=110686299727034&w=2
[3] http://marc.theaimsgroup.com/?l=xml-cocoon-users&w=2&r=1&s=Weblogic&q=b


Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Tony Collen <co...@umn.edu>.
Irv Salisbury wrote:
> Just some more notes on this.  It all seems to be happening at the
> rhino level.  The standard off the shelf cocoon works fine until we do
> anything in flowscript (with our without forms)  We get two main
> errors:
> 
> 1. java.lang.ClassCastException: inv1
> 2. function FOM_WebContinuation() {
> 	[native code]
> }
>  is not a function.
> 
> This has become increasingly frustrating.

Yep, Weblogic ships with it's own version of Rhino.  The solution is to 
use JavaFlow, I believe.


Tony


Re: Cocoon 2.1.7 in Weblogic 8.1.4

Posted by Irv Salisbury <ir...@gmail.com>.
Just some more notes on this.  It all seems to be happening at the
rhino level.  The standard off the shelf cocoon works fine until we do
anything in flowscript (with our without forms)  We get two main
errors:

1. java.lang.ClassCastException: inv1
2. function FOM_WebContinuation() {
	[native code]
}
 is not a function.

This has become increasingly frustrating.

Thanks,

Irv

On 6/21/05, Irv Salisbury <ir...@gmail.com> wrote:
> We already asked this on the users list, but we are having the worst
> time getting Cocoon 2.1.7 running in Weblogic 8.1.4.  We have only
> tried on Windows XP at this point.
> 
> We are getting ClassCastExceptions in xalan at the moment.  We have
> tried various combinations of the ParanoidClassLoader,
> init-classloader param, moving around xalan and xerces jar files to
> endorsed, etc.  We have also set the Weblogic parameter
> prefer-web-inf-classes to true.
> 
> So, has anyone successfully run Cocoon 2.1.7 in Weblogic 8.1.4?
> 
> If so, any pointers or help would be greatly appreciated.
> 
> Irv
>