* Devtools global settings properties on your home directory (~/.spring-boot-devtools.properties when devtools is active). * @TestPropertySource annotations on your tests. * @SpringBootTest#properties annotation attribute on your tests. * Command line arguments. * Properties from SPRING_APPLICATION_JSON (inline JSON embedded in an environment variable or system property) * ServletConfig init parameters. * ServletContext init parameters. * JNDI attributes from java:comp/env. * Java System properties (System.getProperties()). * OS environment variables. * A RandomValuePropertySource that only has properties in random.*. * Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants) * Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants) * Application properties outside of your packaged jar (application.properties and YAML variants). * Application properties packaged inside your jar (application.properties and YAML variants). * @PropertySource annotations on your @Configuration classes. * Default properties (specified using SpringApplication.setDefaultProperties).
不難發現其會檢查Java system propeties里的屬性, 也就是說, 只要把mergerProperties讀到的屬性寫入Java system props里即可, 看了下源碼, 找到個切入點
/** * 重載處理屬性實現 * 根據選項, 決定是否將合并后的props寫入系統屬性, Spring boot需要 * * @param beanFactoryToProcess * @param props 合并后的屬性 * @throws BeansException */ @Override protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException { // 原有邏輯 super.processProperties(beanFactoryToProcess, props); // 寫入到系統屬性 if (writePropsToSystem) { // write all properties to system for spring boot Enumeration<?> propertyNames = props.propertyNames(); while (propertyNames.hasMoreElements()) { String propertyName = (String) propertyNames.nextElement(); String propertyValue = props.getProperty(propertyName); System.setProperty(propertyName, propertyValue); } } }
The classpath*:conf/appContext.xml simply means that all appContext.xml files under conf folders in all your jars on the classpath will be picked up and joined into one big application context.
In contrast, classpath:conf/appContext.xml will load only one such file the first one found on your classpath.
//print some test messages System.out.println("1"); Thread.sleep(1000); System.out.println("22"); Thread.sleep(1000); System.out.println("333"); Thread.sleep(1000); System.out.println("4444"); Thread.sleep(1000);
/** * modify "333" to "-" */ // Move up two lines int count =2; System.out.print(String.format("\033[%dA", count)); Thread.sleep(1000); // Erase current line content System.out.print("\033[2K"); Thread.sleep(1000); // update with new content System.out.print("-"); Thread.sleep(1000); // Move down two lines System.out.print(String.format("\033[%dB", count)); Thread.sleep(1000); // Move cursor to left beginning System.out.print(String.format("\033[D", count)); // continue print others Thread.sleep(1000); System.out.println("55555"); Thread.sleep(1000);
After Centos 7.1 tobe installed on my t400, my wireless link "Intel 5100 AGN" cannot be managed by NetworkManager, which show in "PCI unknown" state.
Googled many pages, most of them introduced how to scan wifi links by command line tool "iw", i tried all steps supplied by the pages but was blocked at the last step to get dynamical ipaddress by dhclient command "sudo dhclient wlp3s0 -v". The dhclient always complain "NO DHCPOFFERS received." (I doubted there should be some tricky to play with dhclient but which i am not faimiar with.. sad.. )
But i think there would be some extending tool for NetworkManager to manager wifi, then i google "NetworkManager wifi", i got "NetwrokManager-wifi plugin" from link https://www.centos.org/forums/viewtopic.php?f=47&t=52810
After following steps , i finally make wifi work well on centos 7.1
yum install NetworkManager-wifi
reboot machine (i tried logout and login, not work)
Problem is NetworkManager-wifi is not installed by default on centos 7.1, (would it be my mistake when install OS? strange..)
uuid_gen_unix.c: In function 'axutil_uuid_gen_v1':uuid_gen_unix.c:62:20: error: variable 'tv' set but not used [-Werror=unused-but-set-variable] struct timeval tv; ^cc1: all warnings being treated as errors
Solution is remove "-Werror" in all configure scripts
find -type f -name configure -exec sed -i '/CFLAGS/s/-Werror//g' {} \;
Another issue is:
/usr/bin/ld: test.o: undefined reference to symbol 'axiom_xml_reader_free' /usr/local/axis2c/lib/libaxis2_parser.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[4]: *** [test] Error 1 make[4]: Leaving directory `/home/miaoyachun/softwares/test/axis2c-src-1.6.0/neethi/test'
As suggested in https://code.google.com/p/staff/issues/detail?id=198, the solution is disable neethi/test in following files:
neethi/configure, remove all "test/Makefile"
neethi/Makefile.am, update "SUBDIRS = src test" with "SUBDIRS = src"
neethi/Makefile.in, update "SUBDIRS = src test" with "SUBDIRS = src"
Finally, you could run "make; sudo make install"" successfully. Last thing should be paid attention to is you may need copy all head files of neethi/include into /usr/local/axis2c/include/axis2-1.6.0/ which needed when you compile customized web service.
gcc -o hello -I$AXIS2C_HOME/include/axis2-1.6.0/ -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver -ldl -Wl,--rpath -Wl,$AXIS2C_HOME/lib hello.c /tmp/ccCYikFh.o: In function `main': hello.c:(.text+0x57): undefined reference to `axutil_env_create_all' hello.c:(.text+0x68): undefined reference to `axis2_options_create' hello.c:(.text+0x93): undefined reference to `axutil_strcmp' hello.c:(.text+0xeb): undefined reference to `axis2_endpoint_ref_create' hello.c:(.text+0x102): undefined reference to `axis2_options_set_to' hello.c:(.text+0x13d): undefined reference to `axis2_svc_client_create' hello.c:(.text+0x168): undefined reference to `axutil_error_get_message' hello.c:(.text+0x193): undefined reference to `axutil_log_impl_log_error' hello.c:(.text+0x1b1): undefined reference to `axis2_svc_client_set_options' hello.c:(.text+0x1d6): undefined reference to `axis2_svc_client_send_receive' hello.c:(.text+0x21d): undefined reference to `axiom_node_free_tree' hello.c:(.text+0x238): undefined reference to `axutil_error_get_message' hello.c:(.text+0x266): undefined reference to `axutil_log_impl_log_error' hello.c:(.text+0x28d): undefined reference to `axis2_svc_client_free' hello.c:(.text+0x2a8): undefined reference to `axutil_env_free' /tmp/ccCYikFh.o: In function `build_om_request': hello.c:(.text+0x2ed): undefined reference to `axiom_element_create' hello.c:(.text+0x307): undefined reference to `axiom_element_set_text' /tmp/ccCYikFh.o: In function `process_om_response': hello.c:(.text+0x337): undefined reference to `axiom_node_get_first_child' hello.c:(.text+0x351): undefined reference to `axiom_node_get_node_type' hello.c:(.text+0x367): undefined reference to `axiom_node_get_data_element' hello.c:(.text+0x381): undefined reference to `axiom_text_get_value' hello.c:(.text+0x396): undefined reference to `axiom_text_get_value' collect2: error: ld returned 1 exit status
從jdk7最開始的release version (http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html)的notes里看到
Area: HotSpot Synopsis: In JDK 7, interned strings are no longer allocated in the permanent generation of the Java heap, but are instead allocated in the main part of the Java heap (known as the young and old generations), along with the other objects created by the application. This change will result in more data residing in the main Java heap, and less data in the permanent generation, and thus may require heap sizes to be adjusted. Most applications will see only relatively small differences in heap usage due to this change, but larger applications that load many classes or make heavy use of the String.intern() method will see more significant differences. RFE: 6962931
latency = client send request time + network trans time (->)+ server receive request time+ reponse time + server send reponse time+ network trans time (<-)+ client receive reponse time
==31915==100 bytes in 1 blocks are definitely lost in loss record 447 of 653 ==31915== at 0x402CE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==31915== by 0x60424F9: Java_MyJNI_hello (MyJNI.c:16)
1. Download JD-Eclipse and JD-GUI - http://java.decompiler.free.fr/ and install. 2. Put a file realignment.jd.ide.eclipse_1.0.2.jar in eclipse/plugins directory. To use Realignment feature it is necessary to open the menu Preferences/General/Editors/File Associations and to select "*.class" file type and to choose "Realignment for JD Class File Editor" for Associated editors. Another possibility is the batch realignment after processing JD-GUI. To work properly you must to switch on the property "Display line numbers" in Help/Preferences of JD-GUI. To use this feature it is necessary to open the menu Preferences/Java/Decompiler/Batch Realignment and click button "Open dialog". Existing limitation: the realignment is performed only for the methods. To work properly it is necessary that the property "Display line numbers" in menu "Preferences/Java/Decompiler" was active.
JD-Eclipse插件 + realignment 補丁讓優雅的debug class 文件成為可能。
sudo dpkg -l \*erlang\* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-=============================-=============================-========================================================================== ii erlang 1:14.b.4-dfsg-1ubuntu1 Concurrent, real-time, distributed functional language un erlang-abi-13.a <none> (no description available) ii erlang-appmon 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP application monitor ii erlang-asn1 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP modules for ASN.1 support rc erlang-base 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP virtual machine and base applications ii erlang-base-hipe 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP HiPE enabled virtual machine and base applications ii erlang-common-test 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP application for automated testing ii erlang-corba 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP applications for CORBA support ii erlang-crypto 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP cryptographic modules ii erlang-debugger 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP application for debugging and testing ii erlang-dev 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP development libraries and headers ii erlang-dialyzer 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP discrepancy analyzer application ii erlang-diameter 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP implementation of RFC 3588 protocol ii erlang-doc 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP HTML/PDF documentation un erlang-doc-html <none> (no description available) ii erlang-docbuilder 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP application for building HTML documentation ii erlang-edoc 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP module for generating documentation ii erlang-erl-docgen 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP documentation stylesheets ii erlang-et 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP event tracer application ii erlang-eunit 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP module for unit testing ii erlang-examples 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP application examples ii erlang-gs 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP graphics system ii erlang-ic 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP IDL compiler ii erlang-ic-java 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP IDL compiler (Java classes) ii erlang-inets 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP Internet clients and servers ii erlang-inviso 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP trace tool ii erlang-jinterface 1:14.b.4-dfsg-1ubuntu1 Java communication tool to Erlang ii erlang-manpages 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP manual pages ii erlang-megaco 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP implementation of Megaco/H.248 protocol ii erlang-mnesia 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP distributed relational/object hybrid database ii erlang-mode 1:14.b.4-dfsg-1ubuntu1 Erlang major editing mode for Emacs ii erlang-nox 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP applications that don't require X Window System ii erlang-observer 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP application for investigating distributed systems ii erlang-odbc 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP interface to SQL databases ii erlang-os-mon 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP operating system monitor ii erlang-parsetools 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP parsing tools ii erlang-percept 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP concurrency profiling tool ii erlang-pman 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP process manager ii erlang-public-key 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP public key infrastructure ii erlang-reltool 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP release management tool ii erlang-runtime-tools 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP runtime tracing/debugging tools ii erlang-snmp 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP SNMP applications ii erlang-src 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP applications sources ii erlang-ssh 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP implementation of SSH protocol ii erlang-ssl 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP implementation of SSL ii erlang-syntax-tools 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP modules for handling abstract Erlang syntax trees ii erlang-test-server 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP server for automated application testing ii erlang-toolbar 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP graphical toolbar ii erlang-tools 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP various tools ii erlang-tv 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP table viewer ii erlang-typer 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP code type annotator ii erlang-webtool 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP helper for web-based tools ii erlang-x11 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP applications that require X Window System ii erlang-xmerl 1:14.b.4-dfsg-1ubuntu1 Erlang/OTP XML tools
arp_ignore - INTEGER Define different modes for sending replies in response to received ARP requests that resolve local target IP addresses: 0 - (default): reply for any local target IP address, configured on any interface 1 - reply only if the target IP address is local address configured on the incoming interface 2 - reply only if the target IP address is local address configured on the incoming interface and both with the sender's IP address are part from same subnet on this interface 3 - do not reply for local addresses configured with scope host, only resolutions for global and link addresses are replied 4-7 - reserved 8 - do not reply for all local addresses