Artifactory无法初始化:上下文为空

时间:2018-07-27 21:14:04

标签: java macos installation artifactory

我尝试从Mac本地运行人工制品6.1.0。

运行

$ARTIFACTORY_HOME/bin/artifactoryctl start

然后

$ARTIFACTORY_HOME/bin/artifactoryctl check

告诉我人工制品运行正常,但是网页甚至无法加载。

一起运行
$ARTIFACTORY_HOME/bin/artifactory.sh 

让我加载网页,但得到以下内容:

{
  "errors" : [ {
    "status" : 500,
    "message" : "Artifactory failed to initialize: check Artifactory logs for errors."
  } ]
}

这是日志的最后几节:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer]: Factory method 'resourceConfigCustomizer' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
    ... 71 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
    at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>(JaxbAnnotationIntrospector.java:139)
    at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>(JaxbAnnotationIntrospector.java:126)
    at org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JacksonResourceConfigCustomizer$ObjectMapperCustomizer.addJaxbAnnotationIntrospector(JerseyAutoConfiguration.java:266)
    at org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JacksonResourceConfigCustomizer$ObjectMapperCustomizer.access$200(JerseyAutoConfiguration.java:262)
    at org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JacksonResourceConfigCustomizer.addJaxbAnnotationIntrospectorIfPresent(JerseyAutoConfiguration.java:258)
    at org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JacksonResourceConfigCustomizer.resourceConfigCustomizer(JerseyAutoConfiguration.java:244)
    at org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JacksonResourceConfigCustomizer$$EnhancerBySpringCGLIB$$13b0b2f2.CGLIB$resourceConfigCustomizer$0(<generated>)
    at org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JacksonResourceConfigCustomizer$$EnhancerBySpringCGLIB$$13b0b2f2$$FastClassBySpringCGLIB$$6acbd0b2.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    at org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JacksonResourceConfigCustomizer$$EnhancerBySpringCGLIB$$13b0b2f2.resourceConfigCustomizer(<generated>)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
    ... 72 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlElement
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    ... 88 more

Jul 27, 2018 6:07:39 PM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor [/Users/pairprogramming/artifactory-oss-6.1.0/tomcat/conf/Catalina/localhost/access.xml]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/access]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.base/java.lang.Thread.run(Thread.java:844)

Jul 27, 2018 6:07:39 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor [/Users/pairprogramming/artifactory-oss-6.1.0/tomcat/conf/Catalina/localhost/access.xml] has finished in [25,971] ms
Jul 27, 2018 6:07:39 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [/Users/pairprogramming/artifactory-oss-6.1.0/tomcat/webapps/ROOT]
Jul 27, 2018 6:07:39 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [/Users/pairprogramming/artifactory-oss-6.1.0/tomcat/webapps/ROOT] has finished in [29] ms
Jul 27, 2018 6:07:39 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8081"]
Jul 27, 2018 6:07:39 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8040"]
Jul 27, 2018 6:07:39 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8019"]
2018-07-27 18:07:40,165 [http-nio-8081-exec-1] [ERROR] (o.a.w.s.ArtifactoryFilter:218) - Artifactory failed to initialize: Context is null

2 个答案:

答案 0 :(得分:2)

Artifactory 6.1.0与Java 9/10不兼容。 在Java 9(https://www.jfrog.com/jira/browse/RTFACT-15061)上运行时存在一个未解决的问题,该问题还提供了一些解决方法来尝试启动它。根据您的错误消息,添加--add-modules java.xml.bind以启动Artifactory脚本可能会解决您的特定问题。

“系统要求”页面也建议使用Java 8 https://www.jfrog.com/confluence/display/RTF/System+Requirements

  

您必须使用JDK 8运行Artifactory,最好是JDK 8 update 45及更高版本

答案 1 :(得分:0)

当我尝试将db更改为工件元数据的postgres时,我遇到了相同的问题,并且如下所示进行了修复

平台Ubuntu

$ sudo su

$ cd / var / opt / jfrog / artifactory / tomcat / lib

$ wget https://jdbc.postgresql.org/download/postgresql-9.4.1212.jre6.jar

注意:-您可以根据您的postgres版本选择jar版本

https://jdbc.postgresql.org/download.html#current

$ systemctl重新启动artifactory.service