티스토리 뷰

728x90
반응형
hat I want to know :

    According to log,  NPE happen when getDeploymentTimeStamp method is called, so I would like to know what value is null and what is going on there.


ErrorMsg :  

             java.lang.NullPointerException



18:04:54,160 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015016: Initial deployment scan failed: java.lang.NullPointerException
    at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.getDeploymentTimestamp

    (FileSystemDeploymentService.java:723) [jboss-as-deployment-scanner-7.3.4.Final-redhat-1.jar:7.3.4.Final-redhat-1]
    ............



Test Source :

  •       org.jboss.as.server.deployment.scanner.FileSystemDeploymentService

 


private long getDeploymentTimestamp(File deploymentFile) {
     if (deploymentFile.isDirectory()) {
             // Scan for most recent file
             long latest = deploymentFile.lastModified();
             for (File child : deploymentFile.listFiles()) {
                 long childTimestamp = getDeploymentTimestamp(child);
                 if (childTimestamp > latest) {
                     latest = childTimestamp;
                 }
             }
             return latest;
         } else {
             return deploymentFile.lastModified();
         }
     }




Byteman script :


RULE Test autodeployment checking all files under the exploded folder
CLASS org.jboss.as.server.deployment.scanner.FileSystemDeploymentService
METHOD getDeploymentTimestamp
AT INVOKE  getDeploymentTimestamp
BIND subfile = $child;
IF TRUE
DO
   System.out.println("=========================JHOUSE-debug=================");
   System.out.println("deploymentFile : " +  $1);
   System.out.println("subFile : " + subfile);
ENDRULE
 



Result :


INFO  [stdout] (DeploymentScanner-threads - 1) Rule.execute called for Test autodeployment_2
INFO  [stdout] (DeploymentScanner-threads - 1) HelperManager.install for helper class org.jboss.byteman.rule.helper.Helper
INFO  [stdout] (DeploymentScanner-threads - 1) calling activated() for helper class org.jboss.byteman.rule.helper.Helper
INFO  [stdout] (DeploymentScanner-threads - 1) Default helper activated
INFO  [stdout] (DeploymentScanner-threads - 1) calling installed(Test autodeployment) for helper classorg.jboss.byteman.rule.helper.Helper
 INFO  [stdout] (DeploymentScanner-threads - 1) Installed rule using default helper : Test autodeployment
 INFO  [stdout] (DeploymentScanner-threads - 1) Test autodeployment execute
 INFO  [stdout] (DeploymentScanner-threads - 1) =========================JHOUSE-debug=================
INFO  [stdout] (DeploymentScanner-threads - 1) deploymentFile : /home/jooho/Applications/JBoss/EAP/jboss-eap-6.2.4/standalone/deployments/cluster.war
INFO  [stdout] (DeploymentScanner-threads - 1) subFile : /home/jooho/Applications/JBoss/EAP/jboss-eap-6.2.4/standalone/deployments/cluster.war/index.jsp


Compared between source and by teman script, you can easily map each value that related with each other.


If you have any questions, please leave comment.


반응형

'이제 관심밖의 IT 기술 > ETC' 카테고리의 다른 글

Mockito Tutorial 1  (0) 2011.10.27
Mockito Framework 이란?  (0) 2011.10.27
Junit 4 Assertion 사용을 위한 기본세팅  (0) 2011.10.26
JUnit4 특징설명  (0) 2011.10.26
JUnit3 example  (0) 2011.10.26
댓글
250x250
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함