Include the com.ibm.ws.webservices.thinclient_6.1.0.jar file is in the classpath.
Remove other jars if present (such as ras.jar, com.ibm.ws.runtime_6.1.0.jar) which contain TraceComponent class
Tuesday, October 07, 2008
Monday, October 06, 2008
java.lang.NoSuchFieldError: com/ibm/mq/MQC.MQCT_NONE
com.ibm.mq.jar is required in the classpath of the java class.
This jar is supplied with WAS
This jar is supplied with WAS
Thursday, July 24, 2008
Unable to use CSS style on the page
I was going nuts why I am unable to view the style on the pages using Struts 2 with AJAX.
I have to investigate but once I removed this line from my JSP it ran fine :-)
I have to investigate but once I removed this line from my JSP it ran fine :-)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Saturday, August 25, 2007
Show Hide using display.style in javascript problem in Firefox
An already javascript function was used to show/hide an array of elments in an HTML page.
It worked perfectly in IE but in Firefox it gave a problem when we used to show/hide multiple times on an element. A new row/column was added in every iteration of show hide.
On investigation, a single line code change made in work fine in both IE and firefox
Old Code
http://www.ozzu.com/ftopic41924.html
http://www.velocityreviews.com/forums/t160487-firefox-and-stylequotdisplayblockquot-on-table-row.html
It worked perfectly in IE but in Firefox it gave a problem when we used to show/hide multiple times on an element. A new row/column was added in every iteration of show hide.
On investigation, a single line code change made in work fine in both IE and firefox
Old Code
function showHideElement(elementId, showHideFlag) {New Code
var elementObj = document.getElementById(elementId);
if(showHideFlag == 1) {
elementObj.style.display = 'block';
} else if(showHideFlag == 0) {
elementObj.style.display = 'none';
}
}
function showHideElement(elementId, showHideFlag) {A single line change from elementObj.style.display = 'block' to elementObj.style.display = '' stopped creation of blank rows/columns on every iteration of show hide
var elementObj = document.getElementById(elementId);
if(showHideFlag == 1) {
elementObj.style.display = '';
} else if(showHideFlag == 0) {
elementObj.style.display = 'none';
}
}
http://www.ozzu.com/ftopic41924.html
http://www.velocityreviews.com/forums/t160487-firefox-and-stylequotdisplayblockquot-on-table-row.html
Friday, August 10, 2007
Dynamically creating radio buttons using DOM
This post almost replicates my experience while trying to create dynamic radio buttons using DOM
In the Trenches: Another IE Gotcha - Dynamiclly Created Radio Buttons
Some other links which helped me
http://www.thescripts.com/forum/thread468483.html
http://www.fleegix.org/articles/2006/04/29/dom-fun-with-ie6-and-form-elements
Wednesday, July 11, 2007
No form found under 'null' in locale 'en_US'. A form must be defined in the Commons Validator configuration when dynamicJavascript=&q
As soon as I put <html:javascript /> tag in the jsp, I get this error.
It indicates that it is unable to find a formset.
Solution: Did not add the form name with the tag
ex:
It indicates that it is unable to find a formset.
Solution: Did not add the form name with the
ex:
The path of an ForwardConfig cannot be null
Usually, this is an indication that you have validation turned on, theSource
validation is failing, and the "input" attribute is not set (i.e. it's
NULL)
I was adding validator and forgot to do 'validation="true"' add the 'input' attribute in action mapping
Tuesday, March 27, 2007
java.sql.SQLException: ORA-01008: not all variables bound
One of the cause of this error can be found in the following snippet of code:
query = "select * from AAA where condn = ?";
pstmt = con.prepareStatement(query);
pstmt.setString(1, firstValue);
// ResultSet rs = pstmt.executeQuery(query); // Wrong Usage - Do not provide query again
ResultSet rs = pstmt.executeQuery(); // Correct Usage
Another reason is that you have not mapped all '?' with corresponding values
query = "select * from AAA where condn = ?";
pstmt = con.prepareStatement(query);
pstmt.setString(1, firstValue);
// ResultSet rs = pstmt.executeQuery(query); // Wrong Usage - Do not provide query again
ResultSet rs = pstmt.executeQuery(); // Correct Usage
Another reason is that you have not mapped all '?' with corresponding values
Thursday, July 27, 2006
ORA-00911: invalid character
The exception was because I had a semicolon(;) after the preparedstatement query.
Removal of it resolved the problem
Removal of it resolved the problem
Tuesday, May 09, 2006
Database Explorer in Eclipse 3.1
Hi,
These are two Plugins which can be used for exploring the DB.
Hence it will reduce the dependency on PL/SQL Dev and Toad.
1. SourceForge.net: Eclipse SQLExplorer plugin
2. SourceForge.net: DBEdit Plugin for Eclipse
Installation is simple, just extract them in the plugin directory of Eclipse.
After you restart your Eclipse you can see one more Perspective(SQLExplorer/DBEdit) which will depend on which plugin you have installed.
Hopefully once we move to Eclipse 3.2 we will get all this features from the Data Tools Platform.
The installation instruction for SQL Exlplorer are present on this link
http://www.onjava.com/pub/a/onjava/2005/05/11/sqlexplorer.html
These are two Plugins which can be used for exploring the DB.
Hence it will reduce the dependency on PL/SQL Dev and Toad.
1. SourceForge.net: Eclipse SQLExplorer plugin
2. SourceForge.net: DBEdit Plugin for Eclipse
Installation is simple, just extract them in the plugin directory of Eclipse.
After you restart your Eclipse you can see one more Perspective(SQLExplorer/DBEdit) which will depend on which plugin you have installed.
Hopefully once we move to Eclipse 3.2 we will get all this features from the Data Tools Platform.
The installation instruction for SQL Exlplorer are present on this link
http://www.onjava.com/pub/a/onjava/2005/05/11/sqlexplorer.html
Thursday, March 23, 2006
Cannot create JDBC driver of class '' for connect URL 'null'
If you get this Exception while using Tomcat 5.5.9 or 5.5.* Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at com.vsnl.pcr.dao.DataAccessObject.getConnection(DataAccessObject.java:119) ... 29 more
Possible Solution:
Check the database lookup entry in either context.xml or server.xml
In Tomcat 5.5.9 there are no <ResouceParams> tag and the parameters are passed alongiwth the resource tag.
e.g Resource Entry in Tomcat 5.5.9
In Tomcat 5.0.28
One Last Point: Dont forget to put your classes12.jar/ojdbc14.jar file in/commons/lib folder.
Two useful links which help me discover this.. :-) (after I had already wasted a lot of time)
1. Java Forums
2. Tomcat Docs
Possible Solution:
Check the database lookup entry in either context.xml or server.xml
In Tomcat 5.5.9 there are no <ResouceParams> tag and the parameters are passed alongiwth the resource tag.
e.g Resource Entry in Tomcat 5.5.9
<resource name="jdbc/XYZ"
auth="Container"
scope="Shareable"
type="javax.sql.DataSource"
driverclassname="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:XYZ"
username="xyz"
password="xyz"
maxactive="10"
maxidle="100"
maxwait="3000">
</resource>
In Tomcat 5.0.28
<resource name="jdbc/XYZ" scope="Shareable" type="javax.sql.DataSource">
<resourceparams name="jdbc/XYZ">
<parameter>
<name>factory</name>
<value>
org.apache.commons.dbcp.BasicDataSourceFactory
</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:XYZ</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>xyz</value>
</parameter>
<parameter>
<name>password</name>
<value>xyz</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>3000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>100</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
</resourceparams>
</resource>
One Last Point: Dont forget to put your classes12.jar/ojdbc14.jar file in
Two useful links which help me discover this.. :-) (after I had already wasted a lot of time)
1. Java Forums
2. Tomcat Docs
Monday, March 13, 2006
Common Struts Errors
Common Struts Errors
A really good compilation of some Common Struts erors and I find it quite handy :-) most of the times
A really good compilation of some Common Struts erors and I find it quite handy :-) most of the times
Wednesday, March 08, 2006
javax.servlet.ServletException: Define tag cannot set a null value
If you are using struts and get this error, it means you might have used
tag for a value which is null.
The problem would be solved if you use tag to check for the null value.
e.g.
1 <logic:notEmpty name="fooForm" property="fooList">
2 <bean:define id="fooList" name="fooForm" property="fooList" />
3 <html:options collection="fooList" property="id" labelProperty="fooname" />
4 </logic:notEmpty>
The 'fooList' is checked before being defined in the samplecode
The problem would be solved if you use
e.g.
1 <logic:notEmpty name="fooForm" property="fooList">
2 <bean:define id="fooList" name="fooForm" property="fooList" />
3 <html:options collection="fooList" property="id" labelProperty="fooname" />
4 </logic:notEmpty>
The 'fooList' is checked before being defined in the samplecode
Tuesday, March 07, 2006
Thursday, February 16, 2006
How to Stop double submit on click of refresh button in Struts
Follow these steps if you are using Struts
1. Add saveToken(request) in the execute() method of the Action when the page needs to displayed first or initialized.
2. Add the following code in the execute() method of Action handling the processing of the page on Submit
if (isTokenValid(request)) {
////// Do the processing for the request and add messages if required
resetToken(request); /// Reset the token so that on resubmit it does not come in this block
return mapping.findForward("success");
} else {
///// The page is submitted again so take app. action if required
return mapping.findForward("failure");
}
1. Add saveToken(request) in the execute() method of the Action when the page needs to displayed first or initialized.
2. Add the following code in the execute() method of Action handling the processing of the page on Submit
if (isTokenValid(request)) {
////// Do the processing for the request and add messages if required
resetToken(request); /// Reset the token so that on resubmit it does not come in this block
return mapping.findForward("success");
} else {
///// The page is submitted again so take app. action if required
return mapping.findForward("failure");
}
Friday, December 30, 2005
One-Time Pad Generator
One-Time Pad Generator
I found this site useful for generating a random key.
Its a web based random key generator.
I found this site useful for generating a random key.
Its a web based random key generator.
Monday, December 19, 2005
java.sql.SQLException: ORA-01006: bind variable does not exist
It could be because you have left the String variable in the query as '?' and then setting it by setString(, ) and this leads ot the Exception.
Solution is to remove the single quotes in the Query around question mark
Solution is to remove the single quotes in the Query around question mark
Monday, November 14, 2005
Equal symbol expected Struts Error
org.apache.jasper.JasperException: *********.jsp equal symbol expected
If you get this error while using struts..
It could be because you are trying to nest two struts tags..
e.g. I was using something like this..
") />
Also check out this link which gives a more detailed explanation
If you get this error while using struts..
It could be because you are trying to nest two struts tags..
e.g. I was using something like this..
Also check out this link which gives a more detailed explanation
Thursday, November 10, 2005
How to print PreparedStatement ?
Hi,
I usually felt the need to view the full query formed after substituting the '?' with their values in a PreparedStatement. I found a solution at JavaWorld
I usually felt the need to view the full query formed after substituting the '?' with their values in a PreparedStatement. I found a solution at JavaWorld
Monday, October 03, 2005
One more blog
Hi, I think this blog might prove useful to someone unlike my other blog which contains nothing but 100% crap..
Subscribe to:
Posts (Atom)