Tuesday 26 February 2013

Invalid expression: ${SPRING_SECURITY_LAST_EXCEPTION.class.simpleName}

Hari ini nakama report error pada page login /WEB-INF/jsp/login.jsp (line: 90, column: 13)
"${SPRING_SECURITY_LAST_EXCEPTION.class.simpleName}" contains invalid expression(s)


Selepas kaji, dicadangkan bahawa Tomcat7 tak benarkan penggunaan keyword class

Maka tukar kepada
${SPRING_SECURITY_LAST_EXCEPTION['class'].simpleName}

My environment: Tomcat 6
Nakama environment: Tomcat 7

Matikan proses pada port tertentu dalam Windows


Masalah betul apabila nak start server dalam STS IDE, kemudian dia kata port sedang digunakan, padahal pada IDE statusnya offline.
Maka kita matikan saja proses yang sedang gunakan port tersebut.

Thursday 21 February 2013

PL/SQL: Script translate view to create table

Basic script, boleh modify lagi untuk PK, nullable dll.
...
 SELECT ' "' || COLUMN_NAME || '" ' || DATA_TYPE || ' (' || data_length || ' ' || decode(char_used,'B','BYTE') || ') , '  
 FROM user_tab_columns   
 WHERE table_name='TABLE_NAME'  
 ;  

Spring WebFlow, empty value from requestParameters

Hari ni berhadapan dengan isu parameter yang dibaca daripada view tidak ada value.
Error yang terlibat adalah NullPointerException kalau tak silap.

Framework

SPRING WebFlow + JSP

Kod asal:

      <view-state id="view_superviseeStudyPlanListing" view="studyplanfrm/summaryForSVor" model="studyPlanForm">  
           <on-entry>  
                <!-- should have a decision-state to check eligibility -->  
                <!-- load list of supervisee -->  
                <evaluate expression="studyPlanFrmService.loadSummaryForSupervisor(flowScope.studyPlanForm)" result="flowScope.studyPlanForm"></evaluate>  
           </on-entry>  
           <transition on="approval" to="view_studyPlanMainForSupervisor" >  
                <evaluate expression="requestParameters.ssp" result="requestScope.paramStaffStudyPlanCode" />       
           </transition>  
      </view-state>  
      <view-state id="view_studyPlanMainForSupervisor" view="studyplanfrm/studyPlanFrmMain" model="studyPlanForm">  
      <!-- sharing view with view_studyPlanMain -->  
           <on-entry>  
                <!-- load main form with all related contents -->  
                <evaluate expression="studyPlanFrmService.loadMainFormForSupervisor( studyPlanForm, paramStaffStudyPlanCode )" result="flowScope.studyPlanForm" >  
                </evaluate>  
                <set name="flowScope.msj" value="flowScope.studyPlanForm.formMessage" ></set>  
           </on-entry>  
      </view-state>  


Kod terbaru:

      <view-state id="view_superviseeStudyPlanListing" view="studyplanfrm/summaryForSVor" model="studyPlanForm">  
           <on-entry>  
                <!-- should have a decision-state to check eligibility -->  
                <!-- load list of supervisee -->  
                <evaluate expression="studyPlanFrmService.loadSummaryForSupervisor(flowScope.studyPlanForm)" result="flowScope.studyPlanForm"></evaluate>  
           </on-entry>  
           <transition on="approval" to="view_studyPlanMainForSupervisor" >  
           </transition>  
      </view-state>  
      <view-state id="view_studyPlanMainForSupervisor" view="studyplanfrm/studyPlanFrmMain" model="studyPlanForm">  
      <!-- sharing view with view_studyPlanMain -->  
           <on-entry>  
                <evaluate expression="requestParameters.ssp" result="requestScope.paramStaffStudyPlanCode" />       
                <!-- load main form with all related contents -->  
                <evaluate expression="studyPlanFrmService.loadMainFormForSupervisor( studyPlanForm, paramStaffStudyPlanCode )" result="flowScope.studyPlanForm" >  
                </evaluate>  
                <set name="flowScope.msj" value="flowScope.studyPlanForm.formMessage" ></set>  
           </on-entry>  
      </view-state>  


Penyelesaian?

Ermm, selepas pindahkan evaluation untuk requestParameters yang berkenaan semua nampak ok.

Wednesday 13 February 2013

Oracle DB: lsnrctl on Windows


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\aidy>lsnrctl

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 14-FEB-2013 10:29:38

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> start
Starting tnslsnr: please wait...

TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
System parameter file is C:\oracle\product\11.2.0\dbhome_3\network\admin\listener.ora
Log messages written to c:\oracle\diag\tnslsnr\ikcm-110304\listener\alert\log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ikcm-110304)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
Start Date                14-FEB-2013 10:29:54
Uptime                    0 days 0 hr. 0 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   C:\oracle\product\11.2.0\dbhome_3\network\admin\listener.ora
Listener Log File         c:\oracle\diag\tnslsnr\ikcm-110304\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ikcm-110304)(PORT=1521)))
The listener supports no services
The command completed successfully
LSNRCTL>

Friday 8 February 2013

Spring Webflow: Transition not triggered

Isu

Transition not triggered as expected.

Punca

Date validation gunakan JSR. Walaupun flow setup utk mute validation, namun JSR version still checking.
No validation found on the model.
@DateTimeFormat(iso=ISO.DATE, pattern=SystemPattern.INPUT_DATE_PATTERN) has been added and transition flow correctly.

Action

Still working on this issue.
Done with the flow. Required checking on data binding.

Alternative:

Remove the JSR validation?

Not an option since data binding will depends heavily on that validation.

Check if JSR Validation is mutable.


APR

Thursday 7 February 2013

PL/SQL: dba_data_files


Selalu lupa mana letaknya EM? Macam mana nak akses EM untuk modify/view tablespace?
atau prefer guna sqldeveloper/sqlplus

Boleh query gunakan table dba_data_files

SELECT file_name, tablespace_name, ROUND(bytes/1024000) MB
FROM dba_data_files
ORDER BY 1;

desc dba_data_files;

select * from dba_data_files;

alter database datafile
   'imsdata.dbf'
autoextend on;

Wednesday 6 February 2013

Assert: The expression string to parse is required and must not empty

Buang masa juga DEBUG ERROR ni, hanya kerana TRY & ERROR.

 Punca: 

 <display:column>  
      <form:checkbox path="studyPlanDetailList[${spd_rowNum-1}].selected" value="Y" />  
 </display:column>  
 Sepatutnya:

 <display:column>  
      <form:checkbox path="studyPlanDetailList[${spd_rowNum-1}].selected" value="Y">  
 </form:checkbox></display:column>