Unresolved requirement: Import-Package: org.apache.commons.codec.language in bndtools/osgi









up vote
1
down vote

favorite












I'm currently working at a project where I need to transfer PDE style plugins to bnd style plugins.
I ran into the problem with external jars so I build up bundles for every jar and included them to the build path. For most of the jars this worked fine but I got one which don't behave as expected.



The org.apache.commons.codec.language. This package comes from the jar org.apache.commons.codec and it resolves fine (at least for bndtools) but when I run the bundle I get the following error:



! could not resolve the bundles: [test-0.0.0 org.osgi.framework.BundleException: Could not resolve module: test [1]
Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

]
! Failed to start bundle test-0.0.0, exception Could not resolve module: test [1]
Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

org.osgi.framework.BundleException: Could not resolve module: test [1]
Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

at org.eclipse.osgi.container.Module.start(Module.java:447)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:431)
at aQute.launcher.Launcher.startBundles(Launcher.java:519)
at aQute.launcher.Launcher.activate(Launcher.java:425)
at aQute.launcher.Launcher.run(Launcher.java:303)
at aQute.launcher.Launcher.main(Launcher.java:149)


In this github repo I extracted one that produces an error as a reference: https://github.com/MaPhil/osgi-externals-test



I googled quite a lot about this topic but the most answers seems to be around liferay or other specific libraries. I hope anyone of you can give me a hint.










share|improve this question

























    up vote
    1
    down vote

    favorite












    I'm currently working at a project where I need to transfer PDE style plugins to bnd style plugins.
    I ran into the problem with external jars so I build up bundles for every jar and included them to the build path. For most of the jars this worked fine but I got one which don't behave as expected.



    The org.apache.commons.codec.language. This package comes from the jar org.apache.commons.codec and it resolves fine (at least for bndtools) but when I run the bundle I get the following error:



    ! could not resolve the bundles: [test-0.0.0 org.osgi.framework.BundleException: Could not resolve module: test [1]
    Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

    ]
    ! Failed to start bundle test-0.0.0, exception Could not resolve module: test [1]
    Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

    org.osgi.framework.BundleException: Could not resolve module: test [1]
    Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

    at org.eclipse.osgi.container.Module.start(Module.java:447)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:431)
    at aQute.launcher.Launcher.startBundles(Launcher.java:519)
    at aQute.launcher.Launcher.activate(Launcher.java:425)
    at aQute.launcher.Launcher.run(Launcher.java:303)
    at aQute.launcher.Launcher.main(Launcher.java:149)


    In this github repo I extracted one that produces an error as a reference: https://github.com/MaPhil/osgi-externals-test



    I googled quite a lot about this topic but the most answers seems to be around liferay or other specific libraries. I hope anyone of you can give me a hint.










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm currently working at a project where I need to transfer PDE style plugins to bnd style plugins.
      I ran into the problem with external jars so I build up bundles for every jar and included them to the build path. For most of the jars this worked fine but I got one which don't behave as expected.



      The org.apache.commons.codec.language. This package comes from the jar org.apache.commons.codec and it resolves fine (at least for bndtools) but when I run the bundle I get the following error:



      ! could not resolve the bundles: [test-0.0.0 org.osgi.framework.BundleException: Could not resolve module: test [1]
      Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

      ]
      ! Failed to start bundle test-0.0.0, exception Could not resolve module: test [1]
      Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

      org.osgi.framework.BundleException: Could not resolve module: test [1]
      Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

      at org.eclipse.osgi.container.Module.start(Module.java:447)
      at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:431)
      at aQute.launcher.Launcher.startBundles(Launcher.java:519)
      at aQute.launcher.Launcher.activate(Launcher.java:425)
      at aQute.launcher.Launcher.run(Launcher.java:303)
      at aQute.launcher.Launcher.main(Launcher.java:149)


      In this github repo I extracted one that produces an error as a reference: https://github.com/MaPhil/osgi-externals-test



      I googled quite a lot about this topic but the most answers seems to be around liferay or other specific libraries. I hope anyone of you can give me a hint.










      share|improve this question













      I'm currently working at a project where I need to transfer PDE style plugins to bnd style plugins.
      I ran into the problem with external jars so I build up bundles for every jar and included them to the build path. For most of the jars this worked fine but I got one which don't behave as expected.



      The org.apache.commons.codec.language. This package comes from the jar org.apache.commons.codec and it resolves fine (at least for bndtools) but when I run the bundle I get the following error:



      ! could not resolve the bundles: [test-0.0.0 org.osgi.framework.BundleException: Could not resolve module: test [1]
      Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

      ]
      ! Failed to start bundle test-0.0.0, exception Could not resolve module: test [1]
      Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

      org.osgi.framework.BundleException: Could not resolve module: test [1]
      Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"

      at org.eclipse.osgi.container.Module.start(Module.java:447)
      at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:431)
      at aQute.launcher.Launcher.startBundles(Launcher.java:519)
      at aQute.launcher.Launcher.activate(Launcher.java:425)
      at aQute.launcher.Launcher.run(Launcher.java:303)
      at aQute.launcher.Launcher.main(Launcher.java:149)


      In this github repo I extracted one that produces an error as a reference: https://github.com/MaPhil/osgi-externals-test



      I googled quite a lot about this topic but the most answers seems to be around liferay or other specific libraries. I hope anyone of you can give me a hint.







      java osgi bnd bndtools






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 17:10









      Philipp Mainz

      225




      225






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Some good news to start with:




           Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"



          This indicates that your OSGi bundle has an import for org.apache.commons.codec.language, and the fact that it has a version range (1.9 up to but not including 2.0) is a good indication that your build path isn't completely messed up.



          Looking at your example workspace I see that you have a project which you're using to wrap the Apache Commons Codec library. I'm somewhat confused as to why you're doing this, as Apache Commons Codec is already natively available as an OSGi bundle. If you want to depend on it in your workspace you can simply add it to one of your existing repositories. For example in /cnf/central.maven you could add:



          commons-codec:commons-codec:1.9


          Which would reference the official release from Maven Central. You can then reference this bundle in your bnd file's build path using:



          -buildpath: org.apache.commons.codec


          To run your application you should really create a bndrun file which you can use to declare your requirements (in this case a requirement on your test project) and then use a Resolve operation (either a button in Bndtools or a Gradle task). This will take your list of -runrequirements and create a list of -runbundles. It will end up looking something like this:



          -runrequirements: osgi.identity;filter:='(osgi.identity=test)'

          -runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'

          -runbundles: test;version="[0.0.0,0.0.1)",
          org.apache.commons.codec;version="[1.9.0,1.9.1)"


          You can then run directly from that bndrun file. It will start the framework and deploy all of the runbundles for you. If you use Bndtools then it will even keep the deployed bundles in sync with your Eclipse Workspace so that you always have the latest code deployed.



          You can see some more information about how to do this sort of thing in the Bndtools documentation or related details in OSGi enRoute






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212839%2funresolved-requirement-import-package-org-apache-commons-codec-language-in-bnd%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            Some good news to start with:




             Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"



            This indicates that your OSGi bundle has an import for org.apache.commons.codec.language, and the fact that it has a version range (1.9 up to but not including 2.0) is a good indication that your build path isn't completely messed up.



            Looking at your example workspace I see that you have a project which you're using to wrap the Apache Commons Codec library. I'm somewhat confused as to why you're doing this, as Apache Commons Codec is already natively available as an OSGi bundle. If you want to depend on it in your workspace you can simply add it to one of your existing repositories. For example in /cnf/central.maven you could add:



            commons-codec:commons-codec:1.9


            Which would reference the official release from Maven Central. You can then reference this bundle in your bnd file's build path using:



            -buildpath: org.apache.commons.codec


            To run your application you should really create a bndrun file which you can use to declare your requirements (in this case a requirement on your test project) and then use a Resolve operation (either a button in Bndtools or a Gradle task). This will take your list of -runrequirements and create a list of -runbundles. It will end up looking something like this:



            -runrequirements: osgi.identity;filter:='(osgi.identity=test)'

            -runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'

            -runbundles: test;version="[0.0.0,0.0.1)",
            org.apache.commons.codec;version="[1.9.0,1.9.1)"


            You can then run directly from that bndrun file. It will start the framework and deploy all of the runbundles for you. If you use Bndtools then it will even keep the deployed bundles in sync with your Eclipse Workspace so that you always have the latest code deployed.



            You can see some more information about how to do this sort of thing in the Bndtools documentation or related details in OSGi enRoute






            share|improve this answer
























              up vote
              2
              down vote



              accepted










              Some good news to start with:




               Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"



              This indicates that your OSGi bundle has an import for org.apache.commons.codec.language, and the fact that it has a version range (1.9 up to but not including 2.0) is a good indication that your build path isn't completely messed up.



              Looking at your example workspace I see that you have a project which you're using to wrap the Apache Commons Codec library. I'm somewhat confused as to why you're doing this, as Apache Commons Codec is already natively available as an OSGi bundle. If you want to depend on it in your workspace you can simply add it to one of your existing repositories. For example in /cnf/central.maven you could add:



              commons-codec:commons-codec:1.9


              Which would reference the official release from Maven Central. You can then reference this bundle in your bnd file's build path using:



              -buildpath: org.apache.commons.codec


              To run your application you should really create a bndrun file which you can use to declare your requirements (in this case a requirement on your test project) and then use a Resolve operation (either a button in Bndtools or a Gradle task). This will take your list of -runrequirements and create a list of -runbundles. It will end up looking something like this:



              -runrequirements: osgi.identity;filter:='(osgi.identity=test)'

              -runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'

              -runbundles: test;version="[0.0.0,0.0.1)",
              org.apache.commons.codec;version="[1.9.0,1.9.1)"


              You can then run directly from that bndrun file. It will start the framework and deploy all of the runbundles for you. If you use Bndtools then it will even keep the deployed bundles in sync with your Eclipse Workspace so that you always have the latest code deployed.



              You can see some more information about how to do this sort of thing in the Bndtools documentation or related details in OSGi enRoute






              share|improve this answer






















                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                Some good news to start with:




                 Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"



                This indicates that your OSGi bundle has an import for org.apache.commons.codec.language, and the fact that it has a version range (1.9 up to but not including 2.0) is a good indication that your build path isn't completely messed up.



                Looking at your example workspace I see that you have a project which you're using to wrap the Apache Commons Codec library. I'm somewhat confused as to why you're doing this, as Apache Commons Codec is already natively available as an OSGi bundle. If you want to depend on it in your workspace you can simply add it to one of your existing repositories. For example in /cnf/central.maven you could add:



                commons-codec:commons-codec:1.9


                Which would reference the official release from Maven Central. You can then reference this bundle in your bnd file's build path using:



                -buildpath: org.apache.commons.codec


                To run your application you should really create a bndrun file which you can use to declare your requirements (in this case a requirement on your test project) and then use a Resolve operation (either a button in Bndtools or a Gradle task). This will take your list of -runrequirements and create a list of -runbundles. It will end up looking something like this:



                -runrequirements: osgi.identity;filter:='(osgi.identity=test)'

                -runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'

                -runbundles: test;version="[0.0.0,0.0.1)",
                org.apache.commons.codec;version="[1.9.0,1.9.1)"


                You can then run directly from that bndrun file. It will start the framework and deploy all of the runbundles for you. If you use Bndtools then it will even keep the deployed bundles in sync with your Eclipse Workspace so that you always have the latest code deployed.



                You can see some more information about how to do this sort of thing in the Bndtools documentation or related details in OSGi enRoute






                share|improve this answer












                Some good news to start with:




                 Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"



                This indicates that your OSGi bundle has an import for org.apache.commons.codec.language, and the fact that it has a version range (1.9 up to but not including 2.0) is a good indication that your build path isn't completely messed up.



                Looking at your example workspace I see that you have a project which you're using to wrap the Apache Commons Codec library. I'm somewhat confused as to why you're doing this, as Apache Commons Codec is already natively available as an OSGi bundle. If you want to depend on it in your workspace you can simply add it to one of your existing repositories. For example in /cnf/central.maven you could add:



                commons-codec:commons-codec:1.9


                Which would reference the official release from Maven Central. You can then reference this bundle in your bnd file's build path using:



                -buildpath: org.apache.commons.codec


                To run your application you should really create a bndrun file which you can use to declare your requirements (in this case a requirement on your test project) and then use a Resolve operation (either a button in Bndtools or a Gradle task). This will take your list of -runrequirements and create a list of -runbundles. It will end up looking something like this:



                -runrequirements: osgi.identity;filter:='(osgi.identity=test)'

                -runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'

                -runbundles: test;version="[0.0.0,0.0.1)",
                org.apache.commons.codec;version="[1.9.0,1.9.1)"


                You can then run directly from that bndrun file. It will start the framework and deploy all of the runbundles for you. If you use Bndtools then it will even keep the deployed bundles in sync with your Eclipse Workspace so that you always have the latest code deployed.



                You can see some more information about how to do this sort of thing in the Bndtools documentation or related details in OSGi enRoute







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 8 at 17:54









                Tim Ward

                87458




                87458



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212839%2funresolved-requirement-import-package-org-apache-commons-codec-language-in-bnd%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

                    Edmonton

                    Crossroads (UK TV series)