我在Eclipse Juno上使用Tomcat 7.我使用工作区元数据作为服务器位置(请参阅下面的我的tomcat配置).
另外,我在eclipse中获得了一个服务器项目 [请参见下图],其中包含单独的server.xml和其他配置文件.
通常它工作正常.在我更改了SSL配置的server.xml(在eclipse项目中)后,问题出现了.
配置工作正常.但每次运行项目(运行 - >运行在服务器上)时,server.xml都会被修改为默认版本.我的自定义SSL更改缺失.
此外,我尝试在tomcat安装位置(C:\ apache-tomcat-7.0.35\conf)中更改server.xml,但它没有从eclipse中选择.
有人可以帮我这个吗?
谢谢
我想一个简单的转换List<Integer>
为Map
使用Java 8个流API,并得到了以下编译时错误:
The method toMap(Function<? super T,? extends K>, Function<? super T,?
extends U>) in the type Collectors is not applicable for the arguments
(Function<Object,Object>, boolean)
Run Code Online (Sandbox Code Playgroud)
我的代码:
ArrayList<Integer> m_list = new ArrayList<Integer>();
m_list.add(1);
m_list.add(2);
m_list.add(3);
m_list.add(4);
Map<Integer, Boolean> m_map = m_list.stream().collect(
Collectors.toMap(Function.identity(), true));
Run Code Online (Sandbox Code Playgroud)
我也尝试了下面的第二种方法,但得到了同样的错误.
Map<Integer, Boolean> m_map = m_list.stream().collect(
Collectors.toMap(Integer::intValue, true));
Run Code Online (Sandbox Code Playgroud)
使用Java 8流API执行此操作的正确方法是什么?
最近我尝试将我的Spring Boot应用程序版本从1.5.10.RELEASE更新到2.0.0.RELEASE
项目环境
我遇到过两个问题
我在下面得到了完成问题.
无法解析配置':compileClasspath'的所有文件.找不到org.springframework.boot:spring-boot-starter-mobile:
然后我检查了最新版本的spring-boot-starter-mobile库,并且Spring Boot 2没有稳定版本的spring-boot-starter-mobile.
因此,我必须使用maven声明里程碑URL以导入版本:'2.0.0.M5'并且问题已解决.
maven {url'https://repo.spring.io/milestone '}
最初我使用的是jcenter(),是否可以使用jcenter导入里程碑?
访问下面的移动设备界面时,我收到以下运行时错误.
org.springframework.mobile.device.Device
public ResponseEntity<?> TestM(@RequestBody MyRequest myRequest, Device device) throws AuthenticationException {
return ResponseEntity.ok();
}
Run Code Online (Sandbox Code Playgroud)
错误
2018-03-12 23:54:58.410 ERROR 13732 --- [nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException:
No primary or default constructor found for interface org.springframework.mobile.device.Device] with root cause
java.lang.NoSuchMethodException: org.springframework.mobile.device.Device.<init>()
at java.lang.Class.getConstructor0(Unknown Source) ~[na:1.8.0_121] …
Run Code Online (Sandbox Code Playgroud) mobile-devices spring-boot jcenter spring-boot-gradle-plugin
我已经阅读了已经发布的大多数类似问题,但我仍然无法找到解决方案.请注意,常规CRUD应用程序正常工作.当我尝试通过spring-security添加登录功能时,我收到此错误.
我的工作环境如下;
1.Tomcat 7.0.35
2.Spring 3.2.0
3.Spring安全
弹簧安全配置,3.1.3.RELEASE.jar
弹簧安全核心3.1.3.RELEASE.jar
弹簧安全标签库,3.1.3.RELEASE.jar
弹簧安全网络3.1.3.RELEASE.jar
4.我的web.xml(/src/main/webapp/WEB-INF/web.xml)
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/root-context.xml</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/conf/*-context.xml
</param-value>
</init-param>
<!--
<load-on-startup>1</load-on-startup>
-->
</servlet>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)
5.我的security-context.xml(/src/main/resources/spring/conf/security-context.xml)
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<http pattern="/resources" security="none" />
<http auto-config="true" …
Run Code Online (Sandbox Code Playgroud) tomcat7 ×2
arraylist ×1
collections ×1
eclipse ×1
eclipse-juno ×1
hashmap ×1
java-8 ×1
java-stream ×1
jcenter ×1
settings ×1
spring-boot ×1
spring-mvc ×1
web.xml ×1