Wednesday, May 20, 2009
SAP Portal - FAQ 2
SAP EP offers users role-specific, Web-based and secure access to all relevant information, applications and services. Employees only need a desktop and a Web Browser, and can begin work once they have been authenticated in the portal.
2. What components does SAP Enterprise Portal contain?
SAP Enterprise Portal contains the NetWeaver components Portal, Knowledge Management, and Collaboration. In addition, SAP provides pre-defined content. At the moment the portfolio contains more than 100 business packages, which are shipped in multiple languages.
3. What is the relationship between Web Dynpro and SAP Enterprise Portal? Are iViews and Web Dynpro competing technologies?
Web Dynpro is SAP's programming model for developing professional and interactive Web user interfaces for business applications.
An iView is a logical portal content module representing a visual application or part of one. One or more iViews are combined on a portal page, which is then assigned to users by the role definition. Web Dynpro UIs are integrated in SAP Enterprise Portal with iViews.
4. What personalization functions does SAP Enterprise Portal provide?
Portal roles are a central element of SAP Enterprise Portal. They structure the content and are defined for specific end users.
A role is a collection of task-specific content. Roles are defined based on responsibilities and areas of interest, and are created by a role administrator. A user can be assigned one or more roles (for example, the roles employee and staff). The roles define the content of the portal navigation as well as the content of the portal. Role assignment can therefore be seen as a pre-personalization of the portal - a personalization that is performed by the administrator and not by the user (personalization level 1). Depending on their permissions, users can also adjust the look and feel of the portal, maintain user-specific attributes (personalization level 2), change portal pages by adding or deleting iViews (personalization level 3), and personalize individual iViews (personalization level 4).
5. What tools does SAP provide for creating portal content?
SAP provides tools for creating and developing portal content, depending on the target group and the complexity of the applications.
One distinguishes between
Portal Content Studio: An administration environment integrated in SAP Enterprise Portal that is used for code-free development of portal content using wizards.
SAP NetWeaver Visual Composer: Model-based development of portal content by simply using graphic tools.
SAP NetWeaver Developer Studio (Web Dynpro perspective): Based on the powerful Web Dynpro programming model, application developers can develop Web user interfaces for professional business applications.
SAP NetWeaver Developer Studio (J2EE + PDK perspective): The SAP NetWeaver Developer Studio offers complete support when developing Java projects.
SAP ABAP Workbench: The ABAP Workbench provides the Business Server Page (BSP) technology for creating Web user interfaces.
All the portal content created using these tools can be seamlessly integrated in SAP Enterprise Portal using the portal services already presented.
6. What are the key features of the portal?
The portal is more than just a "page paste" and different services for handling the interaction between iViews. Typical examples for the integration technology are:
Client Eventing: Enables iViews to communicate with one another at the client side and to communicate with the portal itself.
Work Protect: Function providing an infrastructure for handling unsaved data in portal applications, for example if users navigate in the portal without first having stored their entries in an application.
Session Management: Contains in particular the session persistence to retain the last session status of the user (for example when navigating to another portal page) as well as a server session termination function for releasing resources on the backend system (for example when closing the browser).
Portal Navigation: SAP Enterprise Portal offers more than simply navigation between individual portal pages, in particular.
Object-based navigation (OBN): It provides users with a navigation feature based on the actual business objects from productive backend systems.
Drag&Relate: iViews can contain objects representing business elements of a backend application (for example customer). If users pull such an object, as with Drag&Drop, and relate it to another object in the Drag&Relate target object area, they can navigate between different applications containing similar, but not identical business objects.
Dynamic Navigation: The portal enables you to assign navigation objects to pages and iViews as context-sensitive dynamic navigation iViews. This means that navigation targets are provided dynamically depending on the action selected.
7. Which security features does SAP Enterprise Portal offer?
The portal offers the following security features to help keep your portal secure.
Authentication: When users access the portal, they must provide some form of identification in the form of user ID and password, client certificates, and so on. The portal supports authentication with user ID and password, X.509 certificates, integrated Windows authentication, external Web access management tools.
Single Sign-On: Once users have successfully logged on to the portal, they can access all information, applications, and services without repeatedly having to log on.
Authorization: ACL-based permissions ensure that users can only access portal objects for which they have the required authorization. Authorization for applications integrated in the portal are handled by the systems on which the applications run.
User Management: Existing corporate LDAP directories in your system landscape can be leveraged by the portal. Alternatively user data can be retrieved from a SAP Web Application Server ABAP or from a database.
Secure Communications: Secure Sockets Layer (SSL) and Secure Network Communications (SNC) can be used to build a secure channel between the user's Web browser, the portal server, and backend systems.
Secure network architecture: Recommendations for a secure network architecture for the portal are available in the Portal Security Guide.
Security logging: Security-relevant events such as user logon, or changes to permissions, are logged.
8. How is user management implemented in SAP Enterprise Portal?
The portal uses the 'User Management Engine' (UME) which is an integral part of SAP Web Application Server Java. The UME manages user and user-related data (roles, groups) which can be retrieved from an LDAP directory, a SAP Web Application Server Java, a database, or a combination of these. Administration tools allowing you to manage users, groups, and roles are integrated in the portal user administrator role. A configuration tool for configuring the UME is integrated in the portal system administrator role.
In addition, the UME provides many features such as self-registration with approval workflow, notification emails, and so on.
9. How can I integrate the user management of the portal with that of other systems?
The portal user management is very flexible and allows you to use a variety of repositories for storing and retrieving user data. In particular, it allows you to leverage existing user repositories in your system rather than having to set up a new user repository.
For example, if you are using your portal in a system landscape that includes many non-SAP systems, you can provide a central user base using an LDAP directory and configure the portal to use the LDAP directory as its user repository.
On the other hand, if you are using your portal in a system landscape that consists of SAP systems only, you can set up Central User Administration (CUA) on one of the ABAP-based systems and configure your portal to use the ABAP user management as its user repository.
SAP Portal - FAQ 1
Ans: doContent();
2) Extending class when Developing your Portal Components?
Ans: AbstractPortalComponent.
3) Portal Runtime calls the methods in the Life Cycle
Ans: init(), service(), destroy()
4) What are the Parameters that we have to pass to doConent();
Ans: IPortalComponentRequest ,IPortalComponentResponse;
5) How do u access a Resource from a request object
Ans: request.getResource();
6) Personalization concept what are the data type, the type attribute supports
Ans : String , Date , Select , Boolean (however, the Date does not work in my try out)
7) How do u get the property from the IPortalCompenentProfile
Ans : getProperty(String)
8) What is the method has to be overridden by the class that extends from PageProcessorComponent
Ans : getPage(); A static inner class extends JSPDynPage and in getPage, new the inner class.
9) Give the sequence of methods execution of DynPage
Ans :
1) doInitialization()
2) doProcessAfterInput()
3) doProcessBeforeOutput()
10) sequence of method calls when an event occurs
Ans :
1) doProcessAfterInput()
2) on[eventhandlername]
3) doProcessBeforeOutput()
11) how do u get the getCurrentEvent();
Ans :
IPageContext myContext = PageConectFactory.createPageConext(request,responce);
Event = myContext.getCurrentevent();
12) onClientClick() and onClick() are specified then which method will be called first
Ans : onClientClick();
13) JSPDynPage uses _________ type of approach
Ans : Model View Controller
14) The two properties in the component profile indicate that a JSP need to be compiled into portal component :
Ans :
Property name = JSP
Property name = ComponentType
15) Which one is true in the following statement
a)
b)
c)
d)
Ans : a ( I think the answer shall be d.)
16) How do u call a jsp file :
Ans : setJspName();
17) If java Script are used _______tag is necessary for the page
Ans : Page tag
18) Which tag is used for including bean in the jsp file
Ans : [jsp:]
19) What is the scope of the bean
Ans : Session
20) Give the objects that are extend form the IPrincipal
Ans : IGroup, IRole, IUser, IUserAccount, IUserMaint,
21) ____is the Central object from which all UME object factories are obtained
Ans : UMFactory
22) IUser user = UMfactory.getUserfactory().getUserbyLogonID(uid)
String userName = user.getDisplayName();
String email = user.getEmail();
Response.write( userName + username+ Email :+ email);
1) Displays the username and Email ID
2) Throws an exception
3) Doesnt Compile
Ans : 1.
23) List the methods used to create successful user
Ans :
1) NewUser(uid);
2) setFirstName()
3) setLastName()
4) setEmail()
5) setPassword();
24) can we construct an unique id manually .
Ans : false can create a unique id .
25) Unique IDs are used to identify objects across data sources.
Ans :
26) How do u retrieve log on information
Ans : umdata.enrich(map);
27) What is the return type of map.get("");
Ans : String
28) How do u load the data in the Client Eventing across the iviews
Ans : EPCM.loadClientData();
29) What is the object available in the pages
Ans : EPCM
30) What problems does HTMLB the overcomes on servelts
Ans :
Visualization and business logic are not separate
Development has to take care of different web clients and versions
NamesSpace conflicts with form elements
31) Stored data is identified by the key¦..
Ans : Namespace+name
32) Frame Work Levels
Ans :
Level = 0 ---- not supported by both javaScript, Java
Level = 1 ---- only by browser (java Script )
Level = 2 ---- both javaScript and Java
33) Features of portal Services in the portal
Ans :
1) portal services are way to provide functionality to portal component
2) portal services implement no user interface
3) portal service may be accessed from out side portal framework
34) Why do we need custom portal Services in the portal
Ans :
1) Can be used by other Portal Application
2) Provide commonly used Functionality
3) Can be exposed as webservice
35) To build a new portal service interface must be implemented
Ans :
IService
36) Life cycle of a portal service
Ans :
Init()
Afterinit()
Destroy()
37) Service name =
Ans :
38) Portal service name is myService …what would be the name of interface that extends IService
Ans : IMyService
39) JCA/J2EE connector Architecture is not API. True /False
Ans : true
40) ConnectorFrameWork is SAP Extended API from CCI . all methods in Connector FrameWork has methods with suffix as EX()….
Ans : False only some methods
41) What is the method used to get connection in the Java Connectors
Ans : Service.getConnection();
42) How do u get the locale from the request object.
Ans : Request.getLocale();
43) What is the return type for the table type structure .
Ans : IRecordSet.
44) Give the name of the method that returns resource bundle for the current locale.
Ans : getResourceBundle()
45) Localization.properties
Localization_de_DE.properties.
Localization_en_EN.properties.
What is the Resource bundle name : ?
Ans : Localization
46) What is the data type that returns by the method getString (key)
Ans : String
47) How do u access the a key in the properties file xyz = abc
Ans : getString ("xyz")
48) What type of objects can be translated
Ans : Text
49) the portal translation process is supported by tools
Ans :
Translation worklist coordination
Worklist translation
50) to customize the Logoff screen to the portal ----file is used to change
Ans : masthead
51) SAP Recommends not to modify the SAP code , then what are the process to customize the code
Ans :
1) copy the existing file and rename it according to customer name space
2) create new custom component
52) how can we customize the company Branding
Ans :
1) masthead
2) through customize applicaton
53) Their one question on Desktop inner page
54) What are the components that are added to Portal Desktop
Ans :
Default Frame work
Themes
55) What is the jsp name that contains log on page
Ans : umLogonPage.jsp
56) Authschemes.xml is modified to get custom log on component
57) How do u access portal services from WebDynpro applications
Ans : WDPortalUtils
58) Cache Level :
Ans : none ,session ,user,shared
59) getCachingLevel() is used to get the Cachelevel
60) When will the doinitialization () method is called
Ans :
1 When the page is loaded for the first time
2 When the page is refreshed
3 When object is called from the another object
61) Cached objects are retrieved using the --- method
Ans : get(key)
62) How can the portal service access to external Web Service
Ans :
Generate java proxy out of WSDL file with PDK
You can execute the java proxy as portal service
SAP Portal - Create Custom Layout and Apply the Layout
mylayout.jsp under the dist/jsp folder
lyt:template
...
/lyt:template
Define component in portalapp.xml
component name="myLayout"
config:
ClassName com.sapportals.portal.pb.layout.PageLayout
ResourceBundleName: pagebuilder_nls
profile:
ComponentType: com.sapportals.portal.layout
com.sap.portal.pcm.Title:
com.sap.portal.pcm.Description:
com.sap.portal.reserved.layout.TagLibLayout : /SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld
com.sap.portal.reserved.layout.TagLibHtmlb: /SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld
com.sap.portal.reserved.layout.TemplateFile: mylayout.jsp
com.sap.portal.reserved.layout.Cont1: the_container_id [title: my container, orientation: vertical]
Deploy the PAR to Portal
Create the layout in Portal Content, actually not necessarily under the Layout Templates.
Set the "Object is a Template" to "Yes"
DONE
SAP Portal - Collapse Portal Favorite as Default
select the category "Navigation" and set the "Initial State of Navigation Panel" to "Always Closed".
Monday, May 18, 2009
SAP Portal - JSP DynPage
property name="ComponentType" value="jspnativa"
property name="JSP" value="pagelet/abc.jsp"
It is necessary to remove these two lines. For me, if not, componentRequest value will not be passed to the page and the value will be null.
SAP Portal - KM Service
import com.sap.netweaver.bc.util/lib/bc.util.public_api.jar
and handle WcmException
Thursday, May 14, 2009
SAP Portal - Enable Collabration Room in Portal Application
- log in SAP Portal, System Administration -> Support -> Portal Runtime -> Browse Deployment
- navigate to ROOT/WEB-INF/portal/portalapps/com.sap.netweaver.coll.shared/lib
- download the coll.shared.roomobject_api.jar
- download \portalapps\com.sap.portal.usermanagement\lib\com.sap.security.api.ep5.jar
- download \portalapps\com.sap.netweaver.bc.rf\lib\bc.rf.framework_api.jar
- download \portalapps\com.sap.netweaver.coll.shared\lib\coll.shared.extension_api.jar
- download \portalapps\com.sap.netweaver.coll.shared\lib\coll.shared.types_api.jar
- download \portalapps\com.sap.netweaver.kmc.util\lib\kmc.util.core_api.jar
- actually the downloaded file will be called com.sap.portal.support.browse.zip
- extract the jar to C:\development\sap-portal-7.0.18\lib
- in NWDS, Windows -> Preferences -> Java -> Classpath Variables -> New and add PORTAL_HOME=C:\development\sap-portal-7.0.18\lib
- in a Portal project, right click on the project, Properties -> Java Build Path -> Libraries -> Add Variable
- select PORTAL_HOME, click on Extend
- select the coll.shared.roomobject_api.jar and rest, click on OK
- application-config :: property name = "ServicesReference" :: value = "..., com.sap.netweaver.coll.shared, ..."
Tuesday, May 12, 2009
SAP Portal - User's Own Layout
However the layout is not listed when creating a page. Any idea?
Thursday, May 07, 2009
SAP Portal - Redirect in Portal Component
SAP NetWeaver Developer Studio 7.0.18. (aka 2004s)
Java build path. Extend ECLIPSE_HOME and add plugins/com.tssap.ext.libs.j2ee_xxx/lib/servlet.jar.
HttpServletResponse httpResponse = request.getServletResponse(true);
try { httpResponse.sendRedirect(url); } catch (IOException e) {}
SAP Portal - Direct Access to an iView
After ROLES, it is the PCD id.
or
https://.../irj/servlet/prt/portal/prtmode/preview/prtroot/pcd!3aportal_content!2fe0040034!2fe0040034.myLinkedReport
Wednesday, April 08, 2009
Temporary Objects in SAP Portal
This may cause SAP Portal behavior different among users. The reason is that some users may be associated with some temp objects and others may be with other temp objects.
The tool to clean these temporary objects is to use PCD inspector. Search for all associations or links to the temp object and delete these links first. Then delete these temp objects.
After it, System Admin -> Support Desk -> Portal Content Directory -> PCD Admin -> Release cache.
After it, reboot the server (depends).
Thursday, April 02, 2009
SAP Portal - Direct Access to Portal Content Administration
Try the NavigationTarget as portal?NavigationTarget=navurl://06d9a4f1c16a67d0305579b9459fb574.
It saved me.
Wednesday, March 18, 2009
SQL - Delete in Two Tables
delete from a.doc_attr where sur_doc_nbr in (select sur_doc_nbr from a.doc where deld=1)
delete from a.doc where deld=1
Friday, March 06, 2009
aggregates not allowed in WHERE clause
SELECT player_name, AVG(score) as score FROM NBA.score_box WHERE box_year > 2004 GROUP BY player_name HAVING count(Game) > 100 ORDER BY score
Monday, February 23, 2009
Tomcat Timezone Issue
Solution is to define a TZ environment variable in the user profile and use the user to start up Tomcat.
e.g. TZ=US/Eastern
Saturday, February 21, 2009
CVS User
The default repository path is /var/cvs.
To enable a normal "cvsuser" write into the repository, I chown -R cvsuser.cvsgroup /var/cvs.
Java 6 on CentOS 5.2
After yum install jpackage-utils, it solved.
PostgreSQL Authentication
- su - postgres
- psql
- show hba_file;
- vi the hba_file and comment out all default settings
- add a line "local all all md5"
- now it works from command line and phpPgAdmin web screen
Install Java 6 on CentOS 5.2
- run /usr/sbin/alternatives --config java, it gives no response.
- run uname -m and it gives i386. it means it is a linux not a linux64.
- download jdk rpm from java.sun.com, at the time, sun provides JDK 6 Update 12. select the Linux and the rpm.bin
- chmod of the bin file and make it executable, run it
- Get error -bash: ./jdk-6u12-linux-i586-rpm.bin: /bin/sh: bad interpreter: Permission denied
- after some research, i realized that the /tmp is shared managed. it won't allow me to run any scripts there. so i moved the bin file to my home directory and run it, it installed the java automatically
- run rpm -qa | grep java and got jdk-1.6.0_12-fcs, run rpm -qa | grep sun also returns a bunch of packages
- run /usr/sbin/alternatives --config java, it still gives no response but run java -version, it gives the 1.6.0_12 back.
- done.
Monday, February 09, 2009
Unicode in Web Application
In your web application, you allow users type 似水流年 and you get it from HTTP request and obtain a string.
When you compare the string obtained from request and the string stored in the database, they will not match.
What you need to do is to convert the non-unicode string to unicode. Here is one of the way, simple and elegant.
str = new String(str.getBytes("ISO-8859-1"), "UTF-8");
You would need to handle the UnsupportedEncodingException, but I doubt if there is any JVM not supporting ISO-8859-1 to UTF-8 conversion.
I am not sure if the ISO-8859-1 shall be different on different servers. I tried on my development workstation which is a Windows XP + Eclipse 3.3 + Tomcat 6 + Java 1.6 and my production server which is a Linux RH + Tomcat 6 + Java 1.6. They all work very well and so far I am OK with it hard coded.
Tuesday, February 03, 2009
For-Each Loop
... type ...
}
The For-Each loop makes Java code much more beautiful and clean than before. We shall use it any time we can.
Several exceptions,
- The program needs access to the iterator in order to remove the current element. The for-each loop hides the iterator, so you cannot call remove. Therefore, the for-each loop is not usable for filtering.
- Similarly it is not usable for loops where you need to replace elements in a list or array as you traverse it.
- Finally, it is not usable for loops that must iterate over multiple collections in parallel. These shortcomings were known by the designers, who made a conscious decision to go with a clean, simple construct that would cover the great majority of cases.
Wednesday, January 28, 2009
Java First Moment of a Day
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
Java First Moment of a Month
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
Java First Moment of a Year
cal.set(Calendar.DAY_OF_YEAR, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
Java First Moment of a Week
cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
Monday, January 12, 2009
Spring, Velocity and Dropdown List
First, the key word is springFormSingleSelect. In my velocity file, I wrote
#springFormSingleSelect("command.group", ${groups}, "style='width:270px;'")
Second, use referenceData to populate values in the "groups" in the Controller class.
referenceData(...) {
Map
... add (key, value) into a Map called groups
model.put("groups", groups);
return model;
}
Third, create a custom property editor, GroupEditor extends PropertyEditorSupport and override the setAsText method.
Note the Spring Framework will pass you the groupId and you need to create a Group object from the groupId, then call setValue(group).
Fourth, register the GroupEditor in the initBinder method.
binder.registerCustomerEditor(Group.class, new GroupEditor());
You may find the groups data will disappear after onSubmit. Don't worry, there is an easy fix. Instead of return a new ModelAndView, return showForm(request, response, errors, model). You can put whatever you need into the "model".
I spent a full weekend to sort everything out. Hope it can help you.
Tuesday, December 16, 2008
Monday, December 15, 2008
Method signature and method header
Example:
- toUpperCase()
- println(String s)
The header of a method consists of the signature plus the description of (the type of) the result.
Example:
- String toUpperCase()
- void println(String s)
Two methods of the same class can have the same name, provided they have different signatures. Methods with the same name (but with different signatures) are said to be overloaded. For example, the substring() method in the class String.
Thursday, November 20, 2008
2G Memory is not enough for RSA Profile
JVMDUMP013I Processed Dump Event "systhrow", detail "java/lang/OutOfMemoryError".
Friday, November 14, 2008
RSS - Really Simple Syndication
History 1997, now RSS 2.0 in 2003. 50% sites still use RSS 0.91, 25% RSS 1.0, 12.5% 0.9x and 12.5% 2.0.
With RSS,
- you create a RSS document and save it with a xml extension
- upload the file to your website
- register it with a RSS aggregator
Java RSS programming - ROME
Render RSS on web pages - RSS2HTML
Include rss2html output in a html page - Server Side Include (xyz.shtml)
Thursday, October 23, 2008
Start Tomcat in Eclipse
Solution: Window -> Preferences -> Server -> Server timeout delay
set it to Unlimited.
Monday, October 20, 2008
Enabling PostgreSQL on Linux System Startup
To enable PostgreSQL at startup
#chkconfig --all postgresql
#chkconfig postgresql on --level 2
#chkconfig postgresql on --level 3
#chkconfig postgresql on --level 5
Thursday, October 02, 2008
RUP Notes
RUP provides the software developer with a DISCIPLINED approach to the development process.
The aim of RUP is to ensure a high-quality result that satisfies user requirements within a predictable budget and schedule. It was designed to be fully compatible with object-oriented technology and the UML. It supports component-based software development.
RUP is a configurable process. It uses use cases to drive the development activities. Use cases facilitate the development from the beginning of the development process through to testing. And they give you a means to trace the process flow through the development of the system and the delivered product.
RUP is the opposite of sequential approaches. It is an iterative and incremental approach to the software life cycle. RUP encourages continuous integration. (Note, here it is "encourage", which means you still need to implemente your own continuous integration, or also called continuous build. Since RUP as a process to focus the final executible deliverables, continuous build servics as compliment to build the deliverables automatically. Sometime the build can also include regression tests which is even better.)
RUP deals errors and flaws in the system over successive iterations, thus makes the system more robust and stable.
Coming behind RUP are requirements management and change control. RM ensures the system better meets the customer's expectations, also limits the size of the project to acceptable levels(scope). Change control helps keep track of defects, misunderstandings, and project commitments and to associate them with specific artifacts.
RUP is architecture-centric, its early iterations has a main thrust to produce and validate a software architecture.
In RUP, quality control has been incorporated into the process. This quality assessment uses objective measurements and criteria for all activities and participants in the process.
RUP has four phases and each phase has iterations. At the end of each phase, comes a milestone, which is a predefined point in time by which certain goals must be achieved and certain decisions made. During the inception phase, the original vision of the product is transformed into a project(my understanding, a well defined plan, definition of deliveriables, iterations, etc.). Formulate the vision, establish business cases and specify the project scope, make decisions on what to invest time and money on. Business cases include success criteria, risk assessment, estimation of resources, phase plan indicating the dates of milestones, prototyping.
The goal of the elaboration phase is more thorough analysis of the problem domain, to establish and define the architecture, to address and eliminate high-rish elements of the project, to determine how the work should be divided into iterations(I think it is difficult but critical. It needs strategic thinking, knowledge and experience. But it is also where the value of a good architect lies.) At the end of the elaboration phase, the decision must be made to build or not the system.
The third phase is the construction. In its final iteration the construction delivers a constructed software system.
RUP defines a transition phase, where the product is supplied to its end-users. Plan the packaging, pricing, roll out, support, training, transition strategy, production details.
It's recommended to have a "postmortem" analysis of the project, addressing how well the original and revised success criteria have been met.
There are nine core workflows in the RUP, either engineering process workflows or supporting process workflows. Business modeling, requirements capture, application/system analysis and design, implementation, testing, deployment
Thursday, September 11, 2008
JDBC ResultSet Column Name with Multiple Tables
Incorrect - a.col1, b.col2.
Correct - col1, col2.
What if same column names in both tables, like a.col3 and b.col3?
Write SQL like "select a.col3 as acol3, b.col3 as bcol3 ...", then name the column in getXXX method as acol3 and bcol3.
Thursday, August 28, 2008
Customize 401 Error Page with HTTP Basic Authentication
After adding an error-page element in web.xml to customize 401 error page, HTTP auth will not work.
So far with Tomcat 6.0, I have found no way to make them work.
Monday, August 25, 2008
Tomcat DataSourceRealm
userTable="schema1.users" works and the schema name should be lower case too in the database.
Schema1 or SCHEMA1 won't work.
Wednesday, August 06, 2008
External JACC Provider in WebSphere 6.1
- Internal accepts "welcome.do" but external TAM provider doesn't, it accepts "/welcome.do"
- I switched from Default to External but failed to switch it back. Even from the admin console it looked fine, but the server kept using TAM as authorization provider. What I had to do was to reinstall RSA.
Friday, August 01, 2008
TAM Error AWXJC0050E
com.tivoli.pd.as.jacc.cfg.TAMConfigException: AWXJC0048E An error occurred during the configuration. The details are:
com.tivoli.pd.as.jacc.cfg.ConfigActionFailedException: AWXJC0050E The Tivoli Access Manager user, sec_master, failed to add the Tivoli Access Manager user, JACC_-264539269/cledt-123691.agna.amgreetings.com, to the Tivoli
Access Manager group, iv-admin. The details are: Wrappered Exception:java.net.BindException: Address already in use:
NET_Bind[HPDCO1050E Socket could not be created (8920).].. at
com.tivoli.pd.as.jacc.cfg.TAMConfigController.execute(TAMConfigController.java:156)
For this error, note the port 8920 in the message, then change the client listener port from default 8900:8999 to 8921:8999.
Have a $ in your password?
What you need to enter is "abc$$$$cba".
Wednesday, May 14, 2008
Struts InvalidCancelException
2.1. Bug 38374 - Validation always skipped with Globals.CANCEL_KEY
2.1.1. Issue: Cancel Processing
The Struts <html:cancel> tag sets a request parameter (org.apache.struts.taglib.html.Constants.CANCEL) which causes validation to be skipped.
Spoofing this request parameter however, could be used maliciously in order to circumvent an applications validation and proceed with the request processing with erroneous and potentially damaging data.
See
Bug 38374 for full details.
2.1.2. Resolution: Cancellable Property
A new cancellable property has been introduced which indicates whether an action is allowed to be cancelled or not. In Struts 1.2.9 this is set to true or false for an action in the struts-config.xml using the <set-property> notation. From Struts 1.3.x a new cancellable attribute has been added to the <action> element.
Now any action where the cancellable property is not set to true will throw an InvalidCancelException.
2.1.3. Upgrade Implications
Any existing applications that use the Cancel processing will need to modify their struts-config.xml to set the cancellable property for actions which require it.
In Struts 1.2.9 the <set-property> is used to set the cancellable property for an action....
<action path="/fooAction"
input="/foo.jsp"
validate="true">
<set-property property="cancellable" value="true"/>
<forward name="success" path="/bar.jsp"/>
</action>
From Struts 1.3.x a new cancellable attribute can be used....
<action path="/fooAction"
input="/foo.jsp"
validate="true"
cancellable="true">
<forward name="success" path="/bar.jsp"/>
</action>
In both Struts 1.2.9 and Struts 1.3.x an exception handler can be configured to handle the InvalidCancelException
<action path="/fooAction"
input="/foo.jsp"
validate="true"
cancellable="true">
<forward name="success" path="/bar.jsp"/>
<exception key="errors.cancel"
type="org.apache.struts.action.InvalidCancelException"
path="/foo.jsp"/>
</action>
2.1.4. Test Cases
This bug was tested using the struts-examples webapp (see struts-examples.war in the binary distribution). If you fire up the examples webapp, select the Taglib Test Pages link, then select the <html:cancel> link you will be presented with a page where you can try the Cancel button for four different configurations.
Tuesday, April 29, 2008
Cancel Button for CancellableFormController
where by default "_cancel" is the cancelParamKey. You can use setCancelParamKey() to override it.
Thursday, April 24, 2008
Form Validation Error Message
When the date input doesn't match the specified format, it will report an error message. The message is very much in Java developer's language, not user oriented.
To replace the message with your own, just put a line like that in your messages.properties,
typeMismatch=Invalid or incomplete input.
Spring Framework - Date Field in a SimpleFormController
- Override the initBinder method.
- Create a SimpleDateFormat, e.g. MM/dd/yyyy HH:mm:ss where M is month, d is day, y is year, H is hour(0-23), m is minute, and s is second.
- Set the date format lenient false, which means inputs do not have to match the format exactly
- Create a CustomDateEditor(dateFormat, true), where true means empty allowed.
- Register the editor to Date.class.
Thursday, April 10, 2008
Postgresql - Generate Primary Key before Insert
Second in your program, use select nextval('schema.april_april_id_seq') to obtain the next value for primary key. You don't need to plus 1 since Postgresql does it for you. If using Spring JDBC template, just call getJdbcTemplate().queryForInt(the sql).
Third, use the value just obtained as parameter in the insert sql.
Done.
Monday, April 07, 2008
Velocity Layout in Spring
In web.xml, define org.springframework.web.servlet.DispatcherServlet as spring. Mapping *.xhtml to spring. I leave html for real html files.
In spring-servlet.xml, define
viewResolver class=org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
- viewClass = org.springframework.web.servlet.view.velocity.VelocityLayoutView
- layoutUrl = layouts/mainlayout.vm
- cache = true
- suffix = .vm
- exposeRequestAttributes = true
- exposeSessionAttributes = true
- exposeSpringMacroHelpers = true
- dateToolAttribute = dateTool
- numberToolAttribute = numberTool
velocityConfigurer class = org.springframework.web.servlet.view.velocity.VelocityConfigurer
- resourceLoaderPath = WEB-INF/views
- velocityProperties directive.foreach.counter.name = loopCounter
- directive.foreach.counter.initial.value=0
Create a layout file, mainlayout.vm under WEB-INF/views/layouts. Put html, body, stylesheet stuff in. Note the stylesheet file shall sit outside WEB-INF. e.g. stylesheet href = "includes/main.css" means the main.css file sits at [web-root]/includes forlder.
Put $screen_content whereever you want.
In spring controller, return the ModelAndView name "dashboard", create a dashboard.vm file under WEB-INF/views.
In the dashboard.vm file, put any content in.
Monday, March 31, 2008
Books for JMS
- Paperback: 352 pages
- Publisher: IBM Press (February 25, 2004)
- Language: English
- ISBN-10: 0131468634
- ISBN-13: 978-0131468634
This book offers start-to-finish guidance for building reliable, high-performance JMS-based messaging infrastructure with IBM WebSphere technologies.
IBM expert Kareem Yusuf systematically introduces the latest versions of JMS—both 1.1 and 1.02b. Once you've thoroughly mastered JMS development on any platform, Yusuf turns to the exceptional JMS support found in IBM's WebSphere products. Using extensive code examples, he walks you step-by-step through WebSphere JMS development, configuration, deployment, and administration in several real-world scenarios.
Coverage includes:
- Roles and goals of messaging infrastructure in the enterprise
- Key JMS concepts: messaging domains, messages, and Application Server Facilities
- Defining/structuring content, choosing message types, and manipulating messages
- The JMS API, explained through detailed code examples
- Using JMS with EJB, message-driven beans, servlets, and portlets
- Working with IBM WebSphere JMS providers, administered objects, and tools
- Hands-on tutorials: EJB message exchange, integration with non-JMS applications, and SSL security
- Resource location and physical topologies for maximizing availability and efficiency
Whether you're developing enterprise messaging infrastructure, architecting it, or managing it, this bookdelivers indispensable guidance-straight from the frontlines.
HTTP Request Headers
Its only problem is the header need to applied for every request. It doesn't remember or recall.
I also tested another add-on on Firefox called Modify Headers. It only worked the very first try but failed ever after.
Neither Tamper Data nor Modify Headers works on Internet Explorer.
It is said that IBM Page Details can work on IE.
Thursday, March 27, 2008
Books for Web Services
Web Services
Developing Web Services for Web Applications: A Guided Tour for Rational Application Developer and WebSphere Application Server (Ibm Illustrated Guide Series) (Paperback)
- Paperback: 400 pages
- Publisher: Mc Press; Pap/Cdr edition (September 15, 2005)
- Language: English
- ISBN-10: 1931182213
- ISBN-13: 978-1931182218
Editorial Reviews
This book shows you how easy it is to create and use Web Services with IBM® Rational Application Developer or Web Developer, and WebSphere Application Server.
Intended for novice to intermediate Java programmers, Developing Web Services for Web Applications teaches users how to create Web Services, deploy Web Services to a server, and create client applications that use Web Services. Each chapter of the book teaches a key Web Service concept and takes you on a detailed, guided tour for creating or using a particular Web Service. Even if you’re completely new to Web Services, by the time you finish the lessons in this book, you’ll have all the skills needed to create useful Java programs with Web Services.
Using the “guided tour” approach, the book comes with practical step-by-step instructions and numerous screen captures, making it easy to follow along. While most books teach how to use either a development tool or a particular technology, Developing Web Services for Web Applications combines learning about Web Services with using Rational Developer tools. Each chapter develops a complete Web Service and/or application, with sample code and solution files provided on the accompanying CD-ROM. Also included in each chapter are additional exercises to help reinforce the concepts covered in that chapter.
By the end of the tour, you’ll be able to use Rational Developer tools to build your own Web Services, and you’ll understand why Web Services are gaining popularity as a way to provide services across the Internet.
Developing Web Services for Web Applications:
- Is perfect for all skill levels, from those taking their first steps to those looking to explore more advanced topics
- Teaches you Web Services concepts and terminology as you learn how to use the Rational Developer tools
- Shows you how to create, deploy, publish, and use Web Services
- Explores troubleshooting, using relational databases, using JavaServer Faces Web applications, adding security features, and much more
Contents:
Introduction
Chapter 1: Creating your first Web service and Web application
Chapter 2: Deploying and publishing your Web service
Chapter 3: Discovering Web services
Chapter 4: Handling Web service errors
Chapter 5: Using databases, part 1
Chapter 6: Using databases, part 2
Chapter 7: Using Web services with JavaServer Faces, part 1
Chapter 8: Using Web services with JavaServer Faces, part 2
Chapter 9: Securing Web services, part 1
Chapter 10: Securing Web services, part 2
Appendix A: Installing WebSphere Express
JMS Suggested Readings
Introductions
- Getting Started with Java Message Service (JMS)
- Basic JMS API Concepts
- Introducing the Java Message Service
- Messaging Systems and the Java Message Service (JMS)
- Get the message?
- Listen to heartbeats using JMS
- JMS Introduction
- Should you go with JMS?
- JMS in WIKI
JMS Programming
- JMS Programming Model
- JMS Programming Model (from Sun)
- JMS Programming Model (from IBM)
- Programming JMS applications using AXIS
JMS and WebSphere
Samples
Web Services Suggested Readings
Introductions
- Introduction to Web Services
- A short introduction to Web Services
- Introduction to SOAP
- Introduction to Web services architecture
- Introduction to Service Oriented Architecture (SOA)
- Why Web Services?
- Web Services Platform Elements
- Web Services Example
- Web service in WIKI
- SOAP in WIKI
- WSDL in WIKI
Java Web Services
- Java Web Services at a Glance
- Web Services - Axis
- Java and Web Services Primer
- Developing Web Services at a Glance
- J2EE 1.4 Eases Web Service Development
- Java API for XML Web Services Users Guide
- JAXB Users Guide
- Using WSDL in SOAP applications
Samples
Tutorials
Tuesday, March 18, 2008
Struts Configuration Editor in RSA 7
We solved it by doing the following,
Opened the welcome perspective, enabled web development. Went back to J2EE or Web perspective and right clicked the struts-config.xml, the Editor was listed.
Tuesday, March 04, 2008
J2C CICS COBOL
That causes problem when client sends up less than 300 records.
I solved it by editing the generated Java Binding Class and modifying the lower bound validation to use 0 instead of 300.
Tomcat Debug in Eclipse
Transport dt_socket failed to initialize, rc = 509.
JAVA version = 1.4.2_16
JAVA_HOME = <>\j2sdk1.4.2_16\bin
IDE = Eclipse 3.2
Web Server = Tomcat 5.0.28
I solved this by copying the two dll files (dt_shmem.dll, dt_socket.dll) from "<>\j2sdk1.4.2_16\jre\bin" to "<>\j2sdk1.4.2_16\bin".
Tuesday, January 08, 2008
Commons Logging and IBM WebSphere 6.1
Apache Commons Logging has a problem with WAS 6.1. Its Log4JLogger either can't be loaded or be reported not compatible with LogFactory.
The root cause is WebSphere uses commons-logging and so it's in the root classloader. In addition, WebSphere ships a commons-logging.properties with the following properties set:
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
Therefore by default the application will use JDK logging and not log4j. The solution is to ensure that the right classloader mode is set and the application has an appropriate commons-logging.properties:
Set application classloader mode as PARENT_LAST. Also, add a commons-logging.properties to the application classpath with the following entries:
priority=1
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
The priority flag was introduced in Commons Logging 1.1 to allow an ordering based on priority. To ensure that an application's commons-logging.properties will take precedence over WebSphere's file, a priority of greater that 0.0 must be set.
Wednesday, January 02, 2008
This project needs to migrate WTP metadata
1) The runtime the old code is still pointing to is WAS 6.0 not WAS 6.1 (in RAD7)
2) RAD7 has more options to change more settings
The Solution: I had to fix the problem on the WAR file that is used by the EAR file Following is my fix for the problem in RAD7 PART I with the WAR PROJECT
\---------------------------
1) Right click on the war project and click on properties.
2) Click on Targeted Runtimes in the properties
3) Now check your desired Runtime WebSphere Application Server 6.1
4) Now click on the WebSphere Application Server 6.1 Runtime in the same window
5) You will see under Runtime Composition com.ibm.ws.ast.st.runtime.61 JRE 5.0: WebSphere v61 JRE
6) Now click on Add/Remove Project Facets link in the same window
7) It opens a new windows Project Facets. This page has dependencies when checking the boxes. Therefore...
8) Here First check Java, I selected the version 5.0.
9) Then check Dynamic Web Module (as I am using web module), I selected 2.4
10) Then check WebSphere Web (coexistence) 6.1
11) Then check WebSphere Web (Extended) 6.1
12) Click Finish
13) Click OK in the properties window
14) Now again open the same properties window
15) You will see new types on the Left Hand Side(LHS) windows namely J2EE Module Dependencies.
16) Click J2EE Module Dependencies. Select from the drop down the EAR file name that should have this WAR file
17) Click Java Build Path on the LHS window.
18) Make sure you see WebSphere Application Server v6.1 under your libraries tab on the Right Hand Side(RHS) window.
19) Click on Project Facets and make sure you see the 4 facets namely Dynamic Web Module, Java, WebSphere Web (Co-existence) and WebSphere Web (Extended) listed with the correct values.
20) Click on the Server on the LHS window.
21) Make sure you see the WebSphere Application Server v6.1 selected on the RHS window. If not, select it.
22) Click on Targeted Runtimes. Mostly you should see this time only WebSphere Application Server v6.1
23) Click OK
24) Manually Refresh and Rebuild this project.
PART II with the EAR project
\----------------------------
1) Right click on the EAR project and click properties
2) Click J2EE module dependencies.
3) Make sure desired xxxxxx.war file is checked.
4) Click on Targeted Runtimes.
5) Make sure you have WebSphere Application server 6.1 is checked
6) Click on project Facets
7) Make sure you have EAR 1.4, WebSphere Web (coexistence) 6.1, WebSphere Web (Extended) 6.1 are selected. If not, go to step 5 and click on the add/remove proejct facets link to do it.
8) click on server and check WebSphere Application Server v6.1
9) Manually Refresh and Rebuild this project.
You should be all set. All the best.
Friday, December 21, 2007
IBM HATS in Passport Advantage
Rational Software/IBM WebSphere Host Integration Solution (HIS) for ... v 7.0/
IBM WebSphere Host Access Transformation Services (HATS) Standard v7.0 ... (C97NZML)
IBM WebSphere Host Access Transformation Services Run-Time Web Enablement ... (C97P2ML)
It's so hard to find anything in IBM Passport Advantage.
Tuesday, December 11, 2007
CICS ECI Resource Adapter - execute timeout
0 - No timeout, this is the default value.
any positive int value - in milliseconds
How to Add a VM Argument to WAS 6.1
Open the Administrative Console. Navigate through server -> process definition -> Java Virtual Machine -> Customer Variables.
Done.
Monday, November 26, 2007
J2C CICS ECI - Generate Simple JSP
Enter /minzyWeb as the Web project, ou as the JSP folder.
Show Advanced, if the Resource Reference is missing, enter eisOrderUpdateRef.
Click on Finish.
Notice 4 jsp files were created under WebContent\ou.
J2C CICS ECI - Generate Web Service
Enter \minzyConnect\src\tliu\minzy\eis\ou\OrderUpdateJ2CImpl.java as the J2C bean implementation. Click on "Next >".
Select "Web Service" and click on "Next >".
Browse and select /minzyWeb, show advanced and enter eisOrderUpdateRef as the resource reference, keep JNDI lookup name as eis/OrderUpdate as proposed.
Click on Finish.
Notice minzyWeb was changed to have a reference to minzyConnect, 10 classes generated under tliu.minzy.eis.ou, OrderUpdateJ2CImpl.wsdl generated under WEB-INF/wsdl and webservices.xml, etc under WEB-INF.
Note, do not remove the "gen" folder. It is the generated folder for the 10 new classes.
J2C CICS ECI - Generate J2C Bean Classes
Select ECIResourceAdapter (IBM 6.0.2.1) under J2C 1.5. (CTG 6.1 needs this match up)
Give eis/OrderUpdate as JNDI name.
Click on "New...", select WAS v6.1 as server.
Enter tcp://10.104.252.233 as Connection URL. (For remote, tcp://, for WAS and CTG on same server, local:), AMGCOHA3 as server, 32006 as the port number, user and password etc.. (configurations here shall be obtained from CTG admin)
After that, enter minzyConnect as project, tliu.minzy.eis.ou as package, OrderUpdateJ2C as interface, the implementation class will automatically be given as OrderUpdateJ2CImpl.
At next step, click on Add... to add a method.
Give updateOrder as the method name.
Click on Browse... and select OrderUpdateBind as input type and check on Use the input type for output.
If execute time out is a required argument, enable the Show Advanced and expand Interaction Spec to select executeTimeout - int.
Click on Finish and enter DIC44010 as the Function name.
Click on Finish and generate the J2C Java bean.
Notice the OrderUpdateJ2C and OrderUpdateJ2CImpl were created under tliu.minzy.eis.ou, cicseci6021 i was created and minzyConnect was updated to have cicseci6021 in its build path.
Wednesday, November 21, 2007
J2C CICS ECI - Generate J2C Data Binding Classes
Choose mapping COBOL to Java.
Select z/OS for Platform, IBM-037 for Code page. Click on Query.
Select the DFHCOMMAREA which is the CICS common area.
Select "Shorten names" as Generation Style, minzyConnect as project, tliu.minzy.eis.ou as package, OrderUpdateBind as class.
Class OrderUpdateBind, OrderUpdateBind_DFH_PAL_ID_DATA_DFH_EPC_DATA and OrderUpdateBind_DFH_PAL_ID_DATA will be created under tliu.minzy.eis.ou.
J2C CICS ECI - Obtain COBOL Copybook
The copybook looks like this,
01 DFHCOMMAREA.Do not edit the file.
02 DFH-INPUT-FIELDS.
05 DFH-MRG-NBR PIC 9(07) VALUE ZEROS.
05 DFH-DC-NBR-FILLING PIC X(02) VALUE SPACES.
05 DFH-SESSION-CNT PIC 9(02) VALUE ZEROS.
05 DFH-PAL-ID-DATA OCCURS 5 TIMES.
10 DFH-PAL-ID-NBR PIC 9(03) VALUE ZEROS.
10 DFH-PAL-EPC-NBR PIC 9(09) VALUE ZEROS.
10 DFH-EPC-DATA OCCURS 300 TIMES.
15 DFH-EPC-NBR PIC 9(12) VALUE ZEROS.
02 DFH-STATUS-FIELDS.
05 DFH-RETURN-CODE PIC 99 VALUE ZEROS.
05 DFH-RETURN-TEXT PIC X(80) VALUE SPACES.
05 DFH-PROGRAM-NAME PIC X(08) VALUE SPACES.
05 DFH-ERROR-STATUS PIC X(04) VALUE SPACES.
05 DFH-ERROR-RECORD PIC X(16) VALUE SPACES.
05 DFH-ERROR-SET PIC X(16) VALUE SPACES.
05 DFH-ERROR-AREA PIC X(16) VALUE SPACES.
05 DFH-DML-SEQUENCE PIC 9(08) VALUE ZEROS.
I created a eis folder under minzyConnect. I put DIC44010.cpy under the newly created eis folder.
J2C CICS ECI - Review the Environment
- IBM Rational Software Architect (RSA) v 7.0.0.3
- IBM WebSphere Application Server (WAS) v 6.1, embedded in RSA 7
- IBM CICS Transaction Gateway (CTG) v 6.1
Note, if WAS and CTG sit at the same server, CTG connection URL shall be local:.
Project minzyConnect is created to hold the data binding and J2C beans.
Project minzy is created as EAR holder, and its module project minzyWeb, minzyEnt (for EJB), and minzyClient are also created.
Tuesday, November 20, 2007
CICS Transaction Gateway
Friday, November 16, 2007
Informatica Upgrade to 8.1.1 - Client
- Open the Hub's home page, e.g. http://host:7333/wsh/
- Click on the "Batch Web Services"
- Click on the WSDL icon under Metadata WSDL
- Right click on the pop-up page and select "View Source"
- Save the content as MetaData.wsdl
- Do the same for DataIntegration WSDL, save as DataIntegration.wsdl
- Import these two files to a RSA project
- Add axis-1.4.jar to the project
- Create a Java Application Run,
- Set main class as org.apache.axis.wsdl.WSDL2Java
- Check "Include libraries when searching for a main class" on
- Select Arguments tab
- Enter "--NStoPkg http://www.informatica.com/wsh=com.informatica.www -W informatica-8.1.1/MetaData.wsdl" as Program arguments, where the informatica-8.1.1 is the folder of MetaData.wsdl file
- Run this Java Application
- Informatica client code for MetaData service will be generated
- Do the same for DataIntegration service
- There are some changes from version 7, especially of the connection, workflow and folder
- Modify the client application accordingly
CICS ECI Resource Adapter
- ECIResourceAdapter (IBM : 5.1): This version of the CICS ECI resource adapter is based on Version 1.0 of the J2EE Connector Architecture (JCA 1.0). Because CICS ECI resource adapter for Java verion 5.1 is a JCA 1.0 resource adapter, it will only run in a JCA 1.0 application server or WAS version 5.0.2 (or above). Select CICS 5.1 resource adapter if targeting a WAS v 5.0 server.
- ECIResourceAdapter (IBM : 6.0.2): This version of the CICS ECI resource adapter is based on version 1.5 of the JCA (JCA 1.5). It runs on WAS 6.0.
- ECIResourceAdapter (IBM : 7.0.0): This version based on JCA 1.5. It runs on WAS 6.1.
If you select Configure Resource Adapter Deployment on the Deployment Information page of the J2C wizard, you can use the Resource Adapter Deployment page to configure RAR.
The resource adapter can be deployed as a standalone resource adapter or as part of an EAR file. Typical environments use the standalone method, giving all modules on the application server visibility to the adapter.
Note: Multiple resource adapters should not be installed as standalone on the same runtime server, especially if they are for the same EIS type (for example, CICS ECI 5.1 and CICS ECI 6.2). This is because all standalone resource adapters share the same class loader.
My note: It's probably easier for application maintanence to deploy the adapter per EAR file.
Wednesday, October 31, 2007
Axis 1.1 and 1.2
In Axis 1.2, that class has been replaced by org.apache.axis.constants.Style. When clients try to make connections to web services, it will get an error that enum.Style cannot be found.
I think it will solve the problem to regenerate the stub classes with Axis WSDL2Java emitter from the WSDL definition files. We will see the result after several days.
Monday, October 22, 2007
DelegetingActionProxy
For example, class SpringIndexAction extends Action and declares a setter for the productionManager property. We add an action declaration to the Struts configuration file struts-config.xml.
[action path="/sindex"
type="org.springframework.web.struts.DelegatingActionProxy"
validate="false"]
[forward name="success"
path=".index"/]
[/action]
Notice the action type is set to DelegatingActionProxy, which is a Spring class that delegates all calls to the real bean of the SpringIndexAction class.
Before we can use DelegatingActionProxy, we first need to add the ContextLoaderPlugin bean to the Struts configuration file.
[plug-in
className="org.springframework.web.struts.ContextLoaderPlugin"]
[set-property property="contextConfigLocation"
value="/WEB-INF/actionContext.xml"/]
[/plug-in]
We declare the SpringIndexAction in the actionContext.xml file.
[beans]
[bean name="/sindex" class="com.....actions.SpringIndexAction"]
[property name="productManager"][ref
bean="productManager"/][/property]
[/bean]
[/beans]
When we now make a request to the /sindex.do URL, DelegatingActionProxy looks up the bean with its name set to /sindex. It uses the beans defined in the WebApplicationContext that is loaded by the ContextLoaderPlugin declared in the file specified in its contextConfiguration property. The /sindex bean is the actual SpringIndexAction, it is instantiated, and its productManager property is set.
The difference after using DelegetingActionProxy is that the SpringIndexAction is a fully Spring-managed bean and we have no manual dependency lookup code in the Action.
Monday, October 15, 2007
Form-based Authentication in WAS
One of the login challenges defined in J2EE Specification is form-based login. It enables the application developer to customize the login process and present an application-specific form by making use of the Form Login Authentication Method.
Form login works in the following manner:
1. An unauthenticated user requests a resource protected by the Form Login authentication type.
2. The application server redirects the request to the Login Form defined previously in the Web deployment descriptor.
3. On the HTML login form, the user enters the user ID and password and submits the form.
4. The action triggered by the form submission runs a special WebSphere Application servlet j_security_check. The Web container, after receiving a request for the j_security_check servlet, dispatches the request to another WebSphere servlet that authenticates the user.
5. If the servlet authenticates the user successfully, the originally requested resource is displayed.
Form login configuration using WebSphere Studio
1. Open the web.xml file under the Web project. A Web Deployment Descriptor should be opened in a deployment descriptor editor window.
2. Select the Pages tab, then modify the Login section.
3. Type in the realm name, for example: SecureRealm.
4. Click the drop-down list and select FORM as the Authentication method.
5. In the Login page, click Browse and select your login page from the project, for example: /login/login.html.
6. In the Error page, click Browse and select your login page from the project, for example: /login/loginerror.html (we have used the same page for login and error, but you can define a custom error.jsp page that will present actual error code and error messages).
7. Save and close the Web deployment descriptor file.
Setting the Authentication Method for the application Web module will create a [login-config] section in a Web deployment descriptor XML file, as shown in the following example.
[login-config]
[auth-method]FORM[/auth-method]
[realm-name]SecureRealm[/realm-name]
[form-login-config]
[form-login-page]/login/login.html[/form-login-page]
[form-error-page]/login/loginerror.html[/form-error-page]
[/form-login-config]
[/login-config]
Simple form-based login does not require any extra code development on the server side. The j_security_check servlet used by WebSphere Application Server enforces only the name of the input fields that the developer should put in the custom Login Form. These fields are as follows:
* j_username should be the input field in which a user will type the user ID.
* j_password should be the input field into which the user will type the password.
The action required for the HTTP POST method is j_security_check. A simple HTML code for the custom Login Form is given in the following example:
[!-- ............... --]
[form method="post" action="/itsobank/j_security_check"]
[table width="80%"]
[tr]
[td width="20%" align="right"]Userid:[/td]
[td][input size="20" type="text" name="j_username" maxlength="25"][/td]
[/tr]
[tr]
[td align="right"]Password:[/td]
[td][input size="20" type="password" name="j_password" maxlength="25"][/td]
[/tr]
[tr]
[td][/td]
[td][input type="submit" name="action" value="Login"] [input type="reset" name="reset" value="Clear"][/td]
[/tr]
[/table]
[/form]
[!-- ............... --]
Form-based logout
One of the IBM’s extensions to the J2EE Specification is the form-based logout. After logging out, the user is required to re-authenticate to have access to protected resources again. This logout form can be on any page with calling a POST action on the ibm_security_logout servlet. This form must exist within the same Web application to which the user gets redirected after logging out.
[form method="post" action="ibm_security_logout" name="logout"]
[input type="submit" name="logout" value="Logout"]
[input type="hidden" name="logoutExitPage" value="/login/login.html"]
[/form]
A Real Case with WAS Security
In the application, it defined two roles, tliu:passw0rd:101:101:Thomas Liu and authenticated_user. Only users with administrator role can access administrator pages and carry out administrator functions. Any users authenticated with a pair of user id and password can access general pages and carry out general functions.
In the application.xml file of the EAR project, two security-roles were defined.
[security-role id="admin"]
[role-name]administrator[/role-name]
[/security-role]
[security-role id="user"]
[role-name]authenticated_user[/role-name]
[/security-role]
In the ibm-application-bnd.xml file of the EAR project, one authorization table with two authorizations was defined.
[authorizationTable xmi:id="AuthorizationTable_1126620398213"]
[authorizations xmi:id="RoleAssignment_1126807102767"]
[specialSubjects
xmi:type="applicationbnd:AllAuthenticatedUsers"
xmi:id="AllAuthenticatedUsers_1140011292114"
name="AllAuthenticatedUsers" /]
[role
href="META-INF/application.xml#user" /]
[/authorizations]
[authorizations xmi:id="RoleAssignment_1140011292114"]
[role
href="META-INF/application.xml#admin" /]
[groups xmi:id="Group_1140011292114" name="ceadmin" /]
[/authorizations]
[/authorizationTable]
In the web.xml file of the web project, two security-constraint, one login-config, and two security-role were defined.
[security-constraint]
[display-name]Administrators Constraint[/display-name]
[web-resource-collection]
[web-resource-name](Administrator Web Resource Collection)[/web-resource-name]
[description][/description]
[url-pattern]/admin/*[/url-pattern]
[http-method]GET[/http-method]
[http-method]PUT[/http-method]
[http-method]HEAD[/http-method]
[http-method]DELETE[/http-method]
[http-method]OPTIONS[/http-method]
[/web-resource-collection]
[auth-constraint]
[description][/description]
[role-name]administrator[/role-name]
[/auth-constraint]
[user-data-constraint]
[transport-guarantee]NONE[/transport-guarantee]
[/user-data-constraint]
[/security-constraint]
[security-constraint]
[web-resource-collection]
[web-resource-name](Users Web Resource Collection)[/web-resource-name]
[description][/description]
[url-pattern]/document/*[/url-pattern]
[http-method]GET[/http-method]
[http-method]PUT[/http-method]
[http-method]HEAD[/http-method]
[http-method]POST[/http-method]
[http-method]DELETE[/http-method]
[/web-resource-collection]
[auth-constraint]
[description][/description]
[role-name]authenticated_user[/role-name]
[/auth-constraint]
[user-data-constraint]
[transport-guarantee]NONE[/transport-guarantee]
[/user-data-constraint]
[/security-constraint]
[login-config]
[auth-method]FORM[/auth-method]
[form-login-config]
[form-login-page]/login.do[/form-login-page]
[form-error-page]/login_error.do[/form-error-page]
[/form-login-config]
[/login-config]
[security-role]
[description][/description]
[role-name]administrator[/role-name]
[/security-role]
[security-role]
[description][/description]
[role-name]authenticated_user[/role-name]
[/security-role]
The above login-config enabled the application to use a WebSphere extension called Form-based authentication. WAS Form-based authentication will be introduced in a later post.
In WAS administrative console, in Applications - Enterprise Applications - [Appl] - Security role to user/group mapping, there were two lines
Role | Everyone? | All authenticated? | Mapped users | Mapped groups
authenticated_users | unchecked | checked | null | null
administrator | unchecked | unchecked | null | ceadmin
WAS was defined to use File-based J2EE security. See a previous post about File-based J2EE security for details.
In the groups.props, add a line ceadmin:101:tester:CE Administrative Group, where the 101 was the group number.
In the users.props, add a line tester:password:101:101:CE Admin Tester, where the first 101 was the user number and the second group number.
With the above definitions, the application was able to make use of WAS security and can distinguish users by their authentication and role.
Friday, October 12, 2007
LDAP Browser in Eclipse
That site was somehow a little bit weird. I tried the connection for several times before I was able to see the LDAP browser selection.
I used the "Connections" view to set up a new connection to LDAP server. After connected, I switched to the LDAP Browser view and saw three roots, DIT, Searches and Bookmarks.
The LDAP server which I connected was quite a big one. I easily got lost in the DIT tree. So I had to use the search. I learned something new here which was called the LDAP query.
For example, I needed to search any records that has a uid of ABC. What I needed to put in the "Filter" was (&(uid=ABC)). In my application, it had a query like (&(cn=my_group)(member=uid={0}, *)). It was very interesting, at least to me, since LDAP query was a new thing to me.
The searching speed was actually quite cool. Boom, the result was out. Since I would need to view that record from time to time. I saved it as a bookmark.
So far, the experience was good.
Friday, October 05, 2007
WAS 6.1/RSA 7.0 File-based Authentication
- start up WAS 6.1 in RSA 7.0
- run administrative console
- security > secure administration, applications, and infrastructure
- check on "Enable administrative security"
- check on "Enable application security" (might be checked on automatically when check on "Enable administrative security")
- check off "Use Java 2 security to restrict ..." (if on, be ready to define web resource and beans and roles)
- select "Standalone custom registry" from the "Available realm definitions"
- click on "Set as current"
- click on "Configuration", the "Standalone custom registry" page will be shown
- click on "Custom properties"
- add two properties, usersFile ${USER_INSTALL_ROOT}/File-based_JACC/users.props, groupsFile $USER_INSTALL_ROOT}/File-based_JACC/groups.props
- in Windows explorer, go to folder
\runtimes\base_v61\profiles\AppSrv01, e.g. C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01, and create a new folder "File-based_JACC" - under the newly created folder, create two files, users.props and groups.props,
- in users.props, add entry "wsadmin:password:100:100:Administrator"
- in groups.props, add entry "admins:100:wsadmin:Administrative group"
- go back to "Standalone custom registry" page in the administrative console
- enter "wsadmin" into "Primary administrative user name"
- select "Automatically generated server identity"
- make sure the "Custom registry class name" is "com.ibm.websphere.security.FileRegistrySample" (shall be by default)
- click on "OK" and click on "Save" if asked
- click on "Apply" and click on "Save" if asked
- right click on the "WebSphere Application Server v6.1" in "Servers" view and select "Open"
- expand "Security" and check on "Security is enabled on this server"
- enter "wsadmin" in "User ID" and "password" in "Password"
- save changes made to the server
- restart the server, the server should be ready to use file-based authentication.
Wednesday, October 03, 2007
Ant with JUnit in WID 6.0.2
I searched tools.jar under WID installation. None of them was exactly fit to me. So I decided to ignore it.
Run the ant script, it completed successfully. Question is, what does tools.jar do in ant classpath?
IBM WebSphere Integration Developer
- WebSphere Integration Developer Fix Pack 6.0.2.2
- WebSphere Integration Developer 6.0.2.2 Interim Fix 002
- WebSphere Integration Developer 6.0.2.2 National Language Support Interim Fix
- J2EE Connector Tools 6.0.1.5
If IBM WebSphere Process Server Test Environment is also installed, its updates are not provided through the Rational Product Updater, but may be obtained by visiting http://www.ibm.com/software/integration/wps/support/. Current updates are Fixpack 2 to 6.0.2, released on 7/31/2007.
Started using WID without updates. Since we use Harvest, I started with installing Harvest plugin. WID 6.0.2 uses Eclipse 3.0.2. Harvest plugin site is the same for Eclipse 3.2, 3.1, and 3.0. The site is http://supportconnectw.ca.com/public/harvesteclipse.
Carefully selected Eclipse 3.0, then plugin version 6.20.2. Check out a project from Harvest, no problem. Synchronize the workspace with Harvest, it suggested removing local files.
Harvest plugin was actually installed under rwd. Locate it and uninstall it. Do the plugin installation again, select 6.20.1 and then carefully select the destination to eclipse not rwd. This time the synchronization worked fine.
WID 6.0.2 uses Sun JDK 1.4.2 as default JRE. It has WAS 5.1 and 6.0, but not 6.1. It has the default perspective Business Integration, the only one cannot be found in Rational Software Architect 7.0.0.3.
Tuesday, October 02, 2007
JACC - Java Authorization Container Contract
When an authenticated user makes a request to a web or a EJB resource, the security runtime makes the decision of whether to allow the access. This is called an access decision. Based on JACC, the appropriate permission object is created, the appropriate policy context handlers are registered, and the appropriate policy context identifier (contextID) is set. A call is made to the java.security.Policy object that is implemented by the provider to make the access decision.
In IBM WebSphere Application Server (WAS), when security is enabled, the default authorization is used unless a JACC provider is specified. The default authorization does not require special setup, and the default authorization engine makes all of the authorization decisions. However, if a JACC provider is configured and set up for WAS, all of the enterprise bean and web resource access decision will be delegated to the JACC provider.
Monday, October 01, 2007
WAS 6.1 Startup Error on SystemOut.log
[10/1/07 9:48:28:785 EDT] 0000000a WrappingFileO E archiveCurrentFile TRAS0016E: An unexpected exception while trying to archive log file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\logs\server1\SystemOut.log Exception is java.io.IOException: Unable to rename file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\logs\server1\SystemOut.log to C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\logs\server1\SystemOut_07.10.01_09.48.28.log. Logging continues.It was said on IBM WID Forum that the fix for this issue will be available in 6.0.2.25 fixpack.
Friday, September 28, 2007
Log4JCategoryLog
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
Monday, September 17, 2007
Tuesday, September 11, 2007
Hibernate and Struts - Identifier Altered
We saw messages like that,
org.hibernate.HibernateException: identifier of an instance of ... was altered ...In the beginning of investigation, we found the Hibernate related code did not flush after insert. We added the flush, but it didn't solve the problem.
...
org.hibernate.event.def.DefaultFlushEventListener.onFlush...
...
Then we read Spring document and found HibernateTemplate recommended over Session. So we replaced Session with Template. But it didn't solve the problem.
Because because it had no problem going back to list after update, we tried to use saveOrUpdate and replace save. But it was the same.
Finally we noticed the Hibernate flush was scheduled after the page was forwarded, no matter what the setting of transaction.flush_before_completion was true or false. We also noticed the struts always recovered the form after forward. We tried to reset the data bean in the form right after insert. And this time, it solved the problem.
Thursday, September 06, 2007
Hibernate and MS SQL - Nullability Problem
org.springframework.orm.hibernate3.HibernateSystemException: not-null property references a null or transient value: com.ag.applications.forms.entity.qstnaire.QstnaireBean.qstnaireNam; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: com.ag.applications.forms.entity.qstnaire.QstnaireBean.qstnaireNamTo get rid of the error, edit the hbm.xml file and change the not-null="true" to "false".
org.hibernate.PropertyValueException: not-null property references a null or transient value: com.ag.applications.forms.entity.qstnaire.QstnaireBean.qstnaireNam
However, it is necessary to define some properties not nullable. In this case, modify the application and let the property has non-null value or get the instance from database by primary key, then delete it.
This problem was reported to Hibernate on August, 2007. No known release fixes it.
Wednesday, September 05, 2007
Hibernate and MS SQL - Delete Operation
Data Access Error: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition.This is because Spring 1.2 is incompatible with Hibernate 3. I heard Spring 2.0 solved this problem, but I found a workaround solution with Spring 1.2.
Here is the solution, in applicationContext.xml, set the property "checkWriteOperations" of "org.springframework.orm.hibernate3.HibernateTemplate" to false.
Tuesday, September 04, 2007
Hibernate and MS SQL - Unsupported prepareStatement
For IBM ConnectJDBC for MS SQL,
java.sql.SQLException: [IBM][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatementFor DirectData ConnectJDBC for MS SQL,
at com.ibm.websphere.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.ibm.websphere.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.ibm.websphere.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at com.ibm.websphere.jdbcx.base.BasePooledConnection.prepareStatement(Unknown Source)
at com.ibm.websphere.jdbcx.base.BaseConnectionWrapper.prepareStatement(Unknown Source)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.pmiPrepareStatement(WSJdbcConnection.java:3980)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:3854)
java.sql.SQLException: [DataDirect][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement(String, String[])There is a saying that the Connection.prepareStatement(String sql, String[] columnNames) is not supported. Workaround solution is to set the "hibernate.jdbc.use_get_generated_keys" to false in the hibernate settings, either in the properties or in the cfg.xml.
at com.ddtek.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.ddtek.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.ddtek.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at com.ddtek.jdbcx.base.BasePooledConnection.prepareStatement(Unknown Source)
at com.ddtek.jdbcx.base.BaseConnectionWrapper.prepareStatement(Unknown Source)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.pmiPrepareStatement(WSJdbcConnection.java:3980)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:3854)
Here is the definition of the property.
Enable use of JDBC3 PreparedStatement.getGeneratedKeys() to retrieve natively generated keys after insert. Requires JDBC3+ driver and JRE1.4+, set to false if your driver has problems with the Hibernate identifier generators. By default, tries to determine the driver capabilites using connection metadata.eg. true|false
Here is the quote from mdiamonte in DataDirect forum.
Against SQL Server 2000, the driver can not implement this method correctly in the general case because SQL Server 2000 does not allow you to return the value of an arbitrary column from an insert, update or delete statement. At least not with out making an extra round trip to the server, which negates the purpose of this method.
I have seen implementations of this method by other drivers where the value returned will be the value of the identity column regardless of which column was actually asked for. I believe that implementation is bad. I feel it is much worse for a driver to return incorrect information than it is to not be able to return the information. Assuming the id column in the statement is an identity column, then Hibernate may have just gotten lucky that it worked in the testing that they did.