Montag, Januar 17, 2005
OC4J Debuglevel
-verbosity is my favorite OC4J startparameter to get OC4J debug output. The range is defined from 1-10:
$JAVA_HOME/java -jar oc4j.jar -verbosity 10
Today I need a additional parameter to get more information about the used DataSource:
java -Ddatasource.verbose=true -Dhttp.session.debug=true -jar oc4j.jar -verbosity
HTTP Debugging
- http.session.debug = Provides information about HTTP session events
- http.cluster.debug = Provides information about HTTP clustering events
- http.error.debug = Prints all HTTP errors
JDBC Debugging
- datasource.verbose = Provides verbose information on creation of data source and connections using Data Sources and connections released to the pool, etc,
- jdbc.debug = Provides very verbose information when JDBC calls are made
EJB Debugging
- ejb.cluster.debug = Turns on EJB clustering debug messages
- transaction.debug = Provides debug information on transactions, useful for JTA debugging
RMI Debugging
- rmi.debug = Prints RMI debug information
- rmi.verbose = Provides very verbose information on RMI callsJMS Debugging
- jms.debug = Prints JMS debug information
http://www.oracle.com/technology/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html
Donnerstag, Januar 13, 2005
Get the serialized ADF-RowKey in uiXML
Within a UIX-Table you can get the serialized ADF-RowKey with the EL-Expression ${uix.current.rowKeyStr}. This undocumented feature allow you to bind the key to a link for table actions instead to use the singleSelection element:
Example to delete a row with a link into each table row:
<link text="${uix.current.EmployeeId.attributeValue}">
<boundAttribute name="destination">
<concat>
<contextProperty select="ui:contextURI"/>
<fixed text="/deleteEmp.do?rowKeyStr="/>
<dataObject source="${uix.current.rowKeyStr}"/>
<fixed text="&event=delete"/>
</concat>
</boundAttribute>
</link>
Example to delete a row with a link into each table row:
<link text="${uix.current.EmployeeId.attributeValue}">
<boundAttribute name="destination">
<concat>
<contextProperty select="ui:contextURI"/>
<fixed text="/deleteEmp.do?rowKeyStr="/>
<dataObject source="${uix.current.rowKeyStr}"/>
<fixed text="&event=delete"/>
</concat>
</boundAttribute>
</link>
Mittwoch, Januar 12, 2005
How to use the JAZN API to manage OC4J users
Here is a sample code to change the password in the jazn.xml file in usage of the JAZN API:
changeJaznUserPassword(String realm, String userName, String password){
RealmManager realmMgr = JAZNContext.getRealmManager();
Realm realm = realmMgr.getRealm(realm);
UserManager userMgr = realm.getUserManager();
RealmUser user = userMgr.getUser(userName);
XMLRealmUser xmlrealmuser = (XMLRealmUser)realm.getUserManager().getUser(userName);
if(xmlrealmuser == null)
throw new Exception("The specified user does not exist in the system.");
xmlrealmuser.setCredentials(userPwd, serRepeatedPwd);
// to refresh automaticlly you must set the property "external.synchronization = true" in jazn.xml - see previous blog
userMgr.refresh();
changeJaznUserPassword(String realm, String userName, String password){
RealmManager realmMgr = JAZNContext.getRealmManager();
Realm realm = realmMgr.getRealm(realm);
UserManager userMgr = realm.getUserManager();
RealmUser user = userMgr.getUser(userName);
XMLRealmUser xmlrealmuser = (XMLRealmUser)realm.getUserManager().getUser(userName);
if(xmlrealmuser == null)
throw new Exception("The specified user does not exist in the system.");
xmlrealmuser.setCredentials(userPwd, serRepeatedPwd);
// to refresh automaticlly you must set the property "external.synchronization = true" in jazn.xml - see previous blog
userMgr.refresh();
How to tell a running OC4J to refresh external updated Users (jazn-data.xml)
To tell a running OC4J instance to refresh the cached users after updating the jazn-data.xml manually, you must set the following parameter in the jazn.xml file
<property name="external.synchronization" value="true">
see also jazn documentation:
<property name="external.synchronization" value="true">
see also jazn documentation: