Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

there are more than one GigaSpace beans within the context

Hi,

I just found big problem. When trying to connect two remote spaces to polling container I got funny exception:

Jun 10, 2009 12:31:57 AM SEVERE [org.jini.rio.monitor.provision]: Failed to instantiate service [ServiceElement{OlapTranProcFdNew.PU [1]}] on [Grid Service Container 129.253.106.8/129.253.106.8], GSC reported: org.jini.rio.core.JSBInstantiationException: Failed to start processing unit [OlapTranProcFdNew.PU]; Nested cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PollingEventContainer': Cannot create inner bean 'os-events:annotation-adapter#21bc22cb' of type [org.openspaces.events.config.AnnotationEventAdapterFactoryBean] while setting bean property 'eventListener'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'os-events:annotation-adapter#21bc22cb': Cannot resolve reference to bean 'procFdNewListener' while setting bean property 'delegate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'procFdNewListener' defined in resource loaded from byte array: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Failed to resolve GigaSpace to use with event container, [procFdNewListener] does not specifiy one, has no fields of that type, and there are more than one GigaSpace beans within the context; Nested cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'os-events:annotation-adapter#21bc22cb': Cannot resolve reference to bean 'procFdNewListener' while setting bean property 'delegate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'procFdNewListener' defined in resource loaded from byte array: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Failed to resolve GigaSpace to use with event container, [procFdNewListener] does not specifiy one, has no fields of that type, and there are more than one GigaSpace beans within the context; Nested cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'procFdNewListener' defined in resource loaded from byte array: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Failed to resolve GigaSpace to use with event container, [procFdNewListener] does not specifiy one, has no fields of that type, and there are more than one GigaSpace beans within the context; Nested cause: java.lang.IllegalArgumentException: Failed to resolve GigaSpace to use with event container, [procFdNewListener] does not specifiy one, has no fields of that type, and there are more than one GigaSpace beans within the context

Here is my service pu.xml file:

http://www.springframework.org/schema... http://www.openspaces.org/schema/core http://www.openspaces.org/schema/core... http://www.openspaces.org/schema/events http://www.openspaces.org/schema/even... http://www.openspaces.org/schema/remo... http://www.openspaces.org/schema/remo... http://www.openspaces.org/schema/sla http://www.openspaces.org/schema/sla/...>

<bean id="propertiesConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

<os-core:space id="localSpace" url="jini://*/*/localSpace?versioned=true"/>
<os-core:distributed-tx-manager id="aicTransactionManager"/>
<os-core:giga-space id="aicSpace" space="localSpace" tx-manager="aicTransactionManager"/>

<os-core:giga-space-context/>
<os-events:annotation-support />

<os-core:space id="space" url="jini://*/*/space?versioned=true"/>
<os-core:distributed-tx-manager id="transactionManager"/>

<os-core:giga-space id="gigaSpace" space="space" tx-manager="transactionManager"/>

<bean id="procFdNewListener" class="embeddedservices.procedures.OlapTranProcFdNew" depends-on="gigaSpace,aicSpace">
    <property name="writeLeaseTime" value="600000" />
    <property name="updateLeaseTime" value="20000" />
    <property name="idPoolSize" value="100" />
    <property name="localSpace" ref="aicSpace" />
</bean>

<os-events:polling-container id="PollingEventContainer" giga-space="gigaSpace"
        concurrent-consumers="1" max-concurrent-consumers="2" pass-array-as-is="true"
        receive-timeout="10000">

    <os-events:tx-support tx-manager="transactionManager" tx-timeout="60000"/>

    <os-events:receive-operation-handler>
        <bean class="org.openspaces.events.polling.receive.MultiExclusiveReadReceiveOperationHandler">
            <property name="maxEntries" value="50" />
            <property name="nonBlocking" value="true" />
            <property name="nonBlockingFactor" value="10" />
        </bean>
    </os-events:receive-operation-handler>

    <os-core:template>
        <bean class="mappings.tables.reporting.RawTester">
            <property name="state" value="50"/> 
            <property name="template" value="true" />
        </bean>
    </os-core:template>

    <os-events:listener>
        <os-events:annotation-adapter>
            <os-events:delegate ref="procFdNewListener"/>
        </os-events:annotation-adapter>
    </os-events:listener>
</os-events:polling-container>

</beans>

I don't understand what is the problem. I just want to have access to "localSpace" from bean procFdNewListener.

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3136]{quote}

asked 2009-06-09 11:54:17 -0600

mnemos gravatar image

updated 2013-08-08 09:52:00 -0600

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

How's your embeddedservices.procedures.OlapTranProcFdNew looks like?
Would injecting the right GigaSpace via the @GigaSpaceContext (name) solved the problem?
Shay

answered 2009-06-09 16:31:04 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Hi Shay,

I had this service working when there was just one space configured. In ..FdNew service I always had configured one space via context:

@GigaSpaceContext(name = "gigaSpace")
private GigaSpace space;

the exception occurs when I add second space to pu.xml. There is no other changes. I tried to add second reference with @GigaSpaceContext() in sevice but it didn't help.

Regards, Mateusz

mnemos gravatar imagemnemos ( 2009-06-10 02:42:13 -0600 )edit

You need to specify which GigaSpace instance to use on the polling/notify container it self using the annotation
@Polling(gigaSpace=name) / @Notify(gigaSpace=name)

Eitan

eitany gravatar imageeitany ( 2009-06-10 02:46:44 -0600 )edit

Isn't this line from pu file enough? There is space specified.

<os-events:polling-container id="PollingEventContainer" giga-space="gigaSpace"
concurrent-consumers="1" max-concurrent-consumers="2" pass-array-as-is="true"
receive-timeout="10000">

mnemos gravatar imagemnemos ( 2009-06-10 02:58:50 -0600 )edit

I checked and you were right. Adding Polling(gigaSpaces="name") helped. Some testing is still required but it works.

Thanks.

mnemos gravatar imagemnemos ( 2009-06-10 04:16:13 -0600 )edit

Hi Shay,

good point. I had it overwritten. When I removed @Polling(...) line from services problem was solved as well.

Thanks, Mateusz

mnemos gravatar imagemnemos ( 2009-06-10 10:49:33 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2009-06-09 11:54:17 -0600

Seen: 113 times

Last updated: Jun 09 '09