Joyven_个人页

个人头像照片 Joyven
个人头像照片 个人头像照片
11
22
0

个人介绍

个人博客:https://www.zhoujunwen.com

擅长的技术

  • Java
  • 前端开发
  • Linux
  • 数据库
获得更多能力
通用技术能力:
云产品技术能力:

阿里云技能认证

详细说明
暂无更多信息
  • 发表了文章 2019-11-15

    多SSH KEY切换部署同步代码

  • 发表了文章 2019-11-12

    JAVA中BIO、NIO、AIO的分析理解

  • 发表了文章 2019-10-10

    浅谈AOP以及AspectJ和Spring AOP

  • 发表了文章 2019-10-10

    Shell多进程执行任务

  • 发表了文章 2015-09-22

    Curl POST to HTTPS url gives SSLRead() error:curl: (56) SSLRead() return error -9806

  • 发表了文章 2015-09-21

    phalcon的安装详细

  • 发表了文章 2015-09-10

    eclipse设置maven加载国内镜像

  • 发表了文章 2015-08-31

    ubuntu禁用笔记本触摸板

  • 发表了文章 2015-08-31

    vim全局替换命令

  • 发表了文章 2015-08-26

    SVN冲突解决方法

  • 发表了文章 2015-05-05

    JUnit单元测试工具

正在加载, 请稍后...
滑动查看更多
  • 回答了问题 2022-11-30

    Java的下载文件Servlet,自动更新到chrome【83.0.4103.61 】,文件下载失败

    Google Chrome 下载文件的时候有个小 bug,文件名中不能包含逗号(,),而且字符编码需要改为 ISO 8859-1。

    可以用下面的方式尝试一下:

    String fileName = URLEncoder.encode(mixedFileNameArr[1],"UTF-8");
    new String(fileName.getBytes("UTF-8"), "ISO8859-1");
    
    踩0 评论0
  • 回答了问题 2020-10-23

    为体验实验室取一个新名字。

    百灵,凌云

    踩0 评论0
  • 回答了问题 2020-02-03

    【开工大吉】晒出你的“工位”照,赢开工红包!

    IMG_20200203_162910.jpg IMG_20200203_162854.jpg

    家里冷,不敢吹空调,只能在脚下放一个暖风机。

    踩0 评论1
  • 回答了问题 2019-11-15

    如何为MySQL 8 JDBC客户端启用LOAD DATA LOCAL INFILE

    首先在 Mysql8 中,默认“LOAD DATA LOCAL INFILE”是OFF,即关闭的一起。需要在服务端开启:

    SET @@GLOBAL.local_infile=1;
    

    在客户端命令行中使用,正如你所说,需要添加--local-infile=1参数,但是在JDBC中,貌似没有这个限制。只是需要使用超级用户权限。同时,你需要注意,你的文件必须是MySQL服务系统所在机器中的文件,而不是本地客户机器中中文件(或者说并不是你应用部署系统的文件,除非你的应用和MySQL在同一个机器上)。

    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/foobar", "root", "password");
    Statement stmt = con.createStatement();
    String sql = 
        "load data infile 'c:/temp/some_data.txt' \n" +
        "   replace \n" +
        "   into table prd \n" +
        "   columns terminated by '\\t' \n" +
        "   ignore 1 lines";
    stmt.execute(sql);
    
    踩0 评论0
  • 回答了问题 2019-11-15

    你们有试过在同样的3台机器上部署两套kafka吗?

    kafka的目录,kfka的端口,zk的端口,zk的目录分别配置就可以了呀。

    踩0 评论0
  • 回答了问题 2019-11-12

    为什么Java会有transient字段?

    The transient keyword in Java is used to indicate that a field should not be part of the serialization (which means saved, like to a file) process.

    From the Java Language Specification, Java SE 7 Edition, Section 8.3.1.3. transient Fields:

    Variables may be marked transient to indicate that they are not part of the persistent state of an object.

    For example, you may have fields that are derived from other fields, and should only be done so programmatically, rather than having the state be persisted via serialization.

    Here's a GalleryImage class which contains an image and a thumbnail derived from the image:

    class GalleryImage implements Serializable
    {
        private Image image;
        private transient Image thumbnailImage;
    
        private void generateThumbnail()
        {
            // Generate thumbnail.
        }
    
        private void readObject(ObjectInputStream inputStream)
                throws IOException, ClassNotFoundException
        {
            inputStream.defaultReadObject();
            generateThumbnail();
        }    
    }
    

    In this example, the thumbnailImage is a thumbnail image that is generated by invoking the generateThumbnail method.

    The thumbnailImage field is marked as transient, so only the original image is serialized rather than persisting both the original image and the thumbnail image. This means that less storage would be needed to save the serialized object. (Of course, this may or may not be desirable depending on the requirements of the system -- this is just an example.)

    At the time of deserialization, the readObject method is called to perform any operations necessary to restore the state of the object back to the state at which the serialization occurred. Here, the thumbnail needs to be generated, so the readObject method is overridden so that the thumbnail will be generated by calling the generateThumbnail method.

    For additional information, the Discover the secrets of the Java Serialization API article (which was originally available on the Sun Developer Network) has a section which discusses the use of and presents a scenario where the transient keyword is used to prevent serialization of certain fields.

    踩0 评论0
  • 提交了问题 2019-11-12

    为什么Java会有transient字段?

  • 回答了问题 2019-11-12

    com.sun.xml.internal.ws.client does not exist

    • 解决办法 添加pom依赖:
    <dependency>
          <groupId>com.sun.xml.ws</groupId>
          <artifactId>jaxws-rt</artifactId>
          <version>2.1.4</version>
     </dependency>
    

    不知道为什么,显示不了xml标签,我截图如下: image.png

    踩0 评论0
  • 提交了问题 2019-11-12

    com.sun.xml.internal.ws.client does not exist

  • 回答了问题 2019-11-12

    localhost与127.0.0.1的性能问题

    localhost也叫local ,正确的解释是:本地服务器 127.0.0.1在windows等系统的正确解释是:本机地址(本机服务器)

    • 1、127.0.0.1是回送地址,指本地机,一般用来测试使用。回送地址是本机回送地址(Loopback Address),即主机IP堆栈内部的IP地址,主要用于网络软件测试以及本地机进程间通信,无论什么程序,一旦使用回送地址发送数据,协议软件立即返回,不进行任何网络传输。
    • 2、localhost是本地DNS解析的127.0.0.1的域名,这个你打开本机的hosts文件就可以看到,一般位于c:\windows\system32\driver\etc下,一般在最后有这么一行:
    127.0.0.1 localhost
    
    • 3、本机IP则指你连到网络上的IP地址,可以是内网地址,当然也可能是公网IP,这个就是你实际利用TCP/IP协议与网上计算机通信时使用的IP了。

    localhot(local)是不经网卡传输,它不受网络防火墙和网卡相关的的限制。 127.0.0.1 是通过网卡传输,依赖网卡,并受到网络防火墙和网卡相关的限制。

    一般设置程序时本地服务用localhost是最好的,localhost不会解析成ip,也不会占用网卡、网络资源。

    有时候用localhost可以,但用127.0.0.1就不可以的情况就是在于此。猜想localhost访问时,系统带的本机当前用户的权限去访问,而用ip的时候,等于本机是通过网络再去访问本机,可能涉及到网络用户的权限。

    踩0 评论0
  • 回答了问题 2019-11-12

    有2个域名为什么域名解析到同一ip会自动跳转到另一个域名

    这里有具体的排查思路你可以参考一下:https://help.aliyun.com/knowledge_detail/84083.html?spm=5176.13394938.0.0.6ff04d57onSrct

    感觉这个和你现在遇到的情况很相似。

    踩0 评论0
  • 回答了问题 2019-11-12

    ETC服务器上 Ubuntu系统下MySQL8.0远程连接一直不成功

    2003-不能连接到MySQL服务器上的’119.23.168.137’(100060"未知错误")

    • 1.网络不通 检查能不能ping通。
    • 2.防火墙设置 防火墙是否放过mysql的进程,是否屏蔽了mysql的3306端口。如果是阿里云ECS服务,安全组中3306端口默认是没有开启的。如果3306在安全组中,再检查一下iptable中是否开启3306的出口。
    • 3.mysql的账户设置 mysql账户是否不允许远程连接。如果无法连接可以尝试以下方法: 如果你想myUser使用myPassword从任何主机连接到mysql服务器的话
    GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 
    FLUSH PRIVILEGES; 
    

    通过修改表来实现远程:

    mysql -u root -pvmwaremysql>use mysql; 
    mysql>update user set host = '%' where user = 'root'; 
    mysql>select host, user from user; 
    
    踩0 评论0
  • 回答了问题 2019-11-12

    Java怎么让socket服务一直运行?

    不管是BIO还是NIO,其实都是通过轮训的方式来实现socket服务的。下面几个demo或许有助于你:

    • BIO
    public class BIODemo {
        public static void main(String[] args) throws IOException {
            ServerSocket serverSocket = new ServerSocket();
            serverSocket.bind(new InetSocketAddress("0.0.0.0", 8888), 50);
            Socket socket;
            while ((socket = serverSocket.accept()) != null) {
                InputStream is = socket.getInputStream();
                byte[] data = new byte[1024];
                is.read(data);
    
                System.out.println(new String(data, UTF_8));
                OutputStream out = socket.getOutputStream();
                out.write(data);
                socket.close();
            }
        }
    }
    
    • NIO
    public class NIODemo {
        public static void main(String[] args) throws IOException {
            ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
            serverSocketChannel.bind(new InetSocketAddress("0.0.0.0", 8888), 50);
            serverSocketChannel.configureBlocking(false);
            Selector selector = Selector.open();
            serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);
    
            while (true) {
                selector.select();
                Set<SelectionKey> selectionKeys = selector.selectedKeys();
                Iterator<SelectionKey> iterator = selectionKeys.iterator();
                while (iterator.hasNext()) {
                    SelectionKey key = iterator.next();
                    if (!key.isValid()) {
                        continue;
                    }
    
                    if (key.isAcceptable()) {
                        ServerSocketChannel serverChannel = (ServerSocketChannel) key.channel();
                        SocketChannel clientChannel = serverChannel.accept();
                        clientChannel.configureBlocking(false);
                        clientChannel.register(selector, SelectionKey.OP_READ);
                    } else if (key.isReadable()) {
                        ByteBuffer buffer = ByteBuffer.wrap(new byte[1024]);
                        SocketChannel clientChannel = (SocketChannel) key.channel();
                        int read = clientChannel.read(buffer);
    
                        if (read == -1) {
                            key.cancel();
                            clientChannel.close();
                        } else {
                            buffer.flip();
                            clientChannel.write(buffer);
                        }
                    }
                }
                iterator.remove();
            }
        }
    }
    

    如果你需要更详细的更深入的了解,可以参考我的这篇文章 JAVA中BIO、NIO、AIO的分析理解 https://developer.aliyun.com/article/726698?spm=a2c6h.13148508.0.0.1d844f0eaWNdWj

    踩0 评论0
  • 回答了问题 2019-11-12

    阿里云开发者社区招募首批问答官

    很棒!!!

    踩0 评论0
  • 回答了问题 2019-11-12

    java.lang.UnsupportedOperationException: This is supposed to be overridden by subclasses.

    不支持的操作异常,根据提示,当前某个类不允许子类覆盖。检查你的业务代码,是不是集成了final的类,或者有哪些集合是不可修改的。

    没有其他错误信息,也看不出具体的问题。

    踩0 评论0
  • 回答了问题 2019-11-12

    保护 Spring Boot 应用有哪些方法?

    从两个方面来说吧。第一个是编码安全,第二个是网络设备安全。

    • 编码安全,也需要根据情况进行分析,如果非web项目:
      • 如果有数据库,注意字符编码问题,防止XSS攻击,如果是用Mybatis,建议多使用#做参数的获取
      • 注意异常的处理,不要把系统信息暴露在外面
      • 注意接口权限的校验,永远不要相信用户传入的数据
    • 如果是web项目,除了上面的还应该注意下面的问题:
      • ①需要开启HTTPS
      • ②检查pom中依赖的软件没有已知的漏洞,比如fastjson暴露的0day漏洞,apache zooker 1.0.0~3.4.13存在的ACL越权漏洞
      • ③启动CSRF保护
      • ④注意XSS攻击
    • 网络设备安全,这块儿就是说你部署的服务硬件是安全的,编码再怎么安全,如果服务器不安全,反编译啥都能拿到:
      • 开启防火墙
      • 开启白名单,如果有
      • 开启黑名单限制访问
      • 服务器内核漏洞不容忽视
    踩0 评论0
  • 回答了问题 2019-11-12

    请教下怎么解析域名到163免费企业邮箱

    http://app.ym.163.com/ym/reg/view/index 这个163域名企业邮箱注册地址,根据提示一步一步操作。需要在你的域名解析服务中增加一条MX的配置,值为mx.ym.163.com

    image.png

    http://app.ym.163.com/ym/help/help-hmail.html#3.6 这是域名验证的方法。

    踩0 评论0
  • 回答了问题 2019-11-12

    pts性能测试post参数中添加特殊符号&

    特殊符号&通过urlencode编码试试看。 &编码后为 %26

    踩0 评论0
  • 回答了问题 2019-11-13

    阿里的工程师go语言都什么开发工具?有没用go语言的相关资料可以参考参考?

    上面各位都已经回答的很好了,再补充一个人,国内go语言方面的大神:郝林。

    郝林是 GoHackers 技术社群发起人,畅销榜书籍《Go并发编程实战》的作者,前轻松筹大数据负责人。13年软件开发从业经验,做过银行、电信软件和互联网社交产品。从2012年底开始关注Go语言,对Go语言和 Docker 技术都情有独钟,是Go语言的忠实拥护者。

    不过,郝林一直活跃在 GoHackers 微信群和知识星球,如果你需要进入 GoHackers 技术群,你可以加我,我征询一下大佬,看能不能把你加进去,微群是免费的,知识星球可能是收费的,我没太关注过。

    踩0 评论0
  • 提交了问题 2017-11-06

    .win域名不能备案且该网站暂时无法访问

正在加载, 请稍后...
滑动查看更多
正在加载, 请稍后...
暂无更多信息