posts - 88, comments - 3, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Two compile issues i got:

One issue is:
    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.

Enjoining it!!

posted @ 2015-08-21 11:00 Milo的海域 阅读(521) | 评论 (0)编辑 收藏

http://axis.apache.org/axis2/c/core/docs/axis2c_manual.html#client_api 的hello.c client 编译命令在我的ubuntu 12.04s上总是报错
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
仔细检查了gcc命令,头文件,库文件的路径都是对的,最后跟同事讨论才发现hello.c的位置的问题。。如果hello.c的位置放到了依赖库的右面 就会报类似错误。但是官方的例子应该是测试过的,怎么会有这个问题呢? 难道我的ubuntu 12.04的gcc比较严格?

修正后的gcc命令如下
gcc -o hello hello.c  -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

posted @ 2015-08-18 17:59 Milo的海域 阅读(336) | 评论 (0)编辑 收藏

ubuntu 12.04s每次修改limit.conf文件后,要想让所有的后继ssession都能看到修改,一般要么重启系统,要么relogin系统。下面介绍一个不退出terminal就让修改立刻生效的方式
1. 修改/etc/pam.d/sudo,添加下面行到文件末尾
session    required   pam_limits.so
2. 修改 /etc/security/limits.conf, 比如
root soft nofile 65535
root hard nofile 
65535
3. 执行sudo -i -u root 模拟登录初始化

另外发现centos 6系统/etc/pam.d/sudo已经默认enable pam_limits.so了,直接2,3就可以了。

当然如果用ssh重新登录下可能来的更快。。因为/etc/pam.d/sshd默认enable了pam_limits.so, 多输入个密码而已

posted @ 2015-08-13 17:58 Milo的海域 阅读(4518) | 评论 (0)编辑 收藏

ss(shadowsocks) 是基于socks5的,但是android studio sdk manager只支持http代理,导致android studio无法更新sdk tools,解决方法就是polipo,可以将socks5转换为http代理
具体方法见
https://github.com/shadowsocks/shadowsocks/wiki/Convert-Shadowsocks-into-an-HTTP-proxy

posted @ 2015-06-28 21:50 Milo的海域 阅读(1333) | 评论 (0)编辑 收藏

ubuntu上ibus经常出现不能输入中文的情况,用下面命令可以临时解决问题
ibus-daemon -r &

posted @ 2015-06-17 13:45 Milo的海域 阅读(511) | 评论 (0)编辑 收藏

从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

posted @ 2015-05-06 17:35 Milo的海域 阅读(1850) | 评论 (0)编辑 收藏

今天有同事问为什么ubuntu上启动jenkins失败,我记得之前玩的时候并没有出现这种情况,于是跟踪了下,最终错误信息是:

daemon: fatal: refusing to execute unsafe program: /usr/bin/java (/opt is group and world writable)

根本原因是机器装了多个版本的jdk, jdk所在的/opt父目录的权限放的比较大,按照daemon要求的限制到755
chmod -R 755 /opt

问题就解决了。

其实这个场景还是蛮常见的,遇到的人应该挺多的

posted @ 2015-02-28 16:51 Milo的海域 阅读(534) | 评论 (0)编辑 收藏

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

latency = first byte out, last byte in time

posted @ 2014-07-01 14:10 Milo的海域 阅读(559) | 评论 (0)编辑 收藏

以前用centos的chkconfig来管理系统服务,而ubuntu上是没有这个工具的,google上提到一个替代品sysv-rc-conf, apt-get install下就可以直接用了,有个text console可以使用

posted @ 2013-12-24 14:54 Milo的海域 阅读(5269) | 评论 (0)编辑 收藏

Java程序的memory leak分析也可以用valgrind, 尤其是JNI程序尤其有用:
valgrind --error-limit=no --trace-children=yes --smc-check=all --leak-check=full JAVA_CMD

特意写了个有leak的jni函数,用valgrind成功检查出来了
==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)

在老版本valgrind(3.5.0) enable了--trace-children选项后可能出现错误:
 Error occurred during initialization of VM    
Unknown x64 processor: SSE2 not supported

升级到最新版可以解决这个问题,升级方法:下载src包 解压后执行 ./configure; make; make install

posted @ 2013-12-06 10:26 Milo的海域 阅读(989) | 评论 (0)编辑 收藏

仅列出标题
共9页: 上一页 1 2 3 4 5 6 7 8 9 下一页