工作情境 6:你確定當你不 Full Update Java Source時,你的Server Runtime Environment就不會出問題 ?
呵呵!
這兩個星期我沒有 Full Update Java Source,只更新我修改的Java Code,結果今天早上,我的Server Runtime Environment還是出問題了:不管我Maven怎麼ReBuild,我的IDE Project如何Refresh,Server Runtime Environment不是Run不起來,就是起來了,也登錄進入系統了,解果卻因為一些Java Code Complier有錯,而不能繼續用。
中午,快來不及了,怎麼辦!
感謝主,我採取了一個方式(我沒有 Full Update Java Source),結果問題都解了。
程式測試完,也趕在PM2:00前上版了。
我也另外吃了兩個包子。好好吃。好撐 !!
其實,Eclipse 常出問題的,跟你有沒有 Full Update Java Source,其實沒有絕對關係。
呵呵!
這兩個星期我沒有 Full Update Java Source,只更新我修改的Java Code,結果今天早上,我的Server Runtime Environment還是出問題了:不管我Maven怎麼ReBuild,我的IDE Project如何Refresh,Server Runtime Environment不是Run不起來,就是起來了,也登錄進入系統了,解果卻因為一些Java Code Complier有錯,而不能繼續用。
中午,快來不及了,怎麼辦!
感謝主,我採取了一個方式(我沒有 Full Update Java Source),結果問題都解了。
程式測試完,也趕在PM2:00前上版了。
我也另外吃了兩個包子。好好吃。好撐 !!
其實,Eclipse 常出問題的,跟你有沒有 Full Update Java Source,其實沒有絕對關係。
CTRL+SHIFT+G WITH INSTANCE 情境 1 : 現在已經沒有人會跟你說 Java Doc有多麼重要
當你在IDE(Ig : STS)內,使用CTRL+SHIFT+G WITH INSTANCE(選取Java Class Name, or Instance)後的結果,就可以知道。
當你在IDE(Ig : STS)內,使用CTRL+SHIFT+G WITH INSTANCE(選取Java Class Name, or Instance)後的結果,就可以知道。
Spring/boot 情境 1:使用Maven download,and install建立的Spring Boot第一個專案


- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.XXXX</groupId><artifactId>spring-boot</artifactId><version>0.0.1-SNAPSHOT</version><packaging>war</packaging><name>Spring Boot Actuator</name><description>This is simple boot application for Spring boot actuator test</description><!-- Inherit defaults from Spring Boot --><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.3.3.RELEASE</version></parent><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency><dependency><groupId>io.dropwizard.metrics</groupId><artifactId>metrics-core</artifactId></dependency></dependencies><build><finalName>spring-boot</finalName><resources><resource><directory>src/main/resources</directory><filtering>true</filtering></resource></resources><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>1.8</source><target>1.8</target></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId></plugin></plugins></build></project>
HttpServletRequest 情境 2 :Struts 2 包裝了 request
為什麼要包裝 requst 呢?
因為是為了處理文件上傳 multipart/form-data
request = prepare.wrapRequest(request);
為什麼要包裝 requst 呢?
因為是為了處理文件上傳 multipart/form-data
- public HttpServletRequest wrapRequest(HttpServletRequest oldRequest) throws ServletException {
- HttpServletRequest request = oldRequest;
- try {
- // Wrap request first, just in case it is multipart/form-data
- // parameters might not be accessible through before encoding (ww-1278)
- request = dispatcher.wrapRequest(request, servletContext);
- } catch (IOException e) {
- String message = "Could not wrap servlet request with MultipartRequestWrapper!";
- throw new ServletException(message, e);
- }
- return request;
- }
- public HttpServletRequest wrapRequest(HttpServletRequest request, ServletContext servletContext) throws IOException {
- // don't wrap more than once
- if (request instanceof StrutsRequestWrapper) {
- return request;
- }
- String content_type = request.getContentType();
- if (content_type != null && content_type.contains("multipart/form-data")) {
- MultiPartRequest mpr = null;
- //check for alternate implementations of MultiPartRequest
- Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
- if (multiNames != null) {
- for (String multiName : multiNames) {
- if (multiName.equals(multipartHandlerName)) {
- mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
- }
- }
- }
- if (mpr == null ) {
- mpr = getContainer().getInstance(MultiPartRequest.class);
- }
- request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext));
- } else {
- request = new StrutsRequestWrapper(request);
- }
- return request;
- }
- <form name="form1" method=post enctype="multipart/form-data">
J2SDK 情境 1: jconsole.exe、 Eclipse Memory Analyzer Plugin
Sun(Oracle)/J2SDK 的jconsole.exe 可單獨觀測 J2RE 上 Java 程式集 的執行情況(硬體 CPU 執行比率、Memory 被使用的情況、......) ,同樣地,Eclipse Memory Analyzer Plugin 也可與 Sun(Oracle)/J2SDK 的jconsole.exe 合作。
以上是 在 STS 內安裝好 Eclipse Memory Analyzer Plugin 之後, 使用 Eclipse Memory Analyzer Plugin 連結( Connect) Local 的 Sun( Oracle) /J2SDK 的jconsole.exe (當然, 也能連接另一台電腦的 jconsole.exe, 稱為 Remote 的 Sun( Oracle) /J2SDK 的jconsole.exe)。
連線的設定/Sun J2SDK's J2RE 參數設定:
-Dcom . sun. management. jmxremote =true
-Dcom . sun. management. jmxremote . port=7091
-Dcom . sun. management. jmxremote . authenticate=false
-Dcom . sun. management. jmxremote . ssl =false

設定的位置如上圖
點選Eclipse Memory Analyzer Plugin 的JConsole Icon


設定好,連線 OK。

此圖顯示,第三張圖:設定 JVM Process 使用硬體的CPU程度超過 90% 即顯示警告提示訊息。

Eclipse Memory Analyzer Plugin 連接 Sun(Oracle)/J2SDK 的jconsole.exe 後,顯示在 IDE內的 JConsole Dashboard。

JConsole自己本身的Dash Board,如上圖。
從 Sun( Oracle) /J2SDK Version 1.7.0 開始, 多了: jmc.exe
Sun(Oracle)/J2SDK 的jconsole.exe 可單獨觀測 J2RE 上 Java 程式集 的執行情況(硬體 CPU 執行比率、Memory 被使用的情況、......) ,同樣地,Eclipse Memory Analyzer Plugin 也可與 Sun(Oracle)/J2SDK 的jconsole.exe 合作。
以上是 在 STS 內安裝好 Eclipse Memory Analyzer Plugin 之後
連線的設定/Sun J2SDK's J2RE 參數設定:
-
-
-

設定的位置如上圖
點選Eclipse Memory Analyzer Plugin 的JConsole Icon


設定好,連線 OK。

此圖顯示,第三張圖:設定 JVM Process 使用硬體的CPU程度超過 90% 即顯示警告提示訊息。

Eclipse Memory Analyzer Plugin 連接 Sun(Oracle)/J2SDK 的jconsole.exe 後,顯示在 IDE內的 JConsole Dashboard。

JConsole自己本身的Dash Board,如上圖。
(1). 我們的程式集是使用哪一個Class Loader:
A. 使用 Spring's DaoSupport Or JBoss Hibernate DaoSupport (which executes the Hibernate HQL query) with Hibernate
通常取得的是
若要在 presentation tier
要用
B.
List<Order> orders = new ArrayList<Order>();
Order order = Order
List<the_bo1VO> list = the_dao1.findByCriteriaWithOrder
the_bo1VO
//1.
The_util1.convertMethod1
}
}
C.
//用
Map theMap1 = new HashMap
theMap1 = org.apache.commons.beanutils.BeanUtils.describe(result);
}
// TODO Auto-generated catch block
}
// TODO Auto-generated catch block
}
// TODO Auto-generated catch block
}
D.
/**map-key_Set-and-value-List*/
Map<Long, List<Long>> theMap1 = [ZZZ1
List<Long> list1 = new ArrayList<Long>();
Set<Long> set1 = new HashSet<Long>();
List<Long> ids = theMap1
/**List
List<Map<String, Object>>
Long element1 = (Long
set1
list1
}
}
}
set1
list1
}
}
}
}




















