Announcement Announcement Module
Collapse
No announcement yet.
Spring Integration & S2AP Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Integration & S2AP

    Has anyone tried using Spring Integration as part of a bundle in S2AP?

    I placed the core and adapter jars into the bundles\usr directory of S2AP.
    I created a bundle project and my manifest has the following:

    Code:
    Import-Library: org.springframework.spring;version="2.5.4"
    Import-Bundle:org.springframework.osgi.core,com.springsource.org.apache.juli.extras,spring-integration-core,spring-integration-adapters
    When I deploy, I get the following error

    Cannot import a package more than once "org.springframework.integration.adapter"

    Craig

  • #2
    A little follow up. I moved away from the Import Bundle and just used Import-Packages. The problem seems to be in that the org.springframework.integration.adapter package exists in both the core and adapter jars.

    So my bundle with the following context seems to start fine in S2AP.

    Code:
    <message-bus error-channel="errorChannel"/>		
    <channel id="errorChannel" publish-subscribe="true" capacity="500"/>	
    <channel id="exampleChannel" capacity="100"/>	
    <endpoint input-channel="exampleChannel" handler-ref="exampleHandler"/>
    However, when I add the following

    Code:
    <file-source directory="C:/files/in" channel="exampleChannel" poll-period="5000"/>
    I get this error now:

    Configuration problem: Cannot locate BeanDefinitionParser for element [file-source]

    I run this stuff in a test case (non-OSGI) and it all works. So, is the same package in multiple bundles the root of my problem?


    Craig

    Comment


    • #3
      Craig,

      Thanks for pointing that out. The "org.springframework.integration.adapter" package will not be in the core package for the M4 release.

      I created this issue in JIRA: http://jira.springframework.org/browse/INT-215

      Thanks,
      Mark

      Comment


      • #4
        Spring Integration &amp; S2AP

        I have now tried getting a bundle deployed using M4 with S2AP beta4.

        I have found that I needed to make some changes to the manifest files (listed below), but afterword I still have the same problem as posted before.

        Configuration problem: Cannot locate BeanDefinitionParser for element [file-source]
        The problem is that the class loader does not allow the core bundle access to the parsers file from the adapters bundle.

        IntegrationNamespaceHandler : line 90
        Code:
        Properties mappings = 
        PropertiesLoaderUtils.loadAllProperties(ADAPTER_PARSER_MAPPINGS_LOCATION, classLoader);
        Thoughts?

        CS

        Manifest Changes made to M4
        • I removed three packages from Import-Package in integration-core. These are provided by this bundle, so there should be no need to import them.
          • org.springframework.integration.channel.config
          • org.springframework.integration.gateway.config
          • org.springframework.integration.router.config
        • I removed the config packages from Import-Package in integration-adapter for the same reason the I removed the previous mentioned entries.
          • org.springframework.integration.adapter.file.confi g
          • org.springframework.integration.adapter.ftp.config
          • org.springframework.integration.adapter.httpinvoke r.config
          • org.springframework.integration.adapter.jms.config
          • org.springframework.integration.adapter.mail.confi g
          • org.springframework.integration.adapter.rmi.config
          • org.springframework.integration.adapter.stream.con fig
        • I updated the versions of the of the imported integration-core packages in the integration-adapter bundle to be (1.0.0, 2.0.0]. This allows all the M releases and future RC releases to be resolved.
        • I think the config namespaces in the adapter bundle will need to be exported, but I haven't gotten far enough to confirm.

        Comment


        • #5
          Thanks very much for this feedback Craig. We're considering using separate namespaces (for "core", "adapter", etc) rather than attempting to unify across modules that way. You should be able to make that change relatively easily by removing the problematic line from IntegrationNamespaceHandler and then using the "spring-integration-adapters-1.0.xsd" and "spring-integration-core-1.0.xsd" namespaces explicitly in your XML.

          -Mark

          Comment


          • #6
            Hi Mark,
            I believe I'm having the same issue "Cannot locate BeanDefinitionParser for element" reported by Craig.

            Can you please provide more details on the workaround for this issue?

            I'm using spring-integration 1.0-M6 running within Spring dm Server springsource-dm-server-1.0.0.RC2.
            Here is the debug output I see when I try to deploy my bundle with spring-integration as dependency. Note the highlighted line showing that the parsers in the META-INF/spring-integration.parsers file are not being used.

            Code:
            [2008-09-14 00:37:03.556] server-dm-3              pringframework.beans.factory.xml.PluggableSchemaResolver.unknown D Found XML schema [http://www.springframework.org/schema/beans/spring-beans.xsd] in classpath: org/springfr
            amework/beans/factory/xml/spring-beans-2.5.xsd
            [2008-09-14 00:37:03.556] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D XML schema for null|http://www.springframework.org/schema/beans/spring-beans.xsd found inside Spring Beans
             (org.springframework.beans)
            [2008-09-14 00:37:03.567] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving entity for null|http://www.springframework.org/schema/osgi/spring-osgi.xsd
            [2008-09-14 00:37:03.567] server-dm-3              pringframework.beans.factory.xml.PluggableSchemaResolver.unknown D Found XML schema [http://www.springframework.org/schema/osgi/spring-osgi.xsd] in classpath: org/springfram
            ework/osgi/config/spring-osgi-1.1.xsd
            [2008-09-14 00:37:03.567] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D XML schema for null|http://www.springframework.org/schema/osgi/spring-osgi.xsd found inside Spring DM Core
             (org.springframework.osgi.core)
            [2008-09-14 00:37:03.572] server-dm-3              rk.beans.factory.xml.DefaultBeanDefinitionDocumentReader.unknown D Loading bean definitions
            [2008-09-14 00:37:03.572] server-dm-3              mework.beans.factory.xml.DefaultNamespaceHandlerResolver.unknown D Loaded mappings [{}]
            [2008-09-14 00:37:03.573] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving namespace handler for http://www.springframework.org/schema/osgi
            [2008-09-14 00:37:03.573] server-dm-3              mework.beans.factory.xml.DefaultNamespaceHandlerResolver.unknown D Loaded mappings [{http://www.springframework.org/schema/integration=org.springframework.integration.config
            .IntegrationNamespaceHandler}]
            [2008-09-14 00:37:03.573] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Namespace handler for http://www.springframework.org/schema/osgi found inside Spring DM Core (org.springfr
            amework.osgi.core)
            [2008-09-14 00:37:03.574] server-dm-3              pringframework.beans.factory.xml.XmlBeanDefinitionReader.unknown I Loading XML bean definitions from URL [bundleentry://76/META-INF/spring/bundle-context.xml]
            [2008-09-14 00:37:03.574] server-dm-3              .springframework.beans.factory.xml.DefaultDocumentLoader.unknown D Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
            [2008-09-14 00:37:03.575] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving entity for null|http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
            [2008-09-14 00:37:03.576] server-dm-3              pringframework.beans.factory.xml.PluggableSchemaResolver.unknown D Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in classpath: org/spri
            ngframework/beans/factory/xml/spring-beans-2.5.xsd
            [2008-09-14 00:37:03.576] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D XML schema for null|http://www.springframework.org/schema/beans/spring-beans-2.5.xsd found inside Spring B
            eans (org.springframework.beans)
            [2008-09-14 00:37:03.584] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving entity for null|http://www.springframework.org/schema/integration/spring-integration-1
            .0.xsd
            [2008-09-14 00:37:03.584] server-dm-3              pringframework.beans.factory.xml.PluggableSchemaResolver.unknown D Found XML schema [http://www.springframework.org/schema/integration/spring-integration-1.0.xsd] in classpa
            th: org/springframework/integration/adapter/config/spring-integration-1.0.xsd
            [2008-09-14 00:37:03.584] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D XML schema for null|http://www.springframework.org/schema/integration/spring-integration-1.0.xsd found ins
            
            ide Spring Integration Adapters (org.springframework.integration.adapter)
            [2008-09-14 00:37:03.585] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving entity for null|http://www.springframework.org/schema/integration/spring-integration-c
            ore-1.0.xsd
            [2008-09-14 00:37:03.585] server-dm-3              pringframework.beans.factory.xml.PluggableSchemaResolver.unknown D Found XML schema [http://www.springframework.org/schema/integration/spring-integration-core-1.0.xsd] in cl
            asspath: org/springframework/integration/config/spring-integration-core-1.0.xsd
            [2008-09-14 00:37:03.586] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D XML schema for null|http://www.springframework.org/schema/integration/spring-integration-core-1.0.xsd foun
            d inside Spring Integration Core (org.springframework.integration)
            [2008-09-14 00:37:03.588] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving entity for null|http://www.springframework.org/schema/integration/spring-integration-a
            dapters-1.0.xsd
            [2008-09-14 00:37:03.588] server-dm-3              pringframework.beans.factory.xml.PluggableSchemaResolver.unknown D Found XML schema [http://www.springframework.org/schema/integration/spring-integration-adapters-1.0.xsd] i
            n classpath: org/springframework/integration/adapter/config/spring-integration-adapters-1.0.xsd
            [2008-09-14 00:37:03.588] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D XML schema for null|http://www.springframework.org/schema/integration/spring-integration-adapters-1.0.xsd 
            found inside Spring Integration Adapters (org.springframework.integration.adapter)
            [2008-09-14 00:37:03.596] server-dm-3              rk.beans.factory.xml.DefaultBeanDefinitionDocumentReader.unknown D Loading bean definitions
            [2008-09-14 00:37:03.596] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving namespace handler for http://www.springframework.org/schema/integration
            [2008-09-14 00:37:03.618] server-dm-3              framework.integration.config.IntegrationNamespaceHandler.unknown D Loaded parser mappings [{}]
            [2008-09-14 00:37:03.618] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Namespace handler for http://www.springframework.org/schema/integration found inside Spring Integration Co
            re (org.springframework.integration)
            [2008-09-14 00:37:03.622] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving namespace handler for http://www.springframework.org/schema/integration
            [2008-09-14 00:37:03.622] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Namespace handler for http://www.springframework.org/schema/integration found inside Spring Integration Co
            re (org.springframework.integration)
            [2008-09-14 00:37:03.625] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving namespace handler for http://www.springframework.org/schema/integration
            [2008-09-14 00:37:03.625] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Namespace handler for http://www.springframework.org/schema/integration found inside Spring Integration Co
            re (org.springframework.integration)
            [2008-09-14 00:37:03.625] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving namespace handler for http://www.springframework.org/schema/integration
            [2008-09-14 00:37:03.625] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Namespace handler for http://www.springframework.org/schema/integration found inside Spring Integration Co
            re (org.springframework.integration)
            [2008-09-14 00:37:03.626] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Trying to resolving namespace handler for http://www.springframework.org/schema/integration
            [2008-09-14 00:37:03.627] server-dm-3              ramework.osgi.extender.internal.support.NamespacePlugins.unknown D Namespace handler for http://www.springframework.org/schema/integration found inside Spring Integration Co
            re (org.springframework.integration)
            [2008-09-14 00:37:03.627] server-dm-3              .app.spring.GenericModuleOsgiBundleXmlApplicationContext.unknown E Pre refresh error
            org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [jms-target]
            Offending resource: URL [bundleentry://76/META-INF/spring/bundle-context.xml]
                    at org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:59)
                    at org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68)
                    at

            Thanks,
            -Roberto

            Comment


            • #7
              Probably related to this Jira issue

              I had a similar problem with not locating bean parsers. See the INT-372 Jira issue, which has apparently been fixed in the upcoming version.

              Comment

              Working...
              X