spring cloud function sample在启动时失败

时间:2017-08-09 18:25:20

标签: java spring spring-cloud

尝试运行spring-cloud-function示例

  

弹簧云的功能\弹簧云功能样本\弹簧云功能样品

并按照Here的说明,我从启动失败中获得了以下输出。显然是尝试使用 编译函数的 com.sun.tools.javac.api.JavacTool 没有定义bootclasspath。

我确认使用的java.exe是JDK,而不是JRE的

有谁知道如何纠正这个问题?

C:\代码\ dev的\ playgound \弹簧\弹簧云的功能\弹簧云功能样本\弹簧云功能样品GT; java -jar。\ target \ function-sample-1.0.0.BUILD-SNAPSHOT.jar

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.2.RELEASE)

2017-08-09 14:04:54.289  INFO 8292 --- [           main] com.example.SampleApplication            : Starting SampleApplication v1.0.0.BUILD-SNAPSHOT on ra with PID 8292 (C:\code\dev\playgound\spring\spring-cloud-function\spring-cloud-function-samples\spring-cloud-function-sample\target\function-sample-1.0.0.BUILD-SNAPSHOT.jar started by gbegley in C:\code\dev\playgound\spring\spring-cloud-function\spring-cloud-function-samples\spring-cloud-function-sample)
2017-08-09 14:04:54.292  INFO 8292 --- [           main] com.example.SampleApplication            : No active profile set, falling back to default profiles: default
2017-08-09 14:04:54.419  INFO 8292 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@673bb956: startup date [Wed Aug 09 14:04:54 EDT 2017]; root of context hierarchy
2017-08-09 14:04:55.470  INFO 8292 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.function.web.flux.ReactorAutoConfiguration' of type [org.springframework.cloud.function.web.flux.ReactorAutoConfiguration$$EnhancerBySpringCGLIB$$35a4301] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-08-09 14:04:55.885  INFO 8292 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-08-09 14:04:55.897  INFO 8292 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2017-08-09 14:04:55.899  INFO 8292 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.11
2017-08-09 14:04:55.984  INFO 8292 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-08-09 14:04:55.985  INFO 8292 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1570 ms
2017-08-09 14:04:56.114  INFO 8292 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-08-09 14:04:56.119  INFO 8292 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-08-09 14:04:56.120  INFO 8292 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-08-09 14:04:56.120  INFO 8292 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-08-09 14:04:56.121  INFO 8292 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-08-09 14:04:56.185  INFO 8292 --- [           main] o.s.c.f.c.AbstractFunctionCompiler       : Initial code property value :'s -> s.toUpperCase()'
2017-08-09 14:04:56.187  INFO 8292 --- [           main] o.s.c.f.c.AbstractFunctionCompiler       : Processed code property value :
return (Function<String,String> & java.io.Serializable) s -> s.toUpperCase();

package org.springframework.cloud.function.compiler;
import java.util.*;
import java.util.function.*;
import reactor.core.publisher.Flux;
public class CompiledUppercaseFunctionFactory implements FunctionFactory {
 public Function<String,String> getResult() {
  return (Function<String,String> & java.io.Serializable) s -> s.toUpperCase();
 }
}

2017-08-09 14:04:56.191  INFO 8292 --- [           main] o.s.c.f.c.java.RuntimeJavaCompiler       : Compiling source for class org.springframework.cloud.function.compiler.CompiledUppercaseFunctionFactory using compiler com.sun.tools.javac.api.JavacTool
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
2017-08-09 14:04:56.579  WARN 8292 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compiledUppercase' defined in com.example.SampleApplication: Invocation of init method failed; nested exception is org.springframework.cloud.function.compiler.java.CompilationFailedException:
2017-08-09 14:04:56.581  INFO 8292 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
2017-08-09 14:04:56.599  INFO 8292 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-08-09 14:04:56.609 ERROR 8292 --- [           main] o.s.boot.SpringApplication               : Application startup failed

0 个答案:

没有答案