2009年3月11日 星期三
Find which process has occupied which port
lsof – list open files
The syntax for using "lsof" is:
lsof -i tcp:3480
or
lsof -i udp:3480
if you are interested in port 3480, over the appropriate protocol, TCP or UDP...
In Windows:
C:\>netstat -abno
使用中連線
協定 本機位址 外部位址 狀態 PID
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1932
[httpd.exe]
TCP 0.0.0.0:113 0.0.0.0:0 LISTENING 3580
[ident.exe]
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 800
RpcSs
[svchost.exe]
TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING 472
[wininit.exe]
In AIX:
netstat -Aa | gret 8080
rmsock xxxxxxxx tcpcb
ps -ef|grep thepid
2009年3月10日 星期二
Transaction strategies: Models and strategies overview
The Java platform supports six types of transaction attributes, regardless of whether you are using EJB or the Spring Framework:
Required, Mandatory, RequiresNew, Supports, NotSupported, Never.2009年3月5日 星期四
Running servlet container behind IIS
Installing and Configuring the Microsoft IIS Weblogic proxy Plug-In
http://e-docs.bea.com/wls/docs92/plugins/isapi.html
The Apache Tomcat Connector - Reference Guide - Configuring IIS
http://tomcat.apache.org/connectors-doc/reference/printer/iis.html
Running Tomcat behind IIS
http://www.boplicity.net/confluence/display/Tomcat/Running+Tomcat+behind+IIS
Windows2003下完美配置整合IIS 6+Jre 1.6+Tomcat 6.0.18 - windows 服务器
http://blog.chinaunix.net/u2/69106/showart_1417949.html
整合 IIS 5.1 和 Tomcat 5.5 的步驟
http://xml.nchu.edu.tw/blogs/?p=48
ONJava.com Configuring Tomcat with IIS Web Server
http://www.onjava.com/lpt/a/2829
2009年3月4日 星期三
Tomcat 5.5 SSL Configuration
keytool -genkey -alias tomcat -keyalg RSA
and specify a password value of "changeit".
keytool -delete -alias tomcat
Change the password from “changeit” to “newpass”:
keytool -keypasswd -alias tomcat -keypass changeit -new newpass
The keystore is by default stored in a file named .keystore in the user's home directory, as determined by the "user.home" system property.
Read http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html for more information about keytool.
Tomcat 5.5 JNDI設定
1. conf/context.xml:
<Resource name="jdbc/eflow"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
username="eflow"
password="eflow123"
url="jdbc:oracle:thin:@localhost:1521:orcl"
maxActive="10"
maxIdle="0"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" />
2. web.xml
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/eflow</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
2009年3月3日 星期二
How do I change the IP address on Oracle 10g
If the server's IP address changed, these are the first things I would look at:
The TNSNAMES.ORA file on the client -- does it have the IP address hardcoded? If so, change it. Does it use the machine name? If so, does the machine name resolve to the correct IP address on your client machine?
The LISTENER.ORA file on the server -- does it explicitly specify the old IP address as its listening address?
2009年2月4日 星期三
用java壓縮tar檔
package mytest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.tools.tar.TarEntry;
import org.apache.tools.tar.TarOutputStream;
public class AntTarTest {
public static void main(String[] args) throws Exception {
String[] inputFiles = new String[] { "D:/txt/network.txt",
"D:/txt/sql.txt" };
new AntTarTest().tar("d:/AntTarTest.tar", inputFiles);
}
public void tar(String tarFileName, String[] inputFiles) throws IOException {
TarOutputStream out = new TarOutputStream(new FileOutputStream(
tarFileName));
int buffersize = 1024;
byte[] buf = new byte[buffersize];
for (int i = 0; i < inputFiles.length; i++) {
File file = new File(inputFiles[i]);
TarEntry te = new TarEntry(file.getName());
te.setSize(file.length());
out.putNextEntry(te);
FileInputStream in = new FileInputStream(file);
int count;
while ((count = in.read(buf, 0, buffersize)) != -1)
out.write(buf, 0, count);
out.closeEntry();
in.close();
}
out.close();
System.out.println("compress ok.");
}
}