Re: Objects inherited in subrequests

2008-07-14 Thread Christoph Gaffga (triplemind.com)

sorry, was to quick :((

 So I decided to patch the DefaultIncludeCacheManager to work in the same
 way as the IncludeTransformer does, by setting up the child threads with
 the same context/environment:

   // Setup this thread's environment
   RequestContextHolder.setRequestAttributes(
 this.session.getRequestAttributes());
   EnvironmentHelper.enterProcessor(this.session.getProcessor(),
 this.session.getEnvironment());

 I'll test this out, and if it work's I send in the patch.

it does not help. It's the way it's meant to work, but it doesn't.
Somehow the ObjectModels in the parallel running JXTemplateGenerators 
affect each other and we have strange side affects on most of our request.


we are digging around, but no ideas any more how to fix it...

any help would be appreciated.

Christoph



Re: multithreaded Content Aggregator migration from 2.1 to 2.2

2008-07-03 Thread Christoph Gaffga (triplemind.com)

hi,

we found the problem in DefaultIncludeCacheManager and fixed it. I just 
submitted a patch together with some more information on the problem.


see:
https://issues.apache.org/jira/browse/COCOON-2216

thanks for your help.

regards,
Christoph


Joerg Heinicke wrote:
InheritableThreadLocal [1] might be one solution. But being not able to 
clean up a thread is always a problem in web environment. IIRC Spring 
used to use InheritableThreadLocal in RequestContextListener, but they 
changed it to standard ThreadLocal for that reason.


I don't know if CocoonRunnable mentioned by Grek is another point for 
potential changes.


Joerg

[1] 
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/InheritableThreadLocal.html 



On 05.06.2008 09:21, Imran Pariyani wrote:

Hello,

we have come across this issue .. i posted it on user mailing list and 
some one from there suggested me to post it here since it seems to be 
bug in cocoon 2.2 .. its a very crucial issue for us.. we cant upgrade 
to 2.2  unless we  some how solve or find a work around for this issue ..


we have multithreaded Content Aggregator which is based on the 
CIncludeTransformer and it also implements 
CacheableProcessingComponent for caching .. it used to work fine for 
cocoon 2.1.x but with cocoon 2.2 it gives strange error .. it is 
actually a generator and it gives error in the generate method ..


the code where it gives error

// generate...
  for (Part part : this.parts) {
  if (this.manager.hasService(IncludeCacheManager.ROLE)) {
  part.uri = this.cacheManager.load(part.uri, 
this.cachingSession);

  } else {
  this.getLogger().error(
  The ContentAggregator: aggregator cannot 
find the IncludeCacheManager);

  }
  }

  // aggregate...
  StreamPipe streamPipe = new StreamPipe(this.contentHandler);
  for (Part part : this.parts) {
  streamPipe.firstElement(part.element, this.rootElement, 
part.stripRootElement);

  try {
  System.out.println(ParallelContentAgg.part.uri: + 
part.uri);
  this.cacheManager.stream(part.uri, 
this.cachingSession, streamPipe);

  } finally {
  streamPipe.lastElement(part.element);
  }
  }

it gives the following error

Caused by: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 
'scopedTarget.org.apache.cocoon.el.objectmodel.ObjectModel': Scope 
'request' is not active for the current thread; consider defining a 
scoped proxy for this bean if you intend to refer to it from a 
singleton; nested exception is java.lang.IllegalStateException: No 
thread-bound request found: Are you referring to request attributes 
outside of an actual web request? If you are actually operating within 
a web request and still receive this message,your code is probably 
running outside of DispatcherServlet/DispatcherPortlet: In this case, 
use RequestContextListener or RequestContextFilter to expose the 
current request.
  at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:293) 

  at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) 

  at 
org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33) 

  at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184) 


  at $Proxy2.cleanupLocalContext(Unknown Source)
  at 
org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapSource.java:382) 

  at 
org.apache.cocoon.components.source.util.SourceUtil.toSAX(SourceUtil.java:111) 

  at 
org.apache.cocoon.components.source.util.SourceUtil.toSAX(SourceUtil.java:170) 

  at 
org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:63)
  at 
org.apache.cocoon.transformation.helpers.DefaultIncludeCacheManager$LoaderThread.run(DefaultIncludeCacheManager.java:415) 

  at 
org.apache.cocoon.environment.CocoonRunnable.doRun(CocoonRunnable.java:64) 

  at 
org.apache.cocoon.environment.internal.EnvironmentHelper$AbstractCocoonRunnable.run(EnvironmentHelper.java:453) 

  at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown 
Source)

  ... 1 more

Grzegorz Kossakowski wrote:

Imran Pariyani pisze:

Hi


Hi Imran,

last night i wasted 5 hrs overs this without any success .. i guess 
it has something to do with passing the RequestContextListener to 
the spring context .. i have initialized the listener in my web.xml 
and also added the config in applicationcontext.xml .. i checked 
everything on my end .. everything seems to be fine .. is something 
wrong with the cachemanager present in cocoon ?


any help will be greatly appreciated !! ..


Unfortunately, it looks like you stumbled across rather complicated 
(and 

Re: Objects inherited in subrequests

2008-06-12 Thread Christoph Gaffga (triplemind.com)


Grzegorz Kossakowski wrote:
Therefore I would like to propose introduction of a new scope called 
request-inheritable which would allow beans (like ObjectModel) to be 
inherited but by cloning.


What do you think?


hmm, just tried to solve that problem and found that in 
IncludeTransformer it works with threading and parallel processing. Only 
for the DefaultIncludeCacheManager we are using in our replacement for 
the aggregator to do parallel aggregation it is broken since version 2.2.


So I decided to patch the DefaultIncludeCacheManager to work in the same 
way as the IncludeTransformer does, by setting up the child threads with 
the same context/environment:


  // Setup this thread's environment
  RequestContextHolder.setRequestAttributes(
this.session.getRequestAttributes());
  EnvironmentHelper.enterProcessor(this.session.getProcessor(),
this.session.getEnvironment());

I'll test this out, and if it work's I send in the patch.

Christoph



Re: [GT2007] [VOTE] Conference location + time

2007-04-11 Thread Christoph Gaffga (triplemind.com)


 A) The Netherlands, Amsterdam

+1

 B) Italy, Rome / Milano

+2

 C) England, London / Norwich

+0

 When:
 
 A) Late september

+1

 B) Beginning of October (between the holidays season and ApacheCon)

+2

 C) End of October
 

+0


Re: a new cocoon logo?

2005-11-02 Thread Christoph Gaffga (triplemind.com)

 I've always wondered why the logo isn't a cocoon?

that's exactly what I liked about the new logo (Frédéric's). The
arragement of the letters let it look like a cocoon (at least a bit).

Perheps having a combination of the old cocoon 'logo' and a little
cocoon makes it easier to remember (A cocoon with a feather perhaps).
At the moment it's not much a logo, it's just a text.

Christoph



Re: Do we have a powered by Apache Cocoon logo?

2004-12-15 Thread Christoph Gaffga (triplemind.com)
 Do you have it in vector format? I think we need to create a big and a
 small version.
now for every size, I uploaded the logo again as SVG:
http://www.triplemind.com/images/powered-by-cocoon.svg
Christoph
Bertrand Delacretaz wrote:
Le 14 déc. 04, à 20:06, Christoph Gaffga (triplemind.com) a écrit :
looks something like
http://www.triplemind.com/images/powered-by-cocoon160x48.png than.

Thanks, for me this is the closest to our brand image, I like it!
I'd only lower the powered by text so that the bottom of the letters 
intersects with the box, and change the color of the letters to white 
where they intersect.

Do you have it in vector format? I think we need to create a big and a 
small version.

Then, we can maybe vote for an official version of this logo to 
recommend to our users, I suggest yours in two sizes, and Stefano's, so 
that people can choose a dark or light color depending on their site's 
look.

-Bertrand


Re: Do we have a powered by Apache Cocoon logo?

2004-12-14 Thread Christoph Gaffga (triplemind.com)
some time ago I was also looking for that. Zhe only I found was a build 
with logo. It was somewhere under cocoon.apache.org or in the wiki. 
Can't remember, but I have a copy on
http://www.triplemind.com/third-party.html

Christoph
Bertrand Delacretaz schrieb:
...if not, is there a volunteer with good graphic skills and enough 
Copious Free Time to create one?

I'm thinking of something simple based on the logo 
http://cocoon.apache.org/images/cocoon-logo.gif. It might be a good to 
thing to have on the websites of users who agree.

Note that this vector logo is stored in Illustrator format as 
misc/graphics/cocoon2.ai  - I think, because I cannot open it with my 
Illustrator 10, it says incorrect operator: 'd0'.

-Bertrand



Re: Do we have a powered by Apache Cocoon logo?

2004-12-14 Thread Christoph Gaffga (triplemind.com)
looks something like
http://www.triplemind.com/images/powered-by-cocoon160x48.png than.
It's a little dirty I think. Perheaps a border in the same style as the 
cocoon logo would make it better.

Christoph
Bertrand Delacretaz wrote:
Le 14 déc. 04, à 16:43, Christoph Gaffga (triplemind.com) a écrit :
some time ago I was also looking for that. Zhe only I found was a 
build with logo. It was somewhere under cocoon.apache.org or in the 
wiki. Can't remember, but I have a copy on
http://www.triplemind.com/third-party.html

Thanks for the pointer - I like the idea, only it's the old logo color 
(IIUC, I assume http://cocoon.apache.org/images/cocoon-logo.gif is our 
official color now?).

I'll try to talk my daughter into doing a new one, unless someone beats 
us to it. She's usually pretty good at this.

Can someone help with opening the cocoon2.ai file, or another vector 
version of same? As mentioned previously, when I try to open it with my 
Illustrator 10, it says incorrect operator: 'd0'.

-Bertrand



Re: DO NOT REPLY [Bug 32690] - [i18n] extending the I18nTransformer

2004-12-14 Thread Christoph Gaffga (triplemind.com)
thank for the hint, I'll try to implement it that way.
kind regards,
Christoph
[EMAIL PROTECTED] wrote:
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32690.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32690


--- Additional Comments From [EMAIL PROTECTED]  2004-12-14 12:38 ---
Christoph,
Just so that you know where I18nTransformer is (or supposed to be, or can be)
moving...
I18nT should have most of catalogue handling code removed, and should not have
any catalogue configuration information beside simply specifying the ID of
catalogue set it wants to work with:
  catalogue-set name=foo/
Real configuration of the catalogues should happen within i18n bundle component,
probably as:
  i18n-bundles logger=core.i18n-bundles
catalogue-set name=messages
  catalogue id=messages name=messages
 location=context://samples/i18n/translations/
  catalogue id=menu name=menu
 location=context://samples/i18n/translations/
  catalogue id=tiered name=messages
locationcontext://samples/i18n/translations/tiered/location
locationcontext://samples/i18n/translations/location
  /catalogue
/catalogue-set
catalogue-set name=foo
  ...
/catalogue-set
  /i18n-bundles
This way, catalogue handling part and actual catalogue usage are nicely
separated into two independent components (and you can easily overide one of
them without touching another)
Relevant link to archive:
http://marc.theaimsgroup.com/?l=xml-cocoon-devm=107426274218350



Re: [betwixt] Howto serialize the classname when writing XML

2004-09-29 Thread Christoph Gaffga \(triplemind.com\)
sorry
auto-completion :(
wanted [EMAIL PROTECTED] not [EMAIL PROTECTED] :)
/sorry


- Original Message - 
From: Christoph Gaffga (triplemind.com) [EMAIL PROTECTED]
To: Jakarta Commons Developers List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, September 29, 2004 9:27 PM
Subject: Re: [betwixt] Howto serialize the classname when writing XML


  a concrete example would be useful (so i'm sure i understand you
  correctly)...?
  (i'm guessing that you want to map a com.example.SomeException class to
  xml which looks something like:
  exception
  messageMysterious problem/message
  classcom.example.SomeExceptionclass
  /exception)

 exactly that was my intention. So: Between class.../class there ist
only
 a string, the Class is not introspected.
 And I need the class-property only in class derived from Throwable, not
for
 all classes.

 For my usecase it would work if there is a switch, in the
 IntrospectionConfiguration for example, where I can put the output of
 class-property on/off. Then I would turn it on for all and add sumething
 like hide property='class'/ to my dot-betwixt files.

 But it would be nicer and more flexible if everybody could plug in his
 custom strategy. A defaults strategy available: with-all-class-properites
 and without-all-class-properties.

 Another thing is, that I need the cause of the exception, I handled that
 with the patch.

  but it's important that i understand your use case so i make that i
  cover it.

 so, you saw, its realy a simple case, class-properties in all class
 extending Throwable.

  i'm happy to take a look at coding this up but i other pots on the boil
  right now so it might take a few days...

 sure. And thank you a lot for having a look at this. I would code it
myself
 and send a patch, if I could, but I'm not so into the betwixt code. There
is
 a lot of deprecated code, and this not yet finished (?) change of the
mapper
 for simple/complex types.

 regards and thanks

 Christoph


 - Original Message - 
 From: robert burrell donkin [EMAIL PROTECTED]
 Newsgroups: gmane.comp.jakarta.commons.devel
 Sent: Monday, September 27, 2004 11:51 PM
 Subject: Re: [betwixt] Howto serialize the classname when writing XML


  On 26 Sep 2004, at 18:59, Christoph Gaffga wrote:
 
   hi,
  
   I have to output some Exception instances to XML using betwixt, but it
   doesn't seem to be possible to get the class name into the XML result.
 
  yep. it's on the todo...
 
   First of all it should output the name of the class only, and not
   introspect
   the whole Class type. This is done well because the type Class is
   handled as
   a primitive type (see
   TypeBindingStrategy.Default.isStadardPrimitive(Class)).
 
  a concrete example would be useful (so i'm sure i understand you
  correctly)...?
 
  (i'm guessing that you want to map a com.example.SomeException class to
  xml which looks something like:
 
  exception
  messageMysterious problem/message
  classcom.example.SomeExceptionclass
  /exception)
 
   But the output of the class name is deactivated in betwixt for
whatever
   reason and there is no configuration option for turning it on for some
   classes, or plugging some custom rules in for that.
 
  that's true.
 
  this is related to the derived beans stuff i've been looking at
  recently. i should really add support for writing types (so that
  betwixt supports round tripping for simple attribute typed derived
  beans) so i'll probably take a look at coding this up sometime soonish.
  but it's important that i understand your use case so i make that i
  cover it.
 
  snip
 
   I don't want to output the class property for all beans, I just want
   to have it for
   all beans derived from java.lang.Throwable.
 
  so, you'll need a coursely grained pluggable strategy. probably also
  want to be able to  override in a betwixt file but that seem like it's
  a secondary priority.
 
   Does anybody has a hint for me, where to start? I can't get the parent
   bean
   containing the property 'class' in configureProperty(..) method, only
   PropertyDescriptor, that does not has a context.
 
  i'm happy to take a look at coding this up but i other pots on the boil
  right now so it might take a few days...
 
  - robert



Re: [betwixt] Howto serialize the classname when writing XML

2004-09-29 Thread Christoph Gaffga \(triplemind.com\)
 a concrete example would be useful (so i'm sure i understand you
 correctly)...?
 (i'm guessing that you want to map a com.example.SomeException class to
 xml which looks something like:
 exception
 messageMysterious problem/message
 classcom.example.SomeExceptionclass
 /exception)

exactly that was my intention. So: Between class.../class there ist only
a string, the Class is not introspected.
And I need the class-property only in class derived from Throwable, not for
all classes.

For my usecase it would work if there is a switch, in the
IntrospectionConfiguration for example, where I can put the output of
class-property on/off. Then I would turn it on for all and add sumething
like hide property='class'/ to my dot-betwixt files.

But it would be nicer and more flexible if everybody could plug in his
custom strategy. A defaults strategy available: with-all-class-properites
and without-all-class-properties.

Another thing is, that I need the cause of the exception, I handled that
with the patch.

 but it's important that i understand your use case so i make that i
 cover it.

so, you saw, its realy a simple case, class-properties in all class
extending Throwable.

 i'm happy to take a look at coding this up but i other pots on the boil
 right now so it might take a few days...

sure. And thank you a lot for having a look at this. I would code it myself
and send a patch, if I could, but I'm not so into the betwixt code. There is
a lot of deprecated code, and this not yet finished (?) change of the mapper
for simple/complex types.

regards and thanks

Christoph


- Original Message - 
From: robert burrell donkin [EMAIL PROTECTED]
Newsgroups: gmane.comp.jakarta.commons.devel
Sent: Monday, September 27, 2004 11:51 PM
Subject: Re: [betwixt] Howto serialize the classname when writing XML


 On 26 Sep 2004, at 18:59, Christoph Gaffga wrote:

  hi,
 
  I have to output some Exception instances to XML using betwixt, but it
  doesn't seem to be possible to get the class name into the XML result.

 yep. it's on the todo...

  First of all it should output the name of the class only, and not
  introspect
  the whole Class type. This is done well because the type Class is
  handled as
  a primitive type (see
  TypeBindingStrategy.Default.isStadardPrimitive(Class)).

 a concrete example would be useful (so i'm sure i understand you
 correctly)...?

 (i'm guessing that you want to map a com.example.SomeException class to
 xml which looks something like:

 exception
 messageMysterious problem/message
 classcom.example.SomeExceptionclass
 /exception)

  But the output of the class name is deactivated in betwixt for whatever
  reason and there is no configuration option for turning it on for some
  classes, or plugging some custom rules in for that.

 that's true.

 this is related to the derived beans stuff i've been looking at
 recently. i should really add support for writing types (so that
 betwixt supports round tripping for simple attribute typed derived
 beans) so i'll probably take a look at coding this up sometime soonish.
 but it's important that i understand your use case so i make that i
 cover it.

 snip

  I don't want to output the class property for all beans, I just want
  to have it for
  all beans derived from java.lang.Throwable.

 so, you'll need a coursely grained pluggable strategy. probably also
 want to be able to  override in a betwixt file but that seem like it's
 a secondary priority.

  Does anybody has a hint for me, where to start? I can't get the parent
  bean
  containing the property 'class' in configureProperty(..) method, only
  PropertyDescriptor, that does not has a context.

 i'm happy to take a look at coding this up but i other pots on the boil
 right now so it might take a few days...

 - robert