`
can_do
  • 浏览: 263323 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Karaf下通过HttpClient下载Maven资源,提示连接超时。

阅读更多
【日志】
****************************
org.osgi.jmx.framework.FrameworkMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@59530fe3 with name osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework,uuid=f1ea2aaa-5ff1-4df3-8b5a-4aa2b7f85569
INFO  | JMX OSGi Agent   | core                             | 74 - org.apache.aries.jmx.core - 1.1.1 | Registering org.osgi.jmx.framework.ServiceStateMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@59530fe3 with name osgi.core:type=serviceState,version=1.7,framework=org.apache.felix.framework,uuid=f1ea2aaa-5ff1-4df3-8b5a-4aa2b7f85569
INFO  | Local user karaf | FeaturesServiceImpl              | 24 - org.apache.karaf.features.core - 3.0.1 | Installing feature webconsole 3.0.1
INFO  | Local user karaf | FeaturesServiceImpl              | 24 - org.apache.karaf.features.core - 3.0.1 | Installing feature http 3.0.1
INFO  | Local user karaf | FeaturesServiceImpl              | 24 - org.apache.karaf.features.core - 3.0.1 | Installing feature pax-http 3.1.0
INFO  | Local user karaf | FeaturesServiceImpl              | 24 - org.apache.karaf.features.core - 3.0.1 | Installing feature pax-jetty 8.1.14.v20131031
WARN  | Local user karaf | AetherBasedResolver              | 5 - org.ops4j.pax.url.mvn - 1.6.0 | Error resolving artifactorg.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0:Could not transfer artifact org.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0 from/to central (http://repo1.maven.org/maven2/): Error transferring file: 连接超时
org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0 from/to central (http://repo1.maven.org/maven2/): Error transferring file: 连接超时
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
    at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:250)
    at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolveFile(AetherBasedResolver.java:239)
    at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:223)
    at org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:122)
    at java.net.URL.openStream(URL.java:1037)[:1.7.0_45]
    at org.apache.karaf.features.internal.BundleManager.getInputStreamForBundle(BundleManager.java:173)
    at org.apache.karaf.features.internal.BundleManager.doInstallBundleIfNeeded(BundleManager.java:92)
    at org.apache.karaf.features.internal.BundleManager.installBundleIfNeeded(BundleManager.java:86)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:529)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatureDependency(FeaturesServiceImpl.java:585)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:520)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatureDependency(FeaturesServiceImpl.java:585)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:520)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatureDependency(FeaturesServiceImpl.java:585)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:520)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:393)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:373)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:362)
    at Proxy074d8ce6_e134_49ec_a9f4_db3e4e5c3697.installFeature(Unknown Source)
    at org.apache.karaf.features.command.InstallFeatureCommand.doExecute(InstallFeatureCommand.java:67)
    at org.apache.karaf.features.command.FeaturesCommandSupport.doExecute(FeaturesCommandSupport.java:38)
    at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
    at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)
    at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_45]
    at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_45]
    at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
    at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
    at org.apache.karaf.shell.console.commands.$BlueprintCommand1410716997.execute(Unknown Source)[37:org.apache.karaf.shell.console:3.0.1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_45]
    at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_45]
    at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
    at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
    at org.apache.karaf.shell.console.commands.$BlueprintCommand1410716997.execute(Unknown Source)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
    at org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:521)
    at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:212)
    at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
    at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:126)[37:org.apache.karaf.shell.console:3.0.1]
    at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:117)
    at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_45]
    at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[38:org.apache.karaf.jaas.modules:3.0.1]
    at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:115)[37:org.apache.karaf.shell.console:3.0.1]
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0 from/to central (http://repo1.maven.org/maven2/): Error transferring file: 连接超时
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)[5:org.ops4j.pax.url.mvn:1.6.0]
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)[5:org.ops4j.pax.url.mvn:1.6.0]
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)[5:org.ops4j.pax.url.mvn:1.6.0]
    at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)[5:org.ops4j.pax.url.mvn:1.6.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_45]
    at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file: 连接超时
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:143)[5:org.ops4j.pax.url.mvn:1.6.0]
    at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)[5:org.ops4j.pax.url.mvn:1.6.0]
    at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)[5:org.ops4j.pax.url.mvn:1.6.0]
    at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)[5:org.ops4j.pax.url.mvn:1.6.0]
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:601)[5:org.ops4j.pax.url.mvn:1.6.0]
    ... 4 more
Caused by: java.net.ConnectException: 连接超时
    at java.net.PlainSocketImpl.socketConnect(Native Method)[:1.7.0_45]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)[:1.7.0_45]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)[:1.7.0_45]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)[:1.7.0_45]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[:1.7.0_45]
    at java.net.Socket.connect(Socket.java:579)[:1.7.0_45]
    at java.net.Socket.connect(Socket.java:528)[:1.7.0_45]
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)[:1.7.0_45]
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)[:1.7.0_45]
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)[:1.7.0_45]
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)[:1.7.0_45]
    at sun.net.www.http.HttpClient.New(HttpClient.java:308)[:1.7.0_45]
    at sun.net.www.http.HttpClient.New(HttpClient.java:326)[:1.7.0_45]
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)[:1.7.0_45]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)[:1.7.0_45]
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)[:1.7.0_45]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300)[:1.7.0_45]
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)[:1.7.0_45]
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115)[5:org.ops4j.pax.url.mvn:1.6.0]
    ... 8 more
2014-07-29 15:01:29,514 | ERROR | Local user karaf | ShellUtil                        | 37 - org.apache.karaf.shell.console - 3.0.1 | Exception caught while executing command
**************************************
【分析】
从maven库下载资源文件时,提示连接被拒绝。
【解决】
实际是maven没有开启使用http代理的功能。开启该功能的配置步骤如下:
1/2.修改${karaf_home}/etc/org.ops4j.pax.url.mvn.cfg
【org.ops4j.pax.url.mvn.cfg】
(1).org.ops4j.pax.url.mvn.settings=/maven/conf/settings.xml
(2).org.ops4j.pax.url.mvn.proxySupport=true
2/2.创建文件【/maven/conf/settings.xml】,样例如下:
/////////begin//////
<settings>
<proxies>                                                                                                                                   
  <proxy>                                                                
    <id>optional</id>                                                    
    <active>true</active>                                                
    <protocol>http</protocol>                                            
    <host>xx.xx.xx.xx</host>                                       
    <port>8080</port>
    <nonProxyHosts>localhost|127.0.0.1|10.*.*.*|cnd</nonProxyHosts> 
    </proxy>                                                               
</proxies>
</settings>
/////////end////////
分享到:
评论

相关推荐

    apache karaf 中文文档

    - 安装Karaf需要满足一定的系统要求,包括至少20MB的磁盘空间用于安装包,以及200MB的磁盘空间用于保存发布源码、git拷贝、Maven以及下载的依赖包。 - 在Unix和Windows平台下都可以安装Karaf。对于Windows平台,...

    karaf使用配置文档

    通过Archiva,你可以托管和管理你的组织内部的JAR包,避免直接连接到外部公开的Maven中央仓库。搭建Archiva涉及以下步骤: 1. 下载并解压Archiva的发行版。 2. 配置Archiva的`conf/server.xml`,设置监听端口和...

    distribution-karaf-0.3.0-Lithium.zip

    7. **Maven集成**:Karaf与Maven紧密集成,使得开发者可以方便地利用Maven仓库来部署和管理OSGi捆绑包。 8. **云就绪**:由于其模块化和可扩展性,Apache Karaf是云平台的理想选择,可以作为微服务的基础容器。 9....

    apache-karaf-2.3.5

    Apache Karaf是一个开源的、基于OSGi(Open Service Gateway Initiative)规范的运行环境,它为开发者提供了一个轻量级的服务容器。Karaf这个名字来源于阿拉伯语,意为“小船”,象征着它承载并运载应用服务的能力。...

    Apache Karaf User's Guide 2.2.8

    4. **配置管理**:通过各种方式实现库或应用的配置、下载、安装和启动。这使得资源的管理和部署更加灵活。 5. **原生操作系统集成**:Karaf可以作为服务与你的操作系统集成,使它的生命周期与操作系统的生命周期...

    java 模块化,关于karaf的资源

    java 模块化,关于karaf的资源 内容: apache-karaf-4.2.0.tar.gz karaf-DEV_GUIDE.zip karaf-master.zip Karaf-Microservices-master.zip karaf-springboot-master.zip os-osgiblueprint-sample.zip

    karaf cxf

    - 下载完成后,将其解压缩至期望的目录下,例如 `C:\karaf` 或 `/usr/local/karaf`。 2. **配置环境变量**: - 在系统环境变量中添加 `KARAF_HOME` 指向解压后的 Karaf 目录,并配置 `PATH` 包含 `%KARAF_HOME%\...

    Learning Apache Karaf 配套源码

    这本书《Learning Apache Karaf》显然是为了帮助读者深入理解和掌握Karaf的使用,而配套的源码则是实践和学习的重要资源。 Apache Karaf的核心特性包括: 1. **模块化**:基于OSGi框架,允许应用按需加载和卸载...

    apache karaf 2.3.4(Windows版本)

    在Windows环境下,Apache Karaf 2.3.4通常以.zip格式提供,用户只需将其解压到任意目录,然后通过命令行(如cmd或PowerShell)进入bin目录,执行start.bat脚本来启动Karaf。此外,Karaf提供了基于图形界面的管理工具...

    karaf 手册和入门资料

    7. **远程访问**:使用任何 SSH 客户端连接到 Karaf 并在控制台中发出命令。 8. **基于 JAAS 的安全框架**:Karaf 提供了一个基于 Java Authentication and Authorization Service (JAAS) 的安全框架,为用户提供...

    apache-karaf-2.2.3.zip

    Karaf是Apache旗下的一个开源项目.Karaf同时也是一个基于OSGi的运行环境,Karaf提供了一个轻量级的OSGi容器,可以用于部署 各种组件,应用程序.Karaf提供了很多特性用于帮助开发者和用户更加灵活的部署应用,例如:热部署...

    apache-karaf-4.0.0

    karaf标签表示这个资源与Apache Karaf相关,而osgi标签则表明它是关于OSGi技术的。这暗示了压缩包中可能包含的是Apache Karaf 4.0.0的源代码,这对于理解、定制或扩展Karaf功能的开发者来说非常宝贵。 压缩包中的...

    Karaf在Eclispe中的启动环境

    - 下载并解压Apache Karaf到本地文件系统。 - 在Eclipse中配置Karaf运行时环境,指向已解压的Karaf安装目录。 - 创建karaf运行配置,定义启动参数和工作目录。 5. **启动与调试**: - 使用Eclipse的运行配置...

    [Apache Karaf] Apache Karaf 学习教程 (英文版)

    ☆ 资源说明:☆ [Packt Publishing] Apache Karaf 学习教程 (英文版) [Packt Publishing] Learning Apache Karaf (E-Book) ☆ 图书概要:☆ Develop and deploy applications using the OSGi-based runtime ...

    osgi集成servlet在karaf容器发布

    这可以通过使用Maven的BND插件或者使用Apache Felix的Maven Bundle Plugin实现。在bundle的MANIFEST.MF文件中,需要声明Servlet的类路径以及它在OSGi服务注册时使用的元数据。 2. **服务注册**:在Karaf容器中,...

    learning Apache Karaf 配套源码

    Apache Karaf是一款轻量级的开源应用服务器,它基于OSGi(Open Service Gateway Initiative)框架构建,用于构建、部署和管理微服务和企业级应用程序。本资料“learning Apache Karaf”配套源码提供了深入理解Karaf...

    apache-karaf-4.0.2.tar.gz

    这个“apache-karaf-4.0.2.tar.gz”是一个压缩包文件,包含了Apache Karaf 4.0.2版本的所有组件和相关资源。在本文中,我们将深入探讨Apache Karaf的核心概念、功能以及如何使用tar命令进行安装和解压。 Apache ...

    apache-karaf-3.0.2.tar.gz

    Karaf是Apache旗下的一个开源项目.Karaf同时也是一个基于OSGi的运行环境,Karaf提供了一个轻量级的OSGi容器,可以用于部署各种组件,应用程序.Karaf提供了很多特性用于帮助开发者和用户更加灵活的部署应用,例如:热部署,...

Global site tag (gtag.js) - Google Analytics