在使用nb中使用时发现Uflo中的UfloEnvironmentProvider类中的代码是不是有递归问题
一直报错误
HTTP ERROR 500
Problem accessing /uflo/handlerlist. Reason:
Server Error
Caused by:
java.lang.StackOverflowError
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.checkOrigin(UfloEnvironmentProvider.java:32)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:25)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:27)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:27)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:27)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:27)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:27)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:27)
at org.nutz.boot.starter.uflo.UfloEnvironmentProvider.getLoginUser(UfloEnvironmentProvider.java:27)
代码如下
public String getCategoryId() {
this.checkOrigin();
return this.origin != null ? this.origin.getCategoryId() : null;
}
public String getLoginUser() {
this.checkOrigin();
return this.origin != null ? this.origin.getLoginUser() : "anonymous";//应该是在这里递归了
}
protected void checkOrigin() {
if (this.ioc == null) {
this.ioc = AppContext.getDefault().getIoc();
if (this.ioc.has("uflo.environmentProvider")) {
this.origin = (EnvironmentProvider)this.ioc.get(EnvironmentProvider.class, "uflo.environmentProvider");
}
}
}