我正在设置这个变量
set srcDir = C:\Developpement\Workspaces\Eclipse\MyAuthenticationProvider\src
Run Code Online (Sandbox Code Playgroud)
然后我执行这个程序
java -DMJF=MyAuthentication.jar -Dfiles=%srcDir% weblogic.management.commo.WebLogicMBeanMaker
Run Code Online (Sandbox Code Playgroud)
但我有这个奇怪的错误
The specified input files directory, "%srcDir%", does not exist.
Run Code Online (Sandbox Code Playgroud)
我甚至尝试过使用
java -DMJF=MyAuthentication.jar -Dfiles=$srcDir weblogic.management.commo.WebLogicMBeanMaker
Run Code Online (Sandbox Code Playgroud)
结果相同
The specified input files directory, "$srcDir", does not exist.
Run Code Online (Sandbox Code Playgroud)
另一个测试:
C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>set a=test
C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>echo $a
$a
C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>
Run Code Online (Sandbox Code Playgroud) 我已经使用嵌入式Tomcat + Thymeleaf模板引擎使用Spring Initializr生成了Spring Boot Web应用程序。
我将此属性放在了application.properties中
default.to.address=nunito.calzada@gmail.com
Run Code Online (Sandbox Code Playgroud)
我正在使用Spring Tool Suite版本:3.8.4.RELEASE作为开发环境,但在编辑器中收到此警告 'default.to.address' is an unknown property.
我应该将此属性放在另一个属性文件中吗?
我有这样的代码段,其中,TDK是我在SpringBoot文件中定义的通用变量application.properties命名server.contextPath
我想知道是否有办法替换它
<head th:replace="tdk/common/header :: common-header" />
Run Code Online (Sandbox Code Playgroud)
就像是
<head th:replace="@environment.get('server.contextPath')/common/header :: common-header" />
Run Code Online (Sandbox Code Playgroud)
我在用
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>1.5.3.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
<head th:replace="~{${@environment.getProperty('serverContextPath') + '/common/header'} :: common-header}" />
Run Code Online (Sandbox Code Playgroud)
结果如下:
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "~{${@environment.getProperty('serverContextPath') + '/common/header'}", template might not exist or might not be accessible by any of the configured Template Resolvers (/tdk/registration/signup:6)
Run Code Online (Sandbox Code Playgroud) 我在SpringBoot应用程序的resources文件夹中有这个文件夹.
resources/files/a.txt
resources/files/b/b1.txt
resources/files/b/b2.txt
resources/files/c/c1.txt
resources/files/c/c2.txt
Run Code Online (Sandbox Code Playgroud)
我想得到所有的txt文件,所以这是我的代码:
ClassLoader classLoader = this.getClass().getClassLoader();
Path configFilePath = Paths.get(classLoader.getResource("files").toURI());
List<Path> atrackFileNames = Files.list(configFilePath)
.filter(s -> s.toString().endsWith(".txt"))
.map(Path::getFileName)
.sorted()
.collect(toList());
Run Code Online (Sandbox Code Playgroud)
但我只得到文件a.txt
我有这个类使用 JSON Web Token Support For The JVM 来创建和验证 JWT 令牌
@Component
public class JwtTokenUtil implements Serializable {
private static final long serialVersionUID = -3301605592208950415L;
private Clock clock = DefaultClock.INSTANCE;
@Value("${jwt.secret}")
private String secret;
@Value("${jwt.expiration}")
private Long expiration;
public String getUsernameFromToken(String token) {
return getClaimFromToken(token, Claims::getSubject);
}
public Date getIssuedAtDateFromToken(String token) {
return getClaimFromToken(token, Claims::getIssuedAt);
}
public Date getExpirationDateFromToken(String token) {
return getClaimFromToken(token, Claims::getExpiration);
}
public <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver) {
final Claims claims = getAllClaimsFromToken(token);
return …Run Code Online (Sandbox Code Playgroud) 我的应用程序(Spring 4 MVC/Hibernate 4/MySQL/Maven)使用基于注释的配置将Spring与Hibernate集成在一起.几个小时后它没有使用数据库我总是看到这个错误:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 84,510,841 milliseconds ago. The last packet sent successfully to the server was 84,510,841 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1121)
com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3938)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2551) …Run Code Online (Sandbox Code Playgroud) 当我在Apache Tomcat/7.0.52(Ubuntu)JVM上部署我的战争USING mysql-connector-java-6.0.3.jar时遇到此问题:使用JDK 1.7编译的1.7.0_79-b14
java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0 (unable to load class com.mysql.jdbc.Driver)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2948)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:191)
com.tdk.callbacks.CallBacksListener.doGet(CallBacksListener.java:45)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
Run Code Online (Sandbox Code Playgroud)
当我用1.8编译时这个
java.lang.UnsupportedClassVersionError: com/tdk/callbacks/CallBacksListener : Unsupported major.minor version 52.0 (unable to load class com.tdk.callbacks.CallBacksListener)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2948)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
Run Code Online (Sandbox Code Playgroud)
和这一个1.6:
java.lang.Error: Unresolved compilation problem:
Multi-catch parameters are not allowed for source level below 1.7
Run Code Online (Sandbox Code Playgroud) 我有这门课:
import org.springframework.security.core.userdetails.UserDetails;
@Entity
@Table(name="t_user")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class User implements Serializable, UserDetails {
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return null;
}
..
}
Run Code Online (Sandbox Code Playgroud)
但我有这个编译错误:
'Many To One' attribute type should not be a container
Run Code Online (Sandbox Code Playgroud) 在我的main.c程序中,我包含了这个库:
#include "coap_api.h"
Run Code Online (Sandbox Code Playgroud)
这也包括在内
Properties -> C/C++ Build -> Settings -> Cross ARM GNU Assembler -> Includes
和
Properties -> C/C++ Build -> Settings -> Cross ARM C Compiler -> Includes
构建项目我收到此错误:
./src/main.o: In function `main':
/Users/joanet/Development/Embedded/eclipseWS/EHAL-master/ARM/Nordic/nRF51/ipv6_coap_server/Release/../src/main.c:708: undefined reference to `coap_init'
Run Code Online (Sandbox Code Playgroud)
我在另一篇文章中读到我必须链接库(http://whatwouldnickdo.com/wordpress/328/eclipse-cdt-and-linux-libraries/)
我试图添加名称的库,coap_api但我不工作
lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot find -lcoap_api
Run Code Online (Sandbox Code Playgroud)
在编译中包含coap目录:
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g -DBLE_STACK_SUPPORT_REQD -DNRF51 -D__CORTEX_M0 -DBOARD_PCA10028 -DSOFTDEVICE_PRESENT -DS110 -I/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/ipv6_coap_server/bsp -I/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/nrf51_sdk/components/iot/ipv6_stack/pbuffer -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/nrf51_sdk/components/libraries/util/" -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/nrf51_sdk/components/drivers_nrf/hal/" -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/../../../ARM/CMSIS/CMSIS/Include/" -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/../../../ARM/Nordic/nRF51/CMSIS/include/" -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/nrf51_sdk/components/softdevice/s110/headers/" -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/nrf51_sdk/components/ble/common/" -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/nrf51_sdk/components/ble/ble_services/ble_bas/" -I"/Users/nullpointer/Development/Embedded/eclipseWS/EHAL-master-Hoan/ARM/Nordic/nRF51/nrf51_sdk/components/ble/ble_services/ble_dis/" …Run Code Online (Sandbox Code Playgroud) 我想基于LocalDateTime对一个Collection进行分组,但我只想得到小时,而不是分钟,秒......
.collect(Collectors.groupingBy(cp -> getUpdateLocalDate())
public LocalDate getUpdateLocalDate() {
return getUpdateDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
Run Code Online (Sandbox Code Playgroud)
但是我还需要Date,比如:2018-10-12T09:00:00不仅仅是小时
java ×7
spring-boot ×4
spring ×3
collections ×2
java-8 ×2
jdbc ×2
mysql ×2
spring-mvc ×2
c ×1
eclipse-cdt ×1
embedded ×1
java-stream ×1
jwt ×1
rest ×1
stream ×1
thymeleaf ×1
tomcat7 ×1
toolchain ×1