• 1 已解决
    0
    ubuntu 普通用户设置的crontab任务不会执行吗?

    我用普通用户的身份添加了一个crontab任务:

    0 16 * * * xxxxxxx

    过了时间没有执行,查看crontab.log也没有报错日志。

    咋回事呢?

  • 1 已解决
    0
    rabbitmq中有没有类似redis中set类型的队列?

    如果没有,该如何确保队列中数据是不重复的呢呢

  • 1 已解决
    0
    Shiro 异步报错

    web.xml 关键配置, 可以确定的是配置顺序没有问题

    <!-- 安全过滤 -->
    	<filter>
    		<filter-name>shiroFilter</filter-name>
    		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    		<async-supported>true</async-supported>
    		<init-param>
    			<param-name>targetFilterLifecycle</param-name>
    			<param-value>true</param-value>
    		</init-param>
    	</filter>
    	<filter-mapping>
    		<filter-name>shiroFilter</filter-name>
    		<url-pattern>*.do</url-pattern>
    		<url-pattern>*.json</url-pattern>
    		<url-pattern>*.xhtml</url-pattern>
    	</filter-mapping>
    	
    	<!-- SpringMVC功能 -->
    	<servlet>
    		<servlet-name>dispatcher</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>/META-INF/spring/appconf-*.xml</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    		<async-supported>true</async-supported>
    	</servlet>
    	<servlet-mapping>
    		<servlet-name>dispatcher</servlet-name>
    		<url-pattern>*.do</url-pattern>
    		<url-pattern>*.json</url-pattern>
    		<url-pattern>*.xhtml</url-pattern>
    	</servlet-mapping>

    控制器代码1, 像这样加入异步处理,正常响应,但是后台报错

    /**
    	 * 分页查询
    	 * 
    	 * @param queryVo
    	 * @return Pagination<DynamicformVo>
    	 */
    	@RequestMapping("queryPage")
    	@ResponseBody
    	public Callable<Pagination<DynamicformVo>> getGrid(@ModelAttribute("DynamicformQueryVo") final DynamicformQueryVo queryVo) {
    		return new Callable<Pagination<DynamicformVo>>() {
    			@Override
    			public Pagination<DynamicformVo> call() throws Exception {
    				return dynamicformService.queryForPage(queryVo);
    			}
    		};
    	}

     

    控制器代码2, 像这样写,正常处理没有报错,可惜不支持异步

    /**
    	 * 分页查询
    	 * 
    	 * @param queryVo
    	 * @return Pagination<DynamicformVo>
    	 */
    	@RequestMapping("queryPage")
    	@ResponseBody
    	public Pagination<DynamicformVo> getGrid(@ModelAttribute("DynamicformQueryVo") final DynamicformQueryVo queryVo) {
    		return dynamicformService.queryForPage(queryVo);
    	}

    报错如下:

    org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is an invalid application configuration.
    	at org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)
    	at org.apache.shiro.subject.Subject$Builder.<init>(Subject.java:627)
    	at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
    	at org.apache.shiro.web.servlet.ShiroHttpServletRequest.getSubject(ShiroHttpServletRequest.java:88)
    	at org.apache.shiro.web.servlet.ShiroHttpServletRequest.getSubjectPrincipal(ShiroHttpServletRequest.java:93)
    	at org.apache.shiro.web.servlet.ShiroHttpServletRequest.getUserPrincipal(ShiroHttpServletRequest.java:111)
    	at org.springframework.web.servlet.FrameworkServlet.getUsernameForRequest(FrameworkServlet.java:1079)
    	at org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1065)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:996)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
    	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
    	at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:659)
    	at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:625)
    	at org.apache.catalina.core.AsyncContextImpl$1.run(AsyncContextImpl.java:237)
    	at org.apache.catalina.core.AsyncContextImpl.doInternalDispatch(AsyncContextImpl.java:380)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:215)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    	at org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:299)
    	at org.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1632)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:599)
    	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
    	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    	at java.lang.Thread.run(Thread.java:619)

     如上所述,Shiro 在处理Servlet3异步请求时会出现异常?要怎么处理呢?可以通过log4j配置把该错误屏蔽掉,但这不是我想要的效果!

  • 1 已解决
    0
    为啥redis的set类型存储超过一万条数据就会性能下降?

    为啥redis的set类型存储超过一万条数据就会性能下降?

  • 1 已解决
    0
    我该怎么取这里面的值?

    我在尝试调用一个DLL,按照文档上面说的,它返回0是表示成功,但是我想取里面的值,我应该怎么取buffData 返回值呢?

    attachments-2020-03-OldUclO85e704154435a6.png

    attachments-2020-03-ucR28jGl5e70415aa83f1.png

    attachments-2020-03-HozbAbTL5e704162009fb.png

  • 1 已解决
    0
    SpringBoot Get 请求如何将一个时间戳转换为Date, 最好是框架原本就有的

    attachments-2020-03-zd5WhuAK5e70421a55dec.png

    attachments-2020-03-M53cia3m5e7041f9750d9.png

  • 1 已解决
    0
    如何判断两个长json是否相同?

    RT。

    想过转化成字符串然后md5,怎奈两个json转换成字符串后,里面属性的顺序会变(比如第一个json里name在前age在后,第二个json有时就会age在前name在后),这样的话明明是两个相同的json,字符串化以后验证的结果却是不相同的……

    有没有什么方法能快速判断两个长json是否相同呢?

    PS:尤其是对于golang而言,有没有什么更好的办法?

  • 1 已解决
    0
    初始化对象放在私有方法中操作,却对原对象未初始化,为什么?

    attachments-2020-03-oM0AWeVg5e7040a3c75e5.png

    我在打印student上一步,初始化student的私有方法中对student进行了赋值,可上面主方法执行打印后student对象还是null,大佬们可知道为什么吗,感激不尽

    以下为测试代码

    attachments-2020-03-Qa9MEcYP5e70408a2dbf9.png

  • 1 已解决
    0
    redis大量key怎么存比较省空间

    7000w+简单key(key产生规则是笛卡尔积),vlaue基本就是1、2、3这种简单数字,怎么存比较省空间

  • 1 已解决
    0
    两个并发同时请求,修改数据导致数据有一次修改相同的数据

    attachments-2020-03-8xwsbGrD5e6f1f434a35e.png

    加了悲观锁,

    加了泄洪队列,

    加了限流,

    还会出现

  • 1 已解决
    0
    想法讨论:网站文章栏目分类以关键词代替可行吗

    如果发布文章时不需要分类,只需要提供关键词,当需要调用时,以关键词搜索,或者标题搜索、全文搜索方式返回即可。

    提出此想法的原因是觉得让文章按栏目分类,创建栏目繁琐,而且还伴随二级、三级栏目,甚至无限分类等功能。

    所以,我想以关键词取代栏目分类的想法不知可不可行,请大家指点哈!

  • 1 已解决
    0
    外观模式和命令模式的区别

    Java小白求救,外观模式和命令模式有什么区别,它们都是把复杂逻辑屏蔽,只对外提供一个接口。具体要怎么分辨这两个模式呀!

  • 1 已解决
    0
    mysql从5.6升级8.0后,sql查询变慢

    听说mysql8比mysql5要快很多,我们就尝试将mysql从5.6升级到8.0,然后有些sql就变慢了

    sql如下:

    SELECT
       a.id AS 'id',
       CONCAT(a.firstname,' ',a.lastname) AS 'name',
       a.name AS fullName,
       a.firstname AS 'firstname',
       a.lastname AS 'lastname',
       a.teaching_style as teachingStyle,
       a.type_of_english as typeOfEnglish,
       a.avatar AS 'avatar',
       a.avatar_url AS 'avatarurl',
       c.course_id AS courseId,
       CONCAT(
       IFNULL(a.favorable_rate, '100'),
       '%'
       ) AS rate,
       f.file_path AS path
      FROM
      busi_teacher a
      LEFT JOIN busi_tea_schedule b  ON a.id = b.tea_id
      LEFT JOIN busi_tea_course c ON (a.id = c.tea_id AND c.issys = 1)
      LEFT JOIN busi_stu_course d ON b.stu_course = d.id
      LEFT JOIN busi_file f ON f.id = a.avatar
      WHERE   b. STATUS = 1
      AND b.can_normal = 1
      AND ( (a.is_fulltime = 1 AND b.is_contracted = 1) OR a.is_fulltime != 1 )
      AND b.ex_schedule_date > DATE_ADD(NOW(), INTERVAL 24 HOUR)
      AND (b.ex_schedule_date < '2019-12-25 08:00:00' OR b.ex_schedule_date > '2019-12-27 07:59:00')
      AND (b.ex_schedule_date < '2020-01-01 08:00:00' OR b.ex_schedule_date > '2020-01-02 07:59:00')
       AND a. STATUS IN (3, 7)
      AND b.del_flag = 0
      AND a.del_flag = 0
      AND a.isuse = 1
      AND (b.stu_course IS NULL OR d.course_status = 3)
      AND  FIND_IN_SET('152',c.course_id)
        AND HOUR(b.ex_schedule_date) < 21
        GROUP BY a.id
      ORDER BY b.is_contracted DESC, a.promoted DESC,(CASE a.is_fulltime WHEN 1 THEN 1 WHEN 0 THEN 2 ELSE 3 END),a.firstname
      LIMIT  10;

    mysql版本5.6.16-log:执行0.157s,explain如下

    up-241e59b6556c3035de3c5b00420006376dd.png

    up-88b6df7fe9fd90c05c914e8763339cd2948.png

    mysql版本8.0.16:执行2.080s,explain如下

    up-06593bfbafd4c908443f2af7f60b1162a2a.png

    up-d0ef442beab9c7849e0f00b3c134489cb5b.png

    mysql8先执行a表,mysql5.6先执行b表。mysql8的Creating sort index花费了99%的时间,我将排序去掉后两个版本都执行一遍后,mysql8是要比mysql5.6要快,但是加上排序后mysql8就很慢了,感觉是在mysql8中排序并没有用到索引。有没有大神能看出来是哪儿出了问题吗,是mysql系统参数设置有问题吗?

  • 1 已解决
    0
    Xtrabackup8 对docker中容器的mysql备份

    我想对docker部署的mysql8.0.19进行备份,一开始试了一下Xtrabackup8.0.9 发现宿主机安装Xtrabackup不能连接到docker的mysql,需在docker容器里面安装。因为是微服务系统,数据库会有多个不想在每个容器中都安装Xtrabackup,请教各路大神宿主机安装Xtrabackup怎么对docker 容器的mysql备份,或者还有没有其它更好用的备份工具, mysqldump  这种方式不考虑

    一下是允许命令后的异常信息

    xtrabackup: recognized server arguments:--log_bin=mysql-bin--server-id=1--innodb_flush_log_at_trx_commit=1--innodb_log_buffer_size=1M--innodb_buffer_pool_size=64M--innodb_log_file_size=48M--innodb_autoextend_increment=64--innodb_open_files=300--innodb_file_per_table=1--innodb_checksum_algorithm=0--open_files_limit=4161xtrabackup: recognized client arguments:--user=root--password=*--host=172.17.0.2--port=8250--backup=1--parallel=4--target-dir=/home/back/db_cms_xtrabackupversion8.0.9basedonMySQLserver8.0.18Linux(x86_64)(revisionid:c5cbbe4)20031415:23:24version_checkConnectingtoMySQLserverwithDSN'dbi:mysql:;mysql_read_default_group=xtrabackup;host=172.17.0.2;port=8250'as'root'(usingpassword:YES).Failed to connect to MySQL server:DBIconnect(';mysql_read_default_group=xtrabackup;host=172.17.0.2;port=8250','root',...)failed:Can'tconnecttoMySQLserveron'172.17.0.2'(111)at-line1535.200314 15:23:24 Connecting to MySQL server host:172.17.0.2,user:root,password:set,port:8250,socket:notsetFailed to connect to MySQL server:Can'tconnecttoMySQLserveron'172.17.0.2'(111).

    脚本

    xtrabackup --defaults-file=/home/mysql/xxx/master/config/my.cnf -uroot -pXXX -Hlocalhost --port=8250 --backup --parallel=4 --target-dir=/home/back/db_xxx_ $name

     -H 一开始设置的是localhost不行,我换了mysql容器中的ip地址‘172.17.0.2’也不行。





  • 1 已解决
    0
    怎么把传统的SSM项目以打成jar包部署运行?

    之前有一个非maven项目是用spring,spring mvc,mybatis搭建的,我想能像spring boot那样,部署成可执行的jar包以微服务的方式进行部署安装,脱离单独tomcat软件。在eclipse中,这个怎么改动才能做到?

  • 1 已解决
    0
    分布式系统解决非法并发请求方案

    在分布式系统下,一个正常运行的系统,怎么解决大量的非法并发请求攻击。比如:有3~5万个非法的请求,同时请求系统的某些资源,这种情况该如何解决。还请各位大神指点一二!

  • 1 已解决
    0
    PHP将两级联动数据表生成JSON数据

    有上图结构数据表,用PHP如何生成下面结构的JSON?

    [

        {

            "name":"电脑",

            "id":"1",

            "list":[

                {

                    "name":"无法开机",

                    "id":"3"

                },

                {

                    "name":"无法联网",

                    "id":"4"

                },

                {

                    "name":"蓝屏",

                    "id":"5"

                }

            ]

        },

        {

            "name":"打印机",

            "id":"2",

            "list":[

                {

                    "name":"卡纸",

                    "id":"6"

                },

                {

                    "name":"加粉",

                    "id":"7"

                }

            ]

        }

    ]


  • 1 已解决
    0
    实在无解了,怎么办啊???

    两个进程共享一个manager().list,一个写入,一个不停循环读取,写入没有问题,读出现如下错误:

    Traceback (most recent call last):   File "C:\Anaconda3\lib\site-packages\apscheduler\executors\base.py", line 125, in run_job     retval = job.func(*job.args, **job.kwargs)   File "\\Mac\iCloud\Pyto\Tsing\bts_factory.py", line 588, in Scaning     y = len(od_inStore[j]) - 1   File "<string>", line 2, in __getitem__   File "C:\Anaconda3\lib\multiprocessing\managers.py", line 819, in _callmethod     kind, result = conn.recv()   File "C:\Anaconda3\lib\multiprocessing\connection.py", line 251, in recv     return _ForkingPickler.loads(buf.getbuffer())   File "C:\Anaconda3\lib\multiprocessing\managers.py", line 943, in RebuildProxy     return func(token, serializer, incref=incref, **kwds)   File "C:\Anaconda3\lib\multiprocessing\managers.py", line 793, in __init__     self._incref()   File "C:\Anaconda3\lib\multiprocessing\managers.py", line 847, in _incref     conn = self._Client(self._token.address, authkey=self._authkey)   File "C:\Anaconda3\lib\multiprocessing\connection.py", line 498, in Client     answer_challenge(c, authkey)   File "C:\Anaconda3\lib\multiprocessing\connection.py", line 741, in answer_challenge     message = connection.recv_bytes(256)         # reject large message   File "C:\Anaconda3\lib\multiprocessing\connection.py", line 216, in recv_bytes     buf = self._recv_bytes(maxlength)   File "C:\Anaconda3\lib\multiprocessing\connection.py", line 321, in _recv_bytes     raise EOFError EOFError

  • 1 已解决
    0
    关于微服务的几个问题?实在百度不到问题答案

    对于一个微服务系统中,zuul是不是唯一的?按照我的理解,这东西是网关,网关应该就是唯一的,不会有多个。

    第二个问题,ribbon要配置几个,是不是配置在zuul的服务上就行了,但看官方文档上有一个词叫 “Ribbon客户端” ,那岂不是说可以有多个?但我的想法上,这东西既然如果是放在zuul上,(zuul实际上已经支持负载均衡了,只不过是轮询方式的,暂时没找到配置负载的策略办法),那配一个应该就够了,就和nginx一样使用

  • 1 已解决
    0
    用Golang开发物联网接入网关?

    随着Golang的使用越来越多,加上Golang的各种性能上的优势。

    大胆的提出使用Golang开发物联网接入网关,各位大神来谈谈利弊或者可行性。谢谢!