Announcement Announcement Module
Collapse
No announcement yet.
Exception when running example demo main methods in eclipse Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception when running example demo main methods in eclipse

    Hi,

    I've checked out SI from SVN and have imported samples/ into eclipse as a maven project. When I run the demo main methods I get the following exception for most of the examples.

    Code:
    25-Jan-2009 14:36:29 org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@137c60d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@137c60d]; startup date [Sun Jan 25 14:36:29 GMT 2009]; root of context hierarchy
    25-Jan-2009 14:36:29 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [errorHandlingDemo.xml]
    Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration/stream]
    Offending resource: class path resource [errorHandlingDemo.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:281)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:109)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158)
    	at org.springframework.integration.samples.errorhandling.PartyDemo.main(PartyDemo.java:28)
    The xml file that the exception is referring to above is presented below.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/integration"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:stream="http://www.springframework.org/schema/integration/stream"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    			http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    			http://www.springframework.org/schema/context
    			http://www.springframework.org/schema/context/spring-context-2.5.xsd
    			http://www.springframework.org/schema/integration
    			http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
    			http://www.springframework.org/schema/integration/stream
    			http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd">
    
    	<context:component-scan base-package="org.springframework.integration.samples.errorhandling" />
    
    	<poller default="true" max-messages-per-poll="1">
    		<interval-trigger interval="1000" />
    	</poller>
    
    	<inbound-channel-adapter ref="partyHost" method="nextInvitation" channel="invitations" />
    
    	<channel id="invitations">
    		<queue capacity="100" />
    	</channel>
    
    	<chain input-channel="invitations">
    		<header-enricher error-channel="failed-invitations" />
    		<service-activator ref="partyGuest" method="onInvitation" />
    	</chain>
    
    	<channel id="failed-invitations" />
    
    	<chain input-channel="failed-invitations">
    		<transformer ref="errorUnwrapper" />
    		<service-activator ref="partyHost" method="onInvitationFailed" />
    	</chain>
    
    	<stream:stderr-channel-adapter channel="errorChannel" append-newline="true" />
    
    </beans:beans>
    Any idea how I can resolve this? The xsd url for the stream namespace seems to resolve to the xsd.

    Many thanks.
    Last edited by Narada; Jan 25th, 2009, 01:54 PM.

  • #2
    I've also noticed that this only happens with those examples where the xml file contains the use of the stream namespace. It doesn't happen with other namespaces.

    Comment


    • #3
      Spring Plugin for Eclipse

      Are you including the org.springframework.integration.stream-1.x.x-RELEASE.jar file in you build? Also, I'm not sure if it's related, but when I began using the Spring Plugin for Eclipse, my problem went away.

      Comment


      • #4
        This is a familiar problem. I don't have the issue number at hand, but if you search the forums a bit you will find a bug relating to this I think. Post back here if you can't find it and I'll have a look.

        Comment


        • #5
          I haven't reproduced it, but I think if you set the XML catalog it should go away. Installing SpringSource Toolsuite or Spring IDE will do the same.

          Comment


          • #6
            include spring stream dependency

            Originally posted by Narada View Post
            Hi,

            I've checked out SI from SVN and have imported samples/ into eclipse as a maven project. When I run the demo main methods I get the following exception for most of the examples.

            Code:
            25-Jan-2009 14:36:29 org.springframework.context.support.AbstractApplicationContext prepareRefresh
            INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@137c60d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@137c60d]; startup date [Sun Jan 25 14:36:29 GMT 2009]; root of context hierarchy
            25-Jan-2009 14:36:29 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
            INFO: Loading XML bean definitions from class path resource [errorHandlingDemo.xml]
            Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration/stream]
            Offending resource: class path resource [errorHandlingDemo.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:281)
            	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
            	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
            	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
            	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
            	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
            	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
            	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
            	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
            	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
            	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:109)
            	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
            	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
            	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
            	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
            	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197)
            	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172)
            	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158)
            	at org.springframework.integration.samples.errorhandling.PartyDemo.main(PartyDemo.java:28)
            The xml file that the exception is referring to above is presented below.

            Code:
            <?xml version="1.0" encoding="UTF-8"?>
            <beans:beans xmlns="http://www.springframework.org/schema/integration"
            	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
            	xmlns:context="http://www.springframework.org/schema/context"
            	xmlns:stream="http://www.springframework.org/schema/integration/stream"
            	xsi:schemaLocation="http://www.springframework.org/schema/beans
            			http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
            			http://www.springframework.org/schema/context
            			http://www.springframework.org/schema/context/spring-context-2.5.xsd
            			http://www.springframework.org/schema/integration
            			http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
            			http://www.springframework.org/schema/integration/stream
            			http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd">
            
            	<context:component-scan base-package="org.springframework.integration.samples.errorhandling" />
            
            	<poller default="true" max-messages-per-poll="1">
            		<interval-trigger interval="1000" />
            	</poller>
            
            	<inbound-channel-adapter ref="partyHost" method="nextInvitation" channel="invitations" />
            
            	<channel id="invitations">
            		<queue capacity="100" />
            	</channel>
            
            	<chain input-channel="invitations">
            		<header-enricher error-channel="failed-invitations" />
            		<service-activator ref="partyGuest" method="onInvitation" />
            	</chain>
            
            	<channel id="failed-invitations" />
            
            	<chain input-channel="failed-invitations">
            		<transformer ref="errorUnwrapper" />
            		<service-activator ref="partyHost" method="onInvitationFailed" />
            	</chain>
            
            	<stream:stderr-channel-adapter channel="errorChannel" append-newline="true" />
            
            </beans:beans>
            Any idea how I can resolve this? The xsd url for the stream namespace seems to resolve to the xsd.

            Many thanks.


            in the maven pom.xml if we have the following dependency

            <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-core</artifactId>
            <version>2.1.0.RELEASE</version>
            </dependency>


            replace it with the below


            <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-stream</artifactId>
            <version>2.1.0.RELEASE</version>
            </dependency>

            then for your project steam along with core will be available, and it will fine

            Comment


            • #7
              Also, 2.1.3 is the latest release

              Comment

              Working...
              X