Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The matching wildcard is strict, but no declaration can be found for element 'hz:hazelcast' #9406

Closed
mohan595 opened this issue Dec 8, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@mohan595
Copy link

commented Dec 8, 2016

I am using the hazelcast for the first time and trying to set up Hazelcast spring config in our application.
I am getting the following error message when loading the context

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://hazelcast.com/schema/spring/hazelcast-spring-3.7.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema.

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'hz:hazelcast'.

My Spring config schema definition is

<hz:hazelcast id="cacheInstance">
    <hz:config>
        <hz:group name="${name}" password="${password}"/>
        <hz:properties>
            <hz:property name="hazelcast.merge.first.run.delay.seconds">5</hz:property>
            <hz:property name="hazelcast.merge.next.run.delay.seconds">5</hz:property>
        </hz:properties>
        <hz:network port="${defaultPort}" port-auto-increment="true">
            <hz:join>
                <hz:multicast enabled="true" multicast-group="224.2.2.3" multicast-port="54327" />
              <!--   <hz:tcp-ip enabled="false"> <hz:members>10.10.1.2, 10.10.1.3</hz:members> </hz:tcp-ip> -->
            </hz:join>
        </hz:network>
    </hz:config>
</hz:hazelcast>

I tried different versions of the schema like 3.1, 3.6, 3.7, 3.8 and got the same error message.

Can someone please help use with this issue.

@mohan595

This comment has been minimized.

Copy link
Author

commented Dec 8, 2016

Here is the schema details

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"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation=
               "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
				http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
              	http://www.hazelcast.com/schema/spring http://hazelcast.com/schema/spring/hazelcast-spring-3.7.xsd"

@jerrinot jerrinot added this to the 3.8 milestone Dec 8, 2016

@mohan595

This comment has been minimized.

Copy link
Author

commented Dec 12, 2016

Can you please let us know if some one is looking into this issue.

@mesutcelik

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2016

Are you using hazelcast-all.jar file in your classpath?

@mohan595

This comment has been minimized.

Copy link
Author

commented Dec 12, 2016

No,

I am using

hazelcast-3.6.0.jar,
hazelcast-client-3.6.0.jar,
hazelcast-spring-3.6.0.jar

@mesutcelik

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2016

I think that is normal if you tried those jars with 3.7 xsd. Can you please try to set xsd to 3.6? From your previous comment, i see that you already tried so you can also use versionless version of the spring definition.

Here is a code sample you can use as well.Can you please send us the output of following command executed under spring-configuration folder?

mvn exec:java -Dexec.mainClass="com.hazelcast.springconfiguration.HazelcastDataTypes"

@mohan595

This comment has been minimized.

Copy link
Author

commented Dec 12, 2016

Thanks for the quick response, appreciate your help with this.

I tried with 3.6 xsd still i got the same exception.
But i tried schema from the the same code that you provided, it seems to work fine now.
Can you let me know what version is this generic one points to..

@mesutcelik

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2016

generic does always refer to the version of the hazelcast version you are using.

see below what is used in hazelcast-spring-3.7.4.jar
https://github.com/hazelcast/hazelcast/blob/v3.7.4/hazelcast-spring/src/main/resources/META-INF/spring.schemas#L18

@mesutcelik

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2016

I see it is working fine for you so I am closing this issue. please feel free to reopen if you see similar problem...

@mesutcelik mesutcelik closed this Dec 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.