'일거리'에 해당되는 글 42건
- 2009/11/05 Oracle Update Join Hint
- 2009/08/20 Tomcat Error (1)
- 2009/07/09 원하는 사이즈의 파일을 만들어 주는 사이트
- 2009/06/10 css 마우스 오버(behavior: expression)
- 2009/06/04 Could not load resource factory class
- 2009/06/02 Jeus + WebtoB
- 2009/05/07 JSP Excel 다루기
- 2009/03/31 eclipse plugin
- 2009/03/19 Tomcat 5.X Get 한글깨짐
- 2009/03/17 java 로또 번호 생성기
update /*+ bypass_ujvc */
(
select a.fd5, b.idx, b.name
from ts_temp A, code_detail B
where a.fd5 = b.name
) set fd5 = ccode_idx
Server Tomcat v5.5 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
eclipse.buildId=I20090611-1540
java.version=1.5.0_19
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=ko_KR
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
Error
Thu Aug 20 15:15:01 KST 2009
Server Tomcat v5.5 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
해결방법
Server.xml 에 Mysql 접속 정보가 있으나
mysql 에 접속 아이피를 지정 하여 톰캣이 시작이 안됨
behavior: expression
<style>
/* IE6 이외 브라우저 */
.layer {
padding:30px;
text-align:center;
}
.layer:hover,
.layerOver { /* layerOver 마우스 오버시 디자인 */
border:3px solid blue;
}
.layer {
behavior: expression(
this.onmouseover = new Function("this.className += ' layerOver';"),
this.onmouseout = new Function("this.className = this.className.replace(' layerOver', '');"),
this.style.behavior = null
);
}
경고: Failed to register in JMX: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory]
jar 파일 추가 할것
http://commons.apache.org
commons-pool-1.3.jar
commons-dbcp-1.2.2.jar
Jeus + WebtoB
인터넷에서 찾아본 자료중 jeus와 WebtoB의 연동을 가장 명확하고 간결하게 서술한 글.
근데 지금 생각해보니 개발이 지나가면 어차피 티맥스에서 기술지원 받아 알아서 다 해줄것 같은데..-_-;;
----------------------------------------------------------------------------------------------------------------
webtoB는 웹 서버이다. JEUS는 웹 컨테이너이다.
webtoB standard edition에는 JEUS의 웹 컨테이너 엔진이 얹혀져서 나간다. 물론 많은 양의 데이터를 핸들링하기에는 적합하지 않다. 그렇게 하고 싶다면 JEUS를 같이 써서 해야한다. JEUS에서는 자체 웹서버를 포함하고 있다. 물론 내장된 웹서버는 webtoB이다. 물론 많은 동시 접속자 수를 핸들링하고 싶지만 내장된 웹서버로는 힘들다. 그건 그냥 개발 테스트용 웹서버로 보면 된다.
큰 사이트의 경우에는 2개를 연동해서 써야만 한다.
webtob와 제우스는 설치는 압축을 푼다음 install.sh를 실행시키면 된다.( unix기준 ) 설치 과정은 매뉴얼 참조하면된다.
각각의 제품은 XML을 이용하고 있다. 그리고 WebtoB는 이렇게 만들어진 XML문서를 컴파일 해야한다.
wscfl -i filename.m
으로 컴파일 해주면 wsconfig라는 파일이 생기고 webtob는 구동될 때 이 파일을 가지고 해당 정보를 로드한다. 물론 처음 구동시만 읽어들이기 때문에 변경시에는 웹서버를 다시 start시켜야 한다. 구동 명령은 wsboot이며 중지 명령은 wsdown이다. 이것은 해당 $webtob/bin디렉토리에 있다.
JEUS는 따로이 컴파일 할 것은 없으나 읽어들이는 XML파일들이 있다. 주로 많이 바뀌는 것이 WEBMain.xml이다.
JEUS 구동 명령어를 한번에 입력하는 것이다.
start : jeusp -xml -Uadministrator -Ppassword
down : jeusadmin hostname jeusexit -Uadministrator -Ppassword
아래의 내용은 WebtoB와 JEUS를 연동하는 환경 설정 파일( *.m, WEBMain.xml )의 내용이다.
1. WebtoB
=========================================
*DOMAIN
webtob
*NODE
nitgenaix WEBTOBDIR="/users/hite95/webtob", <== WebtoB가 설치된 디렉토리
SHMKEY = 54000,
DOCROOT="/users/hite95/webtob/docs", <== WebtoB의 document root
PORT = "8080", <== WebtoB의 접속포트(브라우저가 접속할)
HTH = 1,
LOGGING = "log1",
ERRORLOG = "log2",
ServiceOrder="ext,uri", <== (추가) ext(확장자), uri(경로) 순서로 분기 우선순위
JSVPORT = 9900 <== JEUS 와 연동할 포트(WEBMain.xml에 있는 포트와 동일)
*SVRGROUP
htmlg NODENAME = "nitgenaix", SvrTYPE = HTML
cgig NODENAME = "nitgenaix", SVRTYPE = CGI
ssig NODENAME = "nitgenaix", SVRTYPE = SSI
jsvg NODENAME = "nitgenaix", SVRTYPE = JSV <== JEUS 와 연동하기 위한 서버그룹
*SERVER
html SVGNAME = htmlg, MinProc = 2, MaxProc = 10
cgi SVGNAME = cgig, MinProc = 4, MaxProc = 10
ssi SVGNAME = ssig, MinProc = 2, MaxProc = 10
MyGroup SVGNAME = jsvg, MinProc = 25, MaxProc = 30 <== JEUS 와 연동할 서버 프로세스(이름은 WEBMain.xml의 registration-id, 갯수는 min/max 와 동일)
*URI
uri1 Uri = "/cgi-bin/", Svrtype = CGI
uri2 Uri = "/examples/", Svrtype = JSV <== 위에서 ServiceOrder가 "ext,uri"인 경우는 설정할 필요 없음.
*ALIAS
alias1 URI = "/cgi-bin/", REalPath = "/users/hite95/webtob/cgi-bin/"
*LOGGING
log1 Format = "DEFAULT", FileName = "/users/hite95/webtob/log/access.log"
log2 Format = "ERROR", FileName = "/users/hite95/webtob/log/error.log"
*EXT
htm MimeType = "text/html", SvrType = HTML
jsp MimeType = "application/jsp", SvrType = JSV, SVRNAME = MyGroup
================================================================
* wscfl -i <환경설정파일> 로 환경설정 파일을 새로 컴파일 해 주셔야 합니다.
2. JEUS에서 WEBMain.xml 편집
================================================================
...
<webserver-connection>
<http-listener> <==== 이것은 JEUS 내장 간이 웹서버 설정입니다.
<listener-id>http1</listener-id>
<port>8088</port> <==== http://ip:8088/로 접속하면 됩니다.
<output-buffer-size>8192</output-buffer-size>
<thread-pool>
<min>25</min>
<max>30</max>
<step>2</step>
<max-idle-time>1000</max-idle-time>
</thread-pool>
</http-listener>
<webtob-listener> <=== WebtoB와의 연동을 위해서 추가해야 하는 부분입니다.
<listener-id>webtob1</listener-id>
<port>9900</port> <=== WebtoB의 JSVPORT 와 동일해야 합니다.
<webtob-address>127.0.0.1</webtob-address> <=== WebtoB의 IP 입니다.
<registration-id>MyGroup</registration-id> <=== WebtoB의 SERVER 명과 동일
<thread-pool>
<min>25</min>
<max>30</max>
</thread-pool>
</webtob-listener>
</webserver-connection>
...
================================================================
이와같이 설정하면 됩니다.
출처 : http://blog.naver.com/bbokstae/30009903313
JAVA / JSP에서 Excel을 다루는 방법이 몇 가지 존재한다.
그 중, 내가 사용해 본 것은
JExcelAPI (jxl.jar. 참고: http://www.andykhan.com/jexcelapi/tutorial.html#reading)
와
Jakarta POI (참고: http://jakarta.apache.org/poi)
이다.
이 통에 이 두가지를 사용하는 방법에 대한 이야기를 올리기 보다는,
사용하다 부딪힌 문제 및 나름대로의 해결 방법을 적어볼란다.
JExcelAPI를 사용하다보면 종종 만나는 Exception은 다음과 같다.
jxl.read.biff.BiffException: Unable to recognize OLE stream
jxl.read.biff.BiffException: The input file was not found
재미있는 것은 실제로 엑셀파일이 서버에 올라가 있음에도 불구하고
jxl.read.biff.BiffException: The input file was not found
이런 Exception이 뜬다는 것이다. O.o
POI 경우 만나는 Exception은 다음과 같다.
java.io.IOException: Invalid header signature; read 3255307777713441293, expected -2226271756974174256
at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:124)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:120)
Upload Component의 문제일까? (필자의 경우 ActiveX 컴포넌트가 아닌 일반적인 자바 네트웍 프로그램을 사용함)
엑셀 버전에 따르는 문제일까?
별의별 가능성에 따라 테스트를 해보았다.
결국 알아낸 문제점의 원인은... 짠짜란~~(이거 때문에 1주일 고생했다. ㅠㅠ)
UI 페이지에서 <input type="file" ...> 객체를 기술 할 때 감싸는 폼 (
<form target="i_attExcel" name="ATTREAL" enctype="multipart/form-data" method="post">
...
...
</form>
)
안에서 폼 객체(<select>, <input> ...)를 기술 할 때 반드시 <input type="file"...> 요놈 하나만
있어야 한다.
다른 폼 객체가 같이 있어도 업로드는 잘 되지만
업로드 시, 파일의 header에 HTML에 관련된 정보가 자동으로 붙음으로써
문제가 일어났던 것이다. (맞나~ ㅡㅡ;)
그래서 암만 확장자가 xls인 파일이 서버쪽에 올라간다 하더라도
jxl 방식으로 읽어들일 때, 인식할 수 없는 엑셀 파일 형식이라
jxl.read.biff.BiffException: Unable to recognize OLE stream
요런 Exception이 나왔던 것이고,
POI 방식ㅇ로 읽어들일 때도 파일의 header 정보가 알 수 없는 엑셀 파일 형식이라
java.io.IOException: Invalid header signature
요런 Exception이 나왔던 것이다.
휴~ 이 상쾌함~ ㅋㅋ
다음부터는 이런 실수 안하도록 해야지...^^;;
출처 : Tong - robertj님의 Web Programing통
[출처] JSP Excel 다루기|작성자 우마니
- database modeling [clay : http://www.azzurri.jp/en/clay/download.html]
- UML [euml2 : http://www.soyatec.com/main.php]
계속 사용 하던 이클립스가 갑자기 새로 설치 후 다른곳은 문제가 없으나 get으로 넘어오는 값이
한글이깨지는 현상이 있었다...
UTF-8로 작업이 안된 사이트라 마땅히 방법이 없었으나 방법을 해결 하여 나중을 위해 정리 함
server.xml(tomcat or eclipse)
8080 포트와 8009 포트를 사용하는 컨넥션에 붉은색 부분을 추가 또는 변경 하면 된다
<Connector acceptCount="100" connectionTimeout="20000" debug="0" disableUploadTimeout="true" enableLookups="false" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8080" redirectPort="8443" URIEncoding="EUC-KR"/>
<Connector debug="0" enableLookups="false" port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="EUC-KR"/>
class Lotto {
public static void main(String[] args) {
Lotto lotto = new Lotto();
for(int i=0; i<5; i++)
System.out.println(lotto.getLottoNum());
}
public String getLottoNum() {
StringBuffer sb = new StringBuffer();
int[] num = this.createLottoNum();
this.sort(num);
for(int i=0; i<num.length; i++) {
sb.append(Integer.toString(num[i]) + " ");
}
return sb.toString();
}
private int[] createLottoNum() {
int[] num = new int[6];
for(int i=0; i<num.length; i++) {
num[i] = (int)((Math.random()*45)+1);
for(int j=0; j<i; j++)
if(num[i] == num[j]) {
i--;
break;
}
}
return num;
}
private int[] sort(int[] num) {
int tmp;
for(int i=0; i<num.length-1; i++) {
for(int j=0; j<num.length-i-1; j++) {
if(num[j] > num[j+1]) {
tmp = num[j];
num[j] = num[j+1];
num[j+1] = tmp;
}
}
}
return num;
}
}
출처 : 조대리님 감사~

Prev
Rss Feed