【发布时间】:2019-10-10 10:44:46
【问题描述】:
前几天,我下载并安装了 JFrog Artifactory 版本 6.10.0 的开源免费版本。使用 Artifactory UI,我能够根据需要为 Maven 项目设置本地、远程和虚拟存储库,以便在 artifactory 上存储构建并使用它来获取 Maven 依赖项。具体来说,当我第一次打开 UI 时,我通过选择 Maven 进行了设置,它询问了设置 repos。
我在 Windows 10 上将 artifactory 作为服务运行。如果这很重要,我会说,在我第一次安装它时,当我从 Eclipse 运行 maven“部署”目标时,我遇到了 401 Unauthorized 错误。我使用的项目在 pom.xml 文件中有适当的条目,并且在我的 .m2 文件夹中有适当的 settings.xml 文件。即使我的 settings.xml 文件是使用管理员凭据创建的,也会发生 401 错误。我致力于更改人工 UI 中的权限,最终在授予“管理员访问”用户所有权限后解决了该问题。需要明确的是,此时一切正常。当我从 Eclipse 运行“部署”目标时,依赖项从代理存储库下载,工件存储在工件中。
现在,当我启动 Artifactory 时,我会看到典型的启动动画,然后显示以下屏幕:
{
"errors" : [ {
"status" : 500,
"message" : "Artifactory failed to initialize: check Artifactory logs for errors."
} ]
}
编辑:为澄清起见,我将补充一点,当我转到http://localhost:8081/artifactory/webapp 并等待启动动画结束时,我在屏幕上看到的唯一内容是显示上述 JSON 错误消息。该应用程序完全无法使用,因为它只显示上述 JSON 并停留在显示它的屏幕上。这是我面临的核心问题。
在检查工件日志后,在系统信息转储部分之后,我看到以下内容:
2019-05-23 12:07:50,487 [art-init] [INFO ] (o.j.c.w.ConfigurationManagerImpl:445) - Replacing temporary DB channel with permanent DB channel
2019-05-23 12:07:50,488 [art-init] [INFO ] (o.j.c.w.ConfigurationManagerImpl:445) - Successfully closed temporary DB channel
2019-05-23 12:07:50,488 [art-init] [INFO ] (o.a.s.ArtifactoryApplicationContext:505) - Artifactory application context set to READY by refresh
2019-05-23 12:07:50,632 [art-init] [INFO ] (o.a.s.a.AccessServiceImpl:1529) - Successful register of Artifactory serviceId jfrt@01db44pt153v8z1j4eqnm60qxr in Access Federation
2019-05-23 12:07:50,710 [art-init] [ERROR] (o.a.w.s.ArtifactoryContextConfigListener:96) - Application could not be initialized: No content to map due to end-of-input
at [Source: (byte[])""; line: 1, column: 0]
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:211)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener.access$200(ArtifactoryContextConfigListener.java:67)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:92)
Caused by: org.jfrog.common.JsonParsingException: com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: (byte[])""; line: 1, column: 0]
at org.jfrog.common.MapperUtilsBase.unchecked(MapperUtilsBase.java:233)
at org.jfrog.common.MapperUtilsBase.readValue(MapperUtilsBase.java:203)
at org.jfrog.common.JsonUtils.readValue(JsonUtils.java:27)
at org.artifactory.storage.db.migration.service.MigrationStatusStorageServiceImpl.findMigrationByIdWithInfoBlob(MigrationStatusStorageServiceImpl.java:56)
at org.artifactory.metadata.service.MetadataMigrationHelper.getMigrationStatus(MetadataMigrationHelper.java:194)
at org.artifactory.metadata.service.MetadataMigrationHelper.shouldMigrate(MetadataMigrationHelper.java:65)
at org.artifactory.metadata.service.MetadataMigrationHelper.migrateOrStartEventPipe(MetadataMigrationHelper.java:52)
at org.artifactory.metadata.service.MetadataEventServiceImpl.onContextCreated(MetadataEventServiceImpl.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201)
at com.sun.proxy.$Proxy220.onContextCreated(Unknown Source)
at org.artifactory.spring.ArtifactoryApplicationContext.contextCreated(ArtifactoryApplicationContext.java:285)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:146)
... 7 common frames omitted
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: (byte[])""; line: 1, column: 0]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4133)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3988)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3079)
at org.jfrog.common.MapperUtilsBase.lambda$readValue$14(MapperUtilsBase.java:203)
at org.jfrog.common.MapperUtilsBase.unchecked(MapperUtilsBase.java:231)
... 23 common frames omitted
对此的任何帮助将不胜感激。我不确定我是否偶然发现了 Artifactory 错误,或者我在创建 repos、使用 artifactory 存储/获取依赖项或将我的工件存储在那里时是否以某种方式破坏了应用程序。
如果重要,这里是我的 pom.xml 文件的摘录(更改了名称字段以避免任何可能的安全问题。)
<distributionManagement>
<repository>
<id>central</id>
<name>my_computer-releases</name>
<url>http://localhost:8081/artifactory/libs-release-local</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>my_computer-snapshots</name>
<url>http://localhost:8081/artifactory/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
这是我的 settings.xml 文件(已更改加密密码信息)
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"[EncryptedPasswordHere]"}</password>
<id>central</id>
</server>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"[EncryptedPasswordHere]"}</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://localhost:8081/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://localhost:8081/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://localhost:8081/artifactory/libs-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://localhost:8081/artifactory/libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
【问题讨论】:
标签: java windows maven artifactory