You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by James Carman <ja...@carmanconsulting.com> on 2004/10/02 19:07:46 UTC

Bug with parameter-occurs?

I have created a custom service implementation factory and I didn't include
a parameters schema for it..

 

<service-point id="HibernateSessionFactory"
interface="org.apache.hivemind.ServiceImplementationFactory">

  <invoke-factory service-id="hivemind.BuilderFactory">

    <construct

      class="example.hibernate.impl.HibernateSessionFactory"

      initialize-method="init"/>

  </invoke-factory>

</service-point>

 

When the registry creates my instance, I get the following error message.

 

  10-02@12:49:12 ERROR (hivemind.article.HibernateSession)     - Error at
file:/

C:/Java/libraries/jakarta-tomcat-4.1.30/webapps/hivemind-article/WEB-INF/cla
sses

/META-INF/hivemodule.xml, line 66, column 76: Parameters to service
implementati

on factory HibernateSessionFactory contains no contributions but expects
exactly

 one contribution.

 

I see in the code that the default value for parameterOccurs is REQUIRED,
but what if I don't HAVE any parameters schema defined?  Shouldn't it skip
the check if there is no parameters schema?


RE: Bug with parameter-occurs?

Posted by James Carman <ja...@carmanconsulting.com>.
Ahhhhhhhhhhhhhhhhhh.  See, I told you that I can be nearsighted! :-)  

-----Original Message-----
From: Howard Lewis Ship [mailto:hlship@gmail.com] 
Sent: Sunday, October 03, 2004 4:10 PM
To: hivemind-dev@jakarta.apache.org
Subject: Re: Bug with parameter-occurs?

It is allowed to have parameters *without* a schema.  In that case,
the pararements show up as a List of Element, and your service will
have to do the kind of conversion that is normally accomplished using
a schema. This might be useful if you were parsing the XML in an
Ant-like way, where you don't know the schema ahead of time, but
instead try to fit the XML to a Java object model ... other examples
are possible as well.

If your service really does not need parameters, set
parameters-occurs="none".


On Sun, 3 Oct 2004 08:37:04 -0400, James Carman
<ja...@carmanconsulting.com> wrote:
> Yeah, I saw that test case.  I was trying to figure out why it's written
> that way and why that is the expected behavior.  Howard?  It doesn't
really
> make sense to me, but I can be somewhat nearsighted sometimes.  :-)  I
> haven't been around this project long enough to get the big picture when
it
> comes to some aspects.  Anyway, thanks for the tip!  I'll do that.
> 
> 
> 
> -----Original Message-----
> From: Achim Huegen [mailto:ahuegen@gmx-topmail.de]
> Sent: Sunday, October 03, 2004 7:31 AM
> To: hivemind-dev@jakarta.apache.org
> Subject: Re: Bug with parameter-occurs?
> 
> I had the same problem some days ago. It could be easily fixed by
> skipping the schema processing in method
> InvokeFactoryServiceConstructor.constructCoreServiceImplementation(), when
> schema is null, but there
> exists a test case (TestInvokeFactoryServiceConstructor), that explicitly
> tests
> for this case.
> You can use the parameters-occurs attribute to overcome this problem:
> 
>   <service-point id="HibernateSessionFactory"
>    interface="org.apache.hivemind.ServiceImplementationFactory"
>    parameters-occurs="0..n">
> 
> Achim Huegen
> 
> Am Sat, 2 Oct 2004 13:07:46 -0400 schrieb James Carman
> <ja...@carmanconsulting.com>:
> 
> > I have created a custom service implementation factory and I didn't
> > include
> > a parameters schema for it..
> >
> >
> >
> > <service-point id="HibernateSessionFactory"
> > interface="org.apache.hivemind.ServiceImplementationFactory">
> >
> >   <invoke-factory service-id="hivemind.BuilderFactory">
> >
> >     <construct
> >
> >       class="example.hibernate.impl.HibernateSessionFactory"
> >
> >       initialize-method="init"/>
> >
> >   </invoke-factory>
> >
> > </service-point>
> >
> >
> >
> > When the registry creates my instance, I get the following error
message.
> >
> >
> >
> >   10-02@12:49:12 ERROR (hivemind.article.HibernateSession)     - Error
at
> > file:/
> >
> >
>
C:/Java/libraries/jakarta-tomcat-4.1.30/webapps/hivemind-article/WEB-INF/cla
> > sses
> >
> > /META-INF/hivemodule.xml, line 66, column 76: Parameters to service
> > implementati
> >
> > on factory HibernateSessionFactory contains no contributions but expects
> > exactly
> >
> >  one contribution.
> >
> >
> >
> > I see in the code that the default value for parameterOccurs is
REQUIRED,
> > but what if I don't HAVE any parameters schema defined?  Shouldn't it
> > skip
> > the check if there is no parameters schema?
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
> 
> 



-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Bug with parameter-occurs?

Posted by Howard Lewis Ship <hl...@gmail.com>.
It is allowed to have parameters *without* a schema.  In that case,
the pararements show up as a List of Element, and your service will
have to do the kind of conversion that is normally accomplished using
a schema. This might be useful if you were parsing the XML in an
Ant-like way, where you don't know the schema ahead of time, but
instead try to fit the XML to a Java object model ... other examples
are possible as well.

If your service really does not need parameters, set parameters-occurs="none".


On Sun, 3 Oct 2004 08:37:04 -0400, James Carman
<ja...@carmanconsulting.com> wrote:
> Yeah, I saw that test case.  I was trying to figure out why it's written
> that way and why that is the expected behavior.  Howard?  It doesn't really
> make sense to me, but I can be somewhat nearsighted sometimes.  :-)  I
> haven't been around this project long enough to get the big picture when it
> comes to some aspects.  Anyway, thanks for the tip!  I'll do that.
> 
> 
> 
> -----Original Message-----
> From: Achim Huegen [mailto:ahuegen@gmx-topmail.de]
> Sent: Sunday, October 03, 2004 7:31 AM
> To: hivemind-dev@jakarta.apache.org
> Subject: Re: Bug with parameter-occurs?
> 
> I had the same problem some days ago. It could be easily fixed by
> skipping the schema processing in method
> InvokeFactoryServiceConstructor.constructCoreServiceImplementation(), when
> schema is null, but there
> exists a test case (TestInvokeFactoryServiceConstructor), that explicitly
> tests
> for this case.
> You can use the parameters-occurs attribute to overcome this problem:
> 
>   <service-point id="HibernateSessionFactory"
>    interface="org.apache.hivemind.ServiceImplementationFactory"
>    parameters-occurs="0..n">
> 
> Achim Huegen
> 
> Am Sat, 2 Oct 2004 13:07:46 -0400 schrieb James Carman
> <ja...@carmanconsulting.com>:
> 
> > I have created a custom service implementation factory and I didn't
> > include
> > a parameters schema for it..
> >
> >
> >
> > <service-point id="HibernateSessionFactory"
> > interface="org.apache.hivemind.ServiceImplementationFactory">
> >
> >   <invoke-factory service-id="hivemind.BuilderFactory">
> >
> >     <construct
> >
> >       class="example.hibernate.impl.HibernateSessionFactory"
> >
> >       initialize-method="init"/>
> >
> >   </invoke-factory>
> >
> > </service-point>
> >
> >
> >
> > When the registry creates my instance, I get the following error message.
> >
> >
> >
> >   10-02@12:49:12 ERROR (hivemind.article.HibernateSession)     - Error at
> > file:/
> >
> >
> C:/Java/libraries/jakarta-tomcat-4.1.30/webapps/hivemind-article/WEB-INF/cla
> > sses
> >
> > /META-INF/hivemodule.xml, line 66, column 76: Parameters to service
> > implementati
> >
> > on factory HibernateSessionFactory contains no contributions but expects
> > exactly
> >
> >  one contribution.
> >
> >
> >
> > I see in the code that the default value for parameterOccurs is REQUIRED,
> > but what if I don't HAVE any parameters schema defined?  Shouldn't it
> > skip
> > the check if there is no parameters schema?
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
> 
> 



-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


RE: Bug with parameter-occurs?

Posted by James Carman <ja...@carmanconsulting.com>.
Yeah, I saw that test case.  I was trying to figure out why it's written
that way and why that is the expected behavior.  Howard?  It doesn't really
make sense to me, but I can be somewhat nearsighted sometimes.  :-)  I
haven't been around this project long enough to get the big picture when it
comes to some aspects.  Anyway, thanks for the tip!  I'll do that.

-----Original Message-----
From: Achim Huegen [mailto:ahuegen@gmx-topmail.de] 
Sent: Sunday, October 03, 2004 7:31 AM
To: hivemind-dev@jakarta.apache.org
Subject: Re: Bug with parameter-occurs?

I had the same problem some days ago. It could be easily fixed by
skipping the schema processing in method 
InvokeFactoryServiceConstructor.constructCoreServiceImplementation(), when 
schema is null, but there
exists a test case (TestInvokeFactoryServiceConstructor), that explicitly 
tests
for this case.
You can use the parameters-occurs attribute to overcome this problem:

  <service-point id="HibernateSessionFactory"
   interface="org.apache.hivemind.ServiceImplementationFactory"
   parameters-occurs="0..n">

Achim Huegen

Am Sat, 2 Oct 2004 13:07:46 -0400 schrieb James Carman 
<ja...@carmanconsulting.com>:

> I have created a custom service implementation factory and I didn't 
> include
> a parameters schema for it..
>
>
>
> <service-point id="HibernateSessionFactory"
> interface="org.apache.hivemind.ServiceImplementationFactory">
>
>   <invoke-factory service-id="hivemind.BuilderFactory">
>
>     <construct
>
>       class="example.hibernate.impl.HibernateSessionFactory"
>
>       initialize-method="init"/>
>
>   </invoke-factory>
>
> </service-point>
>
>
>
> When the registry creates my instance, I get the following error message.
>
>
>
>   10-02@12:49:12 ERROR (hivemind.article.HibernateSession)     - Error at
> file:/
>
>
C:/Java/libraries/jakarta-tomcat-4.1.30/webapps/hivemind-article/WEB-INF/cla
> sses
>
> /META-INF/hivemodule.xml, line 66, column 76: Parameters to service
> implementati
>
> on factory HibernateSessionFactory contains no contributions but expects
> exactly
>
>  one contribution.
>
>
>
> I see in the code that the default value for parameterOccurs is REQUIRED,
> but what if I don't HAVE any parameters schema defined?  Shouldn't it 
> skip
> the check if there is no parameters schema?
>



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Bug with parameter-occurs?

Posted by Achim Huegen <ah...@gmx-topmail.de>.
I had the same problem some days ago. It could be easily fixed by
skipping the schema processing in method 
InvokeFactoryServiceConstructor.constructCoreServiceImplementation(), when 
schema is null, but there
exists a test case (TestInvokeFactoryServiceConstructor), that explicitly 
tests
for this case.
You can use the parameters-occurs attribute to overcome this problem:

  <service-point id="HibernateSessionFactory"
   interface="org.apache.hivemind.ServiceImplementationFactory"
   parameters-occurs="0..n">

Achim Huegen

Am Sat, 2 Oct 2004 13:07:46 -0400 schrieb James Carman 
<ja...@carmanconsulting.com>:

> I have created a custom service implementation factory and I didn't 
> include
> a parameters schema for it..
>
>
>
> <service-point id="HibernateSessionFactory"
> interface="org.apache.hivemind.ServiceImplementationFactory">
>
>   <invoke-factory service-id="hivemind.BuilderFactory">
>
>     <construct
>
>       class="example.hibernate.impl.HibernateSessionFactory"
>
>       initialize-method="init"/>
>
>   </invoke-factory>
>
> </service-point>
>
>
>
> When the registry creates my instance, I get the following error message.
>
>
>
>   10-02@12:49:12 ERROR (hivemind.article.HibernateSession)     - Error at
> file:/
>
> C:/Java/libraries/jakarta-tomcat-4.1.30/webapps/hivemind-article/WEB-INF/cla
> sses
>
> /META-INF/hivemodule.xml, line 66, column 76: Parameters to service
> implementati
>
> on factory HibernateSessionFactory contains no contributions but expects
> exactly
>
>  one contribution.
>
>
>
> I see in the code that the default value for parameterOccurs is REQUIRED,
> but what if I don't HAVE any parameters schema defined?  Shouldn't it 
> skip
> the check if there is no parameters schema?
>



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org