Announcement Announcement Module
Collapse
No announcement yet.
BeanDefinitionParsingException with M3 (ok with m1) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BeanDefinitionParsingException with M3 (ok with m1)

    Hi

    I'm trying to run example from blog:
    http://www.jroller.com/habuma/date/20080226

    I changed xml so activemq is started with application context:
    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:int="http://www.springframework.org/schema/integration"
    	xmlns:amq="http://activemq.org/config/1.0"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:broker="http://activemq.org/config/1.0"
    	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://activemq.org/config/1.0 
    	    http://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd">
    
    	<!--  lets create an embedded ActiveMQ Broker -->
    	<amq:broker useJmx="false" persistent="false">
    		<amq:transportConnectors>
    			<amq:transportConnector uri="tcp://localhost:0" />
    		</amq:transportConnectors>
    	</amq:broker>
    
    	<!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
    	<amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost" />
    
    	<int:channel id="inAndOutChannel" />
    
    	<int:jms-source channel="inAndOutChannel"
    		connection-factory="jmsFactory" destination="inQueue" />
    
    	<int:jms-target channel="inAndOutChannel"
    		connection-factory="jmsFactory" destination="outTopic" />
    
    	<bean id="inQueue"
    		class="org.apache.activemq.command.ActiveMQQueue">
    		<constructor-arg index="0" value="sample.queue" />
    	</bean>
    
    	<bean id="outTopic"
    		class="org.apache.activemq.command.ActiveMQTopic">
    		<constructor-arg index="0" value="sample.topic" />
    	</bean>
    	
    </beans>
    pom.xml
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    	<groupId>hr.srce.cp.sandbox.integration</groupId>
    	<artifactId>si</artifactId>
    	<version>1.0-SNAPSHOT</version>
    	<name>Spring Integration Test</name>
    	<packaging>jar</packaging>
    	<url>http://maven.apache.org/maven2</url>
    	<inceptionYear>2008</inceptionYear>
    	<distributionManagement>
    		<site>
    			...
    		</site>
    	</distributionManagement>
    	<build>
    		<plugins>
    			<plugin>
    				<artifactId>maven-site-plugin</artifactId>
    			</plugin>
    			<plugin>
    				<groupId>org.apache.maven.plugins</groupId>
    				<artifactId>maven-compiler-plugin</artifactId>
    				<configuration>
    					<source>1.6</source>
    					<target>1.6</target>
    				</configuration>
    			</plugin>
    		</plugins>
    	</build>
    	<dependencies>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring</artifactId>
    			<version>2.5.3</version>
    		</dependency>
    		<dependency>
    			<groupId>log4j</groupId>
    			<artifactId>log4j</artifactId>
    			<version>1.2.14</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.integration</groupId>
    			<artifactId>spring-integration-core</artifactId>
    			<version>1.0.0.M3</version>
    			<exclusions>
    				<exclusion>
    					<groupId>org.springframework</groupId>
    					<artifactId>spring-tx</artifactId>
    				</exclusion>
    				<exclusion>
    					<groupId>org.springframework</groupId>
    					<artifactId>spring-context</artifactId>
    				</exclusion>
    				<exclusion>
    					<groupId>org.springframework</groupId>
    					<artifactId>spring-aop</artifactId>
    				</exclusion>
    				<exclusion>
    					<groupId>org.springframework</groupId>
    					<artifactId>spring-jms</artifactId>
    				</exclusion>
    			</exclusions>
    		</dependency>
    		<dependency>
    			<groupId>commons-lang</groupId>
    			<artifactId>commons-lang</artifactId>
    			<version>2.3</version>
    		</dependency>
    		<dependency>
    			<groupId>org.apache.activemq</groupId>
    			<artifactId>activemq-core</artifactId>
    			<version>5.0.0</version>
    		</dependency>
    		<dependency>
    			<groupId>org.apache.xbean</groupId>
    			<artifactId>xbean-spring</artifactId>
    			<version>3.0</version>
    		</dependency>
    
    	</dependencies>
    
    	<scm>
    	...
    	</scm>
    
    	<repositories>
    		<repository>
    			<id>spring-milestone</id>
    			<name>Spring Portfolio Milestone Repository</name>
    			<url>
    				http://s3.amazonaws.com/maven.springframework.org/milestone
    			</url>
    		</repository>
    	</repositories>
    </project>
    When that application context is started it throws exception:
    Code:
    Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [jms-source]
    Offending resource: class path resource [my/domain/cp/sandbox/integration/sijms/jms.xml]
    	at org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:59)
    	at org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68)
    	at org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:55)
    	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.findParserForElement(NamespaceHandlerSupport.java:79)
    	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1253)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1243)
    	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.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
    	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:423)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    	at my.domain.cp.sandbox.integration.sijms.MainSiJms.runSpringIntegrationExample(MainSiJms.java:15)
    	at my.domain.cp.sandbox.integration.sijms.MainSiJms.main(MainSiJms.java:11)
    When spring-integration-1.0.0.m1 is used, everything works fine.

    Any ideas what's wrong?

    Regards,
    Denis Kranjcec

  • #2
    Denis,

    There are separate jars in M2 and M3 (whereas M1 was a single JAR). You need to make sure that you are including "spring-integration-adapters.jar" in the classpath. The parser for "jms-source" is in that JAR.

    Hope that helps.
    -Mark

    Comment


    • #3
      Thanks Mark,

      Adding
      Code:
      		<dependency>
      			<groupId>org.springframework.integration</groupId>
      			<artifactId>spring-integration-adapters</artifactId>
      			<version>1.0.0.M3</version>
      			<exclusions>
      				<exclusion>
      					<groupId>org.apache.commons</groupId>
      					<artifactId>commons-net</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.apache.oro</groupId>
      					<artifactId>oro</artifactId>
      				</exclusion>
      			</exclusions>			
      		</dependency>
      to pom.xml solved my "problem".

      Regards,
      Denis Kranjcec

      Comment


      • #4
        Denis,

        Glad to hear that resolved it. Note that we are working on a solution for the inconsistencies of the maven groupIds when compared with the (consistent) ivy naming that we are using in our internal repository. Adjusting pom.xml is the easiest solution - or else installing the JARs to a local repository. You can find a slightly more detailed explanation on this thread: http://forum.springframework.org/sho...68&postcount=4

        Regards,
        Mark

        Comment

        Working...
        X