yangfuhai / jboot Goto Github PK
View Code? Open in Web Editor NEW一个优雅的微服务框架,SpringCloud 之外的另一个选择,已经使用在用户量过亿的商业产品上,有超过1000家公司在使用Jboot做极速开发...
Home Page: http://www.jboot.com.cn
License: Apache License 2.0
一个优雅的微服务框架,SpringCloud 之外的另一个选择,已经使用在用户量过亿的商业产品上,有超过1000家公司在使用Jboot做极速开发...
Home Page: http://www.jboot.com.cn
License: Apache License 2.0
Apache公布了Dubbo Hession的反序列化漏洞
影响范围:
Apache Dubbo 2.7.x版本:<= 2.7.17
Apache Dubbo 3.0.x版本:<= 3.0.11
Apache Dubbo 3.1.x版本:<= 3.1.0
目前该漏洞已经修复,受影响用户可以升级到Dubbo hessian-lite 版本 >=3.2.13;或升级Apache Dubbo到以下版本:
Apache Dubbo 2.7.x版本:>= 2.7.18
Apache Dubbo 3.0.x版本:>= 3.0.12
Apache Dubbo 3.1.x版本:>= 3.1.1
我查看了最新的1.16.5的pom文件,文件中引用的dubbo版本是2.7.15,能不能升级一下dubbo的依赖解决这个漏洞
JbootGatewayConfig 中,拦截器执行顺序属性,private private GatewayInterceptor[] inters 需添加一个public void setInters(private GatewayInterceptor[] inters)方法,以便于动态调整拦截器的执行顺序与动态的增加与删除拦截器
集成GraphQL,对于减少服务端的工作量还是很有意义的
#@
海哥你好,基于改过后的代码写了个小测试,代码如下:
public void sessionTest(){
HttpSession session = getSession();
Ret ret = Ret.create("sessionid",session.getId());
if(getSessionAttr("data")!=null){
ret.set("data", getSessionAttr("data"));
}else{
long data = System.currentTimeMillis();
setSessionAttr("data", data);
System.out.println(getSessionAttr("data").toString());
ret.set("data", data);
}
renderJson(ret);
}
用FF隐私浏览窗口首次访问时会在第9行抛出空指针异常。
跟踪进去发现,在首次访问时,凡是用到session.getId()
,setSessionAttr
,getSessionAttr
这几个方法的时候,都会访问JbootHttpSessionWapper的getOrCreatSessionId方法,但是又都得不到JSESSIONID值,导致都会重新生成一次sessionid。
这个问题麻烦确认一下。
Grpc 还不知支持的吧
旧
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.7</version>
</dependency>
新
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>2.7.4.1</version>
</dependency>
1、jboot版本1.4.8
2、配置:
jboot.metric.url=/metrics
jboot.metric.reporter=slf4j
3、在Controller上写@EnableMetricCounter @EnableMetricConcurrency 等统计注解
4、访问 http://127.0.0.1:8080/metrics 报错 404
海哥,请教哪里的问题
我看了一下源码。发现jboot重写了save方法,然后有做判断id为空时候设置id为uuid。。。是不是只能用uuid做主键了。。。
现在很多场景都需要mqtt服务,jboot有没有打算支持mqtt呢?
你好,能不能将安全控制 使用方式 文档等完善,方便开发使用,这样能更好的使用jboot,谢谢开源;
当主机多个ip的时候,可能会导致dubbo获取到错误,建议将duboo注册服务配置文件:
<dubbo:protocol host="192.168..">放出来。
httpPost 方法的参数如果是json对象,有可能是多层的,那么我看了jboot内部只处理了一层这样参数就出问题了,希望可以提供以字符串为参数,实际上application/json头,后端比如PHP接收到的就是对象
jboot为Jfinal对数据库操作做了增强和扩展。通常我们习惯把业务层定义为service,代码生成工具JbootServiceInterfaceGenerator,JbootServiceImplGenerator要能为生成的名类自定义后缀就好啦。
试一下建个数据库,主键为userId,代码生成器不支持
如果不用Jboot.run(args);
的话, 调用数据库的Service实例的时候会报错NullPointer.
这里的DbKit.getConfig(HoUserSettings.class)
返回了null.
每行暂停Debug了一下发现执行到initUndertowServer:107, UnderTowServer (io.jboot.server.undertow)
这里的时候才不会返回null, 但是这样HTTP服务器已经启动了...
initUndertowServer:107, UnderTowServer (io.jboot.server.undertow)
start:192, UnderTowServer (io.jboot.server.undertow)
startServer:167, Jboot (io.jboot)
start:148, Jboot (io.jboot)
run:91, Jboot (io.jboot)
...
sql输出执行时间是个很不错的功能,弥补性能调优中代码中执行SQL代码段大量存在计算耗时的代码,非常实现。
在web性能调优中,大致需求如下:
1,输出整个页面从用户进入到页面输出的总时间;
2,在Jfinal的应用中,我们还会经常使用Directive自定义指令,还需要知道每个Directive输出耗时,便于知道耗时在哪
3,部分Render也会定义一些function,比如#define paginate,虽然一般耗时短,但也想明明白白知道耗时。
目前我的简单思路是:
1,写一个Handler,把优先级调到最高,这样所有的请求都包含在里面,
Stopwatch watch = Stopwatch.createStarted();
next.handle(target, request, response, isHandled);
long time = watch.elapsed(TimeUnit.MILLISECONDS);
logger.error("spendTime:{},{}", time, target);
2,在JbootDirectiveBase中
@OverRide
public void exec(Env env, Scope scope, Writer writer) {
Stopwatch watch = Stopwatch.createStarted();
scope = new Scope(scope);
scope.getCtrl().setLocalAssignment();
exprList.eval(scope);
onRender(env, scope, writer);
long time = watch.elapsed(TimeUnit.MILLISECONDS);
//需要反射获取子类的@JFinalDirective名称和类名
//logger.error("spendTime:{},{}", time, target);
}
3,写一个public class TimeRender extends TemplateRender
@OverRide
public void render() {
Stopwatch watch = Stopwatch.createStarted();
super.render();
long time = watch.elapsed(TimeUnit.MILLISECONDS);
logger.error("spendTime:{},{}", time, this.getView());
}
海哥看看能否增加.
<dependency>
<groupId>io.jboot</groupId>
<artifactId>jboot</artifactId>
<version>2.0-rc.13</version>
</dependency>
CORSInterceptor Line50
String method = inv.getController().getRequest().getMethod();
if (METHOD_OPTIONS.equals(method)) {
inv.getController().renderText("");
return;
}
doProcessCORS(inv, enableCORS);
JbootController 的getBean 和getModel 以及 @para ,只能获取表单提交的参数吗?
如果想做到spring 的@requestbody那样获取Content-Type:application/json 的JSON数据,怎么做?
测试过getBean,getModel,@para 都拿不到
之前是基于jboot.properties中配置Dubbo引用Provider,例如
MongoDB的服务的配置:
group:application.provider.mongodb.group = mongodbApplication
version: application.provider.mongodb.version = 1
在Mall项目中引入MongoDB的Provider
@RPCInject(group = "${application.provider.mongodb.group}", version = "${application.provider.mongodb.version}")
public com.mars.core.provider.EmailServiceProvider emailServiceProvider ;
RPC 相关配置
jboot.rpc.type=dubbo
jboot.rpc.registryType=zookeeper
jboot.rpc.registryAddress=172.17.0.4:2181
jboot.rpc.registryCheck=true
jboot.rpc.requestTimeOut=15000
jboot.rpc.retries=0
错误信息
[ERROR]-[Thread: main]-[io.jboot.aop.JbootAopFactory.doInjectRPC()]: can not inject rpc service in class com.mars.core.provider.email.EmailServiceProvider$$EnhancerByCGLIB$$7e3bd1d6 by config @io.jboot.components.rpc.annotation.RPCInject(registry=[], module=, loadbalance=random, monitor=, check=true, version=${application.version}, actives=0, generic=false, url=, timeout=0, retries=2, async=false, protocol=, application=, id=, tag=, consumer=, group=${application.name})
java.lang.IllegalStateException: Failed to check the status of the service com.mars.api.rpc.core.config.ISysConfigServiceProvider. No provider available for the service play-core-provider-dev/com.mars.api.rpc.core.config.ISysConfigServiceProvider:1 from the url zookeeper://172.16.20.214:2181/org.apache.dubbo.registry.RegistryService?application=tooth_beautiful&application.version=1&dubbo=2.0.2&group=play-core-provider-dev&interface=com.mars.api.rpc.core.config.ISysConfigServiceProvider&methods=findByConfigName,selectConfigListByConfigName,findByConfigNameAndConfigKey,findConfigValueToIntByConfigKey,saveOrUpdateSysConfig,findByConfigKey,findConfigValueByKey,selectByConfigName&pid=8620&qos.enable=false®ister.ip=172.16.10.241&release=2.7.5&revision=1&side=consumer&sticky=false×tamp=1597477784303&version=1 to the consumer 172.16.10.241 use dubbo version 2.7.5
at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:355)
at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:266)
at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:151)
at io.jboot.components.rpc.dubbo.JbootDubborpc.onServiceCreate(JbootDubborpc.java:61)
at io.jboot.components.rpc.JbootrpcBase.serviceObtain(JbootrpcBase.java:45)
at io.jboot.aop.JbootAopFactory.doInjectRPC(JbootAopFactory.java:194)
at io.jboot.aop.JbootAopFactory.doInject(JbootAopFactory.java:126)
at com.jfinal.aop.AopFactory.doGetSingleton(AopFactory.java:93)
at com.jfinal.aop.AopFactory.doGet(AopFactory.java:65)
at com.jfinal.aop.AopFactory.get(AopFactory.java:48)
at com.jfinal.aop.Aop.get(Aop.java:101)
at io.jboot.components.rpc.JbootrpcManager.exportRPCBean(JbootrpcManager.java:114)
at io.jboot.components.rpc.JbootrpcManager.init(JbootrpcManager.java:75)
at io.jboot.core.JbootCoreConfig.onStart(JbootCoreConfig.java:284)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:72)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)
at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:591)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:556)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:598)
at com.jfinal.server.undertow.UndertowServer.configHttp(UndertowServer.java:288)
at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:266)
at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:159)
at io.jboot.app.JbootApplication.start(JbootApplication.java:42)
at io.jboot.app.JbootApplication.run(JbootApplication.java:34)
at com.mars.core.provider.CoreProviderApplication.main(CoreProviderApplication.java:8)
io.jboot.support.redis.jedis.JbootJedisImpl第53-55行根据host进行了地址切割,如果是ipv6的地址,就会出现错误。
jboot版本1.4.4
场景一:
1、已配置 jboot.limitation.webPath = /jboot/limitation
2、Action上加@EnableConcurrencyLimit (rate = 2)注解
3、访问/jboot/limitation 返回数据:{"ipRates":{},"userRates":{},"concurrencyRates":{},"requestRates":{}}
4、并发访问action 没有限流效果
场景二:
1、通过/jboot/limitation/set 设置action限流
2、访问 /jboot/limitation 返回数据: {"ipRates":{},"userRates":{},"concurrencyRates":{"/user":{"enable":true,"rate":2.0,"type":"concurrency"}},"requestRates":{}}
3、并发访问action 有限流效果
期待期待期待正式版
JbootInvocation 没有重写Invocation setArg getArg 倒致参数不能向下传递
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jboot: Compilation failure [ERROR] /Users/leonis/git/jboot/src/main/java/io/jboot/aop/JbootInjectManager.java:[47,44] 对Module的引用不明确 [ERROR] com.google.inject 中的接口 com.google.inject.Module 和 java.lang 中的类 java.lang.Module 都匹配
错误如上
mvn -U clean package install -DskipTests
JbootmqBase.java 的构造方法:
public JbootmqBase() {
String channelString = config.getChannel();
if (StringUtils.isBlank(channelString)) {
return;
}
this.channels.addAll(StringUtils.splitToSet(channelString, ","));
this.syncRecevieMessageChannels.addAll(StringUtils.splitToSet(config.getSyncRecevieMessageChannel(), ","));
}
当只配置了 jboot.mq.channel ,但没有配置 jboot.mq.syncRecevieMessageChannel 时
StringUtils.splitToSet(config.getSyncRecevieMessageChannel() 这一行报空指针
jdk1.7 的支持?
是否有支持nacos的计划?
在初始化initConfigMappingTables的时候,把所有模块的实体表都放到当前模块的数据源的datasourceConfig里,结果在启动ActiveRecordPlugin的时候当前数据源肯定没有其他模块的表呀。
问题点就在ClassScanner.scanSubClass(Model.class)获取当前模块和依赖的其他模块所有model的子类,然后当前模块都配置了具有哪些表,还加到dataSourceConfig的tableinfo里去,所以
if(configTables != null && configTables.contains(tableInfo.getTableName))){
dataSourceConfig.addTableInfo(tableInfo,true);
continue;
}
海哥你好,最近在研究jboot的共享session的实现,发现了以下两个问题:
1.类名中Wapper是不是应改为Wrapper,包装意思?
2.该类的getOrCreatSessionId方法第一行代码String sessionid = ("JSESSIONID");
,想请教这是什么意思,这里是不是应该改为从cookie中取值String sessionid = getCookie("JSESSIONID");
,要不然所有的sessionid不就“JSESSIONID"?
public class JbootApp {
public static void main(String[] args) {
//mysql
JbootApplication.setBootArg("jboot.datasource.type", Jboot.configValue("jboot.datasource.type"));
JbootApplication.setBootArg("jboot.datasource.url", Jboot.configValue("jboot.datasource.url"));
....
JbootApplication.run(args);
}
}
执行时出现以下错误:
Exception in thread "main" java.lang.NullPointerException
at io.jboot.app.config.JbootConfigManager.setBootArg(JbootConfigManager.java:351)
at io.jboot.app.JbootApplication.setBootArg(JbootApplication.java:164)
at com.adsage.jobs.JbootApp.main(JbootApp.java:12)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.