diff --git a/cloud/haikang/hs_err_pid5804.log b/cloud/haikang/hs_err_pid5804.log deleted file mode 100644 index 76774cc..0000000 --- a/cloud/haikang/hs_err_pid5804.log +++ /dev/null @@ -1,380 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000002103643f, pid=5804, tid=0x0000000000005398 -# -# JRE version: Java(TM) SE Runtime Environment (8.0_181-b13) (build 1.8.0_181-b13) -# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode windows-amd64 compressed oops) -# Problematic frame: -# C [HCEHomeAlarm.DLL+0x2643f] -# -# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows -# -# If you would like to submit a bug report, please visit: -# http://bugreport.java.com/bugreport/crash.jsp -# - ---------------- T H R E A D --------------- - -Current thread (0x0000000017be9800): VMThread [stack: 0x00000000198b0000,0x00000000199b0000] [id=21400] - -siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000000 - -Registers: -RAX=0x0000000000000001, RBX=0x0000000000000000, RCX=0x0000000000000000, RDX=0x0000000000000000 -RSP=0x00000000199af330, RBP=0x0000000000000000, RSI=0x0000000000000000, RDI=0x000000000093cca0 -R8 =0x0000000000000001, R9 =0x0000000000000001, R10=0x0000000000008000, R11=0x00000000199af3c0 -R12=0x000000000092afe0, R13=0x0000000000000000, R14=0x0000000000000001, R15=0x000000000092b090 -RIP=0x000000002103643f, EFLAGS=0x0000000000010206 - -Top of Stack: (sp=0x00000000199af330) -0x00000000199af330: 000000002207d400 00007ff8179607cd -0x00000000199af340: 000000000093bd20 00000002008c0000 -0x00000000199af350: 000000000093cca0 00000000210ccb11 -0x00000000199af360: 0000000000000000 0000000000000000 -0x00000000199af370: 00000000009125c0 000000341795fba1 -0x00000000199af380: 000000001c9440e0 0000000021036bf2 -0x00000000199af390: 0000000000000000 0000000000000001 -0x00000000199af3a0: 0000000000000000 000000000092afe0 -0x00000000199af3b0: 0000000000000001 0000000021036620 -0x00000000199af3c0: 0000000000000000 000000001c9440e0 -0x00000000199af3d0: 000000000092afe0 0000000000000000 -0x00000000199af3e0: 0000000000942b00 0000000017a756d0 -0x00000000199af3f0: 0000000021991200 0000000021035cc8 -0x00000000199af400: 0000000017a756d0 000000001c9440e0 -0x00000000199af410: 0000000000000000 0000000000000000 -0x00000000199af420: 0000000021991200 00000000210cdb04 - -Instructions: (pc=0x000000002103643f) -0x000000002103641f: 38 48 8b 74 24 40 48 83 c4 20 5f c3 cc cc cc cc -0x000000002103642f: cc 48 89 5c 24 08 48 89 74 24 10 57 48 83 ec 20 -0x000000002103643f: 48 8b 01 41 8b f0 8b da 48 8b f9 ff 50 08 85 c0 -0x000000002103644f: 75 48 48 8b 05 78 70 17 00 48 83 f8 ff 74 1f ba - - -Register to memory mapping: - -RAX=0x0000000000000001 is an unknown value -RBX=0x0000000000000000 is an unknown value -RCX=0x0000000000000000 is an unknown value -RDX=0x0000000000000000 is an unknown value -RSP=0x00000000199af330 is an unknown value -RBP=0x0000000000000000 is an unknown value -RSI=0x0000000000000000 is an unknown value -RDI=0x000000000093cca0 is an unknown value -R8 =0x0000000000000001 is an unknown value -R9 =0x0000000000000001 is an unknown value -R10=0x0000000000008000 is an unknown value -R11=0x00000000199af3c0 is an unknown value -R12=0x000000000092afe0 is an unknown value -R13=0x0000000000000000 is an unknown value -R14=0x0000000000000001 is an unknown value -R15=0x000000000092b090 is an unknown value - - -Stack: [0x00000000198b0000,0x00000000199b0000], sp=0x00000000199af330, free space=1020k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) - -VM_Operation (0x0000000002b8ed80): Exit, mode: safepoint, requested by thread 0x0000000002c03000 - - ---------------- P R O C E S S --------------- - -Java Threads: ( => current thread ) - 0x000000001e757800 JavaThread "surefire-forkedjvm-last-ditch-daemon-shutdown-thread-30s" daemon [_thread_blocked, id=4628, stack(0x000000001f5d0000,0x000000001f6d0000)] - 0x0000000019c8d000 JavaThread "surefire-forkedjvm-command-thread" daemon [_thread_in_native, id=4584, stack(0x000000001a7b0000,0x000000001a8b0000)] - 0x0000000019bd8800 JavaThread "Service Thread" daemon [_thread_blocked, id=1544, stack(0x000000001a5b0000,0x000000001a6b0000)] - 0x0000000019b4b800 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=11108, stack(0x000000001a4b0000,0x000000001a5b0000)] - 0x0000000019b44800 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=15628, stack(0x000000001a3b0000,0x000000001a4b0000)] - 0x0000000019b41800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=21148, stack(0x000000001a2b0000,0x000000001a3b0000)] - 0x0000000019b3d800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=19612, stack(0x000000001a1b0000,0x000000001a2b0000)] - 0x0000000019ae9000 JavaThread "Attach Listener" daemon [_thread_blocked, id=5504, stack(0x000000001a0b0000,0x000000001a1b0000)] - 0x0000000019ae8000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=17668, stack(0x0000000019fb0000,0x000000001a0b0000)] - 0x0000000019ad0800 JavaThread "Finalizer" daemon [_thread_blocked, id=18084, stack(0x0000000019eb0000,0x0000000019fb0000)] - 0x0000000002cf6000 JavaThread "Reference Handler" daemon [_thread_blocked, id=21476, stack(0x00000000199b0000,0x0000000019ab0000)] - 0x0000000002c03000 JavaThread "main" [_thread_blocked, id=128, stack(0x0000000002a90000,0x0000000002b90000)] - -Other Threads: -=>0x0000000017be9800 VMThread [stack: 0x00000000198b0000,0x00000000199b0000] [id=21400] - -VM state:at safepoint (shutting down) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x0000000002bfe070] Threads_lock - owner thread: 0x0000000017be9800 - -Heap: - PSYoungGen total 110080K, used 8586K [0x00000000d6300000, 0x00000000e0580000, 0x0000000100000000) - eden space 100864K, 8% used [0x00000000d6300000,0x00000000d6b62a30,0x00000000dc580000) - from space 9216K, 0% used [0x00000000dc580000,0x00000000dc580000,0x00000000dce80000) - to space 10240K, 0% used [0x00000000dfb80000,0x00000000dfb80000,0x00000000e0580000) - ParOldGen total 87552K, used 13265K [0x0000000082800000, 0x0000000087d80000, 0x00000000d6300000) - object space 87552K, 15% used [0x0000000082800000,0x00000000834f4528,0x0000000087d80000) - Metaspace used 34115K, capacity 35628K, committed 35800K, reserved 1081344K - class space used 4508K, capacity 4790K, committed 4864K, reserved 1048576K - -Card table byte_map: [0x00000000120c0000,0x00000000124b0000] byte_map_base: 0x0000000011cac000 - -Marking Bits: (ParMarkBitMap*) 0x000000005ca12d00 - Begin Bits: [0x0000000012f50000, 0x0000000014eb0000) - End Bits: [0x0000000014eb0000, 0x0000000016e10000) - -Polling page: 0x00000000008b0000 - -CodeCache: size=245760Kb used=12489Kb max_used=12525Kb free=233270Kb - bounds [0x0000000002d00000, 0x0000000003950000, 0x0000000011d00000] - total_blobs=3721 nmethods=3298 adapters=334 - compilation: enabled - -Compilation events (10 events): -Event: 4.095 Thread 0x0000000019b4b800 nmethod 3298 0x00000000038f4250 code [0x00000000038f43a0, 0x00000000038f44d0] -Event: 4.095 Thread 0x0000000019b4b800 3299 3 java.util.logging.LogManager$LoggerContext::requiresDefaultLoggers (29 bytes) -Event: 4.095 Thread 0x0000000019b3d800 3300 4 org.springframework.core.ResolvableType$1::isAssignableFrom (24 bytes) -Event: 4.095 Thread 0x0000000019b4b800 nmethod 3299 0x00000000038f77d0 code [0x00000000038f7940, 0x00000000038f7d68] -Event: 4.096 Thread 0x0000000019b4b800 3301 1 java.util.concurrent.ConcurrentHashMap$MapEntry::getValue (5 bytes) -Event: 4.096 Thread 0x0000000019b4b800 nmethod 3301 0x00000000038f67d0 code [0x00000000038f6920, 0x00000000038f6a30] -Event: 4.096 Thread 0x0000000019b4b800 3302 1 ch.qos.logback.core.pattern.Converter::getNext (5 bytes) -Event: 4.096 Thread 0x0000000019b4b800 nmethod 3302 0x00000000038f7510 code [0x00000000038f7660, 0x00000000038f7770] -Event: 4.097 Thread 0x0000000019b4b800 3303 ! 3 java.util.concurrent.ConcurrentHashMap::clear (176 bytes) -Event: 4.098 Thread 0x0000000019b4b800 nmethod 3303 0x00000000038f1b10 code [0x00000000038f1d20, 0x00000000038f2ab8] - -GC Heap History (10 events): -Event: 1.128 GC heap before -{Heap before GC invocations=5 (full 1): - PSYoungGen total 70656K, used 5119K [0x00000000d6300000, 0x00000000dad00000, 0x0000000100000000) - eden space 65536K, 0% used [0x00000000d6300000,0x00000000d6300000,0x00000000da300000) - from space 5120K, 99% used [0x00000000da800000,0x00000000dacffcc0,0x00000000dad00000) - to space 5120K, 0% used [0x00000000da300000,0x00000000da300000,0x00000000da800000) - ParOldGen total 86016K, used 6297K [0x0000000082800000, 0x0000000087c00000, 0x00000000d6300000) - object space 86016K, 7% used [0x0000000082800000,0x0000000082e26720,0x0000000087c00000) - Metaspace used 20641K, capacity 21176K, committed 21248K, reserved 1067008K - class space used 2650K, capacity 2802K, committed 2816K, reserved 1048576K -Event: 1.151 GC heap after -Heap after GC invocations=5 (full 1): - PSYoungGen total 70656K, used 0K [0x00000000d6300000, 0x00000000dad00000, 0x0000000100000000) - eden space 65536K, 0% used [0x00000000d6300000,0x00000000d6300000,0x00000000da300000) - from space 5120K, 0% used [0x00000000da800000,0x00000000da800000,0x00000000dad00000) - to space 5120K, 0% used [0x00000000da300000,0x00000000da300000,0x00000000da800000) - ParOldGen total 56832K, used 7391K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 13% used [0x0000000082800000,0x0000000082f37fc8,0x0000000085f80000) - Metaspace used 20641K, capacity 21176K, committed 21248K, reserved 1067008K - class space used 2650K, capacity 2802K, committed 2816K, reserved 1048576K -} -Event: 1.614 GC heap before -{Heap before GC invocations=6 (full 1): - PSYoungGen total 70656K, used 65536K [0x00000000d6300000, 0x00000000dad00000, 0x0000000100000000) - eden space 65536K, 100% used [0x00000000d6300000,0x00000000da300000,0x00000000da300000) - from space 5120K, 0% used [0x00000000da800000,0x00000000da800000,0x00000000dad00000) - to space 5120K, 0% used [0x00000000da300000,0x00000000da300000,0x00000000da800000) - ParOldGen total 56832K, used 7391K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 13% used [0x0000000082800000,0x0000000082f37fc8,0x0000000085f80000) - Metaspace used 27507K, capacity 28260K, committed 28288K, reserved 1073152K - class space used 3531K, capacity 3706K, committed 3712K, reserved 1048576K -Event: 1.622 GC heap after -Heap after GC invocations=6 (full 1): - PSYoungGen total 70656K, used 5118K [0x00000000d6300000, 0x00000000dd800000, 0x0000000100000000) - eden space 65536K, 0% used [0x00000000d6300000,0x00000000d6300000,0x00000000da300000) - from space 5120K, 99% used [0x00000000da300000,0x00000000da7ff870,0x00000000da800000) - to space 8704K, 0% used [0x00000000dcf80000,0x00000000dcf80000,0x00000000dd800000) - ParOldGen total 56832K, used 10601K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 18% used [0x0000000082800000,0x000000008325a5e8,0x0000000085f80000) - Metaspace used 27507K, capacity 28260K, committed 28288K, reserved 1073152K - class space used 3531K, capacity 3706K, committed 3712K, reserved 1048576K -} -Event: 3.417 GC heap before -{Heap before GC invocations=7 (full 1): - PSYoungGen total 70656K, used 70654K [0x00000000d6300000, 0x00000000dd800000, 0x0000000100000000) - eden space 65536K, 100% used [0x00000000d6300000,0x00000000da300000,0x00000000da300000) - from space 5120K, 99% used [0x00000000da300000,0x00000000da7ff870,0x00000000da800000) - to space 8704K, 0% used [0x00000000dcf80000,0x00000000dcf80000,0x00000000dd800000) - ParOldGen total 56832K, used 10601K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 18% used [0x0000000082800000,0x000000008325a5e8,0x0000000085f80000) - Metaspace used 30824K, capacity 32158K, committed 32512K, reserved 1077248K - class space used 3972K, capacity 4243K, committed 4352K, reserved 1048576K -Event: 3.422 GC heap after -Heap after GC invocations=7 (full 1): - PSYoungGen total 106496K, used 7736K [0x00000000d6300000, 0x00000000dd780000, 0x0000000100000000) - eden space 98304K, 0% used [0x00000000d6300000,0x00000000d6300000,0x00000000dc300000) - from space 8192K, 94% used [0x00000000dcf80000,0x00000000dd70e208,0x00000000dd780000) - to space 9216K, 0% used [0x00000000dc580000,0x00000000dc580000,0x00000000dce80000) - ParOldGen total 56832K, used 10609K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 18% used [0x0000000082800000,0x000000008325c5e8,0x0000000085f80000) - Metaspace used 30824K, capacity 32158K, committed 32512K, reserved 1077248K - class space used 3972K, capacity 4243K, committed 4352K, reserved 1048576K -} -Event: 3.985 GC heap before -{Heap before GC invocations=8 (full 1): - PSYoungGen total 106496K, used 88928K [0x00000000d6300000, 0x00000000dd780000, 0x0000000100000000) - eden space 98304K, 82% used [0x00000000d6300000,0x00000000db24a1a0,0x00000000dc300000) - from space 8192K, 94% used [0x00000000dcf80000,0x00000000dd70e208,0x00000000dd780000) - to space 9216K, 0% used [0x00000000dc580000,0x00000000dc580000,0x00000000dce80000) - ParOldGen total 56832K, used 10609K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 18% used [0x0000000082800000,0x000000008325c5e8,0x0000000085f80000) - Metaspace used 33846K, capacity 35360K, committed 35416K, reserved 1079296K - class space used 4445K, capacity 4722K, committed 4736K, reserved 1048576K -Event: 3.994 GC heap after -Heap after GC invocations=8 (full 1): - PSYoungGen total 110080K, used 9213K [0x00000000d6300000, 0x00000000e0580000, 0x0000000100000000) - eden space 100864K, 0% used [0x00000000d6300000,0x00000000d6300000,0x00000000dc580000) - from space 9216K, 99% used [0x00000000dc580000,0x00000000dce7f6c8,0x00000000dce80000) - to space 10240K, 0% used [0x00000000dfb80000,0x00000000dfb80000,0x00000000e0580000) - ParOldGen total 56832K, used 10895K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 19% used [0x0000000082800000,0x00000000832a3cc0,0x0000000085f80000) - Metaspace used 33846K, capacity 35360K, committed 35416K, reserved 1079296K - class space used 4445K, capacity 4722K, committed 4736K, reserved 1048576K -} -Event: 3.994 GC heap before -{Heap before GC invocations=9 (full 2): - PSYoungGen total 110080K, used 9213K [0x00000000d6300000, 0x00000000e0580000, 0x0000000100000000) - eden space 100864K, 0% used [0x00000000d6300000,0x00000000d6300000,0x00000000dc580000) - from space 9216K, 99% used [0x00000000dc580000,0x00000000dce7f6c8,0x00000000dce80000) - to space 10240K, 0% used [0x00000000dfb80000,0x00000000dfb80000,0x00000000e0580000) - ParOldGen total 56832K, used 10895K [0x0000000082800000, 0x0000000085f80000, 0x00000000d6300000) - object space 56832K, 19% used [0x0000000082800000,0x00000000832a3cc0,0x0000000085f80000) - Metaspace used 33846K, capacity 35360K, committed 35416K, reserved 1079296K - class space used 4445K, capacity 4722K, committed 4736K, reserved 1048576K -Event: 4.043 GC heap after -Heap after GC invocations=9 (full 2): - PSYoungGen total 110080K, used 0K [0x00000000d6300000, 0x00000000e0580000, 0x0000000100000000) - eden space 100864K, 0% used [0x00000000d6300000,0x00000000d6300000,0x00000000dc580000) - from space 9216K, 0% used [0x00000000dc580000,0x00000000dc580000,0x00000000dce80000) - to space 10240K, 0% used [0x00000000dfb80000,0x00000000dfb80000,0x00000000e0580000) - ParOldGen total 87552K, used 13265K [0x0000000082800000, 0x0000000087d80000, 0x00000000d6300000) - object space 87552K, 15% used [0x0000000082800000,0x00000000834f4528,0x0000000087d80000) - Metaspace used 33846K, capacity 35360K, committed 35416K, reserved 1079296K - class space used 4445K, capacity 4722K, committed 4736K, reserved 1048576K -} - -Deoptimization events (10 events): -Event: 3.280 Thread 0x0000000002c03000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000035b9da4 method=org.springframework.util.ConcurrentReferenceHashMap$Segment.findInChain(Lorg/springframework/util/ConcurrentReferenceHashMap$Reference;Ljava/lang/Object;I)Lorg/springframewo -Event: 3.343 Thread 0x0000000002c03000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000360ed98 method=org.springframework.util.ConcurrentReferenceHashMap$Segment.findInChain(Lorg/springframework/util/ConcurrentReferenceHashMap$Reference;Ljava/lang/Object;I)Lorg/springframewo -Event: 3.398 Thread 0x0000000002c03000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000035bb154 method=java.lang.reflect.Method.equals(Ljava/lang/Object;)Z @ 1 -Event: 3.540 Thread 0x0000000002c03000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000003775984 method=org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(Ljava/lang/String;Lorg/springframework/core/ResolvableType;)Z @ 66 -Event: 3.789 Thread 0x0000000002c03000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000003813fd4 method=org.springframework.util.ConcurrentReferenceHashMap$Segment.clear()V @ 4 -Event: 3.863 Thread 0x0000000002c03000 Uncommon trap: reason=predicate action=maybe_recompile pc=0x000000000307ed50 method=java.lang.String.regionMatches(ZILjava/lang/String;II)Z @ 63 -Event: 3.910 Thread 0x0000000002c03000 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000003726afc method=java.util.AbstractList$Itr.next()Ljava/lang/Object; @ 14 -Event: 3.912 Thread 0x0000000002c03000 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000003726afc method=java.util.AbstractList$Itr.next()Ljava/lang/Object; @ 14 -Event: 3.912 Thread 0x0000000002c03000 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000003726afc method=java.util.AbstractList$Itr.next()Ljava/lang/Object; @ 14 -Event: 3.912 Thread 0x0000000002c03000 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000003726afc method=java.util.AbstractList$Itr.next()Ljava/lang/Object; @ 14 - -Classes redefined (0 events): -No events - -Internal exceptions (10 events): -Event: 3.770 Thread 0x0000000002c03000 Exception (0x00000000da1eadc0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cpp, -Event: 3.770 Thread 0x0000000002c03000 Exception (0x00000000da1fff18) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.c -Event: 3.771 Thread 0x0000000002c03000 Exception (0x00000000da212620) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 210 -Event: 3.771 Thread 0x0000000002c03000 Exception (0x00000000da226008) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cp -Event: 3.771 Thread 0x0000000002c03000 Exception (0x00000000da2395e0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cpp, -Event: 3.774 Thread 0x0000000002c03000 Exception (0x00000000da262588) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 210] -Event: 3.774 Thread 0x0000000002c03000 Exception (0x00000000da27e750) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\class -Event: 3.775 Thread 0x0000000002c03000 Exception (0x00000000da297570) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.c -Event: 3.847 Thread 0x0000000002c03000 Exception (0x00000000da5ca5e8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 210] -Event: 3.848 Thread 0x0000000002c03000 Exception (0x00000000da5e00c8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cpp, line - -Events (10 events): -Event: 4.094 Thread 0x000000001e757000 Thread added: 0x000000001e757000 -Event: 4.094 Thread 0x000000001e758800 Thread added: 0x000000001e758800 -Event: 4.095 Thread 0x000000001e758800 Thread exited: 0x000000001e758800 -Event: 4.095 loading class org/springframework/context/support/DefaultLifecycleProcessor -Event: 4.095 loading class org/springframework/context/support/DefaultLifecycleProcessor done -Event: 4.097 loading class java/util/concurrent/ConcurrentHashMap$ValueIterator -Event: 4.097 loading class java/util/concurrent/ConcurrentHashMap$ValueIterator done -Event: 4.098 Thread 0x000000001e756000 Thread exited: 0x000000001e756000 -Event: 4.098 Thread 0x000000001e757000 Thread exited: 0x000000001e757000 -Event: 4.099 Executing VM operation: EnableBiasedLocking - - -Dynamic libraries: -0x00007ff7b7a80000 - 0x00007ff7b7ab7000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\java.exe -0x00007ff817920000 - 0x00007ff817b10000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ff815d40000 - 0x00007ff815df2000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ff8156c0000 - 0x00007ff815963000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ff816600000 - 0x00007ff8166a3000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ff817570000 - 0x00007ff81760e000 C:\WINDOWS\System32\msvcrt.dll -0x00007ff816f10000 - 0x00007ff816fa7000 C:\WINDOWS\System32\sechost.dll -0x00007ff817420000 - 0x00007ff817540000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ff815b90000 - 0x00007ff815d23000 C:\WINDOWS\System32\USER32.dll -0x00007ff815030000 - 0x00007ff815051000 C:\WINDOWS\System32\win32u.dll -0x00007ff816830000 - 0x00007ff816856000 C:\WINDOWS\System32\GDI32.dll -0x00007ff8154f0000 - 0x00007ff815684000 C:\WINDOWS\System32\gdi32full.dll -0x00007ff815450000 - 0x00007ff8154ee000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ff815190000 - 0x00007ff81528a000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffffbbb0000 - 0x00007ffffbe35000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.295_none_e6c3acbd13101292\COMCTL32.dll -0x00007ff817080000 - 0x00007ff8173b6000 C:\WINDOWS\System32\combase.dll -0x00007ff815060000 - 0x00007ff8150e0000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ff817540000 - 0x00007ff81756e000 C:\WINDOWS\System32\IMM32.DLL -0x000000005caa0000 - 0x000000005cb72000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\msvcr100.dll -0x000000005c1f0000 - 0x000000005ca92000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\server\jvm.dll -0x00007ff815ef0000 - 0x00007ff815ef8000 C:\WINDOWS\System32\PSAPI.DLL -0x00007ff8002c0000 - 0x00007ff8002c9000 C:\WINDOWS\SYSTEM32\WSOCK32.dll -0x00007ff8176c0000 - 0x00007ff81772f000 C:\WINDOWS\System32\WS2_32.dll -0x00007ff80b780000 - 0x00007ff80b78a000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ff80f370000 - 0x00007ff80f394000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ff80efa0000 - 0x00007ff80efcd000 C:\WINDOWS\SYSTEM32\winmmbase.dll -0x00007ff815290000 - 0x00007ff8152da000 C:\WINDOWS\System32\cfgmgr32.dll -0x000000005c1e0000 - 0x000000005c1ef000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\verify.dll -0x000000005c1b0000 - 0x000000005c1d9000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\java.dll -0x000000005c190000 - 0x000000005c1a6000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\zip.dll -0x00007ff815f00000 - 0x00007ff8165e2000 C:\WINDOWS\System32\SHELL32.dll -0x00007ff8166b0000 - 0x00007ff816759000 C:\WINDOWS\System32\shcore.dll -0x00007ff8148b0000 - 0x00007ff81502c000 C:\WINDOWS\System32\windows.storage.dll -0x00007ff814890000 - 0x00007ff8148af000 C:\WINDOWS\System32\profapi.dll -0x00007ff814800000 - 0x00007ff81484a000 C:\WINDOWS\System32\powrprof.dll -0x00007ff8147f0000 - 0x00007ff814800000 C:\WINDOWS\System32\UMPDC.dll -0x00007ff815e90000 - 0x00007ff815ee2000 C:\WINDOWS\System32\shlwapi.dll -0x00007ff814850000 - 0x00007ff814861000 C:\WINDOWS\System32\kernel.appcore.dll -0x00007ff815430000 - 0x00007ff815447000 C:\WINDOWS\System32\cryptsp.dll -0x000000005c140000 - 0x000000005c14d000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\management.dll -0x000000005c170000 - 0x000000005c18a000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\net.dll -0x00007ff814060000 - 0x00007ff8140c7000 C:\WINDOWS\system32\mswsock.dll -0x000000005c090000 - 0x000000005c0a1000 C:\Program Files\Java\jdk1.8.0_181\jre\bin\nio.dll -0x00007fffee0e0000 - 0x00007fffee0f6000 C:\WINDOWS\system32\napinsp.dll -0x00007fffee0c0000 - 0x00007fffee0da000 C:\WINDOWS\system32\pnrpnsp.dll -0x00007ff813db0000 - 0x00007ff813e7a000 C:\WINDOWS\SYSTEM32\DNSAPI.dll -0x00007ff815d30000 - 0x00007ff815d38000 C:\WINDOWS\System32\NSI.dll -0x00007ff813d70000 - 0x00007ff813daa000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL -0x00007fffee750000 - 0x00007fffee75e000 C:\WINDOWS\System32\winrnr.dll -0x00007ff811110000 - 0x00007ff81112c000 C:\WINDOWS\system32\NLAapi.dll -0x00007fffee0a0000 - 0x00007fffee0b5000 C:\WINDOWS\system32\wshbth.dll -0x00007ff80b540000 - 0x00007ff80b54a000 C:\Windows\System32\rasadhlp.dll -0x00007ff80c3b0000 - 0x00007ff80c427000 C:\WINDOWS\System32\fwpuclnt.dll -0x00007ff815690000 - 0x00007ff8156b6000 C:\WINDOWS\System32\bcrypt.dll -0x00007ff813bd0000 - 0x00007ff813c03000 C:\WINDOWS\system32\rsaenh.dll -0x00007ff814710000 - 0x00007ff814735000 C:\WINDOWS\SYSTEM32\USERENV.dll -0x00007ff814230000 - 0x00007ff81423c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll -0x00007ff80cab0000 - 0x00007ff80cac6000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL -0x00007ff80cf90000 - 0x00007ff80cfac000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL -0x0000000180000000 - 0x0000000180031000 C:\Users\taohandong\AppData\Local\Temp\jna8573894597523270195.tmp -0x0000000020c40000 - 0x000000002100b000 C:\lib\HCEHomeCMS.DLL -0x0000000021010000 - 0x000000002139f000 C:\lib\HCEHomeAlarm.DLL -0x0000000020730000 - 0x0000000020920000 C:\TaoHandong\Java_Code\apache-tomcat-8.5.34\bin\tcnative-1.dll -0x00007ff805a80000 - 0x00007ff805ab2000 C:\Program Files\Intel\WiFi\bin\zlib1.dll -0x00007ff813110000 - 0x00007ff813304000 C:\WINDOWS\SYSTEM32\dbghelp.dll - -VM Arguments: -java_command: C:\Users\TAOHAN~1\AppData\Local\Temp\surefire4361925548474029200\surefirebooter6466546106949192259.jar C:\Users\taohandong\AppData\Local\Temp\surefire4361925548474029200 2019-08-21T17-05-37_284-jvmRun1 surefire6910806768415210701tmp surefire_03608835572114943320tmp -java_class_path (initial): C:\Users\TAOHAN~1\AppData\Local\Temp\surefire4361925548474029200\surefirebooter6466546106949192259.jar -Launcher Type: SUN_STANDARD - -Environment Variables: -JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181 -CLASSPATH=.;C:\Program Files\Java\jdk1.8.0_181\lib;C:\Program Files\Java\jdk1.8.0_181\lib\tools.jar; -USERNAME=taohandong -OS=Windows_NT -PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel - - - ---------------- S Y S T E M --------------- - -OS: Windows 10.0 , 64 bit Build 18362 (10.0.18362.86) - -CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 142 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx - -Memory: 4k page, physical 8218728k(1001364k free), swap 16922824k(2753668k free) - -vm_info: Java HotSpot(TM) 64-Bit Server VM (25.181-b13) for windows-amd64 JRE (1.8.0_181-b13), built on Jul 7 2018 04:01:33 by "java_re" with MS VC++ 10.0 (VS2010) - -time: Wed Aug 21 17:05:42 2019 -elapsed time: 4 seconds (0d 0h 0m 4s) - diff --git a/cloud/haikang/pom.xml b/cloud/haikang/pom.xml index ef06db3..17b3d9d 100644 --- a/cloud/haikang/pom.xml +++ b/cloud/haikang/pom.xml @@ -76,7 +76,18 @@ spring-boot-starter-jdbc 2.1.6.RELEASE - + + + org.apache.httpcomponents + httpclient + 4.5.3 + + + + com.alibaba + fastjson + 1.2.58 + diff --git a/cloud/haikang/src/main/java/com/sincere/haikang/CMSServer.java b/cloud/haikang/src/main/java/com/sincere/haikang/CMSServer.java index c4e41b2..5eea561 100644 --- a/cloud/haikang/src/main/java/com/sincere/haikang/CMSServer.java +++ b/cloud/haikang/src/main/java/com/sincere/haikang/CMSServer.java @@ -1,16 +1,20 @@ package com.sincere.haikang; +import com.alibaba.fastjson.JSON; import com.sincere.haikang.bean.AttendanceBean; +import com.sincere.haikang.bean.AttendanceInfoBean; import com.sincere.haikang.dao.DeviceDao; import com.sincere.haikang.libutils.HCEHomeAlarm; import com.sincere.haikang.libutils.HCEHomeCMS; import com.sincere.haikang.libutils.HCEHomeSS; import com.sincere.haikang.libutils.HCEHomeStream; import com.sincere.haikang.server.AttendanceService; +import com.sincere.haikang.utils.ApiHelper; import com.sun.jna.Memory; import com.sun.jna.NativeLong; import com.sun.jna.Pointer; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.jdbc.core.JdbcTemplate; @@ -21,6 +25,7 @@ import java.math.BigInteger; import java.nio.ByteBuffer; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.HashMap; @Component public class CMSServer implements ApplicationRunner { @@ -40,8 +45,16 @@ public class CMSServer implements ApplicationRunner { static HCEHomeCMS.NET_EHOME_CMS_LISTEN_PARAM struCMSListenPara = new HCEHomeCMS.NET_EHOME_CMS_LISTEN_PARAM(); // private String ip = "121.40.109.21"; - private String ip = "172.16.2.145"; + private String ip = "192.168.66.46"; + @Value("${attendanceHost}") + private String host; + + @Value("${SchoolPwd}") + private String pwd; + + @Value("${SchoolAccount}") + private String account; @Override public void run(ApplicationArguments args) { @@ -202,7 +215,7 @@ public class CMSServer implements ApplicationRunner { String configCmd = "SetFingerPrintCfg"; net_ehome_xml_cfg.pCmdBuf = new Memory(configCmd.length()); - net_ehome_xml_cfg.pCmdBuf.write(0,configCmd.getBytes(),0,configCmd.length()); + net_ehome_xml_cfg.pCmdBuf.write(0, configCmd.getBytes(), 0, configCmd.length()); net_ehome_xml_cfg.dwCmdLen = configCmd.length(); byte[] configByte = configCmd.getBytes(); @@ -215,21 +228,21 @@ public class CMSServer implements ApplicationRunner { byte[] paramByte = strInputXParam.getBytes(); - int pInLength = configByte.length+paramByte.length; + int pInLength = configByte.length + paramByte.length; byte[] byInput = new byte[pInLength]; - System.out.println("configByte:"+configByte.length+" paramByte:"+paramByte.length+" byInput:"+byInput.length); + System.out.println("configByte:" + configByte.length + " paramByte:" + paramByte.length + " byInput:" + byInput.length); //复制配置信息 - System.arraycopy(configByte,0,byInput,0,configByte.length); + System.arraycopy(configByte, 0, byInput, 0, configByte.length); //复制配置信息 - System.arraycopy(paramByte,0,byInput,configByte.length,paramByte.length); + System.arraycopy(paramByte, 0, byInput, configByte.length, paramByte.length); //输入缓冲区 net_ehome_xml_cfg.pInBuf = new Memory(pInLength); - net_ehome_xml_cfg.pInBuf.write(0,byInput,0,byInput.length); + net_ehome_xml_cfg.pInBuf.write(0, byInput, 0, byInput.length); net_ehome_xml_cfg.dwInSize = byInput.length; @@ -239,9 +252,8 @@ public class CMSServer implements ApplicationRunner { net_ehome_xml_cfg.dwOutSize = 3 * 1024 * 1024; - - boolean putXml = hCEhomeCMS.NET_ECMS_XMLConfig(lUserID, net_ehome_xml_cfg,net_ehome_xml_cfg.size()); - System.out.println("下发卡号:" + putXml+" lUserID:"+lUserID+net_ehome_xml_cfg.toString()+" content:"+new String(byInput)); + boolean putXml = hCEhomeCMS.NET_ECMS_XMLConfig(lUserID, net_ehome_xml_cfg, net_ehome_xml_cfg.size()); + System.out.println("下发卡号:" + putXml + " lUserID:" + lUserID + net_ehome_xml_cfg.toString() + " content:" + new String(byInput)); } /** @@ -286,9 +298,39 @@ public class CMSServer implements ApplicationRunner { } else if (majirType.equals("0x4")) {// } else if (majirType.equals("0x5")) {//事件 -// BigInteger bigInteger = new BigInteger(cardNo); -// cardNo = cardNo(bigInteger.toString(16)).toUpperCase(); + + if (cardNo != null && cardNo.length() > 0) { + + BigInteger bigInteger = new BigInteger(cardNo); + cardNo = String.format("%08x", bigInteger); //16进制取8位,不够补0 + cardNo = cardNo(cardNo).toUpperCase(); + cardNo = new BigInteger(cardNo, 16).toString(); + + } System.out.println(String.format("设备号:%s 卡号:%s 时间:%s", deviceID, cardNo, time)); + + if (deviceID != null && !deviceID.isEmpty()) { + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = String.format("", simpleDateFormat.format(new Date()), deviceID, cardNo, time, "-1"); + + AttendanceInfoBean attendanceInfoBean = new AttendanceInfoBean(); + attendanceInfoBean.setInfo(info); + attendanceInfoBean.setIsControl(0); + attendanceInfoBean.setPwd(pwd); + attendanceInfoBean.setUsername(account); + + String jsonResult = JSON.toJSONString(attendanceInfoBean); + + System.out.println(jsonResult); + String urlXST = host + "api/XiaoAnCommon/SendXST"; + String result1 = ApiHelper.doPost(urlXST, new HashMap(), jsonResult); + System.out.println("urlXST:" + result1); + String urlHXY = host + "api/XiaoAnCommon/SendHXY"; + String result2 = ApiHelper.doPost(urlHXY, new HashMap(), jsonResult); + System.out.println("urlHXY:" + result2); + + } } // System.out.println(strXML); @@ -322,5 +364,4 @@ public class CMSServer implements ApplicationRunner { return cardR; } - } diff --git a/cloud/haikang/src/main/java/com/sincere/haikang/bean/AttendanceInfo.java b/cloud/haikang/src/main/java/com/sincere/haikang/bean/AttendanceInfo.java new file mode 100644 index 0000000..cc87f24 --- /dev/null +++ b/cloud/haikang/src/main/java/com/sincere/haikang/bean/AttendanceInfo.java @@ -0,0 +1,8 @@ +package com.sincere.haikang.bean; + +public class AttendanceInfo { + + /* + * + * */ +} diff --git a/cloud/haikang/src/main/java/com/sincere/haikang/bean/AttendanceInfoBean.java b/cloud/haikang/src/main/java/com/sincere/haikang/bean/AttendanceInfoBean.java new file mode 100644 index 0000000..c691a12 --- /dev/null +++ b/cloud/haikang/src/main/java/com/sincere/haikang/bean/AttendanceInfoBean.java @@ -0,0 +1,61 @@ +package com.sincere.haikang.bean; + +/** + * 考勤账号表 + */ +public class AttendanceInfoBean { + + /** + * 控制器类型,0是其他控制器,1是微耕控制器 + */ + private Integer isControl; + + public Integer getIsControl() { + return isControl; + } + + public void setIsControl(Integer isControl) { + this.isControl = isControl; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPwd() { + return pwd; + } + + public void setPwd(String pwd) { + this.pwd = pwd; + } + + /** + * 刷卡信息,XML格式字符串: + * + * + */ + private String info; + + /** + * 账号 + */ + private String username; + + /** + * 密码 + */ + private String pwd; +} diff --git a/cloud/haikang/src/main/java/com/sincere/haikang/utils/ApiHelper.java b/cloud/haikang/src/main/java/com/sincere/haikang/utils/ApiHelper.java new file mode 100644 index 0000000..1fe4e64 --- /dev/null +++ b/cloud/haikang/src/main/java/com/sincere/haikang/utils/ApiHelper.java @@ -0,0 +1,270 @@ +package com.sincere.haikang.utils; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.*; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.*; + +public class ApiHelper { + + public static String doGet(String url,Map headerParamMap) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + try { + // 通过址默认配置创建一个httpClient实例 + httpClient = HttpClients.createDefault(); + // 创建httpGet远程连接实例 + HttpGet httpGet = new HttpGet(url); + // 设置请求头信息, + for (Map.Entry entry : headerParamMap.entrySet()) { + httpGet.setHeader(entry.getKey(),entry.getValue()); + } + + // 为httpGet实例设置配置 + httpGet.setConfig(setRequestConfig()); + // 执行get请求得到返回对象 + response = httpClient.execute(httpGet); + // 通过返回对象获取返回数据 + HttpEntity entity = response.getEntity(); + // 通过EntityUtils中的toString方法将结果转换为字符串 + result = EntityUtils.toString(entity); + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭资源 + if (null != response) { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return result; + } + + + + public static String doDelete(String url,Map headerParamMap) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + try { + // 通过址默认配置创建一个httpClient实例 + httpClient = HttpClients.createDefault(); + // 创建HttpDelete远程连接实例 + HttpDelete httpDelete = new HttpDelete(url); + // 设置请求头信息, + for (Map.Entry entry : headerParamMap.entrySet()) { + httpDelete.setHeader(entry.getKey(),entry.getValue()); + } + // 为httpGet实例设置配置 + httpDelete.setConfig(setRequestConfig()); + // 执行get请求得到返回对象 + response = httpClient.execute(httpDelete); + // 通过返回对象获取返回数据 + HttpEntity entity = response.getEntity(); + // 通过EntityUtils中的toString方法将结果转换为字符串 + result = EntityUtils.toString(entity); + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭资源 + if (null != response) { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return result; + } + + /** + * 表单格式的post请求 + * + * @param url 接口地址 + * @param headerParamMap 设置请求头 + * @param paramMap 设置请求值,表单格式的请求值 + * @return + */ + public static String doPost(String url, Map headerParamMap, Map paramMap) { + CloseableHttpClient httpClient; + String result; + // 创建httpClient实例 + httpClient = HttpClients.createDefault(); + // 创建httpPost远程连接实例 + HttpPost httpPost = new HttpPost(url); + // 设置请求头 + httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded"); + for (Map.Entry entry : headerParamMap.entrySet()) { + httpPost.setHeader(entry.getKey(), entry.getValue()); + } + // 为httpPost实例设置配置 + httpPost.setConfig(setRequestConfig()); + + // 封装post请求参数 + if (null != paramMap && paramMap.size() > 0) { + List nvps = new ArrayList(); + // 通过map集成entrySet方法获取entity + Set> entrySet = paramMap.entrySet(); + // 循环遍历,获取迭代器 + Iterator> iterator = entrySet.iterator(); + while (iterator.hasNext()) { + Map.Entry mapEntry = iterator.next(); + nvps.add(new BasicNameValuePair(mapEntry.getKey(), mapEntry.getValue().toString())); + } + + // 为httpPost设置封装好的请求参数 + try { + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nvps, "UTF-8"); + httpPost.setEntity(entity); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + result = closeHttpAndResult(httpClient, httpPost,null); + return result; + } + /** + * post请求,内容体比较灵活,任意字符串格式的内容 + * @param url + * @param headerParamMap + * @param jsonParam + * @return + */ + public static String doPost(String url, Map headerParamMap, String jsonParam) { + CloseableHttpClient httpClient; + String result; + // 创建httpClient实例 + httpClient = HttpClients.createDefault(); + // 创建httpPost远程连接实例 + HttpPost httpPost = new HttpPost(url); + // 设置请求头 + httpPost.addHeader("Content-Type", "application/json"); + for (Map.Entry entry : headerParamMap.entrySet()) { + httpPost.setHeader(entry.getKey(),entry.getValue()); + } + // 为httpPost实例设置配置 + httpPost.setConfig(setRequestConfig()); +// try { + StringEntity stringEntity = new StringEntity(jsonParam, ContentType.create("application/json","UTF-8")); +// stringEntity.setContentType("application/json"); +// stringEntity.setContentEncoding("gzip");//请求头的编码格式 + httpPost.setEntity(stringEntity); +// }catch (UnsupportedEncodingException e){ +// e.printStackTrace(); +// } + result = closeHttpAndResult(httpClient,httpPost,null); + return result; + } + + public static String doPut(String url, Map headerParamMap, String jsonParam) { + CloseableHttpClient httpClient; + String result; + // 创建httpClient实例 + httpClient = HttpClients.createDefault(); + // 创建httpPost远程连接实例 + HttpPut httpPut= new HttpPut(url); + // 设置请求头 + httpPut.addHeader("Content-Type", "application/json"); + for (Map.Entry entry : headerParamMap.entrySet()) { + httpPut.setHeader(entry.getKey(),entry.getValue()); + } + // 为httpPut实例设置配置 + httpPut.setConfig(setRequestConfig()); + + StringEntity stringEntity = new StringEntity(jsonParam, ContentType.create("application/json","UTF-8")); + + httpPut.setEntity(stringEntity); + + result = closeHttpAndResult(httpClient,null,httpPut); + return result; + } + + + private static String closeHttpAndResult(CloseableHttpClient httpClient,HttpPost httpPost,HttpPut httpPut){ + CloseableHttpResponse httpResponse = null; + String result = null; + try { + // httpClient对象执行post或者是put请求,并返回响应参数对象 + if(httpPost != null) { + httpResponse = httpClient.execute(httpPost); + }else { + httpResponse = httpClient.execute(httpPut); + } + // 从响应对象中获取响应内容 + HttpEntity entity = httpResponse.getEntity(); + result = EntityUtils.toString(entity); + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭资源 + if (null != httpResponse) { + try { + httpResponse.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + return result; + } + + + /** + * 设置配置请求参数 + * @return + */ + private static RequestConfig setRequestConfig(){ + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 连接主机服务超时时间 + .setConnectionRequestTimeout(35000)// 请求超时时间 + .setSocketTimeout(60000)// 数据读取超时时间 + .build(); + + return requestConfig; + } +} + diff --git a/cloud/haikang/src/main/resources/application.yaml b/cloud/haikang/src/main/resources/application.yaml index d9b0b46..bf10bb5 100644 --- a/cloud/haikang/src/main/resources/application.yaml +++ b/cloud/haikang/src/main/resources/application.yaml @@ -22,3 +22,10 @@ mybatis: mapper-locations: classpath:mapper/*.xml config-location: classpath:mybatis-config.xml +attendanceHost: http://campus.myjxt.com/ +SchoolAccount: ceshixiao +SchoolPwd: 11111111-6fef-48gh-a5a9-447ec68bff1f + + + + -- libgit2 0.21.0