Announcement Announcement Module
Collapse
No announcement yet.
Spring AMQP 1.0.0 GA - Annoying and still missing XML elements declaration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring AMQP 1.0.0 GA - Annoying and still missing XML elements declaration

    Edit: Problem has been resolved

    Spring AMQP 1.0 GA has just been released. See http://www.springsource.org/node/3219

    I'm using Maven where my pom.xml has the following snippets:

    Code:
    <spring.amqp.version>1.0.0.RELEASE</spring.amqp.version>
    
    <dependency>
    	<groupId>org.springframework.amqp</groupId>
    	<artifactId>spring-rabbit</artifactId>
    	<version>${spring.amqp.version}</version>
    </dependency>

    After upgrading to 1.0.0 RELEASE, I get the following problem error 6 times:

    Code:
    cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'rabbit:admin'.
    This is my XML configuration:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" 
           	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           	xmlns:p="http://www.springframework.org/schema/p" 
           	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:rabbit="http://www.springframework.org/schema/rabbit"
           	xsi:schemaLocation="
    			http://www.springframework.org/schema/beans 
    			http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    			http://www.springframework.org/schema/context
    			http://www.springframework.org/schema/context/spring-context-3.1.xsd
    			http://www.springframework.org/schema/rabbit
    			http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd
    	   		">
    	<context:property-placeholder location="/WEB-INF/spring.properties" />
    	
    	<rabbit:queue id="chatQueue"/>
    	
    	<rabbit:fanout-exchange name="chatExchange">
    		<rabbit:bindings>
    			<rabbit:binding queue="chatQueue"/>
    		</rabbit:bindings>
    	</rabbit:fanout-exchange>
    
    ...
    </beans>
    In fact, this is based on the Chatting on the Cloud blog (http://blog.springsource.com/2011/08...e-cloud-part-1).

    To resolve the issue, I have to change the declaration to:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" 
           	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           	xmlns:p="http://www.springframework.org/schema/p" 
           	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:rabbit="http://www.springframework.org/schema/rabbit"
           	xsi:schemaLocation="
    			http://www.springframework.org/schema/beans 
    			http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    			http://www.springframework.org/schema/context
    			http://www.springframework.org/schema/context/spring-context-3.1.xsd
    			http://www.springframework.org/schema/rabbit
    			https://raw.github.com/SpringSource/spring-amqp/master/spring-rabbit/src/main/resources/org/springframework/amqp/rabbit/config/spring-rabbit-1.0.xsd
    	   		">
    	<context:property-placeholder location="/WEB-INF/spring.properties" />
    	
    	<rabbit:queue id="chatQueue"/>
    	
    	<rabbit:fanout-exchange name="chatExchange">
    		<rabbit:bindings>
    			<rabbit:binding queue="chatQueue"/>
    		</rabbit:bindings>
    	</rabbit:fanout-exchange>
    
    ...
    </beans>
    The part that I replaced is

    Code:
    http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd
    with

    Code:
    https://raw.github.com/SpringSource/spring-amqp/master/spring-rabbit/src/main/resources/org/springframework/amqp/rabbit/config/spring-rabbit-1.0.xsd
    This is a solution suggested in StackOverflow.com.

    But I was wondering why it has not been resolved in 1.0.0 GA?

    I'm using the latest STS Suite (I've downloaded updates today):

    Code:
    SpringSource Tool Suite 
    
    Version: 2.7.1.RELEASE
    Build Id: 201107091000
    
    Copyright (c) 2007 - 2011 SpringSource, a division of VMware, Inc.
    All rights reserved. Visit http://springsource.com/products/sts
    Last edited by skram; Aug 25th, 2011, 07:40 PM.

  • #2
    The schema takes a while for the server to rsync, so it's probably still in progress. But it shouldn't matter - your app should run fine, and if you have STS 2.7.1 you should only need to make sure that the project has Spring nature and the schema will be loaded from the classpath, and the editor will be happy too. The github hack should only be necessary for XML editors that do not know about the classpath (and it isn't necessary at all anyway now that we are released).

    Comment


    • #3
      Problem has been resolved

      Dave, I think you're right. I actually did nothing to make it work. I just took a 7 hour sleep and when I woke-up and run STS and use the standard schema declaration again:

      Code:
      http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd
      It suddenly worked without any IDE errors.

      Also, you're correct that regardless if there are errors in the XML editor, my app will still run fine. I apologize if I didn't mention that in my original post. I was just too annoyed with those red marks appearing (but functionally the app is well).

      Now, the red marks are gone. By the way I've just updated to the latest Spring Social 1.0.0.RC3.

      Comment

      Working...
      X