Friday, October 24, 2008

WASUpdater trace

com.ibm.websphere.management.application.*=all=enabled:com.ibm.ws.management.application.*=all=enabled:com.ibm.websphere.commerce.WC_SERVER_MANAGEMENT=all

Thursday, October 23, 2008

Toolkit recovery tips

- In the Project Explorer, expand Enterprise Applications --> WC
Right-click on the WC project and select 'close'
Stop the server
Right-click on the WC project and select 'open'
Right-click on the WC project again, and select 'refresh'
In the Projects menu, make sure 'Build Automatically' is selected, then select 'Clean'- Ensure 'Clean all projects' is selected, then click 'ok'


Start the server
Right-click the Test Server, select 'add/remove projects' and add the WC application- if publishing does not start, click the 'publish to server' icon in the Servers View Tab- Stop the server and close RAD


Backup the /wasprofile directory
Delete the /wasprofile directory
Backup the /workspace/.metadata directory
Delete the /workspace/.metadata directory
CD into /bin
Run setup.bat
Open RAD and start the server
Check the console for 'Application Started: WC'


If it's there, you are good to go; if not, click the 'publish to server' icon in the Servers View Tab

Tuesday, October 21, 2008

PHP, JavaScript, J2EE, MySQL, Ajax, SEO, Wordpress, Joomla, zend, osCommerce

Web development links

http://www.webreference.com/

AJAX in one diagram

Monday, October 20, 2008

My online contract providers

http://www.odesk.com/
http://www.elance.com

My online contract providers

http://www.odesk.com/
http://www.elance.com

Thursday, October 16, 2008

How to use Java Logger

1. Define the LOGGER instance for the class
private static final String CLASSNAME = WASUtil.class.getName();
private static final java.util.logging.Logger LOGGER =
java.util.logging.Logger.getLogger(CLASSNAME);
2. Log trace on your specified level
LOGGER.log(Level.FINE, "profile name: "+name);

3. Enable the trace to a benchmark level. For example, for a standalone program,
you can enable trace by modifying /lib/logging.properties,
java.util.logging.ConsoleHandler.level = ALL
com.yourcompany.yourclass.level=FINER
will trace all the entries with trace level higher than FINER, ie, FINE, CONFIG, INFO.

Change datasource password in a clustered env.

If you're federated, config manager detects this and attempts to connect to the DMGR pocess via it's SOAP port.It then instructs the DMGR to update the EJB module's configuration (the datasource password). This information will be stored on the DMGR in the config/cells//applications//deployments///META-INF/ibm-ejb-bnd.xmi file.If automatic sync is enabled, the change will be synced to all of the nodes running that app automatically after a period of time. (This is the default) The sync requires that the node agent is running.If automatic sync is disabled, you'll need to manually sync each node that runs the app.

Based on my quick analysis of the code yes, we will use the WAS APIs to modify the datasource password a per module basis. The password will be stored in the ibm-ejb-bnd.xmi file for each EJB module in directories as you have mentioned below.Does WAS need to be running? If you are federated to a DMGR, yes we will connect to the DMGR process and ask it to do the configuration changes. If not federated, we will not connect to any process. The WAS APIs we use will update the files directly on the file system without connecting to any WAS server.A bit of background:The datasource itself can have a default password.This password can be overridden at the MODULE levelThis password can also be overridden at the BEAN level.Config manager sets the password at the MODULE level in 5.6.x (WAS5AdminClient.mapEjbsToDataSource(). (6.0 is different)

Clean connection pool

The immediate purge pool option should only be used if the database is down. To use the Mbean operation purgePoolContents, you must use wsadmin commands. The purgePoolContents is a DataSource or J2CConnectionFactory Mbean type .
View the following wsadmin example, assuming that the data source name is mydatasource:
%WAS_HOME\bin\wsadmin
set ds [$AdminControl queryNames *,type=DataSource,name="mydatasource"]
$AdminControl invoke $ds purgePoolContents [normal immediate]

Which JAR does my class run from?

The following code gets runtime JAR file name:
.class.getProtectionDomain().getCodeSource().getLocation().toString()

The first post

Looking for bussiness opp is hard. creating a blog page is much easier however. This is a site for J2EE consulting assets.