hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Lewis Ship <hls...@gmail.com>
Subject Re: Trying to use a service constructor
Date Wed, 14 Jul 2004 02:23:05 GMT
To SDL, that ClientController looks like a ClientController element. 
You need to put it in quotes for it to realize its literal character
data.  Character data is always enclosed in quotes in SDL.

On Tue, 13 Jul 2004 20:20:14 -0400, Hensley, Richard
<richard.hensley@mckesson.com> wrote:
> I have a hivemodule.sdl configuration that looks like:
> 
> module (id=com.mckesson.adept.net version="1.0.0")
> {
>   service-point (id=ClientController
> interface=com.mckesson.adept.net.Controller)
>   {
>     invoke-factory (service-id=hivemind.BuilderFactory model=singleton)
>     {
>       construct (class=com.mckesson.adept.net.client.ClientController)
>       {
>         string { "${com.mckesson.adept.broker.host}" }
>         int { "${com.mckesson.adept.broker.port}" }
>       }
>     }
>   }
> 
>   service-point (id=Controller interface=com.mckesson.adept.net.Controller)
>   {
>     invoke-factory (service-id=hivemind.BuilderFactory model=singleton)
>     {
>       construct
> (class=com.mckesson.adept.net.client.ConnectionPoolingController)
>       {
>         service { ClientController }
>       }
>     }
>   }
> }
> 
> When I use the following code:
> 
>         Controller controller = (Controller) reg.getService(
>                 "com.mckesson.adept.net.ClientController",
> Controller.class);
> 
> Everything works great.
> 
> When I use the following code:
> 
>         Controller controller = (Controller) reg.getService(
>                 "com.mckesson.adept.net.Controller", Controller.class);
> 
> Hivemind gives me the following exception:
> 
> Jul 13, 2004 5:18:50 PM org.apache.hivemind.impl.DefaultErrorHandler error
> SEVERE: Error at
> file:/C:/dev900/java/adept/target/classes/META-INF/hivemodule.sdl, line 21,
> column 43: Element construct/service/ClientController is not allowed here.
> org.apache.hivemind.ApplicationRuntimeException: Unable to construct service
> com.mckesson.adept.net.Controller: java.lang.NullPointerException
>         at
> org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewS
> erviceImplementation(AbstractServiceModelImpl.java:156)
>         at
> org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServ
> iceImplementation(AbstractServiceModelImpl.java:130)
>         at
> org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualService
> Implementation(SingletonServiceModel.java:69)
>         at $InnerProxy_fdbb040d47_3._service($InnerProxy_fdbb040d47_3.java)
>         at
> $InnerProxy_fdbb040d47_3.brokerConnection($InnerProxy_fdbb040d47_3.java)
>         at
> $SingletonProxy_fdbb040d29_2.brokerConnection($SingletonProxy_fdbb040d29_2.j
> ava)
>         at com.mckesson.adept.net.HiveMindDemo.main(HiveMindDemo.java:21)
> org.apache.hivemind.ApplicationRuntimeException: Unable to construct service
> com.mckesson.adept.net.Controller: java.lang.NullPointerException
>         at
> org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewS
> erviceImplementation(AbstractServiceModelImpl.java:156)
>         at
> org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServ
> iceImplementation(AbstractServiceModelImpl.java:130)
>         at
> org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualService
> Implementation(SingletonServiceModel.java:69)
>         at $InnerProxy_fdbb040d47_3._service($InnerProxy_fdbb040d47_3.java)
>         at $InnerProxy_fdbb040d47_3.shutdown($InnerProxy_fdbb040d47_3.java)
>         at
> $SingletonProxy_fdbb040d29_2.shutdown($SingletonProxy_fdbb040d29_2.java)
>         at com.mckesson.adept.net.HiveMindDemo.main(HiveMindDemo.java:33)
> Exception in thread "main"
> 
> I really don't know why, but I suspect it is because I'm not using the
> service element correctly in the contruct element for the BuilderFactory.
> Can anybody give me some insight as to what might be wrong?
> 
> Richard Hensley
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-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-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message