精华内容
下载资源
问答
  • 接上回书,成功连接上vpn后,down代码,起代码……额,在起代码时又出现了问题。 问题 主要是这几句: Unable to start web server;...Unable to create the directory [/Users/liming/Downloads/logs/tomca...

    接上回书,成功连接上vPiEn后,down代码,起代码……额,在起代码时又出现了问题。

    问题

    主要是这几句:
    Unable to start web server;
    nested exception is java.lang.IllegalStateException:
    Unable to create the directory [/Users/liming/Downloads/logs/tomcat_log] to use as the base directory

    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    2020-04-12 10:24:37,648 [ERROR] [main] [org.springframework.boot.SpringApplication] - Application run failed
    org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: Unable to create the directory [/Users/liming/Downloads/logs/tomcat_log] to use as the base directory
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at com.yhdx.agbweapp.WeappApplication.main(WeappApplication.java:96) [classes/:na]
    Caused by: java.lang.IllegalStateException: Unable to create the directory [/Users/liming/Downloads/logs/tomcat_log] to use as the base directory
    	at org.apache.catalina.startup.Tomcat.initBaseDir(Tomcat.java:816) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
    	at org.apache.catalina.startup.Tomcat.getServer(Tomcat.java:625) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
    	at org.apache.catalina.startup.Tomcat.getService(Tomcat.java:558) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
    	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:169) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    	... 8 common frames omitted
    
    原因

    自己电脑是没有这个目录的,也或许是因为SIP安全机制,idea也没有办法在电脑上创建个此目录,所以报错了。解决办法就是找个已存在的目录即可。

    解决

    全局搜“/Users/liming/Downloads”,找到dev环境的配置文件,将“liming”改为自己的电脑用户名就可以啦

    比如我的改为“/Users/wangziyue/Downloads”就能运行成功啦。不过要注意,git提交代码时,不要提交上去。

    展开全文
  • Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching. 问题描述 Spring Boot 项目,启用...

    Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.

    问题描述

    Spring Boot 项目,启用事务支持时出现以下错误:

    Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.

    2018-12-28 09:19:09.467 ERROR 1105 --- [          main] o.s.b.d.LoggingFailureAnalysisReporter  : 

    ***************************

    APPLICATION FAILED TO START

    ***************************

    Description:

    The bean 'departmentDao' could not be injected as a 'com.wanyu.fams.dao.DepartmentDao' because it is a JDK dynamic proxy that implements:

    Action:

    Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.

    相关代码

    /**
     * Hello world!
     * @SpringBootApplication注释是相当于使用 @Configuration,@EnableAutoConfiguration,和@ComponentScan 会去拿起在所有的配置类和属于所述类的包。
     */
    @SpringBootApplication
    @ServletComponentScan // 不使用此注解导致项目访问后出现死循环,估计和Filter有关:at
    						// com.wanyu.frame.base.AuthFilter.doFilter(AuthFilter.java:71)
    						// ~[classes/:na]
    // @Configuration
    // @EnableAutoConfiguration
    // @EnableWebMvc // 启用后导致 /loginback 等都返回 404
    @EnableTransactionManagement  // 启用事务处理
    // @MapperScan("com.wanyu.fams.dao")
    // @ComponentScan
    // @EnableAspectJAutoProxy  不需要此注解,带有@Aspect注解的类就会被织入
    // @MapperScan(basePackages = "com.wanyu.fams.mapping")
    @EnableAsync
    public class FamsApplication extends SpringBootServletInitializer {

    也就是添加了一个注解:@EnableTransactionManagement  // 启用事务处理,启动的时候就报错了。

    解决方法

    在 application.properties 或者 application.yml 配置文件中添加配置:

    以下为 application.properties 中的配置方法:

    #解决问题
    #Description:
    #The bean 'departmentDao' could not be injected as a 'com.wanyu.fams.dao.DepartmentDao' because it is a JDK dynamic proxy that implements:
    #Action:
    #Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.
    spring.aop.proxy-target-class=true

     application.yml 写法有点不同:

    spring:
      aop:
        proxy-target-class: true

     

    失败的尝试

    文章指出:在springboot启动类中添加如下代码,最终解决问题,我尝试失败,错误依旧!

    @Bean
        @ConditionalOnMissingBean
        public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
            DefaultAdvisorAutoProxyCreator daap = new DefaultAdvisorAutoProxyCreator();
            daap.setProxyTargetClass(true);
            return daap;
        }
    

    相关参考:

    springboot CGLib 方式实现AOP代理问题

    还有另外一种可能是:启动类位置不在同级包下

     

    展开全文
  • Cannot use ss(type k8sClient.ResourceName) as type ResourceName in map index ) Reports invalid index and slice expressions. TenantStatus、ResourceList、ResourceName定义如下: type ...

    问题出现的背景:
    今天对接别人api的时候,对方引用了kubernetes下的client-go,具体信息如下:

        {
                "ImportPath": "k8s.io/client-go/pkg/api/v1",
                "Comment": "v4.0.0-beta.0",
                "Rev": "df46f7f13b3da19b90b8b4f0d18b8adc6fbf28dc"
            }

    为了使用对方代码中的struct,我也下载并放置到相应的位置,但仍然报错,具体错误信息如下:

    Cannot use ss(type k8sClient.ResourceName) as type ResourceName in map index )
    Reports invalid index and slice expressions.

    这里写图片描述

    TenantStatus、ResourceList、ResourceName定义如下:

    type TenantStatus struct {
        Phase      TenantPhase     `json:"phase"`
        ActualUsed v1.ResourceList `json:"actualUsed"`
        Used       v1.ResourceList `json:"used"`
        Hard       v1.ResourceList `json:"hard"`
    }
    // ResourceList is a set of (resource name, quantity) pairs.
    type ResourceList map[ResourceName]resource.Quantity
    
    // ResourceName is the name identifying various resources in a ResourceList.
    type ResourceName string

    从截图可以看出idea对于我本地的ResourceName,并不识别

    list.Status.Hard[ss].Add(item.Status.Hard["requests.cpu"])

    通过goland进入list.Status.Hard具体定义可以发现,此处引用是对方vendor中的client-go
    这里写图片描述

    //k8sClient "k8s.io/client-go/pkg/api/v1"
    var ss k8sClient.ResourceName

    通过goland进入k8sClient.ResourceName具体定义可以发现,此处引用是我本地的client-go
    这里写图片描述

    于是,决定删除对方项目vendor中的client-go包,问题解决。
    这里写图片描述

    个人微信公众号:
    这里写图片描述

    作者:jiankunking 出处:http://blog.csdn.net/jiankunking

    展开全文
  • 今天在服务器部署项目的时候遇到了项目无法启动的错误,仔细一看异常: org.springframework.context.... nested exception is java.lang.IllegalStateException: Unable to create the direc...

    今天在服务器部署项目的时候遇到了项目无法启动的错误,仔细一看异常:

    org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: Unable to create the directory [/tmp/tomcat.xxx] to use as the base directory
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at com.example.ruledemo.RuledemoApplication.main(RuledemoApplication.java:10) [ruledemo.jar:na]
    Caused by: java.lang.IllegalStateException: Unable to create the directory [/tmp/tomcat.3736867899040188915.8080] to use as the base directory
    	at org.apache.catalina.startup.Tomcat.initBaseDir(Tomcat.java:724) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    	at org.apache.catalina.startup.Tomcat.getServer(Tomcat.java:539) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    	at org.apache.catalina.startup.Tomcat.getService(Tomcat.java:472) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:165) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    	... 8 common frames omitted
    

    大体意思就是无法启动服务,没办法创建目录?权限不够?这必然不可能,使用的已经是最高权限。那必然便是磁盘不够了,df -h一查果然如此。理论上该问题到这里就结束了啊,但是问题是这目录里的东西不知道哪些没有用哪些有用啊?那这怎么办?

    没事,假若别的地方还有空间,那么一开始其实系统已经提示你了:

    Try using the -Djava.io.tmpdir= option to select an alternate temp location.

    照着方法来就是了,所以我们在启动jar包的时候,多加上这么一条,形如:

    java -Djava.io.tmpdir=/xxx/xxxx/tmp -jar xxxx.jar 

    中间的tmpdir替换成有空间的目录就行了,最后项目完美的启动了启动。

    Started TestdemoApplication in 32.283 seconds (JVM running for 37.222)

     

    展开全文
  • ROS进阶学习手记 10 - 搭建自己的TurtleBot(2)- Using iRobot Roomba as the Driving Base ROS进阶学习手记 10 - 搭建自己的TurtleBot(2)- 使用iRobot Roomba 5xx/6xx/7xx作为turtlebot的驱动底盘 参考《ROS by ...
  • How you can use qemu/kvm base images to be more productive (Part 1) from: http://www.linux-kvm.com/content/how-you-can-use-qemukvm-base-images-be-more-productive-part-1 Monday, August 11, 2008 - 1
  • http://stackoverflow.com/questions/26993903/a-virtualbox-machine-with-the-name-homestead-already-exists If you're planning to use multiple VMs ...
  • 出错原因是: Object是php7.2中的保留类名,不可以... The object name was previously soft-reserved in PHP 7.0. This is now hard-reserved, prohibiting it from being used as a class, trait, or interface n...
  • 一篇文章彻底弄懂Base64编码原理

    千次阅读 2019-04-08 23:28:12
    前半部分为转载,后半部分为自己补充 ----------------------------转载部分start------...在做支付系统时,系统之间的报文交互都需要使用Base64对明文进行转码,然后再进行签名或加密,之后再进行(或再次Base64)...
  • 使用TP5框架时出现Cannot declare class app\index\controller\xxx because the name is already in use解决办法 最近在学习tp5框架,自己写了一个简单的测试代码 出现下面的错误 出现这个问题后自己捣鼓了...
  • Dramatic increases in data trafic generated by the increasingly common use of internet-enabled devices, such as smartphones, is prompting rapid development of faster data throughput networks. Base ...
  • # Use the kinematics of your robot to map linear and angular velocities into motor commands # v_l = ... # v_r = ... # Then set your wheel speeds (using wheel_left and wheel_right as examples) # ...
  • 使用move_base做4个点循环跑的导航

    千次阅读 多人点赞 2019-01-23 21:35:02
    这有点难住我了,以前用move_base跑导航的时候只是给一个目标点然后等它走过去,但是怎么才能循环的跑起来呢?第一反应百度一下, 好吧,貌似网上没有用move_base跑循环的。。。那就自己写一个吧。 以前记得《ros ...
  • ubuntu base64 encode/decode

    千次阅读 2018-09-22 09:38:18
    base64 - base64 encode/decode data and print to standard output SYNOPSIS base64 [OPTION]… [FILE] DISCRIPTION # man base64 Base64 encode or decode FILE, or standard input, to standard output. ...
  • Base64Utils

    千次阅读 2020-02-28 07:57:39
    /* * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License")... * you may not use this file except in compliance with the License. * ...
  • 这里要再次感谢一下原创,本人也找到了解决问题的办法,只是没搞明白原因是什么,学习上面的文章才得以明白。 是生产的上线后发现的问题: ...java.lang.IllegalArgumentException: Illegal base64 character d ...
  • matplotlib.use('Agg') # pylint: disable=multiple-statements 目录 解决问题 解决思路 解决方法 解决问题 import matplotlib; matplotlib.use('Agg') # pylint: disable=multiple-statements ...
  • MySQL 中的 base64 函数

    万次阅读 2016-03-25 15:35:36
    MySQL在5.6版本的时候增加了to_base64和from_base64函数,在此之前没有内部函数,只能使用User-Defined-Function。 本文分别介绍这两种方式下base64函数的使用。
  • tensorflow decode base64 解析图像

    千次阅读 2018-06-27 20:32:24
    Base64是网络上最常见的用于传输字节码的编码方式之一,可用于在HTTP环境下传递较长的...tensorflow也提供了函数decode_base64来解析图像。 tensorflow decode_base64函数的使用方法如下: def base64_decode_im...
  • ROS Navigation-----base_local_planner简介

    万次阅读 2016-11-28 23:43:19
    base_local_planner简介
  • In today’s long post, I’m going to explain the guidelines we follow at Retibus Software in order to handle Unicode text in Windows programs written in C and C++ with Microsoft Visual Studio....
  • BASE64编码解码

    万次阅读 2018-03-08 14:49:11
    BASE64,是一种公共编解码算法 大家都是遵循同一种算法来对字节数组进行编解码,所以可以通用. java在很多公共的框架中都有BASE64的实现. 可以用: Apache Commons Codec 的实现 <!-- ...
  • Base64与国际化

    万次阅读 2018-08-22 18:10:03
    抛个问题,什么是base64?何时会用到他?与我们熟知的charset又是怎样的关系呢?跟国际化又有何恩怨呢?先看看wikipedia对其定义吧。 “ Base64是一种基于64个可打印字符来表示二进制数据的表示方法。由于 26=64,...
  • * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
  • 前端加密解密(base64.js)使用方法

    千次阅读 2020-08-03 18:07:52
    总所周知,域名都是可看的,如何把链接上中的参数如何加解密!! 一、引用<script src="../js/jquery.base64.js" type="text/javascript"></script> 1、jquery.base64.js ... -decoding simpler as i
  • 可能是由于我之前安装了一个错误版本的 vmware tools  我果断删除所提示不能创建的目录的父目录 再次安装 问题解决
  • move_base

    千次阅读 2017-04-07 16:34:39
    //move_base.cpp /********************************************************************* * * Software License Agreement (BSD License) * * Copyright (c) 2008, Willow Garage, Inc. * All rights reserved.

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 176,458
精华内容 70,583
关键字:

asthebaseuse