You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Rodrigo Madera <ro...@gmail.com> on 2008/03/04 01:27:48 UTC

maven-scr-plugin and QDox (or JAXB)

Hello community,

I found a serious incompatibility between maven-scr-plugin (used to generate
service descriptors for Declarative Services) and QDox, which is used for
JAXB (Java XML Bindings).
Thus, I am stuck using OSGi and JAXB together.

The issue is that QDox has trouble reading the "package-info.java" files
generated by the JAXB Schema-to-POJO compiler (xjc).
QDox doesn't like the annotations on the package directive, as in:


@javax.xml.bind.annotation.XmlSchema(namespace = "
http://schemas.acme.com/product/coyote/1.0")
package com.acme.coyote;


This problem is known on QDox's JIRA:
http://jira.codehaus.org/browse/QDOX-98
However it seems to be *very* dusty for some time now. Unfortunately, nobody
is really concerned with it.

I'm working on this issue and I'll post a follow-up if I get anything
working.

If anyone has experience using OSGi + JAXB please give us some thoughts on
how this QDox issue was avoided or solved.

Thank you for your attention,
Rodrigo Madera

Re: maven-scr-plugin and QDox (or JAXB)

Posted by Rodrigo Madera <ro...@gmail.com>.
Hey Carsten,

Nice work, I'll be testing it this evening.

Did you make it in 30 mins as I guessed? =o)

Regards,
Rodrigo

On Sat, Mar 8, 2008 at 5:52 PM, Carsten Ziegeler <cz...@apache.org>
wrote:

> The first patch was totally wrong, I applied a new patch that supports
> pattern matching and requires excludes to be defined relative to the
> source directory.
> In your case, relative to target/generated-sources!
> Patterns now work, like
>
> <configuration>
>   <excludes>org/apache/felix/generated/**</excludes>
> </configuration>
>
> Can you please test this?
>
> Thanks
> Carsten
>
> Carsten Ziegeler wrote:
> > I just committed an initial version which uses
> <configuration><excludes>...
> >
> > (See https://issues.apache.org/jira/browse/FELIX-509 for more info)
> >
> > Could you please test this if it works for you?
> >
> > Thanks
> > Carsten
> >
> > Carsten Ziegeler wrote:
> >> Rodrigo Madera wrote:
> >>> Created JIRA issue: https://issues.apache.org/jira/browse/FELIX-509
> >>>
> >> Thanks
> >>
> >>> I provided all the information necessary to make the fix quick and
> >>> easy. I
> >>> would have done it myself but I don't have MOJO experience to read
> >>> plugin
> >>> configuration data (must be dead simple, indeed).
> >>>
> >>> Anyways, I really believe that 30 minutes is more than enough for this
> >>> simple (but useful) change.
> >>>
> >> Hehe, thanks for the motivation :) I'll try to beat this time!
> >>
> >> Carsten
> >>
> >
> >
>
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: maven-scr-plugin and QDox (or JAXB)

Posted by Carsten Ziegeler <cz...@apache.org>.
The first patch was totally wrong, I applied a new patch that supports 
pattern matching and requires excludes to be defined relative to the 
source directory.
In your case, relative to target/generated-sources!
Patterns now work, like

<configuration>
   <excludes>org/apache/felix/generated/**</excludes>
</configuration>

Can you please test this?

Thanks
Carsten

Carsten Ziegeler wrote:
> I just committed an initial version which uses <configuration><excludes>...
> 
> (See https://issues.apache.org/jira/browse/FELIX-509 for more info)
> 
> Could you please test this if it works for you?
> 
> Thanks
> Carsten
> 
> Carsten Ziegeler wrote:
>> Rodrigo Madera wrote:
>>> Created JIRA issue: https://issues.apache.org/jira/browse/FELIX-509
>>>
>> Thanks
>>
>>> I provided all the information necessary to make the fix quick and 
>>> easy. I
>>> would have done it myself but I don't have MOJO experience to read 
>>> plugin
>>> configuration data (must be dead simple, indeed).
>>>
>>> Anyways, I really believe that 30 minutes is more than enough for this
>>> simple (but useful) change.
>>>
>> Hehe, thanks for the motivation :) I'll try to beat this time!
>>
>> Carsten
>>
> 
> 


-- 
Carsten Ziegeler
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: maven-scr-plugin and QDox (or JAXB)

Posted by Carsten Ziegeler <cz...@apache.org>.
I just committed an initial version which uses <configuration><excludes>...

(See https://issues.apache.org/jira/browse/FELIX-509 for more info)

Could you please test this if it works for you?

Thanks
Carsten

Carsten Ziegeler wrote:
> Rodrigo Madera wrote:
>> Created JIRA issue: https://issues.apache.org/jira/browse/FELIX-509
>>
> Thanks
> 
>> I provided all the information necessary to make the fix quick and 
>> easy. I
>> would have done it myself but I don't have MOJO experience to read plugin
>> configuration data (must be dead simple, indeed).
>>
>> Anyways, I really believe that 30 minutes is more than enough for this
>> simple (but useful) change.
>>
> Hehe, thanks for the motivation :) I'll try to beat this time!
> 
> Carsten
> 


-- 
Carsten Ziegeler
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: maven-scr-plugin and QDox (or JAXB)

Posted by Carsten Ziegeler <cz...@apache.org>.
Rodrigo Madera wrote:
> Created JIRA issue: https://issues.apache.org/jira/browse/FELIX-509
> 
Thanks

> I provided all the information necessary to make the fix quick and easy. I
> would have done it myself but I don't have MOJO experience to read plugin
> configuration data (must be dead simple, indeed).
> 
> Anyways, I really believe that 30 minutes is more than enough for this
> simple (but useful) change.
> 
Hehe, thanks for the motivation :) I'll try to beat this time!

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: maven-scr-plugin and QDox (or JAXB)

Posted by Rodrigo Madera <ro...@gmail.com>.
Created JIRA issue: https://issues.apache.org/jira/browse/FELIX-509

I provided all the information necessary to make the fix quick and easy. I
would have done it myself but I don't have MOJO experience to read plugin
configuration data (must be dead simple, indeed).

Anyways, I really believe that 30 minutes is more than enough for this
simple (but useful) change.

Kind regards,
Rodrigo Madera

On Tue, Mar 4, 2008 at 4:58 PM, Carsten Ziegeler <cz...@apache.org>
wrote:

> Rodrigo Madera wrote:
> > Hello Ziegeler,
> >
> > I believe that having explicit include/exclude tags in the SCR plugin's
> > configuration would be fantastic. Not only due to QDox's shortcomings,
> but
> > in the future we might need it for something totally different.
> >
> > How about appending it at the bottom of the TODO list? =o)
> >
> Hehe, good idea :)
>
> Could you please open an issue in Jira for this (so I wont forget it...)?
> I'll try to fix it for the next release of the scr plugin which should
> be out sometime this month.
>
> Thanks
> Carsten
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: maven-scr-plugin and QDox (or JAXB)

Posted by Carsten Ziegeler <cz...@apache.org>.
Rodrigo Madera wrote:
> Hello Ziegeler,
> 
> I believe that having explicit include/exclude tags in the SCR plugin's
> configuration would be fantastic. Not only due to QDox's shortcomings, but
> in the future we might need it for something totally different.
> 
> How about appending it at the bottom of the TODO list? =o)
> 
Hehe, good idea :)

Could you please open an issue in Jira for this (so I wont forget it...)?
I'll try to fix it for the next release of the scr plugin which should 
be out sometime this month.

Thanks
Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: maven-scr-plugin and QDox (or JAXB)

Posted by Rodrigo Madera <ro...@gmail.com>.
Hello Ziegeler,

I believe that having explicit include/exclude tags in the SCR plugin's
configuration would be fantastic. Not only due to QDox's shortcomings, but
in the future we might need it for something totally different.

How about appending it at the bottom of the TODO list? =o)

Yours,
Rodrigo Madera

On Tue, Mar 4, 2008 at 10:42 AM, Carsten Ziegeler <cz...@apache.org>
wrote:

> Hi,
>
> thanks for the analysis. Yes, qdox is really very buggy and has several
> problems; and there seems to be little interest to fix these in new
> releases :( I'm still searching for an alternative to qdox.
>
> We could - as a workaround - think about providing configuration for
> includes/excludes for the scr plugin; but the better solution would be
> to have a working parser :)
>
> Carsten
>
> Rodrigo Madera write:
> > After further analysis I have concluded that the best way to solve the
> > problem right now is to modify the Apache Felix SCR Maven Plugin.
> >
> > On JavaClassDescriptorManager's constructor I will put a check before
> adding
> > a source tree for QDox's processing, so that the xjc generated directory
> > will be ignored.
> >
> > This is a simple hack that solves the QDox problem, but it's much
> simpler
> > than messing with byacc rules for this.
> >
> > Hope this helps somebody with the same problem I had when using OSGi +
> JAXB
> > (or any other tool based on buggy QDox).
> >
> > Regards,
> > Rodrigo Madera
> >
> > P.S. Keywords: maven osgi jaxb xjc xml serialization deserialization
> > marshalling unmarshalling qdox ParseException syntax error yyerror
> yyparse
> >
> > On Tue, Mar 4, 2008 at 12:27 AM, Rodrigo Madera <
> rodrigo.madera@gmail.com>
> > wrote:
> >
> >> Hello community,
> >>
> >> I found a serious incompatibility between maven-scr-plugin (used to
> >> generate service descriptors for Declarative Services) and QDox, which
> is
> >> used for JAXB (Java XML Bindings).
> >> Thus, I am stuck using OSGi and JAXB together.
> >>
> >> The issue is that QDox has trouble reading the "package-info.java"
> files
> >> generated by the JAXB Schema-to-POJO compiler (xjc).
> >> QDox doesn't like the annotations on the package directive, as in:
> >>
> >>
> >> @javax.xml.bind.annotation.XmlSchema(namespace = "
> >> http://schemas.acme.com/product/coyote/1.0")
> >> package com.acme.coyote;
> >>
> >>
> >> This problem is known on QDox's JIRA:
> >> http://jira.codehaus.org/browse/QDOX-98
> >> However it seems to be *very* dusty for some time now. Unfortunately,
> >> nobody is really concerned with it.
> >>
> >> I'm working on this issue and I'll post a follow-up if I get anything
> >> working.
> >>
> >> If anyone has experience using OSGi + JAXB please give us some thoughts
> on
> >> how this QDox issue was avoided or solved.
> >>
> >> Thank you for your attention,
> >> Rodrigo Madera
> >>
> >
>
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: maven-scr-plugin and QDox (or JAXB)

Posted by Carsten Ziegeler <cz...@apache.org>.
Hi,

thanks for the analysis. Yes, qdox is really very buggy and has several 
problems; and there seems to be little interest to fix these in new 
releases :( I'm still searching for an alternative to qdox.

We could - as a workaround - think about providing configuration for 
includes/excludes for the scr plugin; but the better solution would be 
to have a working parser :)

Carsten

Rodrigo Madera write:
> After further analysis I have concluded that the best way to solve the
> problem right now is to modify the Apache Felix SCR Maven Plugin.
> 
> On JavaClassDescriptorManager's constructor I will put a check before adding
> a source tree for QDox's processing, so that the xjc generated directory
> will be ignored.
> 
> This is a simple hack that solves the QDox problem, but it's much simpler
> than messing with byacc rules for this.
> 
> Hope this helps somebody with the same problem I had when using OSGi + JAXB
> (or any other tool based on buggy QDox).
> 
> Regards,
> Rodrigo Madera
> 
> P.S. Keywords: maven osgi jaxb xjc xml serialization deserialization
> marshalling unmarshalling qdox ParseException syntax error yyerror yyparse
> 
> On Tue, Mar 4, 2008 at 12:27 AM, Rodrigo Madera <ro...@gmail.com>
> wrote:
> 
>> Hello community,
>>
>> I found a serious incompatibility between maven-scr-plugin (used to
>> generate service descriptors for Declarative Services) and QDox, which is
>> used for JAXB (Java XML Bindings).
>> Thus, I am stuck using OSGi and JAXB together.
>>
>> The issue is that QDox has trouble reading the "package-info.java" files
>> generated by the JAXB Schema-to-POJO compiler (xjc).
>> QDox doesn't like the annotations on the package directive, as in:
>>
>>
>> @javax.xml.bind.annotation.XmlSchema(namespace = "
>> http://schemas.acme.com/product/coyote/1.0")
>> package com.acme.coyote;
>>
>>
>> This problem is known on QDox's JIRA:
>> http://jira.codehaus.org/browse/QDOX-98
>> However it seems to be *very* dusty for some time now. Unfortunately,
>> nobody is really concerned with it.
>>
>> I'm working on this issue and I'll post a follow-up if I get anything
>> working.
>>
>> If anyone has experience using OSGi + JAXB please give us some thoughts on
>> how this QDox issue was avoided or solved.
>>
>> Thank you for your attention,
>> Rodrigo Madera
>>
> 


-- 
Carsten Ziegeler
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: maven-scr-plugin and QDox (or JAXB)

Posted by Rodrigo Madera <ro...@gmail.com>.
After further analysis I have concluded that the best way to solve the
problem right now is to modify the Apache Felix SCR Maven Plugin.

On JavaClassDescriptorManager's constructor I will put a check before adding
a source tree for QDox's processing, so that the xjc generated directory
will be ignored.

This is a simple hack that solves the QDox problem, but it's much simpler
than messing with byacc rules for this.

Hope this helps somebody with the same problem I had when using OSGi + JAXB
(or any other tool based on buggy QDox).

Regards,
Rodrigo Madera

P.S. Keywords: maven osgi jaxb xjc xml serialization deserialization
marshalling unmarshalling qdox ParseException syntax error yyerror yyparse

On Tue, Mar 4, 2008 at 12:27 AM, Rodrigo Madera <ro...@gmail.com>
wrote:

> Hello community,
>
> I found a serious incompatibility between maven-scr-plugin (used to
> generate service descriptors for Declarative Services) and QDox, which is
> used for JAXB (Java XML Bindings).
> Thus, I am stuck using OSGi and JAXB together.
>
> The issue is that QDox has trouble reading the "package-info.java" files
> generated by the JAXB Schema-to-POJO compiler (xjc).
> QDox doesn't like the annotations on the package directive, as in:
>
>
> @javax.xml.bind.annotation.XmlSchema(namespace = "
> http://schemas.acme.com/product/coyote/1.0")
> package com.acme.coyote;
>
>
> This problem is known on QDox's JIRA:
> http://jira.codehaus.org/browse/QDOX-98
> However it seems to be *very* dusty for some time now. Unfortunately,
> nobody is really concerned with it.
>
> I'm working on this issue and I'll post a follow-up if I get anything
> working.
>
> If anyone has experience using OSGi + JAXB please give us some thoughts on
> how this QDox issue was avoided or solved.
>
> Thank you for your attention,
> Rodrigo Madera
>