Ошибки квазара при запуске Spring-сервера с Corda

Я использую довольно здоровенную версию Spring (сгенерированную jHipster) в соответствии с моим проектом Corda. Я получаю некоторые ошибки, связанные с квазаром, когда запускаю сервер Spring. Я предполагаю, что это потому, что quasar-utils находится в зависимостях сервера gradle. Quasar жалуется на что-то связанное с весенним сервисом OAuth2. На самом деле я пока не использую какие-либо функции OAuth, поэтому я не уверен, являются ли эти ошибки доброкачественными или нет. Несмотря на это, я немного обеспокоен тем, что квазар мешает вообще. Есть ли способ сделать RPC-взаимодействия с Corda, не имея квазар-утилит в зависимостях серверного gradle?

Вот ошибки:

[quasar] WARNING: Can't determine super class of org/springframework/security/ldap/authentication/BindAuthenticator
[quasar] WARNING: Can't determine super class of org/springframework/security/ldap/authentication/PasswordComparisonAuthenticator
2018-08-06 17:55:04.769 DEBUG 2492 --- [  restartedMain] c.ehcache.core.Ehcache-usersByLogin      : Initialize successful.
2018-08-06 17:55:04.801 DEBUG 2492 --- [  restartedMain] c.ehcache.core.Ehcache-usersByEmail      : Initialize successful.
[quasar] WARNING: Can't determine super class of org/springframework/security/oauth2/client/oidc/userinfo/OidcUserService
[quasar] WARNING: Can't determine super class of org/springframework/security/oauth2/client/userinfo/OAuth2UserService
[quasar] ERROR: Unable to instrument class org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurer
java.lang.NullPointerException
    at co.paralleluniverse.asm.Item.a(Unknown Source)
    at co.paralleluniverse.asm.ClassWriter.c(Unknown Source)
    at co.paralleluniverse.asm.ClassWriter.a(Unknown Source)
    at co.paralleluniverse.asm.Frame.a(Unknown Source)
    at co.paralleluniverse.asm.Frame.a(Unknown Source)
    at co.paralleluniverse.asm.MethodWriter.visitMaxs(Unknown Source)
    at co.paralleluniverse.asm.tree.MethodNode.accept(Unknown Source)
    at co.paralleluniverse.asm.commons.JSRInlinerAdapter.visitEnd(Unknown Source)
    at co.paralleluniverse.asm.MethodVisitor.visitEnd(Unknown Source)
    at co.paralleluniverse.fibers.instrument.InstrumentClass$1.visitEnd(InstrumentClass.java:190)
    at co.paralleluniverse.asm.ClassReader.b(Unknown Source)
    at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
    at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
    at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:134)
    at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:94)
    at co.paralleluniverse.fibers.instrument.JavaAgent$Transformer.transform(JavaAgent.java:209)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.getHttp(WebSecurityConfigurerAdapter.java:205)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:321)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:92)
    at com.cordatemplate.cordapp.config.SecurityConfiguration$$EnhancerBySpringCGLIB$$c1c18162.init(<generated>)
    at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:371)
    at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:325)
    at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:41)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:104)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$bc81b89d.CGLIB$springSecurityFilterChain$4(<generated>)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$bc81b89d$$FastClassBySpringCGLIB$$6a532806.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$bc81b89d.springSecurityFilterChain(<generated>:65535)
    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.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1256)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1105)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:304)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
    at com.cordatemplate.cordapp.CordaApp.main(CordaApp.java:61)
    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.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
[quasar] ERROR: while transforming org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurer: null
java.lang.NullPointerException
    at co.paralleluniverse.asm.Item.a(Unknown Source)
    at co.paralleluniverse.asm.ClassWriter.c(Unknown Source)
    at co.paralleluniverse.asm.ClassWriter.a(Unknown Source)
    at co.paralleluniverse.asm.Frame.a(Unknown Source)
    at co.paralleluniverse.asm.Frame.a(Unknown Source)
    at co.paralleluniverse.asm.MethodWriter.visitMaxs(Unknown Source)
    at co.paralleluniverse.asm.tree.MethodNode.accept(Unknown Source)
    at co.paralleluniverse.asm.commons.JSRInlinerAdapter.visitEnd(Unknown Source)
    at co.paralleluniverse.asm.MethodVisitor.visitEnd(Unknown Source)
    at co.paralleluniverse.fibers.instrument.InstrumentClass$1.visitEnd(InstrumentClass.java:190)
    at co.paralleluniverse.asm.ClassReader.b(Unknown Source)
    at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
    at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
    at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:134)
    at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:94)
    at co.paralleluniverse.fibers.instrument.JavaAgent$Transformer.transform(JavaAgent.java:209)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.getHttp(WebSecurityConfigurerAdapter.java:205)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:321)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:92)
    at com.cordatemplate.cordapp.config.SecurityConfiguration$$EnhancerBySpringCGLIB$$c1c18162.init(<generated>)
    at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:371)
    at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:325)
    at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:41)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:104)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$bc81b89d.CGLIB$springSecurityFilterChain$4(<generated>)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$bc81b89d$$FastClassBySpringCGLIB$$6a532806.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361)
    at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$bc81b89d.springSecurityFilterChain(<generated>:65535)
    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.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1256)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1105)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:304)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
    at com.cordatemplate.cordapp.CordaApp.main(CordaApp.java:61)
    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.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)

1 ответ

Пока вы не используете объекты, которые Квазар не может использовать внутри потоков, у вас не будет проблем с этим. Quasar в основном используется в Corda для подвесных волокон, что означает сериализованный стек. Если объект отсутствует в указанном стеке, это не должно вызывать никаких проблем.

Но что более важно; Ваш узел Corda и приложение Spring Boot должны работать в отдельных процессах, чтобы избежать каких-либо помех. Вам нужны только утилиты Quasar при компиляции Cordapps и самой Corda. Если ваше загрузочное приложение Spring является отдельным, я бы порекомендовал собрать его в отдельный подпроект gradle / maven без зависимости от quasar-utils.

Немного поздно на вечеринку, но глядя на исходный код quasar-utils здесь вы можете установить опору расширения для игнорируемых пакетов в корневой сборке:

ext.quasar_exclusions = [
        'co.paralleluniverse**',
        'groovy**',
        'com.esotericsoftware.**',
        'jdk**',
        'junit**',
        'kotlin**',
        'net.rubygrapefruit.**',
        'org.gradle.**',
        'org.apache.**',
        'org.jacoco.**',
        'org.junit**',
        'org.slf4j**',
        'worker.org.gradle.**',
        'com.nhaarman.mockito_kotlin**',
        'org.assertj**',
        'org.hamcrest**',
        'org.mockito**',
        'org.opentest4j**',
        'org.springframework**',
        'reactor.core.publisher**',
        'com.github.manosbatsis.corbeans.spring.boot**'
]

кроме того, похоже, что выпуск 4.0.45 позволяетquasar расширение как:

quasar {
    /// ...
    // defaults to quasar_exclusions property
    excludePackages = [
        'glob for package not to be instrumented',
        //...
    ]
}
Другие вопросы по тегам