Re: Gump for Cocoon3

2010-06-24 Thread Stefan Bodewig
On 2010-06-24, David Crossley wrote:

> At Apache Gump, Stefan has recently added a Gump build of Cocoon3.

thank you for the pointer, David.

> Could someone here at Cocoon assist with the build errors.

Over the past few months we've found mvn reactor builds to be tricky for
various reasons.  One of them is that we need to build up the combined
dependencies of all components just to build a single one - and another
one are cryptic errors like the one we see right now 8-)

I'll see whether I can find time to split up the reactor into individual
component builds over the next few hours, this may give us something
that is easier to target.

> Not sure if Gump runs more than once per day,

cron would start it every six hours, but it will never start two runs in
parallel and since we are close to twelve hours it is more or less one
maybe two builds a day.

Stefan


Cocoon 3: the three sisters as OSGi bundles?

2010-06-24 Thread Jos Snellings

Dear all,

Some weeks ago, I was coding a servlet in an OSGi context (apache 
felix/sling).
In the process, of course, I wanted to use the triplet cocoon-pipeline, 
cocoon-sax, cocoon-xml, which as a result of the
design goals of Cocoon 3, can be used without further dependencies. A 
wise thing !


Of course, a first rough attempt is to just embed the jars in the 
bundle. This worked.
But now, I would like to take the thing an obvious step further: prepare 
OSGi bundles for the three sisters.


When I checked out the trunk again, I was pleasantly surprised to notice 
that ... cocoon-xml already is!
That means that I am not the only guy in the world thinking this would 
be a good idea.


I prepared bundles for the other two, but ... there is a class loading 
issue with cocoon-sax.

Summarising:
1. in spite of adding the xerces bundle to felix, inside the SAX2 
classes a class.forName("") gives a

ClassNotFoundException.:
  org.apache.cocoon.pipeline.ProcessingException: Cannot create and 
prepare an XMLReader.
at 
org.apache.cocoon.sax.util.XMLUtils.createXMLReader(XMLUtils.java:138)

  and this is because:
Caused by: java.lang.ClassNotFoundException: 
org.apache.xerces.parsers.SAXParser
at 
org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:189)

2.  On the other hand, inside 'my' bundle a code like:

XMLReader reader = new SAXParser();
reader = null;
String className = System.getProperty("org.xml.sax.driver");
try {
reader = 
(XMLReader)(Class.forName(className).newInstance());

}
catch (Exception e) {
System.err.println("No love...");
e.printStackTrace();
}


URL here = new 
URL("http://localhost:8080/some/nice/xml/content";);


URLConnection hc = here.openConnection();
InputStream in = hc.getInputStream();


ContentHandler contentHandler = new MyFavoriteContentHandler();
reader.setContentHandler(contentHandler);

InputSource input = new InputSource(in);
try {
reader.parse(input);
}
catch (Exception e) {
System.err.println("Can't parse your file");
e.printStackTrace();
}

works.

So, clearly there is a classloader confusion.
But the question is: is this the right way to go inside OSGi? Probably 
it would be better to ask the framework what parser

services it has available for us, and then use XMLParserActivator?
We could think about adding such a method to XMLUtils.

Of course I can take the embedded solution, but this is really a 
third-class solution. I really think there is an interest

to transform cocoon-sax into a genuine OSGi bundle.
I do not expect problems with cocoon-pipeline, being nicely insulated 
from the JAXP-loading issues.

Is there any interest in this group to dig into the matter?

Please let me know. If we can set up a discussion on this matter I am 
willing to address the issues in my own time.


Cheers,
Jos


Re: Gump for Cocoon3

2010-06-24 Thread Stefan Bodewig
On 2010-06-24, Stefan Bodewig wrote:

> I'll see whether I can find time to split up the reactor into individual
> component builds over the next few hours, this may give us something
> that is easier to target.

This is ready now[1].  The Gump run that started on vmgump a few hours
ago won't see it but the next one starting at
 will.

I've created individual mvn builds for all modules that cocoon-all
depends on and also kept the reactor build as a separate Gump project.

It usually takes a few Gump runs until all dependencies have been sorted
out - and typos been fixed - but hopefully we'll see parts of Coccon
building again soon.

Once this is through it would be nice if we could make the 2.2 and 2.1
branches build as well in order to help Cocoon's downstream users.  But
let's do that one can of worms at a time ...

Stefan

[1] http://svn.apache.org/repos/asf/gump/metadata/project/cocoon3.xml


Re: Gump for Cocoon3

2010-06-24 Thread Stefan Bodewig
[resending, original is likely stuck in the moderation queue]

On 2010-06-24, David Crossley wrote:

> At Apache Gump, Stefan has recently added a Gump build of Cocoon3.

thank you for the pointer, David.

> Could someone here at Cocoon assist with the build errors.

Over the past few months we've found mvn reactor builds to be tricky for
various reasons.  One of them is that we need to build up the combined
dependencies of all components just to build a single one - and another
one are cryptic errors like the one we see right now 8-)

I'll see whether I can find time to split up the reactor into individual
component builds over the next few hours, this may give us something
that is easier to target.

> Not sure if Gump runs more than once per day,

cron would start it every six hours, but it will never start two runs in
parallel and since we are close to twelve hours it is more or less one
maybe two builds a day.

Stefan


Re: Gump for Cocoon3

2010-06-24 Thread Simone Tripodi
Hi all,
it seems something wrong happens when pre-compiling XSLTs, as Reinhard
supposed. I'll try to add the BCEL dependency to fix that, btw I don't
understand why it happens... I'll let you know as soon as possible.
Thanks!!!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Jun 24, 2010 at 10:42 AM, Reinhard Pötz  wrote:
> David Crossley wrote:
>> At Apache Gump, Stefan has recently added a Gump build of Cocoon3.
>>
>> See http://thread.gmane.org/gmane.comp.jakarta.gump/14458/focus=14475
>>
>> Here is the first output:
>> http://vmgump.apache.org/gump/public/cocoon3/
>>
>> If not familiar with Gump, then follow:
>> All Projects : cocoon3
>> then
>> Project-level Work : build_cocoon3_cocoon3
>> then
>> Output : Complete Output File
>>
>> Could someone here at Cocoon assist with the build errors.
>>
>> Not sure if Gump runs more than once per day,
>> but that last run finished at 19:20 US PDT.
>>
>> When it settles, we could enable Gump to "nag" us.
>
> I guess it is somehow related with the XSLTC precompilation tests.
> Simone, any idea?
>
> --
> Reinhard Pötz                        Founder & Managing Director, Indoqa
>                        http://www.indoqa.com/people/reinhard-poetz.html
>
> Member of the Apache Software Foundation
> Apache Cocoon Committer, PMC member                  reinh...@apache.org
> 
>


Help needed on finalizing the JAXB optional support

2010-06-24 Thread Simone Tripodi
Hi all,
a month ago I started developing the JAXB optional support for C3
pipeline, with a lot of limits:

* each time a new object has to be mashalled, the JAXBContext were
created, now it uses a memory-based LRU cache;
* it supported just POJOs graphs, without any support for collections and array.

I was able to plug the array support (see cocoon-optional r936231) but
after several tries I had to resign to discover collections generic
type at runtime; I also checked-out the Jersey source code to see how
do they extract this information, but I got lost :(
So, my first question is: can anyone help me please? :P

Moreover, for Collection/Array object, there is the need that the root
element name of the marshalled document is the plural of the list; I
found two existing implementations for this purpose:

* the Apache Betwixt "PluralStemmer" [1]
* the Jersey "Inflector" [2]

I personally find the Jersey implementation much more complete but it
is not licensed under the Apache license. So my question is: can I
extract part of that class to include in our software? Is that
allowed?

Many thanks in advance, have a nice day
Simo

[1] http://tinyurl.com/376ehs9
[2] http://tinyurl.com/3yqbssj

http://people.apache.org/~simonetripodi/
http://www.99soft.org/


Re: Gump for Cocoon3

2010-06-24 Thread Reinhard Pötz
David Crossley wrote:
> At Apache Gump, Stefan has recently added a Gump build of Cocoon3.
> 
> See http://thread.gmane.org/gmane.comp.jakarta.gump/14458/focus=14475
> 
> Here is the first output:
> http://vmgump.apache.org/gump/public/cocoon3/
> 
> If not familiar with Gump, then follow:
> All Projects : cocoon3
> then
> Project-level Work : build_cocoon3_cocoon3
> then
> Output : Complete Output File
> 
> Could someone here at Cocoon assist with the build errors.
> 
> Not sure if Gump runs more than once per day,
> but that last run finished at 19:20 US PDT.
> 
> When it settles, we could enable Gump to "nag" us.

I guess it is somehow related with the XSLTC precompilation tests.
Simone, any idea?

-- 
Reinhard PötzFounder & Managing Director, Indoqa
http://www.indoqa.com/people/reinhard-poetz.html

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member  reinh...@apache.org



Gump for Cocoon3

2010-06-24 Thread David Crossley
At Apache Gump, Stefan has recently added a Gump build of Cocoon3.

See http://thread.gmane.org/gmane.comp.jakarta.gump/14458/focus=14475

Here is the first output:
http://vmgump.apache.org/gump/public/cocoon3/

If not familiar with Gump, then follow:
All Projects : cocoon3
then
Project-level Work : build_cocoon3_cocoon3
then
Output : Complete Output File

Could someone here at Cocoon assist with the build errors.

Not sure if Gump runs more than once per day,
but that last run finished at 19:20 US PDT.

When it settles, we could enable Gump to "nag" us.

-David