@Controller)@Scope("session").Serializable以便在服务器重新启动时可以物理存储它们Serializable,这意味着它所引用的所有服务(其他spring bean)也将被序列化.它们通常是代理,引用了交易管理器,实体管理器工厂等.ApplicationContext通过实现来保持对引用的引用并不是不太可能ApplicationContextAware,因此这可以有效地意味着整个上下文被序列化.并且鉴于它拥有许多连接 - 即不能通过思想序列化的东西,它将在腐败状态下恢复.到目前为止,我大多忽略了这些问题.最近我想到声明我所有的spring依赖项transient并readResolve()通过静态实用程序类将它们重新WebApplicationContextUtils导入,并将请求/ ServletContext保存在ThreadLocal.这很乏味,但它保证了,当反序列化对象时,它的依赖关系将与当前应用程序上下文"保持同步" .
是否有任何公认的做法,或任何序列化春季背景部分的指南.
请注意,在JSF中,托管bean(~controller)是有状态的(与基于动作的Web框架不同).所以也许我的问题更多的是JSF,而不是spring-mvc.
我正在尝试构建一个由Alexa Skills Kit触发的简单AWS Lambda函数.我正在关注亚马逊制作的关于创建技能等的教程.不幸的是,Alexa Skills Kit不是"配置触发器"窗口下拉菜单中的选项.我附上了一张可用的照片.
无论如何都要显示Alexa Skills Kit?我的帐户有问题吗?任何建议都会非常有帮助.我被困在一个真正不应该引起任何问题的地方.我有一个基本帐户,因此无法获得亚马逊的支持.

在我的项目中,我创建了一个py函数来检查和修改我的谷歌日历,如下所示:
def main(event, context):
ck_app = check(event['calID'], event['datada'], event['dataa'])
if not ck_app: insert(event['calID'], event['datada'], event['dataa'], event['email'])
return {
"isBase64Encoded": False,
"statusCode": '200',
"headers": {},
"body": {'input': event,
'busy': ck_app,
'guest_email': event['email']}
}
Run Code Online (Sandbox Code Playgroud)
当我在我的lambda上测试它时都完成了,但是当我从lambda创建一个API时:
并测试结果是:
Wed Dec 20 13:35:58 UTC 2017:由于配置错误导致执行失败:格式错误的Lambda代理响应Wed Dec 20 13:35:58 UTC 2017:方法已完成,状态:502
提前致谢
您好我正在使用ViewScoped Bean问题是,当调用它时,我得到NotSerializableException.
这是我的Managed Bean的代码:
@ManagedBean(name="demandesBean")
@ViewScoped
public class DemandesBean implements Serializable {
private static final long serialVersionUID = 1L;
@ManagedProperty(value="#{demandeService}")
private DemandeService demandeService; //A Spring Service
@ManagedProperty(value="#{loginBean}")
private LoginBean loginBean;
private DemandeVO newDemande;
@PostConstruct
public void initData() {
newDemande = new DemandeVO();
}
public void doAjouterDemande(ActionListener event) {
demandeService.createDemande(newDemande, loginBean.getUsername());
newDemande = new DemandeVO();
}
public List<DemandeVO> getListDemande() {
return demandeService.getAllDemandesByUser(loginBean.getUsername());
}
public DemandeService getDemandeService() {
return demandeService;
}
public void setDemandeService(DemandeService demandeService) {
this.demandeService = demandeService;
}
public LoginBean …Run Code Online (Sandbox Code Playgroud) 我在尝试提交表单时遇到以下异常.
javax.faces.application.ViewExpiredException: /page1.xhtml No saved view state could be found for the view identifier: /page1.xhtml
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:132)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:94)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at …Run Code Online (Sandbox Code Playgroud) primefaces jsf-2 viewexpiredexception view-scope notserializableexception
我喜欢在AWS中使用lambda函数.它理想地减少了维护服务器的时间.我的问题是当使用lambda时,有上下文对象和回调函数来终止函数.是否有任何使用回调超过上下文的用例.
谁能告诉我context.succeed()的回调行为(错误,消息)
var startedAt = new Date();
var interval = setInterval(function () {
console.log(startedAt, new Date());
}, 1000);
exports.handler = function (event, context, callback) {
setTimeout(function () {
console.log('returning');
// v1:
return callback(null);
// v2:
// return context.succeed();
}, 5000);
};
Run Code Online (Sandbox Code Playgroud) 我在我的父实体中有一个Set,如下所示:
Class Parent {
@OneToMany(mappedBy = parent, cascade = CasacadeType.ALL)
Set<Child> children;
}
Class Child {
@Column(nullable=false)
@ManyToOne
Parent parent;
}
Run Code Online (Sandbox Code Playgroud)
现在事件,如果我对其中一个元素的Set执行remove()操作,它实际上不会被删除.
我正在为Alexa开发一个简单的自定义技能.我已经启动并运行,并在AWS Lambda上托管处理程序.它的工作正常,除了......
在测试用户界面中,如果我输入有效的话语,例如帮助,取消,游泳,跑步(两个自定义话语),一切运作良好; 但是,如果我输入无意义的话语,例如dsfhfdsjhf,则Alexa服务始终将无意义映射到意图模式中的第一个有效意图.
在我的lambda代码中,我有一个处理未知意图的处理程序; 然而,意图永远不会被人知道.这是测试界面的工件吗?还有其他事情发生了吗?
谢谢,约翰
我正在尝试使用CLI在AWS上调用lambda:
aws lambda invoke --function-name GetErrorLambda --payload '{"body":"{\"Id\":[\"321\",\"123\"]}"}' \output.
Run Code Online (Sandbox Code Playgroud)
我想知道是否有办法在cli上打印输出而不是创建文件.
提前致谢.
我们使用Cloud Formation来定义一堆Lambda函数:
AWSTemplateFormatVersion: '2010-09-09'
Transform:
- 'AWS::Serverless-2016-10-31'
Resources:
MyLambda:
Type: 'AWS::Serverless::Function'
Properties:
Handler: com.handler::MyLambda
Runtime: java8
CodeUri: .
Description: Some desc
MemorySize: 512
Timeout: 15
Role: !Ref LambdaRole
FunctionName: MyLambda
Events:
MyLambdaEvt:
Type: Api
Properties:
RestApiId: !Ref MyApiDef
Path: /lambda/my
Method: get
MyApiDef:
Type: AWS::Serverless::Api
Properties:
DefinitionUri: s3://a-bucket/api-gateway.yml
StageName: prod
Outputs:
ApiUrl:
Description: URL of your API endpoint
Value: !Join
- ''
- - https://
- !Ref MyApiDef
- '.execute-api.'
- !Ref 'AWS::Region'
- '.amazonaws.com/prod'
Run Code Online (Sandbox Code Playgroud)
CodePipeline生成变更集并执行它.
通过这种方式,所有Lambda函数都已正确更新,但API Gateway端点未正确更新,我们需要s3://a-bucket/api-gateway.yml手动导入和部署YML …
amazon-web-services aws-cloudformation aws-lambda aws-api-gateway aws-codepipeline
aws-lambda ×5
java ×2
jsf ×2
jsf-2 ×2
spring ×2
alexa-skill ×1
aws-cli ×1
hibernate ×1
javascript ×1
jpa ×1
node.js ×1
primefaces ×1
python ×1
servlets ×1
set ×1
triggers ×1
view-scope ×1