spring integration issues (eclipse)

931 views
Skip to first unread message

gibffe

unread,
Oct 12, 2012, 10:56:55 AM10/12/12
to haze...@googlegroups.com
After following spring integration instructions found in the manual, I'm getting this while running my unit test:

Configuration problem: Failed to import bean definitions from relative location [./hazelcast-context.xml]
Offending resource: class path resource [com/scee/guerrilla/agent/messaging/messaging-context.xml];
nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.hazelcast.com/schema/spring]
Offending resource: class path resource [com/scee/guerrilla/agent/messaging/hazelcast-context.xml]

please help


Mehmet Dogan

unread,
Oct 12, 2012, 12:18:28 PM10/12/12
to haze...@googlegroups.com

Can you post your xml header? It should look like ;

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hz="http://www.hazelcast.com/schema/spring" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring-2.3.xsd">

@mmdogan

~Sent from mobile

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hazelcast/-/5Ck8hcHQFx4J.
To post to this group, send email to haze...@googlegroups.com.
To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.
Message has been deleted

gibffe

unread,
Oct 12, 2012, 5:31:19 PM10/12/12
to haze...@googlegroups.com
It might have something to do with http status 404 on http://www.hazelcast.com/schema/spring/ maybe ?

Mehmet Dogan

unread,
Oct 13, 2012, 12:31:24 AM10/13/12
to haze...@googlegroups.com

Actual xsd url is;
http://www.hazelcast.com/schema/spring/hazelcast-spring-2.3.xsd

http://www.hazelcast.com/schema/spring is namespace.

@mmdogan

~Sent from mobile

On Oct 13, 2012 12:27 AM, "gibffe" <gib...@gmail.com> wrote:
It might have something to do with http status 404 on http://www.hazelcast.com/schema/spring/ ?
To view this discussion on the web visit https://groups.google.com/d/msg/hazelcast/-/FvdH4SnKQJwJ.

amon

unread,
Oct 13, 2012, 6:09:42 AM10/13/12
to haze...@googlegroups.com
this is my xml:

<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:hz="http://www.hazelcast.com/schema/spring"
    xmlns="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                        http://www.hazelcast.com/schema/spring
                        http://www.hazelcast.com/schema/spring/hazelcast-spring-2.3.xsd" >

  
   <hz:hazelcast id="instance">
        <hz:config>
            <hz:group name="dev" password="password"/>
            <hz:network port="5701" port-auto-increment="false">
                <hz:join>
                    <hz:multicast enabled="false" multicast-group="224.2.2.3" multicast-port="54327"/>
                    <hz:tcp-ip enabled="true">
                        <hz:members>10.10.1.2, 10.10.1.3</hz:members>
                    </hz:tcp-ip>
                </hz:join>
            </hz:network>
        </hz:config>
    </hz:hazelcast>            
</beans>


This is what I get:

INFO: Loading XML bean definitions from class path resource [com/hazelcast/test/context.xml]
Oct 13, 2012 11:07:38 AM org.springframework.test.context.TestContextManager prepareTestInstance
SEVERE: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@44071d] to prepare test instance [com.hazelcast.test.AppTest@2f0214]
java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.hazelcast.com/schema/spring]
Offending resource: class path resource [com/hazelcast/test/context.xml]

    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:316)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1416)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadBeanDefinitions(AbstractGenericContextLoader.java:205)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:100)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
    at org.springframework.test.context.support.DelegatingSmartContextLoader.loadContext(DelegatingSmartContextLoader.java:228)
    at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)
    at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
    ... 24 more

I'm using hazelcast 2.3.1

link to test source: https://dl.dropbox.com/u/1366238/test.zip

barryl

unread,
Oct 15, 2012, 9:51:47 AM10/15/12
to haze...@googlegroups.com
Your pom.xml file is missing 'hazelcast-spring' as a dependency...

Barry

Peter Veentjer

unread,
May 13, 2013, 10:09:03 AM5/13/13
to haze...@googlegroups.com
Can you post the part of your spring configuration including the the full <beans> attribute, e.g.

Spring is trying to load the xml file on http://www.hazelcast.com/schema/spring. And this file doesn't exist. So perhaps your spring appcontext file is out of date.


On Mon, May 13, 2013 at 4:18 PM, <namita...@gmail.com> wrote:
I am running an example from net i get the same error can you tell me exactly what am i missing
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.

To post to this group, send email to haze...@googlegroups.com.

Mehmet Dogan

unread,
May 14, 2013, 3:24:27 AM5/14/13
to haze...@googlegroups.com
Actual error is;

java.lang.NoSuchMethodError: org.springframework.beans.factory.support.BeanDefinitionBuilder.addConstructorArgValue(Ljava/lang/Object;)Lorg/springframework/beans/factory/support/BeanDefinitionBuilder

It seems there is a version mismatch between Hazelcast Spring dependency and Spring version you are using.

What are your Hazelcast and Spring versions?

@mmdogan



On Tue, May 14, 2013 at 9:37 AM, <namita...@gmail.com> wrote:
Bean definitions :
    <import resource="classpath:applicationContext-hazelcast.xml" />
   
    <!-- Beans Declaration -->
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:/hazelcast-config.properties</value>
            </list>
        </property>
    </bean>

    <bean id="cacheService" class="com.onlinetechvision.cache.srv.CacheService">
        <constructor-arg ref="customerMap"/>
    </bean>

    <bean id="distributedExecutorService" class="com.onlinetechvision.executor.srv.DistributedExecutorService">
        <property name="hazelcastDistributedExecutorService" ref="hazelcastDistributedExecutorService" />
    </bean>

    <bean id="hazelcast" class="com.hazelcast.core.Hazelcast"/>

    <bean id="starter" class="com.onlinetechvision.exe.Starter">
           <property name="hazelcastInstanceName" value="${hz.instance.name}" />
        <property name="hazelcast" ref="hazelcast" />
        <property name="distributedExecutorService" ref="distributedExecutorService" />
        <property name="cacheService" ref="cacheService" />
    </bean>
   
</beans>



On Friday, October 12, 2012 8:26:55 PM UTC+5:30, amon wrote:
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
Reply all
Reply to author
Forward
0 new messages