Friday, November 12, 2010
Apache Rewrite Rule for outage notification.
...
RewriteEngine On
...
Also make sure that this rule is ahead of any other rules in the conf file.
...
RewriteRule (^/context.*$|^/cxt2.*$) /outage/reason.html [R,L]
....
R - to send HTTP redirection.
L - this is the last rule to be evaluated.
Tuesday, August 3, 2010
Creating PDF995 printer again
You may be able to create it manually as follows.
- Make sure c:/windows/pdf995.ini has the settings as needed. If this file is empty, see whether you can get a copy from c:/program files/pdf995/res/pdf995.ini that you can modify appropriately.
- Launch "Add Printer" wizard.
- Select "Local printer attached to this computer", uncheck "Automatically detect and install ..."
- Select "PDF995PORT (local port)" for "Use the following port:"
- Ignore listed Manufacturer and Printers, but click on "Have Disk ...".
- Navigate to c:/Program Files/pdf995/res/convert to select "ghostpdf.ini".
- Change printer name to PDF995.
- Complete printer set up.
- Make the new printer as the default printer, if necessary.
- Find the printer in "Printer and Faxes", click on properties to go to "Advanced tab" as shown.
- Select "PDF995 Printer Driver" under "Driver" as opposed to any reference to Ghostscript.
- Click OK to complete printer configuration.
- Print a text file, from Word Pad, to PDF995 printer to make sure it shows up as a PDF file under "My Documents". If the file does not show up, then the printer set up likely not working.
Thursday, May 20, 2010
ORABPEL-04003 error in OC4J 10.1.3.4
tab in the standalone(olite based) instance of Oracle BPEL
Console(10.1.3.4), then it is due to a missing column, namely
process_guid, in "admin_list_wi" view.
You can create the view again by running the following.
create or replace view admin_list_wi
as select wi.cikey, wi.node_id, wi.scope_id, wi.count_id,
wi.creation_date wi_creation_date, wi.creator wi_creator,
wi.modify_date wi_modify_date, wi.modifier wi_modifier,
wi.state wi_state, wi.transition,
wi.exp_date, exp_flag, wi.priority wi_priority,
wi.label, wi.custom_id, wi.comments, wi.reference_id,
wi.execution_type,
ci.domain_ref as ci_domain_ref,
ci.process_id process_id, ci.revision_tag revision_tag,
ci.process_guid process_guid,
ci.title title, ci.root_id, ci.parent_id, fault_name,
index_1, index_2, index_3, index_4, index_5, index_6
from cube_instance ci, work_item wi, wi_fault fault, ci_indexes indexes
where ci.cikey = wi.cikey (+)
and fault.cikey (+) = wi.cikey
and fault.node_id (+) = wi.node_id
and fault.scope_id (+) = wi.scope_id
and fault.count_id (+) = wi.count_id
and indexes.cikey (+) = ci.cikey ;
Monday, March 8, 2010
Altiris as Search provider in IE
(Refer to the following post to install a new search provider in IE.)
https://<altiris.server>/Altiris/NS/default.aspx?cmd=viewItem&id=TEST
Thursday, January 21, 2010
JIRA as a search provider in IE
Instead of going to JIRA every time to do a quick search, all you have to do is type in a key word and select "JIRA" as the search provider to trigger a search within JIRA.
Click on the drop down box next to search box, in IE, to select "Find More Providers ...".
IE presents a list of Web and Topic search providers along with "Create Your Own".
In the URL box under "Create Your Own", type in the following with the hostname of your JIRA server.
http://_JIRAHOST_/secure/QuickSearch.jspa?searchString=TEST
Type in "JIRA" as the search provider name.
Click "Install".
You do not have to go to JIRA to start a search anymore.
Thursday, December 24, 2009
Windows logs off immediately after logging in
Here is the link.
http://www.troublefixers.com/windows-logs-off-automatically-while-login/
"Guti" response on Sep 7th, 2009 is on the mark.
http://support.microsoft.com/kb/223188 - Problem as stated from Microsoft Support
The question thereafter is how do you fix the registry key when the system does not let you log in. There are a number of articles that state how to access the registry remotely and you try this and that and the clock goes by without making any progress due to any one of the following.
- your system may not be on the network
- you may have turned off "Remote Registry" service from starting up.
- cannot seem to get remote registry access working
- in my case, the laptop was not even "pingable".
Here is what I did to fix that and mine is Windows XP.
- put the old drive (smaller) back in my laptop and booted it up.
- put the new and bigger hard disk back in the USB enclosure and connected t to the laptop.
- located the registry file
:\windows\system32\config\system. - took a copy of this file.
- http://support.microsoft.com/kb/256986 - Registry and associated files
- used a binary file editor such as "TextPad" to open this file.
- moved all references such as \DosDevices\C: to \DosDevices\X: (Pick an unused drive etter as appropriate for your laptop). There may be more than one occurrence of this string in the file and you need to replace all of them.
- moved all references such as \DosDevices\E: to \DosDevices\C: (E was the drive letter assigned when the bigger hard disk enclosure was connected the first time).
- saved the file and then replaced the old hard drive with new hard drive.
- voila!
Ensuring only one active BPEL instance for a unique transaction
Though any subsequent messages meant for this process were handled and processed by the process manager, it led to data inconsistency issues because of two active processes for the same transaction id.
We went down the familiar path of preventing a user from creating such a condition and it was getting harder and harder to fix it. So we decided to approach it from the process side and this is what we did to enable only one active process instance for a given transaction (correlation id).
- added a new message and an operation namely "ignore"
- implemented an event handler for "ignore" on the process's main scope. This handler did not to do anything other than sinking the message.
- set up correlation on this event handler to match the correlation id of the transaction.
- removed the message and operation from the WSDL for ignore before distributing it to the client to avoid any confusion.
This worked because any attempt to start a new process due to duplicate submissions
fails due to a conflicting receive condition created by the event handler for the main scope. This may dump quite a bit of exceptions in the logs, but it helped!
Saturday, October 17, 2009
OCFS Cluster(block) size and performance
You may know that 1024(1MB) is the recommended OCFS cluster
size for data files while 4(4K) for program files. But OCFS
with 1024(1MB) cluster size seems to lead to performance issues
when it has directories with a large number of big files.
The file system, used to hold archive logs and export dumps,
showed gradual degradation as more and more files were
created/moved in, and at some point in time Windows explorer
failed to show the contents of a directory leading to server
reboot - noticed in a Windows 2003 - 64 bit environment.
Reformatting the drive with 4K cluster size seems to fix the issue.
So consider the number of many files that are going to be in the
drive, how often they are going to be accessed(I/O performance)
and how huge they are going to be over time before selecting a
cluster size not just based on whether it is going to have data
files or program files.
Size and determining factors
- 4K - A huge number of files in the file system irrespective
of the size such as program files, exports, archive logs etc. - 1024K - A few, but large files such as data files that need a
lot of caching to improve I/O performance.
Unix: sleep <seconds> && command - equivalent in Windows
Short Version: choice /T secs /D Y command
Long Version: choice /N /T secs /D Y >NUL command
- Requires a number of key strokes.
- You need to have or install choice.exe to be availabe in your path.
- Notice that '||' is used instead of '&&'. Pipe-pipe is required if you wish to hit "Ctrl-C" to abort both choice and command together. If you used "&&" and hit "Ctrl-C", your command will still execute because choice returns a 0(zero - true) upon encountering "Ctrl-C".
Wednesday, April 22, 2009
Generating total in Excel using R1C1 References
You may have to turn on support for R1C1 addressing in MS-Excel by checking off
Tools -> Options -> General (tab) -> R1C1 Reference style.
Here is the formula that I used to sum up all the values in a given column from the
top to the cell just above the total.
"=SUM(R1C:R[-1]C)" - note that no numeric value follows C to address current column.
Thursday, April 16, 2009
Top down Web Service Re-generation using JDeveloper
You may have noticed (or got burnt!) that JDeveloper overwrites your server side Java implementation class with a skeleton whenever you have to re-generate a web service due to changes to WSDL or Schemas?
Here is a way around this issue.
Your application server container will find your implementation class, if you do the following.
- Write your own service implementation class with appropriate operations and make it extend JDeveloper generated server skeleton class.
- Locate
element <servlet> in /public_html/WEB-INF/web.xml - Modify <servlet>
/<servlet-class> element to refer to your class (package.classname) instead of JDeveloper generated class.
Wednesday, April 15, 2009
Mapping a Java Object to two tables using Hibernate - Possible?
Is it possible for an object to be mapped to two different tables? The answer is , No. But the desired effect can be achieved with a minimal effort by taking advantage of Hibernate's support for inheritance hierarchy as follows.
One may wonder where is the need for this kind of behavior.
When an object is persisted in a table that is a queue table or used like a scratch pad (a reader process may delete a record from this table after consuming it), there may be a need to capture the persisted object in a secondary table for logging, auditing or reconciliation purposes.
Here are the steps ...
1. Create a new POJO(say com.mycom.hb.module.SecondaryObject) and make it extend your base Hibernate POJO(say PrimaryObject) that is already hibernated. This object should look simple because the secondary table is exactly same as the primary table.
(It is not a big issue if the secondary table includes more fields. Just implement
the setters and getters for the additional fields if necessary.)
2. Externalize all the property mappings from primary.hbm.xml in a standalone file namely props.xml. This goes a long way and saves a lot of work for secondary table mapping.
3. Use entity reference declaration as shown in hibernate documentation to include property mappings for primary.hbm.xml from props.xml, defined in Step 2. (Chapter 9.1.6 - Table per concrete class, using implicit polymorphism - This is NOT the mapping approach we will take, but used as the reference for entity declaration and references.)
4. Map newly created POJO in secondary.hbm.xml and use entity references to pull in properties from props.xml. The mapping strategy for this approach is going to be "Table per subclass" and the mapping file for the secondary.hbm.xml may look like the following. Remember that making secondary object extend primary object in Java class definition is not just enough. It need to be specified in the joined-subclass definition as follows to get this working.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
[<!ENTITY myprops SYSTEM "com/mycom/hb/module/props.xml">]>
<hibernate-mapping>
<joined-subclass
name="com.mycom.hb.module.SecondaryObject"
table="SECONDARY_TABLE"
schema="app_schema"
extends="com.mycom.hb.module.PrimaryObject">
<key column="REC_NO" /><!-- primary key -->
&myprops;
</joined-subclass>
</hibernate-mapping>
5. Include secondary.hbm.xml in your hibernate_configuration.cfg.xml
6. Build and populate SecondaryObject and persist them from your data access classes. After persisting SecondaryObject, you could find data actually persisted in both PRIMARY_TABLE and also a copy of it in SECONDARY_TABLE.
Thursday, April 2, 2009
Distinguishing numbers from strings in a String(varchar) coulmn.
e.g. Let us say myTable.myColumn of type varchar(50) has the following values.
EA-234
1234567
CT/234
9876543
10203040
AB/04/02/09
and you want to select only the rows that have "1234567, 9876543 and 10203040".
The following query is very consise and efficient than building a "like" search for all allowed prefixes.
select * from myTable
where myColumn between '0' and 'A'
and myColumn not like 'A%'
Remember that the ranges are inclusive in a "between" clause, so you may have to eliminate all the values begining with "A". One may be able to use a different filter such as "and len(myColumn) = 7" or rewrite the where clause as
myColumn >= '0' and < 'A' to achieve it instead of "not like" depending on actual data.
Note: It may noted that "9" cannot be used in the above query instead of "A" because the filter will not include values such as "99" or "921" etc.
Wednesday, December 3, 2008
BPEL calling itself - in design time ...
- Create a new partner link, give it a name "server", and select current project's WSDL as the WSDL file for this partner.
- Select partner roles to be just opposite of what is in "client".(My role and partner role settings should switch with respect to client configuration)
- Define "wsdlRuntimeLocation" property for "server" partner as something like this. This is very very important. http://localhost:8888/orabpel/default/MyProcess/?wsdl(Note that there is no version info in the endpoint and it ends with a slash to point to the default version. This will not work if "wsdlRuntimeLocation" property is not defined or not set appropriately.)
- Now you can select all operations supported by this process to be invoked by itself from an "invoke" activity. Note that invocations lead to a new process instance to be created, not in the current instance.
Modifying BPEL partner link endpoints after deployment
This is how one can do it OC4J - 10.1.3.3.0 deployment.
- Shut OC4J down
- cd to $OC4J_HOME/bpel/domains/$YOUR_DOMAIN/tmp/
- Locate the directory that starts with ".bpel_***" and corresponds to your process and version. This directory has some hexa-decimal value in it and also ends with ".tmp".
- cd to the above identified directory.
- Modify "wsdlRuntimeLocation" property in bpel.xml found in this directory.(If you never used "wsdlRuntimeLocation" property, modify endpoint in the partner link WSDL directly)
- Bring up OC4J.
Wednesday, March 12, 2008
Forcing Oracle BPEL recompilation on the server
when Oracle AS is down. When the application server comes up, it recompiles the deployed process.
Remove .../BPEL-INF/src and .../BPEL-INF/classes to force regeneration and recompilation.
This is applicable for Oracle AS 10.1.3.3.1.
Struts validation - validwhen - 3rd degree of complexity
Here is an example.
- An employee is transferred to a new organization in the company, with or without a promotion(optional).
- Let us say the same screen also allows promotions to be done without any org transfer.
- The third field, namely "myfield", is an optional field most of the time, except when either or both of the above actions are done at the same time.
Validation Rules in words.
- Field 1 (neworg) -> If "neworg" value is non-null and not same as "prevorg", then "myfield" is required.
- Field 2 (newgrade) -> If "newgrade" is equal to 'A', then "myfield" is required, otherwise not.
- Field 3 (myfield) -> Required if either of the above condition is valid.
Let us say this form also has another field namely "prevorg" to hold the user's original org name.
<field property="myfield" depends="validwhen" >
....
<var-value>
(
(
(
(neworg == prevorg) or (neworg == null)
) and (newgrade != 'A')
) or (*this* != null)
)
</var-value>
...
Note carefully that negative of written rules is realized as the "var-value".
Launching Cygwin from Cygwin
Set this alias in your .bashrc.
alias cygwin='cmd /C start c:/cygwin/cygwin.bat'
If you have customized cygwin.bat as mentioned in http://cygwin.com/ml/cygwin/2004-03/msg00006.html, then the following works better.
alias cygwin='cmd /C start c:/cygwin/cygwin.bat "$PWD"'
Replace c:/cygwin in the above aliases with your installation specific location.
Tuesday, November 27, 2007
IE Auto completion and javascript events for 'text' input.
Listen for both 'propert change' and 'change' on a 'text' input if your form behaves depending on the value entered either manually or by browser's auto completion feature.
OC4J Start up problem - DMS NounType Iterator
An unknown OPMN error has occured.
DMS NounType Iterator.
Change 'IASname' under section '[InstallData]' in $ORACLE_HOME/config/ias.properties to be in sync with ias-instance attributes in opmn.xml
