Category - IT技术

jenkins docker tomcat java restful shell    2017-07-19 21:50:48    14

前提:jenkins是装在CentOS6.7中,同时,我的这台linux上面安装有docker


一、项目代码:

项目主要是jersey 1.x 版本的maven项目,重点在与我在项目中放置了tomcat,以及使用maven对tomcat进行解压,并将项目打包的文件放置到项目中,那么项目信息就不多写了,把maven配置信息重点写出来吧:

    <build>
        <finalName>testjersey</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>copy-package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>

                                <unzip dest="target/apache/">
                                    <fileset dir="${basedir}">
                                        <include name="apache-tomcat-7.0.68.zip" />
                               
nginx    2017-07-19 21:49:37    26
2016/03/21 16:57:10 [emerg] 30420#29876: BIO_new_file("C:
ginx-1.9.9\ssl\1_domain_bundle.crt") failed (SSL: error:0200107B:system library:fopen:Unknown error:fopen('C:
ginx-1.9.9\ssl\1_domain_bundle.crt','r') error:2006D002:BIO routines:BIO_new_file:system lib)
2016/03/21 16:57:11 [alert] 29884#31740: worker process 30420 exited with code 1
2016/03/21 16:57:11 [alert] 29884#31740: could not respawn worker
2016/03/21 16:57:28 [emerg] 28212#30316: BIO_new_file("C:
ginx-1.9.9\ssl\1_domain_bundle.crt") failed (SSL: error:0200107B:system library:fopen:Unknown error:fopen('C:
ginx-1.9.9\ssl\1_domain_bundle.crt','r') error:2006D002:BIO routines:BIO_new_file:system lib)


问题分析:只要写绝对路径,就会报错,无论windows还是linux,怀疑是对路径的处理有问题

解决办法
    windows下,将证书文件放到conf目录下,
    linux下,将证书文件放到nginx.conf所在的目录下



 

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

certificate curl    2017-07-19 21:46:25    24
 x509: certificate has expired or is not yet valid


两种可能:
    1、本机时间错乱,本机时间为证书过期时间或者本机时间为证书未申请时间

    2、证书过期


经过检查,是我的虚拟机的时钟出现问题,时钟同步下即可:
# ntpdate s2m.time.edu.cn




 

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

2017-07-19 21:44:47    17
+++++++ 20160404 begin+++++++
maven环境:
<dependency>
	<groupId>org.mongodb</groupId>
	<artifactId>mongodb-driver</artifactId>
	<version>3.2.2</version>
</dependency>

+++++++ 20160404 end+++++++

 
import java.util.ArrayList;
import java.util.List;

import org.bson.Document;

import com.mongodb.MongoClient;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.Filters;

public class TestMongo {
    public static void main(String[] args) {
        MongoClient client = null;
        ServerAddress serverAddress = new ServerAddress("115.28.246.12",
                27017);
        List<ServerAddress> seeds = new ArrayList<ServerAddress>();
        seeds.add(serverAddress);
        MongoCredential credentials = MongoCredential
                .createScramSha1Credential("admin", "admin",
                        "abc123,admin".toCharArray());
        List<MongoCredential>
java mongodb exception    2017-07-19 21:43:42    3
分析:
    参考地址:https://github.com/brianfrankcooper/YCSB/issues/277
    应该是官方的update策略有变化,3.0以前,使用updateOne,3.0以后使用replaceOne
解决办法:
    将updateOne替换为replaceOne即可

完整错误栈:

java.lang.IllegalArgumentException: Invalid BSON field name _id
    at org.bson.AbstractBsonWriter.writeName(AbstractBsonWriter.java:494) ~[bson-3.2.2.jar:na]
    at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:188) ~[bson-3.2.2.jar:na]
    at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:131) ~[bson-3.2.2.jar:na]
    at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:45) ~[bson-3.2.2.jar:na]
    at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63) ~[bson-3.2.2.jar:na]
    at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29) ~[bson-3.2.2.jar:na]
    at com.mongodb.connection.UpdateCommandMessage.writeTheWrites(UpdateCommandMessage.java:84) ~[mongodb-driver-core-3.2.2.jar:na]
    at com.mongodb.connection.UpdateCommandMessage.writeTheWrites(Upd
13/24