`
fanrey
  • 浏览: 251919 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
对于源代码,在POM文件中增加<excludes><exclude></exclude></excludes>参数; 对于测试代码,在POM文件中增加<testExcludes><testExclude></testExclude></testExcludes>参数. <build>     <plugins>       <plugin>           <groupId>org.apache.maven.plugins</groupId ...
1. Download FreeTTS: http://freetts.sourceforge.net/ 2. 解压后运行:D:\software\freetts-1.2\lib\jsapi.exe, 选择agree. 3. 写helloworld程序,语音读出"MPLS alarm: link down": import java.util.Locale; import javax.speech.Central; import javax.speech.EngineList; import javax.speech.synthesis.Synthesizer; impo ...

Java SPI学习

    博客分类:
  • JAVA
Java1.6开始提供了ServiceLoader类来支持SPI。 1. 写好接口: public interface Service1 {   public void sayHello(); } 2. 两个实现类: public class ServiceImpl implements Service1 {   public void sayHello(){     System.out.println("hello");   } } public class ServiceImpl2 implements Service1{ @Override public ...
1. 为被调试的程序设置启动参数: -Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n 作为server,打开8888监听,不挂起。 2.把tools.jar加到CLASSPATH里。note: 这个jar包含在JDK中,不在JRE中。 3. 用JDI获取每个类有多少实例: import java.util.Iterator; import java.util.List; import java.util.Map; import com.sun.jdi.Bootstrap; import com.sun.jdi.Obj ...
如果不用jconsole,我们也可以直接用JMX来编程实现jconsole的所有功能。 1. Java应用启动时增加下面的参数: -Dcom.sun.management.jmxremote.port=6789 -Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.ssl=false 这样Java程序起来后会多起一个"JMX server connection timeout"线程和一些RMI线程。 2.写代码连到6789端口,得到所有线程的堆栈信息。 impo ...
1. 用C写一个动态链接库, 代码如下: ubuntu@ubuntu-VirtualBox:~$ cat agent.cpp #include <jvmti.h> #include <string> #include <cstring> #include <iostream> #include <list> #include <map> #include <set> #include <stdlib.h> #include <jni_md.h> JNIEXPORT jin ...
周末用了两个晚上安装成功了opensaf,发文总结一下安装过程,和其他菜鸟共享。 系统信息: 虚拟机: Oracle VirtualBox 操作系统: ubuntu 2.6.38-12-generic 1. 安装opensaf依赖的类库,我这里只缺libxml2和tipc-config: 1) 更新apt-get sudo apt-get update 2) 安装libxml2和libxml2-dev:(rpm转换成deb包安装没有成功) sudo apt-get install libxml2 sudo apt-get install libxml2-dev sudo ap ...
1. 更新apt-get sudo apt-get update 2. 安装libxml2: sudo apt-get install libxml2 sudo apt-get install libxml2-dev 下面这个方法没有成功 1. 下载libxml2的RPM文件 http://rpmfind.net/linux/rpm2html/search.php?query=libxml2 2. 安装alien. sudo apt-get install alien 3. 用alien把rpm转成deb sudo alien libxml2-2.8.0-1.fc18.i686.rpm 4 ...
根本原因是socket资源不足,导致连接失败, 下面是对exception的分析: 1. java.net.BindException: Address already in use. It may be caused by the port resources are not released quickly after we call socket.close(), but be in TIME_WAIT state for some time. Below is the result. 380g7x09:/opt # netstat -na|grep TIME_WAIT|wc -l ...
Found one Java-level deadlock: ============================= "StartStopServicePool-5 - 5165":   waiting to lock monitor 0x0816cc20 (object 0xb37eb908, a sun.misc.Launcher$AppClassLoader),   which is held by "soxplugin" "soxplugin":   waiting to lock monitor 0x08468ed4 (o ...
The Hungry Birds Problem  (one producer - multiple consumers) Given are n baby birds and one parent bird. The baby birds eat out of a common dish that initially contains W worms. Each baby bird repeatedly takes a worm, eats it, sleeps for a while, takes another worm, and so on. If the dish is empty, ...
Develop a parallel multithreaded program (in C using Pthreads, or in Java) that implements the Unix tee command, which is invoked as follows: tee filename The command reads the standard  input and writes it to both the standard output and to the file filename.  Your parallel tee program should have ...
Given are n baby birds and one parent bird. The baby birds eat out of a common dish that initially contains W worms. Each baby bird repeatedly takes a worm, eats it, sleeps for a while, takes another worm, and so on. If the dish is empty, the baby bird who discovers the empty dish chirps real loud to ...
<html> <head> <script type="text/javascript"> function sendXRPC() {   var xmlhttp;   if (window.XMLHttpRequest)   {// code for IE7+, Firefox, Chrome, Opera, Safari   xmlhttp=new XMLHttpRequest();   }   else   {// code for IE6, IE5   xmlhttp=new ActiveXObject("Microsof ...
Usually we specify the SNAPSHOT version to get the latest jars. For example,   <dependencies>     <dependency>       <groupId>exa</groupId>       <type>jar</type>       <artifactId>app-mbeans-core</artifactId>       <version>3.3.0-SNAPSHOT</ve ...
Global site tag (gtag.js) - Google Analytics