linux Forwarding    2017-07-19 21:25:06    6
参考文章:http://blog.csdn.net/maeom/article/details/6033927

但是依据此文章中的操作,重启network服务以后,还是没有配置成功,解决办法


# vi /etc/sysctl.conf
或者
# vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:
    net.ipv4.ip_forward=1

重启network服务
# systemctl restart network

查看是否修改成功
# sysctl net.ipv4.ip_forward

如果返回为“net.ipv4.ip_forward = 1”则表示成功了
 

 

by 刘迎光@萤火虫工作室 
OpenBI交流群:495266201 
MicroService 微服务交流群:217722918 
mail: liuyg#liuyingguang.cn 
博主首页(==防止爬虫==):http://blog.liuyingguang.cn

docker    2017-07-19 21:23:55    12
修改文件

# vi /usr/lib/systemd/system/docker.service

修改为如下方式
[Unit]
Description=Docker Application Container Engine
After=network.target docker.socket
Requires=docker.socket

[Service]
Type=notify
ExecStart=/usr/bin/docker daemon --tls=false -H unix:///var/run/docker.sock  -H tcp://0.0.0.0:2375
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0

[Install]
WantedBy=multi-user.target

重载配置文件:
    # systemctl daemon-reload

重启Docker
    # systemctl restart docker


 


 

by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(防止爬虫):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/

java xwiki restful    2017-07-19 21:22:41    9

xwiki测试流程

  1. 测试页面
  1. public void normalTest()throws Exception, IOException{
  2. CloseableHttpClient httpclient = HttpClients.createDefault();
  3. JAXBContext context = JAXBContext.newInstance("org.xwiki.rest.model.jaxb");
  4. Unmarshaller unmarshaller = context.createUnmarshaller();
  5. HttpUriRequest httpPost = RequestBuilder.get()
  6. .setUri(new URI("http://172.16.200.220:8082/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome"))
  7. .setHeader("Accept", "application/xml").build();
  8. CloseableHttpResponse response = httpclient.execute(httpPost);
  9. System.out.println(response.getEntity());
  10. HttpEntity responseEntity=response.getEntity();
  11. Page page = (Page) unmarshaller.unmarshal(responseEntity.getContent());
  12. System.out.println(new Gson().toJson(page));
  13. }
  1. 登录并获取session
  1. public void testLogin() throws Exception{
  2. CloseableHttpClient httpclient =
HttpClient java xml    2017-07-19 21:20:57    6


介绍:我现在有一个对象page,需要将page对象转换为xml格式并以binary方式传输到服务端
其中涉及到的技术点有:
1、对象转xml流
2、输出流转输入流
3、httpClient发送二进制流数据

POM文件依赖配置
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.2</version>
		</dependency>
		
		<dependency>
		  <groupId>org.apache.httpcomponents</groupId>
		  <artifactId>httpmime</artifactId>
		  <version>4.5.2</version>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.4</version>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.2.4</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.xwiki.platform</groupId>
			<artifactId>xwiki-platform-rest-model</artifactId>
			<version>7
java eclipse exception    2017-07-19 21:18:39    16
错误信息(我的错误类似,网络copy):

java.lang.Error: Unresolved compilation problems: 
The import javax.servlet.ServletContext cannot be resolved
The import javax.servlet.http.HttpSession cannot be resolved
The import javax.servlet.http.HttpSessionEvent cannot be resolved
The import javax.servlet.http.HttpSessionListener cannot be resolved
HttpSessionListener cannot be resolved to a type
ServletContext cannot be resolved to a type
HttpSessionEvent cannot be resolved to a type
HttpSession cannot be resolved to a type
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
context cannot be resolved
HttpSessionEvent cannot be resolved to a type
HttpSession cannot be resolved to a type




解决办法:
    原因有很多,解决办法也很多,参考地址:
        http://www.360doc.com/content/12/1015/17/4152160_241639166.shtml
        http://blog.csdn.net/chl
24/41