感谢您支持approuter
在本地运行该程序包。
现在在本地运行firstapp时遇到异常。
我添加xs.appname
xs.uaa.clientid
xs.uaa.identityzone
xs.uaa.verificationkey
,但仅遇到相同的问题。
请建议我必须设置哪些值 Environment variable VCAP_SERVICES
[localhost-startStop-1] ERROR com.sap.xs2.security.commons.SAPVcapServicesParser - Environment variable VCAP_SERVICES not set
[localhost-startStop-1] WARN org.springframework.web.context.support.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'offlineTokenServices' defined in ServletContext resource [/WEB-INF/spring-security.xml]: Environment variable VCAP_SERVICES not set; nested exception is java.lang.IllegalStateException: Environment variable VCAP_SERVICES not set
[localhost-startStop-1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'offlineTokenServices' defined in ServletContext resource [/WEB-INF/spring-security.xml]: Environment variable VCAP_SERVICES not set; nested exception is java.lang.IllegalStateException: Environment variable VCAP_SERVICES not set
at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:228)
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:225)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:166)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:530)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Environment variable VCAP_SERVICES not set
at com.sap.xs2.security.commons.SAPVcapServicesParser.getAttribute(SAPVcapServicesParser.java:34)
at com.sap.xs2.security.commons.SAPPropertyPlaceholderConfigurer.parseVcapServices(SAPPropertyPlaceholderConfigurer.java:44)
at com.sap.xs2.security.commons.SAPPropertyPlaceholderConfigurer.readVcapServices(SAPPropertyPlaceholderConfigurer.java:67)
at com.sap.xs2.security.commons.SAPPropertyPlaceholderConfigurer.resolvePlaceholder(SAPPropertyPlaceholderConfigurer.java:94)
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.resolvePlaceholder(PropertyPlaceholderConfigurer.java:163)
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PropertyPlaceholderConfigurerResolver.resolvePlaceholder(PropertyPlaceholderConfigurer.java:264)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:145)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:244)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:296)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:217)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:147)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:85)
at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:225)
... 18 common frames omitted
您需要VCAP_SERVICES
按照错误消息的指示将其作为环境变量提供给本地容器Caused by: java.lang.IllegalStateException: Environment variable VCAP_SERVICES not set
。为此,请向环境变量提供相应的参数,就像将真实的XSUAA实例绑定到您的CloudFoundry微服务时一样。对于本地部署,您VCAP_SERVICES
必须至少具有以下参数,其中该verificationkey
属性需要与JWT的签名匹配。此外,该tags
属性至关重要。
对于Mac / Unix
export VCAP_SERVICES='{
"xsuaa":[
{
"credentials": {
"clientid":"testClient",
"clientsecret":"dummy-clientsecret",
"identityzone":"uaa",
"url":"dummy-url",
"verificationkey":"-----BEGIN PUBLIC KEY-----MIIBI...QIDAQAB-----END PUBLIC KEY-----"
},
"tags":["xsuaa"]
}]
}'
如果正确提供了环境变量,则应该在本地环境日志输出中看到以下消息:
INFO: Got from VCAP_SERVICES: identityzone=uaa
问题内容: 问题: 我正在为在类中执行方法创建切入点。该类是控制器类,由注解@Controller表示,因此对于方面所要求的相同,不需要bean。我附加了dispathcher servlet代码,方面和控制器类。有人可以识别出问题所在。 DISPATCHER SERVLET : 方面: 控制器类别: 控制台错误: 问题答案: 这是Spring AOP中的限制。当你使用AspectJ切入点将方面编
更多的细节: 我正在尝试创建第一个没有注释的Spring MVC应用程序。下面是我的URL请求'http://localhost:8080/firstspringmvc/welcome.html',它调用了我的代码。 以下是我的错误列表供参考:
http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/
问题内容: 好的,我是第500位用户问这个问题,我读了很多答案,但仍然没有运气。 父模块pom包含: 子模块有,我使用运行我的webapp模块。 定义标准的调度程序模块: 我在下有文件,但是启动失败: 怎么了?文档和所有人都说Spring MVC将搜索XX-servlet.xml,其中XX是servlet的名称。为什么要搜索? 问题答案: 有自己的上下文,所有servlet和过滤器都共享它。默认情
我在下有文件,但启动失败的原因是: 怎么啦?所有人都说Spring MVC将搜索xx-servlet.xml,其中XX是servlet的名称。它为什么搜索?
我正在尝试在阿帕奇雄猫和我的sql上运行Web应用程序。早些时候它在预言机11g和野蝇上运行并且工作正常,请在下面找到附加的xml配置文件。提前致谢。 这是我的调度程序-servlet.xml 这是我的web.xml 堆栈跟踪