我正在使用一个非常简单的项目 - 即兴在我的Mac笔记本电脑上运行的minkube。它过去曾经工作过一次。在对函数进行少量更改后,我无法为Function创建bean。我在试图执行该功能的minkube pod中获得了跟踪堆栈跟踪。
将不胜感激任何帮助。不确定,我做错了什么。我有一个简单的node.js函数来计算数字的平方。这似乎工作正常。
@SpringBootApplication
public class FunctionExecutorApplication {
@Bean
Function<Flux<String>,Flux<String>> uppercase(){
return influx ->
influx.map(String::toUpperCase);
}
public static void main(String[] args) {
SpringApplication.run(FunctionExecutorApplication.class, args);
}
}
项目网址是 https://github.com/jaysara/FunctionExecutor
这是我在minikube日志中看到的堆栈跟踪,其中pod尝试初始化该函数。
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) at io.projectriff.invoker.ContextRunner$1.run(ContextRunner.java:66) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Cannot create functions at io.projectriff.invoker.FunctionConfiguration.init(FunctionConfiguration.java:133) 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:366) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134) ... 18 more Caused by: java.lang.IllegalStateException: Cannot create bean for: uppercase at io.projectriff.invoker.FunctionConfiguration$BeanCreator.create(FunctionConfiguration.java:282) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at io.projectriff.invoker.FunctionConfiguration.init(FunctionConfiguration.java:130) ... 25 more