7 Replies Latest reply on May 22, 2014 3:02 AM by ffang

    Error in installing Spring JDBC Bundle

    shiv.dixit

      Hi,

      I need to use camel-jdbc or camel-sql compoent hence I was trying to install spring-jdbc-3.1.3.RELEASE jar available as part of JBoss Fuse 6.0 distribution using following command:

      osgi:install -s mvn:org/springframework/spring-jdbc/3.1.3.RELEASE

       

      But I am getting following error. Any suggestion what is missing? Seems the jar archive has any issue but I am able to open it via WinZip and see its content.

       

      Thanks

      Shiv

      ========================================

      16:54:58,643 | INFO  | l Console Thread | Console                          | 15 - org.apache.karaf.shell.console - 2.3.0.redhat-60024 | Exception caught while executing command

      org.apache.karaf.shell.console.MultiException: Error installing bundles:

        Unable to install bundle mvn:org/springframework/spring-jdbc/3.1.3.RELEASE

        at org.apache.karaf.shell.console.MultiException.throwIf(MultiException.java:91)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:70)[47:org.apache.karaf.shell.osgi:2.3.0.redhat-60024]

        at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.karaf.shell.console.jline.Console.run(Console.java:176)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

        at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:61)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]

      Caused by: java.lang.Exception: Unable to install bundle mvn:org/springframework/spring-jdbc/3.1.3.RELEASE

        at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:45)[47:org.apache.karaf.shell.osgi:2.3.0.redhat-60024]

        ... 11 more

      Caused by: org.osgi.framework.BundleException: Unable to cache bundle: mvn:org/springframework/spring-jdbc/3.1.3.RELEASE

        at org.apache.felix.framework.Felix.installBundle(Felix.java:3051)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:43)[47:org.apache.karaf.shell.osgi:2.3.0.redhat-60024]

        ... 11 more

      Caused by: java.util.zip.ZipException: error in opening zip file

        at java.util.zip.ZipFile.open(Native Method)[:1.6.0_45]

        at java.util.zip.ZipFile.<init>(ZipFile.java:127)[:1.6.0_45]

        at java.util.zip.ZipFile.<init>(ZipFile.java:143)[:1.6.0_45]

        at org.apache.felix.framework.util.SecureAction.openZipFile(SecureAction.java:623)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.util.WeakZipFileFactory$WeakZipFile.<init>(WeakZipFileFactory.java:191)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.util.WeakZipFileFactory$WeakZipFile.<init>(WeakZipFileFactory.java:173)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.util.WeakZipFileFactory.create(WeakZipFileFactory.java:76)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:84)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:878)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        at org.apache.felix.framework.Felix.installBundle(Felix.java:3047)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

        ... 13 more

        • 1. Re: Error in installing Spring JDBC Bundle
          ffang

          Hi,

           

          You should use

           

          osgi:install -s mvn:org.springframework/spring-jdbc/3.1.3.RELEASE

          instead of

          osgi:install -s mvn:org/springframework/spring-jdbc/3.1.3.RELEASE

           

          Freeman

          1 of 1 people found this helpful
          • 2. Re: Error in installing Spring JDBC Bundle
            davsclaus

            There is a feature for it, which is better to use I think

             

            features:install spring-jdbc

             

            Then you install the correct spring jdbc that works with the already provided spring bundles in the container.

            1 of 1 people found this helpful
            • 3. Re: Error in installing Spring JDBC Bundle
              shiv.dixit

              Thanks Freeman & Claus.

               

              I ran the commands in following order and Spring JDBC is available now:

              * features:install spring-jdbc

              * osgi:install -s mvn:org.springframework/spring-jdbc/3.1.3.RELEASE

               

              Which files i should modify so that this is available in fuse start up? If adding org.springframework/spring-jdbc/3.1.3.RELEASE/spring-jdbc-3.1.3.RELEASE.jar=<N> in /etc/startup.properties is good enough?

               

              Thanks

              Shiv

              • 4. Re: Error in installing Spring JDBC Bundle
                davsclaus

                Add it to the featuresBoot of the file etc/org.apache.karaf.features.cfg

                • 5. Re: Error in installing Spring JDBC Bundle
                  ffang

                  Hi,

                   

                  The best way is edit

                  $JBOSS_HOME/etc/org.apache.karaf.features.cfg

                  add spring-jdbc to featuresBoot property.

                   

                  Freeman

                  • 6. Re: Error in installing Spring JDBC Bundle
                    shiv.dixit

                    Hi Claus,

                    I got small confusion w.r.t to your answer

                    "There is a feature for it, which is better to use I think

                    features:install spring-jdbc

                    Then you install the correct spring jdbc that works with the already provided spring bundles in the container."

                     

                    It means i need to run both the steps manually? 

                    * features:install spring-jdbc

                    * osgi:install -s mvn:org.springframework/spring-jdbc/3.1.3.RELEASE


                    In order to bring spring-jdbc at startup, adding spring-jdbc to $JBOSS_HOME/etc/org.apache.karaf.features.cfg is enough?


                    thanks

                    Shiv

                    • 7. Re: Error in installing Spring JDBC Bundle
                      ffang

                      Hi,

                       

                      Using

                      features:install spring-jdbc

                      is enough, this feature will install mvn:org.springframework/spring-jdbc/3.1.3.RELEASE


                      adding spring-jdbc to $JBOSS_HOME/etc/org.apache.karaf.features.cfg is enough


                      Freeman