java - 无法调试 Artifactory 问题,无法启动,卡住 500 错误

标签 java spring amazon-web-services javabeans artifactory

我在做什么

我正在尝试设置 Artifactory。每当我尝试启动服务时,它的位置都是 500错误,我无法修复它。


我尝试过的

我在网上尝试了很多解决方案,主要是搜索并尝试不同的解决方案,例如:

  • '(o.a.w.s.ArtifactoryFilter:194) - Artifactory failed to initialize: Context is null'

还有

  • '[art-init] [ERROR] (o.a.w.s.ArtifactoryContextConfigListener:96) - Application could not be initialized: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')'

更多信息

Version:  6.13.1                                  
 Revision: 61301900                            
 Artifactory Home: '/var/opt/jfrog/artifactory'
 HA Node ID: '[REDACTED]'

openjdk version "1.8.0_232"  
OpenJDK Runtime Environment (build 1.8.0_232-b09)  
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)  

status  500  
message "Artifactory failed to initialize: check Artifactory logs for errors."

我不知道为什么会发生这种情况,如果有人可以提出建议,我会全部尝试。

2020-02-18 15:45:39,797 [art-init] [INFO ] (o.j.s.b.p.t.BinaryProviderClassScanner:76) - Added 'remote' from jar:file:/opt/jfrog/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/binary-store-client-3.4.8.jar!/
2020-02-18 15:45:40,251 [art-init] [INFO ] (o.a.a.f.t.j.s.S3JetS3tBinaryProvider:530) - Connecting to S3 endpoint: 's3-us-west-2.amazonaws.com'
2020-02-18 15:45:40,956 [art-init] [WARN ] (o.a.s.ArtifactoryApplicationContext:254) - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xrayServiceImpl' defined in URL [jar:file:/opt/jfrog/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-addon-xray-6.13.1.jar!/org/artifactory/addon/xray/XrayServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'centralConfig': Unsatisfied dependency expressed through field 'authService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityServiceImpl': Unsatisfied dependency expressed through field 'activePrincipalTokenStore'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'activePrincipalTokenStoreImpl' defined in URL [jar:file:/opt/jfrog/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-core-6.13.1.jar!/org/artifactory/security/auth/ActivePrincipalTokenStoreImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accessServiceImpl': Unsatisfied dependency expressed through method 'setRepositoryService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'repositoryServiceImpl': Unsatisfied dependency expressed through field 'uploadService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'uploadServiceImpl': Unsatisfied dependency expressed through method 'setBinaryService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'binaryServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@6cb92d33; line: 1, column: 2]
2020-02-18 15:45:40,975 [art-init] [ERROR] (o.a.w.s.ArtifactoryContextConfigListener:96) - Application could not be initialized: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@6cb92d33; line: 1, column: 2]
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.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xrayServiceImpl' defined in URL [jar:file:/opt/jfrog/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-addon-xray-6.13.1.jar!/org/artifactory/addon/xray/XrayServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'centralConfig': Unsatisfied dependency expressed through field 'authService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityServiceImpl': Unsatisfied dependency expressed through field 'activePrincipalTokenStore'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'activePrincipalTokenStoreImpl' defined in URL [jar:file:/opt/jfrog/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-core-6.13.1.jar!/org/artifactory/security/auth/ActivePrincipalTokenStoreImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accessServiceImpl': Unsatisfied dependency expressed through method 'setRepositoryService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'repositoryServiceImpl': Unsatisfied dependency expressed through field 'uploadService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'uploadServiceImpl': Unsatisfied dependency expressed through method 'setBinaryService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'binaryServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@6cb92d33; line: 1, column: 2]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:218)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1341)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1187)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:843)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
        at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:254)
        at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:149)
        ... 7 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'centralConfig': Unsatisfied dependency expressed through field 'authService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityServiceImpl': Unsatisfied dependency expressed through field 'activePrincipalTokenStore'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'activePrincipalTokenStoreImpl' defined in URL [jar:file:/opt/jfrog/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-core-6.13.1.jar!/org/artifactory/security/auth/ActivePrincipalTokenStoreImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accessServiceImpl': Unsatisfied dependency expressed through method 'setRepositoryService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'repositoryServiceImpl': Unsatisfied dependency expressed through field 'uploadService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'uploadServiceImpl': Unsatisfied dependency expressed through method 'setBinaryService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'binaryServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@6cb92d33; line: 1, column: 2]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1248)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1168)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760)
        ... 21 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityServiceImpl': Unsatisfied dependency expressed through field 'activePrincipalTokenStore'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'activePrincipalTokenStoreImpl' defined in URL [jar:file:/opt/jfrog/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-core-6.13.1.jar!/org/artifactory/security/auth/ActivePrincipalTokenStoreImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accessServiceImpl': Unsatisfied dependency expressed through method 'setRepositoryService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'repositoryServiceImpl': Unsatisfied dependency expressed through field 'uploadService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'uploadServiceImpl': Unsatisfied dependency expressed through method 'setBinaryService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'binaryServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@6cb92d33; line: 1, column: 2]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)


... removed cause 30k char limit but same errors...




 org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:668)
            ... 101 common frames omitted
    Caused by: java.lang.RuntimeException: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
     at [Source: java.io.StringReader@6cb92d33; line: 1, column: 2]
            at org.artifactory.addon.filestore.type.jets3t.s3.AWSEC2IAMSessionCredentialsNew.loadFromEC2InstanceDataNew(AWSEC2IAMSessionCredentialsNew.java:141)
            at org.artifactory.addon.filestore.type.jets3t.s3.AWSEC2IAMSessionCredentialsNew.loadFromEC2InstanceDataNew(AWSEC2IAMSessionCredentialsNew.java:160)
            at org.artifactory.addon.filestore.type.jets3t.s3.S3JetS3tBinaryProvider.createCredentials(S3JetS3tBinaryProvider.java:479)
            at org.artifactory.addon.filestore.type.jets3t.s3.S3JetS3tBinaryProvider.initialize(S3JetS3tBinaryProvider.java:135)
            at org.jfrog.storage.binstore.providers.builder.BinaryProviderFactory.build(BinaryProviderFactory.java:98)
            at org.jfrog.storage.binstore.providers.builder.BinaryProviderFactory.build(BinaryProviderFactory.java:86)
            at org.jfrog.storage.binstore.providers.builder.BinaryProviderFactory.build(BinaryProviderFactory.java:86)
            at org.jfrog.storage.binstore.providers.builder.BinaryProviderFactory.build(BinaryProviderFactory.java:93)
            at org.jfrog.storage.binstore.providers.builder.BinaryProviderFactory.build(BinaryProviderFactory.java:86)
            at org.jfrog.storage.binstore.providers.builder.BinaryProviderFactory.buildProviders(BinaryProviderFactory.java:75)
            at org.jfrog.storage.binstore.manager.BinaryProviderManagerImpl.<init>(BinaryProviderManagerImpl.java:115)
            at org.artifactory.storage.db.binstore.service.BinaryServiceImpl.initialize(BinaryServiceImpl.java:187)
            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.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)
            at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)
            at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
            ... 113 common frames omitted
    Caused by: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
     at [Source: java.io.StringReader@6cb92d33; line: 1, column: 2]
            at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1432)
            at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521)
            at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442)
            at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1198)
            at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:485)
            at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2770)
            at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2718)
            at org.codehaus.jackson.map.ObjectMapper.readTree(ObjectMapper.java:1542)
            at org.artifactory.addon.filestore.type.jets3t.s3.AWSEC2IAMSessionCredentialsNew.parseEC2InstanceDataNew(AWSEC2IAMSessionCredentialsNew.java:183)
            at org.artifactory.addon.filestore.type.jets3t.s3.AWSEC2IAMSessionCredentialsNew.loadFromEC2InstanceDataNew(AWSEC2IAMSessionCredentialsNew.java:138)
            ... 131 common frames omitted
    2020-02-18 15:45:41,372 [http-nio-8081-exec-1] [ERROR] (o.a.w.s.ArtifactoryFilter:194) - Artifactory failed to initialize: Context is null

最佳答案

检查您的binarystore.xml。

好像你有一个名为instanceMetadataUrl的属性,这个url应该解析json,但它解析xml。可能是错误页面。

您还可以通过更改 logback.xml 文件来打开 Artifactory 应用程序的此部分的调试。 在其中一个记录器下添加此部分:

<logger name="org.artifactory.addon.filestore">
        <level value="debug"/>
</logger>

这将为您提供有关正在发生的事情的更多信息。 问题解决后,将 logback.xml 返回到其原始状态。

关于java - 无法调试 Artifactory 问题,无法启动,卡住 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60307465/

相关文章:

google-app-engine - AppEngine Channel API 的 Amazon EC2 等效项是什么?

javascript - Neptune DB 不会将属性值更改为以前的值

spring - 未定义名为 'entityManagerFactory' 的 bean,bean 引用问题

mysql - RDS 参数组

java - Kotlin 内联函数是否比 Java 匿名类便宜?

java - 无法通过 getMethod() 找到公共(public)方法

java - 使用 Hibernate 二级缓存和 HSQL 的令人失望的插入/更新率

spring - 如何在 Spring 3 中以编程方式执行注销

java - 安卓全屏摄像头

java - Android Slider 中的 NoClassDefFoundError 错误