git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [heads-up] Re: camel-spring.xsd gets updated and new tag fails during start up


Hi Onder,

Can you share more detail information of the problem that you found?
Maybe we can help you review the design at the first place :)


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Jun 14, 2018 at 2:36 AM, Onder SEZGIN <onders@xxxxxxxxxx> wrote:

> Hi Guys,
>
> Just a heads up.
> I found problems with the implementation so before moving ahead with XML
> DSL i reverted the changes.
> I will try to revisit.
> Four you information.
>
> Thanks.
>
> On Tue, Jun 12, 2018 at 9:53 AM Onder SEZGIN <onders@xxxxxxxxxx> wrote:
>
> > Thanks Guys,
> >
> > @ Alex, I suspect the schema is wrong but as you and Willem mentioned
> jaxb
> > annotation definition may matter.
> >
> > @ Willem, i thought not putting required="true" makes it optional, maybe
> > making it optional as you mentioned and what i presumably did changes the
> > output of autogenerated xsd file and then it affects the xml dsl.
> >
> > I will try to go into deep.
> >
> >
> > On Tue, Jun 12, 2018 at 6:57 AM Willem Jiang <willem.jiang@xxxxxxxxx>
> > wrote:
> >
> >> I just have a quick look at the code, the schema is updated, but there
> are
> >> something wrong with the xml file.
> >> As the ThrottleDefinition is extends from ExpressionNode, but the first
> >> element of ExpressionNode is a reference of expression element, not
> >> the correlationExpression
> >> that you want.
> >> So you keep getting the complain message.
> >>
> >> Once I put the correlationExpression as the last element of throttle, I
> >> don't get the error message anymore. (but the test is freeze ).
> >>
> >> <route errorHandlerRef="dlc">
> >>   <from uri="seda:b"/>
> >>   <throttle timePeriodMillis="1000">
> >>     <header>max</header>
> >>     <to uri="log:result"/>
> >>     <to uri="mock:result"/>
> >>     <correlationExpression>
> >>       <constant>2</constant>
> >>     </correlationExpression>
> >>   </throttle>
> >> </route>
> >>
> >> We need to address the element order first to fix this issue.
> >>
> >> BTW, I also find an issue in the ThrottleDefinition, to support to old
> XML
> >> which has no correlationExpression, we need to specify the element as an
> >> optional one.
> >> Just like this :
> >>
> >> @XmlElements({
> >>     @XmlElement(name = "correlationExpression", type =
> >> ExpressionSubElementDefinition.class)}
> >> )
> >> private ExpressionSubElementDefinition correlationExpression;
> >>
> >>
> >>
> >>
> >> Willem Jiang
> >>
> >> Twitter: willemjiang
> >> Weibo: 姜宁willem
> >>
> >> On Tue, Jun 12, 2018 at 5:23 AM, Alex Dettinger <aldettinger@xxxxxxxxx>
> >> wrote:
> >>
> >> > Hi,
> >> >
> >> >   I had a quick look and forced the resolution of the schema like
> this:
> >> > http://camel.apache.org/schema/spring
> >> > /home/aldettinger/.m2/repository/org/apache/camel/
> >> > camel-spring/2.22.0-SNAPSHOT/camel-spring-2.22.0-SNAPSHOT.xsd
> >> >
> >> >   And hit the same issue then you. So I think that the last version of
> >> the
> >> > schema is loaded, but the schema would be wrong then.
> >> >
> >> > Hope this help,
> >> > Alex
> >> >
> >> > On Mon, Jun 11, 2018 at 5:12 PM, Onder SEZGIN <ondersezgin@xxxxxxxxx>
> >> > wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > please see the branch in this link.
> >> > > https://github.com/apache/camel/pull/2366#issuecomment-396193135
> >> > >
> >> > > or this one.
> >> > >
> >> > >
> >> https://github.com/onderson/camel/commit/ae63d64f627ec921c574059aadd1cf
> >> > > 894f5f3e2e
> >> > >
> >> > >
> >> > > On Mon, Jun 11, 2018 at 5:32 PM Willem Jiang <
> willem.jiang@xxxxxxxxx>
> >> > > wrote:
> >> > >
> >> > > > Where is your unit test?
> >> > > > Can you check if you are using the latest built camel-spring jar.
> >> > > > There is a schema definition in the camel-spring[1],  please make
> >> sure
> >> > > the
> >> > > > new generated camel-spring.xsd is wrap into the camel-spring.jar
> >> > > >
> >> > > > [1]
> >> > > >
> >> > > > https://github.com/apache/camel/blob/master/components/
> >> > > camel-spring/src/main/resources/META-INF/spring.schemas
> >> > > >
> >> > > >
> >> > > > Willem Jiang
> >> > > >
> >> > > > Twitter: willemjiang
> >> > > > Weibo: 姜宁willem
> >> > > >
> >> > > > On Mon, Jun 11, 2018 at 9:11 PM, Onder SEZGIN <onders@xxxxxxxxxx>
> >> > wrote:
> >> > > >
> >> > > > > i did try full build. it did not help in my case :/
> >> > > > >
> >> > > > > On Mon, Jun 11, 2018 at 12:23 PM Onder SEZGIN <
> >> ondersezgin@xxxxxxxxx
> >> > >
> >> > > > > wrote:
> >> > > > >
> >> > > > > > no. because it may take very long on my pc.
> >> > > > > > I will try to check.
> >> > > > > >
> >> > > > > > On Mon, Jun 11, 2018 at 12:17 PM Andrea Cosentino
> >> > > > > > <ancosen1985@xxxxxxxxx.invalid> wrote:
> >> > > > > >
> >> > > > > >> Did you try a full rebuild?
> >> > > > > >>
> >> > > > > >> --
> >> > > > > >> Andrea Cosentino
> >> > > > > >> ----------------------------------
> >> > > > > >> Apache Camel PMC Chair
> >> > > > > >> Apache Karaf Committer
> >> > > > > >> Apache Servicemix PMC Member
> >> > > > > >> Email: ancosen1985@xxxxxxxxx
> >> > > > > >> Twitter: @oscerd2
> >> > > > > >> Github: oscerd
> >> > > > > >>
> >> > > > > >>
> >> > > > > >>
> >> > > > > >>
> >> > > > > >>
> >> > > > > >>
> >> > > > > >> On Monday, June 11, 2018, 11:15:17 AM GMT+2, Onder SEZGIN <
> >> > > > > >> onders@xxxxxxxxxx> wrote:
> >> > > > > >>
> >> > > > > >>
> >> > > > > >>
> >> > > > > >>
> >> > > > > >>
> >> > > > > >> Hi Guys,
> >> > > > > >>
> >> > > > > >> I've recently implemented CAMEL-6840 and new xml element is
> >> > > introduced
> >> > > > > as
> >> > > > > >> a
> >> > > > > >> result of it.
> >> > > > > >> I am trying to create a unit test for it under camel-spring
> to
> >> see
> >> > > if
> >> > > > > the
> >> > > > > >> new element is fine in XML DSL.
> >> > > > > >> and i have this simple xml route.
> >> > > > > >>
> >> > > > > >>   <camelContext xmlns="http://camel.apache.org/schema/spring
> ">
> >> > > > > >>     <errorHandler id="dlc" deadLetterUri="mock:dead"
> >> > > > > >> type="DeadLetterChannel"/>
> >> > > > > >>     <route errorHandlerRef="dlc">
> >> > > > > >>       <from uri="seda:a"/>
> >> > > > > >>       <throttle timePeriodMillis="1000">
> >> > > > > >>         <correlationExpression>
> >> > > > > >>           <constant>1</constant>
> >> > > > > >>         </correlationExpression>
> >> > > > > >>         <header>max</header>
> >> > > > > >>         <to uri="log:result"/>
> >> > > > > >>         <to uri="mock:result"/>
> >> > > > > >>       </throttle>
> >> > > > > >>     </route>
> >> > > > > >>
> >> > > > > >> Even though the build of camel-spring is ok and i can see
> right
> >> > > > > >> definitions
> >> > > > > >> in camel-spring.xsd, i can not run the unit test because of
> an
> >> > error
> >> > > > as
> >> > > > > >> below.
> >> > > > > >>
> >> > > > > >> My guess is somewhat unit test can not recognize
> >> camel-spring.xsd
> >> > > but
> >> > > > > not
> >> > > > > >> sure.
> >> > > > > >> Any idea?
> >> > > > > >>
> >> > > > > >> Caused by: org.xml.sax.SAXParseException; lineNumber: 34;
> >> > > > columnNumber:
> >> > > > > >> 32;
> >> > > > > >> cvc-complex-type.2.4.a: Invalid content was found starting
> with
> >> > > > element
> >> > > > > >> 'correlationExpression'. One of
> >> > > > > >> '{"http://camel.apache.org/schema/spring":description,
> >> > > > > >> "http://camel.apache.org/schema/spring":
> expressionDefinition,
> >> "
> >> > > > > >> http://camel.apache.org/schema/spring":constant, "
> >> > > > > >> http://camel.apache.org/schema/spring":el, "
> >> > > > > >> http://camel.apache.org/schema/spring":exchangeProperty, "
> >> > > > > >> http://camel.apache.org/schema/spring":groovy, "
> >> > > > > >> http://camel.apache.org/schema/spring":header, "
> >> > > > > >> http://camel.apache.org/schema/spring":jxpath, "
> >> > > > > >> http://camel.apache.org/schema/spring":javaScript, "
> >> > > > > >> http://camel.apache.org/schema/spring":jsonpath, "
> >> > > > > >> http://camel.apache.org/schema/spring":language, "
> >> > > > > >> http://camel.apache.org/schema/spring":method, "
> >> > > > > >> http://camel.apache.org/schema/spring":mvel, "
> >> > > > > >> http://camel.apache.org/schema/spring":ognl, "
> >> > > > > >> http://camel.apache.org/schema/spring":php, "
> >> > > > > >> http://camel.apache.org/schema/spring":python, "
> >> > > > > >> http://camel.apache.org/schema/spring":ref, "
> >> > > > > >> http://camel.apache.org/schema/spring":ruby, "
> >> > > > > >> http://camel.apache.org/schema/spring":simple, "
> >> > > > > >> http://camel.apache.org/schema/spring":spel, "
> >> > > > > >> http://camel.apache.org/schema/spring":sql, "
> >> > > > > >> http://camel.apache.org/schema/spring":terser, "
> >> > > > > >> http://camel.apache.org/schema/spring":tokenize, "
> >> > > > > >> http://camel.apache.org/schema/spring":xtokenize, "
> >> > > > > >> http://camel.apache.org/schema/spring":xpath, "
> >> > > > > >> http://camel.apache.org/schema/spring":xquery}' is expected.
> >> > > > > >>
> >> > > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> >
>


( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-camel-development/msg04202.html on line 341
Call Stack
#TimeMemoryFunctionLocation
10.0008381016{main}( ).../msg04202.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-camel-development/msg04202.html on line 341
Call Stack
#TimeMemoryFunctionLocation
10.0008381016{main}( ).../msg04202.html:0