Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: java.lang.ClassNotFoundException after upgrading to 2.0.0.RC2

  1. #1
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Default java.lang.ClassNotFoundException after upgrading to 2.0.0.RC2

    Hi,

    After upgrading to SI 2.0.0.RC2 I'm getting the following error:

    Code:
    Cannot create inner bean 'org.springframework.integration.xml.router.XPathSingleChannelRouter#9707d' of type [org.springframework.integration.xml.router.XPathSingleCh
    annelRouter] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanCla
    ssException: Cannot find class [org.springframework.integration.xml.router.XPathSingleChannelRouter] for bean with name
    'org.springframework.integration.xml.router.XPathSingleChannelRouter#9707d' defined in class path resource [applicationC
    ontext-integration.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.integration.xm
    l.router.XPathSingleChannelRouter
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueRes
    olver.java:281) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    It looks like XPathSingleChannelRouter class is missing. I would like to mention that I use the latest release of Spring Framework which is 3.0.5.RELEASE.

    Has anyone faced similar issue?
    What's the recommended version of Spring Framework to use together with
    SI 2.0.0.RC2.

    Any help is really appreciated.

    Regards,
    Krzysztof

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    Are you sure that you have the 2.0.0.RC2 version of the spring-integration-xml JAR? Can you double-check the classpath to verify that there are no earlier versions still present?

    Thanks,
    Mark

  3. #3
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Default

    Quote Originally Posted by Mark Fisher View Post
    Are you sure that you have the 2.0.0.RC2 version of the spring-integration-xml JAR? Can you double-check the classpath to verify that there are no earlier versions still present?

    Thanks,
    Mark
    I'm using maven and here is dependency definiton:

    Code:
    <dependency>
                            <groupId>org.springframework.integration</groupId>
    			<artifactId>spring-integration-xml</artifactId>
    			<version>${springintegration.version}</version>
    </dependency>
    
    
    ...
    
    <springintegration.version>2.0.0.RC2</springintegration.version>

    I did check the org.springframework.integration.xml.router package in the spring-integration-xml-2.0.0.RC2.xml file and there is only one class defined, the XPathRouter.

    Regards,
    Krzysztof

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    This class is gone, but are you configuring it yourself? No SI components are using it.

  5. #5
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Default

    Quote Originally Posted by oleg.zhurakousky View Post
    This class is gone, but are you configuring it yourself? No SI components are using it.
    Yes I configured it in order to get some value from XML bean base on XPath expression. I think it could be replaced by org.springframework.integration.xml.router.XPathRo uter which does same thing.
    Am I correct?

    Unfortunately one more class is missing: org.springframework.integration.channel.MapBasedCh annelResolver which I did configure by myself. Is there any class that could replace it?

    Please find the current configuration below:

    Code:
    <!-- i replaced this class -->
    <beans:bean class="org.springframework.integration.xml.router.XPathRouter">
    	<beans:constructor-arg value="/DOCUMENT/@DBLABEL" />
    	<beans:property name="channelResolver">
    <!-- need replace this one-->
    		<beans:bean class="org.springframework.integration.channel.MapBasedChannelResolver">
    			<beans:constructor-arg>
    				<beans:map>
    					<beans:entry key="A" value-ref="aDocument"/>
    					<beans:entry key="B" value-ref="bDocument"/>
    					<beans:entry key="C" value-ref="cDocument"/>
    					<beans:entry key="D" value-ref="dDocument"/>
    					<beans:entry key="E" value-ref="eDocument"/>
    				</beans:map>
    			</beans:constructor-arg>
    		</beans:bean>
    	</beans:property>
    </beans:bean>
    Thanks a lot.

    Regards,
    Krzysztof

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    MapBasedChannelResolver was removed as well. The whole router infrastructure was greatly simplified for 2.0.
    To address your use case you can do something like this:

    Code:
    <int-xml:xpath-router id="xpathRouterWithMappingMultiChannel" input-channel="multiChannelRouterChannel">
    		<int-xml:xpath-expression expression="/root/name"/>
    		<int-xml:mapping value="A" channel="aDocument"/>	
    		<int-xml:mapping value="B" channel="bDocument"/>	
    </int-xml:xpath-router>

  7. #7
    Join Date
    Jul 2009
    Location
    Charlotte, NC
    Posts
    131

    Default

    Hi Mark / Oleg

    I might be asking something which probably could have been answered before.
    Do we have release notes or some documentation, which details out what all has been changed, covering things like these (like removal of certain classes etc)?
    I know that there are lot of changes, but if we can have a unified place to go and check such things, that will help those alot who are planning to upgrade to 2.0 GA from 1.0.x in near future.

  8. #8
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    There is a new chapter in the docs called Dynamic Router Support which explains this use case in particular.
    And yes we'l be coming out with migration blog as soon as GA is out.

  9. #9
    Join Date
    Jul 2009
    Location
    Charlotte, NC
    Posts
    131

    Default

    Thanks, that would save a lot of time!
    Next and obvious question, when is GA coming

  10. #10
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Default

    Quote Originally Posted by oleg.zhurakousky View Post
    Code:
    <int-xml:xpath-router id="xpathRouterWithMappingMultiChannel" input-channel="multiChannelRouterChannel">
    		<int-xml:xpath-expression expression="/root/name"/>
    		<int-xml:mapping value="A" channel="aDocument"/>	
    		<int-xml:mapping value="B" channel="bDocument"/>	
    </int-xml:xpath-router>
    It works well. Thanks.

    Regards,
    Krzysztof

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •