9 Replies Latest reply on Dec 31, 2013 4:28 AM by Dinesh Kadam

    Can't install examples

    Vito Ingrassia Newbie

      I have installed Jboss Fuse version jboss-fuse-6.0.0.redhat-024.

      I have configured etc/org.ops4j.pax.url.mvn.cfg in order to point the maven settings.xml file and maven local repository.

      And, being behind a company proxy, I have enabled the flag org.ops4j.pax.url.mvn.proxySupport to true.

       

      org.ops4j.pax.url.mvn.settings=C:/VITO/Programmi/apache-maven-3.0.4/conf/settings.xml

      org.ops4j.pax.url.mvn.localRepository=C:/Documents and Settings/ingrassia/.m2/repository

      org.ops4j.pax.url.mvn.proxySupport=true

       

      I can compile and install examples with my local maven installation, the same I'd like to use in karaf.

      During compile maven downloads all the necessary dependencies (passing through the proxy).

      Then, from the same shell windows command, I run karaf and try to install the example (rest)

       

      osgi:install -s fab:mvn:org.jboss.fuse.examples/rest/6.0.0.redhat-024

       

      but fuse gets hanged in downloading some artifacts (although the artifact is available in the local maven repository!!).

       

      This is the beginning of the traces about this scenario:

       

      10:57:50,825 | DEBUG | l Console Thread | MavenResolverImpl                | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Resolving artifact: org.apache.servicemix.specs:specs:pom:1.9.0^M

      10:57:50,825 | DEBUG | l Console Thread | MavenResolverImpl                | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Resolved artifact: org.apache.servicemix.specs:specs:pom:1.9.0 on fusesource.ea (http://repo.fusesource.com/nexus/content/groups/ea, releases)^M

      [omissis]

      10:57:50,841 | DEBUG | l Console Thread | MavenResolverImpl                | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Resolving artifact: org.apache.servicemix:servicemix-pom:pom:5^M

      10:57:50,841 | DEBUG | l Console Thread | Aether                           | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Verifying availability of C:\Documents and Settings\ingrassia\.m2\repository\org\apache\servicemix\servicemix-pom\5\servicemix-pom-5.pom from [repos0 (http://repo1.maven.org/maven2, releases+snapshots), repos1 (http://repo.fusesource.com/nexus/content/repositories/releases, releases+snapshots), repos2 (http://repo.fusesource.com/nexus/content/groups/ea, releases+snapshots), repos3 (http://svn.apache.org/repos/asf/servicemix/m2-repo, releases+snapshots), repos4 (http://repository.springsource.com/maven/bundles/release, releases+snapshots), repos5 (http://repository.springsource.com/maven/bundles/external, releases+snapshots), repos6 (http://scala-tools.org/repo-releases, releases+snapshots), fusesource.m2 (http://repo.fusesource.com/nexus/content/repositories/releases, releases), fusesource.ea (http://repo.fusesource.com/nexus/content/groups/ea, releases), central (http://repo1.maven.org/maven2, releases), java.net.2 (http://download.java.net/maven/2, releases), servicemix (http://svn.apache.org/repos/asf/servicemix/m2-repo, releases+snapshots)]^M

      10:57:50,841 | DEBUG | l Console Thread | MavenResolverImpl                | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Artifact downloading: org.apache.servicemix:servicemix-pom:pom:5 on repos0 (http://repo1.maven.org/maven2, releases+snapshots)^M

      10:57:50,856 | DEBUG | l Console Thread | Aether                           | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Using connector WagonRepositoryConnector with priority 0 for http://repo1.maven.org/maven2^M

      10:57:55,366 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint started.^M

      10:57:55,366 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint done.^M

      10:58:09,395 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint started.^M

      10:58:09,395 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint done.^M

      10:58:11,954 | DEBUG | l Console Thread | MavenResolverImpl                | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Metadata downloaded: org.apache.servicemix:servicemix-pom:pom:5 on repos0 (http://repo1.maven.org/maven2, releases+snapshots)^M

      10:58:11,954 | DEBUG | l Console Thread | MavenResolverImpl                | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Artifact downloading: org.apache.servicemix:servicemix-pom:pom:5 on repos1 (http://repo.fusesource.com/nexus/content/repositories/releases, releases+snapshots)^M

      10:58:11,954 | DEBUG | l Console Thread | Aether                           | 71 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | Using connector WagonRepositoryConnector with priority 0 for http://repo.fusesource.com/nexus/content/repositories/releases^M

      10:58:14,404 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint started.^M

      10:58:14,404 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint done.^M

      10:58:19,413 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint started.^M

      10:58:19,413 | DEBUG | heckpoint Worker | MessageDatabase                  | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Checkpoint done.^M

      [omissis]

       

      at the end I get a connection timeout (after a few minuts!)

       

      Caused by: java.net.ConnectException: Connection timed out: connect^M

              at java.net.PlainSocketImpl.socketConnect(Native Method)[:1.6.0_33]^M

       

      and in the karaf  console

       

      JBossFuse:karaf@root> osgi:install -s fab:mvn:org.jboss.fuse.examples/rest/6.0.0.redhat-024

      Bundle IDs:

      Error executing command: Error installing bundles:

              Unable to install bundle fab:mvn:org.jboss.fuse.examples/rest/6.0.0.redhat-024

       

       

      This is my list of remote repository (I didn't change it, so it's the default)

       

      org.ops4j.pax.url.mvn.repositories= \

          http://repo1.maven.org/maven2@id=maven.central.repo, \

          http://repo.fusesource.com/nexus/content/repositories/releases@id=fusesource.release.repo, \

          http://repo.fusesource.com/nexus/content/groups/ea@id=fusesource.ea.repo, \

          http://svn.apache.org/repos/asf/servicemix/m2-repo@id=servicemix.repo, \

          http://repository.springsource.com/maven/bundles/release@id=springsource.release.repo, \

          http://repository.springsource.com/maven/bundles/external@id=springsource.external.repo, \

          http://scala-tools.org/repo-releases@id=scala.repo

       

       

      My question is: why karaf search for an artifact that is available in local repository and downloaded just before by maven during example installation?

      And, Is any remote repository missing in my configuration or can't Karaf manage proxy configuration?

       

      thanks

       

      Vito

        • 1. Re: Can't install examples
          Freeman(Yue) Fang Master

          Hi,

           

          Could you please post your settings.xml?

           

          Also, the space in the file path on windows might cause problems, could you please change your maven local repo path without any space in it

          to see if it helps?

           

          Freeman


          • 2. Re: Can't install examples
            Vito Ingrassia Newbie

            Hi Freeman,

             

            in settingx.xml I have only the proxy configuration

             

                  <proxy>

                     <active>true</active>

                     <protocol>http</protocol>

                     <host>iwcache.iwbank.it</host>

                     <port>8080</port>

                     <username>ingrassia</username>

                     <password>password</password>

                     <nonProxyHosts>localhost|172.26.16.136</nonProxyHosts>

                  </proxy>

             

            (for http and htpps)

             

            and the following profiles

             

            <profile>

                     <id>fusesource</id>

                     <repositories>

                        <repository>

                           <id>fusesource</id>

                           <url>http://repo.fusesource.com/nexus/content/groups/public/</url>

                           <snapshots>

                              <enabled>false</enabled>

                           </snapshots>

                           <releases>

                              <enabled>true</enabled>

                           </releases>

                        </repository>

                        <repository>

                           <id>fusesource.snapshot</id>

                           <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots/</url>

                           <snapshots>

                              <enabled>true</enabled>

                           </snapshots>

                           <releases>

                              <enabled>false</enabled>

                           </releases>

                        </repository>

                        <repository>

                           <id>apache-public</id>

                           <url>https://repository.apache.org/content/groups/public/</url>

                           <snapshots>

                              <enabled>true</enabled>

                           </snapshots>

                           <releases>

                              <enabled>true</enabled>

                           </releases>

                        </repository>

                     </repositories>

                  </profile>

               </profiles>

             

              <activeProfiles>

                <activeProfile>fusesource</activeProfile>

              </activeProfiles>


             

            I have thought to the spaces in the path but I have the same problem on a linux machine where path are these:

             

            org.ops4j.pax.url.mvn.localRepository=/private/home/appl/.m2/repository

            org.ops4j.pax.url.mvn.settings=/appl/iwbin/apache-maven-3.0.5/conf/settings.xml

             

            thanks a lot,

             

            Vito


            • 3. Re: Can't install examples
              Lalit Manchanda Newbie

              Hi,

               

              It seems that maven in fuse has problem working with proxy. I have similar settings vito and maven works perfectly fine from the command line and IDE. While I was having the problem I changed to the network which does not require the proxy. Without changing any settings I could install successfully.

               

              Regds

              Lalit

              • 4. Re: Can't install examples
                Freeman(Yue) Fang Master

                Hi,

                 

                It works from my testing/debuging.

                 

                Ensure you have specified org.ops4j.pax.url.mvn.settings(in etc/org.ops4j.pax.url.mvn.cfg) pointed to your maven settings.xml if it's not in the

                default folder(so that the proxy configuration in maven settings.xml could get picked up). Also ensure you don't have any system wide http.proxyHost|http.proxyPort|org.ops4j.pax.url.mvn.proxies properties

                which will override the one in maven settings.xml.

                 

                Freeman

                • 5. Re: Can't install examples
                  Lalit Manchanda Newbie

                  Hi Freeman,

                   

                  I tried it without  any settings done in etc/org.ops4j.pax.url.mvn.cfg. It should aceess ~m2/settings.xml

                   

                  Just to mention again My Maven 2.2.1 works fine with no sepcific settings and uses the settings in .m2/settings.xml, so do my FuseIDE.

                   

                  I am not aware of or not changed anything on http.proxyHost|http.proxyPort|org.ops4j.pax.url.mvn.proxies.

                   

                  Could there be some sort of cache for such settings within Jboss fuse, as I work from home too which does not require any proxy but office does.


                   

                  Regds

                  lalit


                  • 6. Re: Can't install examples
                    Freeman(Yue) Fang Master

                    Hi,

                     

                    In FUSE ESB, it will use pax-url-mvn to leverage maven to download artifacts, and configuration in

                    etc/org.ops4j.pax.url.mvn.cfg will kick in, so everything works in standalone maven may not works through pax-url-mvn in a OSGi container.

                     

                    Back to your original problem, does your proxy need username/password? If so, are you aware that any other bundle in your FUSE ESB set system

                    wide authenticator like
                    Authenticator.setDefault( new Authenticator() {

                    ...

                    }

                     

                    This may override the one set by pax-url-mvn which extract username/password from .m2/settings.xml.

                     

                    Freeman

                    • 7. Re: Can't install examples
                      Freeman(Yue) Fang Master

                      For a better track, the command like

                       

                      osgi:install -s fab:mvn:org.jboss.fuse.examples/rest/6.0.0.redhat-024


                      doesn't work behind a proxy is caused by fab ignore the proxy configuration in settings.xml, fab use different logic to download pom

                      and artifacts which doesn't leverage pax-url-mvn, so the configuration mentioned above works for pax-url-mvn doesn't work for fab.

                      Internal issue already get created to track it and next release will have this fix.

                       

                       

                      Freeman


                       

                      • 8. Re: Can't install examples
                        Lalit Manchanda Newbie

                        Thanks Freeman, this will help.

                        • 9. Re: Can't install examples
                          Dinesh Kadam Newbie

                          Hi,

                           

                          Is this fab proxy issue resolved in jboss-fuse-6.0.0.redhat-024?

                           

                          Thanks

                          Dinesh