Re: Hivemind eager loading of a service which references tapestry services is not possible
Howard, At present this is all the output I'm getting, I haven't enabled Log4j/Logging yet though (haven't decided on the best way to do so). org.apache.hivemind.ApplicationRuntimeException: Unable to construct service tapestry.init.MasterInitializer: Failure invoking constructor for class $ApplicationInitializer_1122b245fc1: java.lang.ArrayStoreException location: jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/TapestryStart/WEB-INF/lib/tapestry-framework-4.1.1.jar!/META-INF/tapestry.init.xml, line 27, column 60 org.apache.hivemind.ApplicationRuntimeException: Failure invoking constructor for class $ApplicationInitializer_1122b245fc1: java.lang.ArrayStoreException location: jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/TapestryStart/WEB-INF/lib/tapestry-framework-4.1.1.jar!/META-INF/tapestry.init.xml, line 27, column 60 org.apache.hivemind.ApplicationRuntimeException: Failure invoking constructor for class $ApplicationInitializer_1122b245fc1: java.lang.ArrayStoreException java.lang.ArrayStoreException java.lang.System.arraycopy(Native Method) java.util.ArrayList.toArray(ArrayList.java:304) $ApplicationInitializer_1122b245fc1.init($ApplicationInitializer_1122b245fc1.java) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:494) org.apache.hivemind.util.ConstructorUtils.invoke(ConstructorUtils.java:139) org.apache.hivemind.util.ConstructorUtils.invokeMatchingConstructor(ConstructorUtils.java:92) org.apache.hivemind.util.ConstructorUtils.invokeConstructor(ConstructorUtils.java:79) org.apache.hivemind.lib.chain.ChainBuilderImpl.createInstance(ChainBuilderImpl.java:109) org.apache.hivemind.lib.chain.ChainBuilderImpl.buildImplementation(ChainBuilderImpl.java:58) $ChainBuilder_1122b245fb8.buildImplementation($ChainBuilder_1122b245fb8.java) $ChainBuilder_1122b245fb7.buildImplementation($ChainBuilder_1122b245fb7.java) org.apache.hivemind.lib.chain.ChainFactory.createCoreServiceImplementation(ChainFactory.java:67) $ServiceImplementationFactory_1122b245fb6.createCoreServiceImplementation($ServiceImplementationFactory_1122b245fb6.java) $ServiceImplementationFactory_1122b245fb5.createCoreServiceImplementation($ServiceImplementationFactory_1122b245fb5.java) org.apache.hivemind.impl.InvokeFactoryServiceConstructor.constructCoreServiceImplementation(InvokeFactoryServiceConstructor.java:62) org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructCoreServiceImplementation(AbstractServiceModelImpl.java:108) org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation(AbstractServiceModelImpl.java:158) org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation(AbstractServiceModelImpl.java:140) org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation(SingletonServiceModel.java:69) $ApplicationInitializer_1122b245fb4._service($ApplicationInitializer_1122b245fb4.java) $ApplicationInitializer_1122b245fb4.initialize($ApplicationInitializer_1122b245fb4.java) $ApplicationInitializer_1122b245fb3.initialize($ApplicationInitializer_1122b245fb3.java) org.apache.tapestry.ApplicationServlet.initializeApplication(ApplicationServlet.java:299) org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:198) Howard Lewis Ship wrote: Check your console; there is almost certainly additional output describing why the code failed. On 4/25/07, Paul Stanton [EMAIL PROTECTED] wrote: Thanks Marcus, I think I'm closer but it still doesn't work. I've updated my hivemodule.xml, so now the initializer part reads: contribution configuration-id=tapestry.init.ApplicationInitializers command id=zzz object=service:zzz/ /contribution But now I get the following exception: org.apache.hivemind.ApplicationRuntimeException: Unable to construct service tapestry.init.MasterInitializer: Failure invoking constructor for class $ApplicationInitializer_1122afa4f72: java.lang.ArrayStoreException location: jar:file:tapestry-framework-4.1.1.jar!/META-INF/tapestry.init.xml, line 27, column 60 Is there any documentation for this besides the hivedocs? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hivemind eager loading of a service which references tapestry services is not possible
One possibility is that the service you are contributing does not implement the correct interface, though I'm pretty sure there should be checks in place for that. I wrote the ChainBuilder code in HiveMind a couple of years back! Basically, your contributions are mixed in with Tapestry's and anybody else's to form a chain-of-command. The exception inside the constructor indicates that there was an issue converting the List to an object array (of the service interface type) and the most likely cause there is that your contributed service is the wrong type. On 4/25/07, Paul Stanton [EMAIL PROTECTED] wrote: Howard, At present this is all the output I'm getting, I haven't enabled Log4j/Logging yet though (haven't decided on the best way to do so). org.apache.hivemind.ApplicationRuntimeException: Unable to construct service tapestry.init.MasterInitializer: Failure invoking constructor for class $ApplicationInitializer_1122b245fc1: java.lang.ArrayStoreException location: jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/TapestryStart/WEB-INF/lib/tapestry- framework-4.1.1.jar!/META-INF/tapestry.init.xml, line 27, column 60 org.apache.hivemind.ApplicationRuntimeException: Failure invoking constructor for class $ApplicationInitializer_1122b245fc1: java.lang.ArrayStoreException location: jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/TapestryStart/WEB-INF/lib/tapestry- framework-4.1.1.jar!/META-INF/tapestry.init.xml, line 27, column 60 org.apache.hivemind.ApplicationRuntimeException: Failure invoking constructor for class $ApplicationInitializer_1122b245fc1: java.lang.ArrayStoreException java.lang.ArrayStoreException java.lang.System.arraycopy(Native Method) java.util.ArrayList.toArray(ArrayList.java:304) $ApplicationInitializer_1122b245fc1.init($ApplicationInitializer_1122b245fc1.java) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance( NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance( DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:494) org.apache.hivemind.util.ConstructorUtils.invoke(ConstructorUtils.java :139) org.apache.hivemind.util.ConstructorUtils.invokeMatchingConstructor( ConstructorUtils.java:92) org.apache.hivemind.util.ConstructorUtils.invokeConstructor( ConstructorUtils.java:79) org.apache.hivemind.lib.chain.ChainBuilderImpl.createInstance( ChainBuilderImpl.java:109) org.apache.hivemind.lib.chain.ChainBuilderImpl.buildImplementation( ChainBuilderImpl.java:58) $ChainBuilder_1122b245fb8.buildImplementation($ChainBuilder_1122b245fb8.java) $ChainBuilder_1122b245fb7.buildImplementation($ChainBuilder_1122b245fb7.java) org.apache.hivemind.lib.chain.ChainFactory.createCoreServiceImplementation (ChainFactory.java:67) $ServiceImplementationFactory_1122b245fb6.createCoreServiceImplementation($ServiceImplementationFactory_1122b245fb6.java) $ServiceImplementationFactory_1122b245fb5.createCoreServiceImplementation($ServiceImplementationFactory_1122b245fb5.java) org.apache.hivemind.impl.InvokeFactoryServiceConstructor.constructCoreServiceImplementation (InvokeFactoryServiceConstructor.java:62) org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructCoreServiceImplementation (AbstractServiceModelImpl.java:108) org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation (AbstractServiceModelImpl.java:158) org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation (AbstractServiceModelImpl.java:140) org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation (SingletonServiceModel.java:69) $ApplicationInitializer_1122b245fb4._service($ApplicationInitializer_1122b245fb4.java) $ApplicationInitializer_1122b245fb4.initialize($ApplicationInitializer_1122b245fb4.java) $ApplicationInitializer_1122b245fb3.initialize($ApplicationInitializer_1122b245fb3.java) org.apache.tapestry.ApplicationServlet.initializeApplication( ApplicationServlet.java:299) org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:198) Howard Lewis Ship wrote: Check your console; there is almost certainly additional output describing why the code failed. On 4/25/07, Paul Stanton [EMAIL PROTECTED] wrote: Thanks Marcus, I think I'm closer but it still doesn't work. I've updated my hivemodule.xml, so now the initializer part reads: contribution configuration-id=tapestry.init.ApplicationInitializers command id=zzz object=service:zzz/ /contribution But now I get the following exception: org.apache.hivemind.ApplicationRuntimeException: Unable to construct service tapestry.init.MasterInitializer: Failure invoking constructor for class $ApplicationInitializer_1122afa4f72: java.lang.ArrayStoreException location:
RE: Hivemind eager loading of a service which references tapestry services is not possible
The name of the config-point is ApplicationInitializers, not ApplicationSpecificationInitializer. -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 24, 2007 2:27 AM To: Tapestry users Subject: Re: Hivemind eager loading of a service which references tapestry services is not possible Thanks Howard, I've altered the 'contribution element to the following: contribution configuration-id=tapestry.init.ApplicationSpecificationInitializer command after=tapestry.init.ApplicationSpecificationInitializer id=zzz object=service:application.zzz/ /contribution But now I get the error message: org.apache.hivemind.ApplicationRuntimeException: Error at context:/WEB-INF/hivemodule.xml, line 29, column 85: Module application has contributed to unknown configuration point tapestry.init.ApplicationSpecificationInitializer. The contribution has been ignored. It seems I don't have visibility of the tapestry configuration points. How I declare/reference the configuration point? Paul. Howard Lewis Ship wrote: What you do in this case, where you are reliant on information HiveMind doesn't have at Registry creation, is to hook into the ApplicationInitializers configuration point: http://tapestry.apache.org/tapestry4/tapestry/hivedocs/config/tapestry .init.ApplicationInitializers.html On 4/22/07, Paul Stanton [EMAIL PROTECTED] wrote: I'm trying to avoid Spring and use Hivemind to manage my Hibernate service. It's pretty basic stuff but one basic feature is proving very hard to achieve: eager load startup. In my case I need to reference WebContext (the tapestry component) in my initialisation procedure, but it seems to be 'unresolved' at that point and I get a NullPointerException. As a result, I'm starting to think there is a gap in how Tapestry and Hivemind are integrated, in that tapestry components cannot be referenced in eager loading services. It's possible that changing service loading order (in ApplicationServlet.init) solves this, and equally possible that I've missed an obvious alternative. I've got a thread with all the relevant details: http://www.tapestryforums.com/can-hivemind-call-something-after-all-s et-objects-vt9931.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hivemind eager loading of a service which references tapestry services is not possible
Thanks Howard, I've altered the 'contribution element to the following: contribution configuration-id=tapestry.init.ApplicationSpecificationInitializer command after=tapestry.init.ApplicationSpecificationInitializer id=zzz object=service:application.zzz/ /contribution But now I get the error message: org.apache.hivemind.ApplicationRuntimeException: Error at context:/WEB-INF/hivemodule.xml, line 29, column 85: Module application has contributed to unknown configuration point tapestry.init.ApplicationSpecificationInitializer. The contribution has been ignored. It seems I don't have visibility of the tapestry configuration points. How I declare/reference the configuration point? Paul. Howard Lewis Ship wrote: What you do in this case, where you are reliant on information HiveMind doesn't have at Registry creation, is to hook into the ApplicationInitializers configuration point: http://tapestry.apache.org/tapestry4/tapestry/hivedocs/config/tapestry.init.ApplicationInitializers.html On 4/22/07, Paul Stanton [EMAIL PROTECTED] wrote: I'm trying to avoid Spring and use Hivemind to manage my Hibernate service. It's pretty basic stuff but one basic feature is proving very hard to achieve: eager load startup. In my case I need to reference WebContext (the tapestry component) in my initialisation procedure, but it seems to be 'unresolved' at that point and I get a NullPointerException. As a result, I'm starting to think there is a gap in how Tapestry and Hivemind are integrated, in that tapestry components cannot be referenced in eager loading services. It's possible that changing service loading order (in ApplicationServlet.init) solves this, and equally possible that I've missed an obvious alternative. I've got a thread with all the relevant details: http://www.tapestryforums.com/can-hivemind-call-something-after-all-set-objects-vt9931.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]