최근에 내 블로그에서 소개한 Twitter가 JVM으로 간다는 소식을 작성하였는데, 관련해서 OSCON 2011 에서 관련 내용이 발표되었다. 


O'Reilly OSCON Java 2011, Raffi Krikorian, "Twitter: From Ruby on Rails to the JVM" 

동영상 :   http://goo.gl/Klj9v

발로 쓴 내용 : 처음에는 배경설명을 많이 한다.  IO가 어마하게 많았다. 프로젝트이름을 Gosai Kiji(꿩?)으로 결정했다. 서버 부하를 잘 처리하고, 여러 언어(특별히 Scala, java)에 대한 유연성이 있어야 했다. 

GC, runtime gc, deploy 이슈를 해결하기 위해서 많은 조사를 했다. 그리고, Finagle이라는 것을 만들었다.
http://twitter.github.com/finagle/
 
Scala, 자바 뿐 아니라 다른 JVM 언어에서 비동기 RPC 클라이언트/서버 모듈을 만들어지주는 라이브러리를 개발했다. 예쁜 코드이다. 

jvm 기반에 동작하는 많은 어플들을 개발하고 운영하고 있다. 

그렇다고 해서 java(jvm)을 사용하는 것이 트위터가 ruby를 썼다는 것을 실수였다는 것을 의미하는 것은 아니다. java는 많은 리소스를 가질 수 있다. 엄청난 트래픽에 대한 유연성을 가지고 있어서 쓴 것이다.

평 : 지난 번에 쓴 내용에서  크게 벗어나지 않았던 것 같다. 트위터의 발전을 기원하며~^^

 자료 : PPT가 없어서 유투브에서 발표 자료 캡쳐함
























 







Posted by '김용환'
,


OSCON 2011 에서 Joe Darcy가 발표한 2개를 공유한다.
 

JDK7 nutshell 

http://blogs.oracle.com/darcy/resource/OSCON/oscon2011_JDK7_nutshell.pdf

동영상 : http://www.youtube.com/watch?v=7nkB3hxH5po&feature=player_embedded

내용 : jdk 7 기본 소개, project coin에 시간을 많이 들임 (Netbeans 사용)




OpenJDK의 State 공유

http://blogs.oracle.com/darcy/resource/OSCON/oscon2011_OpenJDKState.pdf

내용 : JDK7으로 가는 여정, JCP의 state, jdk 7 기본 소개,jdk 8 방향

Posted by '김용환'
,

java7 nio2를 소개.



Posted by '김용환'
,
java7 RC 버그로 의심되는 코드가 있었다.


c:\test 라는 디렉토리를 계속 모니터링하고, 디렉토리안에서 특정 폴더나 파일이 변경되면 알려주는 간단한 코드이다.



import java.nio.channels.CompletionHandler;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
import static java.nio.file.StandardWatchEventKinds.*;
public class WatchServiceTest {
 public static void main(String[] args) throws Exception {
  Path dir = Paths.get("c:\\test\\");
  WatchService watcher = FileSystems.getDefault().newWatchService();
  WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE,
    ENTRY_MODIFY);
  for (;;) {
   key = watcher.take();
   for (WatchEvent<?> event : key.pollEvents()) {
    if (event.kind() == ENTRY_CREATE) {
     Path name = (Path) event.context();
     System.out.println("path : " + name.toAbsolutePath());
     System.out.format("%s created%n", name);
    } else if (event.kind() == ENTRY_DELETE) {
     Path name = (Path) event.context();
     System.out.println("path : " + name.toAbsolutePath());
     System.out.format("%s deleted%n", name);
    } else if (event.kind() == ENTRY_MODIFY) {
     Path name = (Path) event.context();
     System.out.println("path : " + name.toAbsolutePath());
     System.out.format("%s modified%n", name);
    }
   }
   key.reset();
  }
 }
}


c:\test\ 에서 폴더를 생성했는데.. 잉??
workspace 에서 폴더를 생성했다고 나온다..

WatchEvent 클래스의 context 메소드를 호출하면 Path 가 나오는데, 내부적으로 꼬였나 보다.


path : E:\jdk1.7\test\새 폴더
새 폴더 created
path : E:\jdk1.7\test\새 폴더 (2)
새 폴더 (2) created
path : E:\jdk1.7\test\새 폴더 (2)
새 폴더 (2) deleted
path : E:\jdk1.7\test\make
make created



관련해서 Oracle BugDatabase에 신고했다.


Posted by '김용환'
,

jdk 6 update 26 이 critical patch 로 6월에 나왔네요.

java.lang.ClassCircularityError 관련 에러 패치와 보안 패치가 이루어진 긴급 패치 버전입니다.

 

[결론 : Red hat 계열의 java에서는 영향이 없고, window 플랫폼에서 사용하는 java만 upgrade하면 됩니다.]

 

다음 버전에 대해서는 패치하라고 권고하있습니다.

- JDK & JRE 6 Update 25 버전 및 하위 버전
- JDK 5.0 Update 29 버전 및 하위 버전
- SDK 1.4.2_31 버전 및 하위 버전

 

패치에 대한 내용은 다음과 같습니다.

http://www.oracle.com/technetwork/java/javase/6u26releasenotes-401875.html

 

내용 중에 critical한 요소를 쫓아 들어가보겠습니다.

Bug Fixes

This release contains fixes for security vulnerabilities. For more information, please see Oracle Java SE Critical Patch Update advisory.

 

 

어떤 보안 요소가 패치되었나 들어가보니.아래 링크가 뜹니다.

http://www.oracle.com/technetwork/topics/security/javacpujune2011-313339.html

 

Oracle Java SE Risk Matrix


CVE# Component Protocol Sub-
component
Remote Exploit without Auth.? CVSS VERSION 2.0 RISK (see Risk Matrix Definitions) Supported Versions Affected Notes
Base Score Access Vector Access Complexity Authen-
tication
Confiden-
tiality
Integrity Avail-
ability
CVE-2011-0862 Java Runtime Environment Multiple 2D Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before See Note 1
CVE-2011-0873 Java Runtime Environment Multiple 2D Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before, and 5.0 Update 29 and before See Note 2
CVE-2011-0815 Java Runtime Environment Multiple AWT Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before See Note 3
CVE-2011-0817 Java Runtime Environment Multiple Deployment Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before on Windows See Note 3
CVE-2011-0863 Java Runtime Environment Multiple Deployment Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before See Note 3
CVE-2011-0864 Java Runtime Environment Multiple HotSpot Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before See Note 3
CVE-2011-0802 Java Runtime Environment Multiple Sound Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before See Note 2
CVE-2011-0814 Java Runtime Environment Multiple Sound Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before See Note 2
CVE-2011-0871 Java Runtime Environment Multiple Swing Yes 10.0 Network Low None Complete Complete Complete 6 Update 25 and before, 5.0 Update 29 and before, and 1.4.2_31 and before See Note 3
CVE-2011-0786 Java Runtime Environment Multiple Deployment Yes 7.6 Network High None Complete Complete Complete 6 Update 25 and before on Windows See Note 3
CVE-2011-0788 Java Runtime Environment Multiple Deployment Yes 7.6 Network High None Complete Complete Complete 6 Update 25 and before on Windows See Note 3
CVE-2011-0866 Java Runtime Environment Multiple Java Runtime Environment Yes 7.6 Network High None Complete Complete Complete 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before on Windows See Note 3
CVE-2011-0868 Java Runtime Environment Multiple 2D Yes 5.0 Network Low None Partial None None 6 Update 25 and before See Note 2
CVE-2011-0872 Java Runtime Environment Multiple NIO Yes 5.0 Network Low None None None Partial+ 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before for Windows See Note 4
CVE-2011-0867 Java Runtime Environment Multiple Networking Yes 5.0 Network Low None Partial None None 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before See Note 3
CVE-2011-0869 Java Runtime Environment Multiple SAAJ Yes 5.0 Network Low None Partial None None 6 Update 25 and before See Note 3
CVE-2011-0865 Java Runtime Environment Multiple Deserialization Yes 2.6 Network High None None Partial None 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before See Note 3
 

 

Notes:

  1. Fix addresses multiple instances of this vulnerability.
    Applies to client and server deployments of Java. This vulnerability can be exploited through Untrusted Java Web Start applications and Untrusted Java applets. It can also be exploited by supplying data to APIs in the specified Component without using untrusted Java Web Start applications or untrusted Java applets, such as through a web service.
  2. Applies to client and server deployments of Java. This vulnerability can be exploited through Untrusted Java Web Start applications and Untrusted Java applets. It can also be exploited by supplying data to APIs in the specified Component without using untrusted Java Web Start applications or untrusted Java applets, such as through a web service.
  3. Applies to client deployments of Java only. This vulnerability can be exploited only through Untrusted Java Web Start applications and Untrusted Java applets. (Untrusted Java Web Start applications and untrusted applets run in the Java sandbox with limited privileges.)
  4. Applies to server deployments of Java. This vulnerability can only be exploited by supplying data to APIs in the specified Component without using Untrusted Java Web Start applications or Untrusted Java applets, such as through a web service.

 

대부분이 webstart와 관련된 것이라 큰 이슈가 없지만, 이 중에 NIO 컴포넌트쪽이 이슈가 있군요.

 

CVE-2011-0872 Java Runtime Environment Multiple NIO Yes 5.0 Network Low None None None Partial+ 6 Update 25 and before, 5.0 Update 29 and before, 1.4.2_31 and before for Windows See Note 4

 

 

원래 이름은 이거입니다.

CVE-2011-0872 OpenJDK: non-blocking sockets incorrectly selected for reading (NIO, 6213702)

 

정확한 내용을 확인해보니, Red hat 계열의 java에서는 영향이 없고, window 플랫폼에서 사용하는 java에 영향이 있다고 합니다.

https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-0872 

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-0872

Posted by '김용환'
,
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6948803


jdk 19에서 아래와 같은 문제가 밸생할 수 있다.
algorithm check failed: MD2withRSA is disabled

http://kr.forums.oracle.com/forums/thread.jspa?threadID=1237743&start=0&tstart=0

토의 내용
http://mail.openjdk.java.net/pipermail/jdk6-dev/2010-May/001609.html
 


Bug ID: 6948803
Votes 0
Synopsis CertPath validation regression caused by SHA1 replacement root and MD2 disable feature
Category java:classes_security
Reported Against
Release Fixed 6u21(b05), 7(b97) (Bug ID:2193256)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs 6861062 , 6904162 , 2194455 , 7017668
Submit Date 30-APR-2010
Description
In 6u19, several VeriSign MD2/MD5 root certificates were replaced with stronger SHA1 versions (same key, stronger signature). Some customers using certificates issued from the VeriSign PCA 3 root have been reporting problems that cause their existing certificate chains to be rejected by the JRE because the certificate chain still includes the weaker MD2 root and we disabled MD2 support in 6u17.

The problem is that our certpath validation implementation adds the SHA1 root to the beginning of the chain but does not replace the existing MD2 root. So the chain includes both roots, first the SHA1, then the MD2 and then the rest of the chain. The chain is rejected because the MD2 root is treated as an intermediate CA cert. 

It seems our implementation should instead replace the MD2 root with the stronger SHA1 root before validating the chain.
Posted Date : 2010-04-30 13:38:51.0
Work Around
Their are a few ways to workaround the issue. For TLS, the server's certificate chain can be reconfigured so that either the MD2 root certificate is not included in the chain (including the root cert is optional in TLS), or it should be replaced with the SHA1 root certificate.

For code signing, you can re-sign the jar and include a chain with the SHA1 root instead of the MD2 root, or a chain without the root cert.
Evaluation
Fixed. A cert with the same issuer and public key as a trusted anchor is removed from the chain.
Posted Date : 2010-05-18 10:43:09.0
Comments
   
  Include a link with my name & email   
 


PLEASE NOTE: JDK6 is formerly known as Project Mustang
 


oracle java 6 update 21에서 패치되었다.
http://www.oracle.com/technetwork/java/javase/bugfixes6u21-156339.html
6948803  java classes_security CertPath validation regression caused by SHA1 replacement root and MD2 disable feature

Posted by '김용환'
,
Posted by '김용환'
,
Posted by '김용환'
,

JDK 7 RC 출시

java core 2011. 7. 12. 17:42


JDK 7 RC 버전이 7월 6일 release 되었습니다. build 147 버전입니다.

openjdk7 정보

http://mreinhold.org/blog/jdk7-rc
JDK 7: Release Candidate
2011/07/06 14:08:22 -07:00
After an ini­tial round of test­ing we’ve de­clared build 147 to be the first Re­lease Can­di­date of JDK 7.

There are only thir­teen changes in this build. Over half of them are ad­min­istriv­ial up­dates that don’t af­fect the ac­tual code; the re­main­der are true show­stop­pers, in­clud­ing sev­eral hard VM crashes and a JIT cor­rect­ness bug iden­ti­fied by an Eclipse unit test.

If no new show­stop­per is­sues are re­ported, and if JSR 336 and the com­po­nent JSRs pass their Final Ap­proval Bal­lots in the JCP, then this will be the GA build for re­lease later this month per the sched­ule posted back in Jan­u­ary.




외신과 국내 zdnet에 기사가 나왔습니다.
http://adtmag.com/articles/2011/07/08/oracle-launches-jdk-7.aspx
http://www.zdnet.co.kr/news/news_view.asp?artice_id=20110708104138

거의 최종 공개라고 했고, 눈에 띄는 문제점이 발생되지 않으면 7월 28일 GA가 발표된다고 합니다.

문서를 다운받아 annex1파트를 보고, 중요한 것만 링크를 적어놨습니다.

<vm>

   JSR 292: Support for dynamically-typed languages (InvokeDynamic)
     - http://jcp.org/en/jsr/detail?id=292
     - http://download.java.net/jdk7/docs/api//java/lang/invoke/package-summary.html
   Strict class-file checking
     - http://jcp.org/en/jsr/detail?id=202

<lang>

   JSR 334: Small language enhancements (Project Coin)
     - http://jcp.org/en/jsr/detail?id=334

<core>

   Upgrade class-loader architecture
      - http://download.java.net/jdk7/docs/api//java/lang/ClassLoader.html#getClassLoadingLock(java.lang.String)
      - http://download.java.net/jdk7/docs/api//java/lang/ClassLoader.html#registerAsParallelCapable()
   Method to close a URLClassLoader
      - http://download.java.net/jdk7/docs/api//java/net/URLClassLoader.html#close()

   Concurrency and collections updates (jsr166y)
      - http://download.java.net/jdk7/docs/api//java/util/concurrent/ForkJoinPool.html
      - http://download.java.net/jdk7/docs/api//java/util/concurrent/Phaser.html
      - http://download.java.net/jdk7/docs/api//java/util/concurrent/TransferQueue.html
      - http://download.java.net/jdk7/docs/api//java/util/concurrent/ConcurrentLinkedDeque.html
      - http://download.java.net/jdk7/docs/api//java/util/concurrent/ThreadLocalRandom.html


<ionet>
   JSR 203: More new I/O APIs for the Java platform (NIO.2)
      - http://jcp.org/en/jsr/detail?id=203

   TLS 1.2

<jdbc>

   JDBC 4.1 
   
<client>
   Create new platform APIs for 6u10 graphics features
  
   Nimbus look-and-feel for Swing

   Swing JLayer component

<web>

   Update the XML stack
      JAXP 1.4, JAXB 2.2a, and JAX-WS 2.2

<i18n>
   Unicode 6.0
      - http://download.java.net/jdk7/docs/api//java/lang/Character.html
  
   Locale enhancement

   Separate user locale and user-interface locale




<기타 내용>
JDK7에 적용될 것이라고 했던 내용중 빠진 내용이 있습니다.
module과 Project Lamda, Project Coin 중의 일부 정도가 미뤄졌습니다.

- module은 이번 jdk 7에서 제외되었습니다.
문서에도 없고 실제 컴파일 해보면 에러 발생됩니다.

Test.java:1: error: class, interface, or eum expected
module com.aa;
^
1 error


- Project Lamba(closure)는 jdk 8으로 밀렸습니다.

테스트해보면, Closure 클래스도 없으며, closure 기능 자체가 jdk7에 없습니다.


- JSR 308도 적용이 안되었습니다.


Test.java:6: error: cannot find symbol
        @NonNull List<String> strings;
         ^
  symbol:   class NonNull
  location: class Test
1 error

2010년 9월에 jdk8 이후로 연기된다고 발표했었군요..^^;;



API 정보는 이 곳을 확인하면 됩니다.

http://download.java.net/jdk7/docs/api/



튜터리얼 정보에 일부 내용은 잘 나와 있습니다.
http://download.oracle.com/javase/tutorial/


JDK7에 대해서는 아래 URL에서 다운받을 수 있습니다.
http://www.oracle.com/technetwork/java/javase/downloads/ea-jsp-142245.html
http://jdk7.java.net/download.html


다운 받으시면 잘 나와 있으니. 참조하시면 좋을 것 같습니다.
이제 슬슬 jdk 7 코딩해봐야지..

Posted by '김용환'
,


기존에는 1.6까지만 컴파일이 되니. jdk7 플러그인을 새로 깔아야 한다.
아래 내용 참조..(http://wiki.eclipse.org/JDT/Eclipse_Java_7_Support_%28BETA%29)


이클립스가 없다면,  새로 받는다. 
나는 eclipse 대신 Spring Tool Suite를 사용한다. Spring을 쓸 때가 많아서^^;;


 현재 개발중인 jdk 7 auto 컴파일 플러그인을 설치해야 한다.
Help -> New Install Software에

http://build.eclipse.org/eclipse/java7patch/ 

다음 주소를 추가하고 Eclipse Java 7 Support를 다운받는다.



그리고,

프로젝트의 Properties 설정 화면을 띄우고,  Java Compiler에서 compiler compliance level을 1.7로 변경한다.





기존에 1.6 컴파일 방식을 Switch문에 String이 들어갔을 때, 자동 빌드시 에러가 난다.
1.7 컴파일 방식을 사용하니 에러 발생하지 않는다.



jdk 7 테스트 환경 구성 완료.

'java core' 카테고리의 다른 글

Java7 (jdk7) 소개 (출시기념) #1 Short Introduction  (0) 2011.07.15
JDK 7 RC 출시  (0) 2011.07.12
Cubrid에서의 connection 연결중의 timeout  (0) 2011.06.22
jdk 1.6.0 update 25 크래쉬 crash 사례  (0) 2011.06.22
jdk 6u 25 릴리즈  (0) 2011.06.07
Posted by '김용환'
,