Posts

Error "Document could not be opened"

When we try to open any of the jasper reports in pdf, csv or rtf format, it results in an error saying that the document can't be opened. However, when we first save the report then it can be opened. This problem only occurs when we connect directly to Websphere 6.1. When there is a HTTP server in between, everything works ok. Analysis: We studied the HTTP header information being transmitted in both the cases; with HTTP Server and without HTTP server. Realized that the issue does occur because in case of no HTTP Server the HTTP had the cache settings as "Cache-Control: no-cache" Following is what we have suggested the customer: If you have 'CookiesConfigureNoCache' property already configured in your server, then please change its value to False, restart the server and try to replicate the problem. Otherwise, please add this property following the steps mentioned below. Steps to configure custom property CookiesConfigureNoCache on WAS 6.1: Login to the Administra...

One or more local transaction resources were rolled back during the cleanup of a LocalTransactionContainment.

You might have seen the following statement in your log file sometimes: [9/11/09 10:26:06:349 CEST] 00000033 LocalTranCoor W WLTC0032W: One or more local transaction resources were rolled back during the cleanup of a LocalTransactionContainment. [9/11/09 10:26:06:762 CEST] 00000030 LocalTranCoor W WLTC0033W: Resource Test Datasource rolled back in cleanup of LocalTransactionContainment. We also recieved the statement for one of our client running on Websphere 6.1 server. The solution was to change the data source settings. (GO TO Resources -> JDBC in Admin Console) Client had the Data Source settings under the option "Resources -> JDBC -> Data Sources (WebSphere Application Server V4)". This section specifies the data source to support older versions of EJB (i believe EJB 1.1) and Servlet (I think 1.1 and earlier). There may me other compatibility issues, please check the WebSphere site for details. For any other later specifications Data Source should be speci...

Factory Method Pattern - Misconception

Image
This post does not talk about the Factory Method Pattern, but I would like to discuss about from where it starts. Recently I had the privilege to attend a training on the topic. I do not miss opportunity to attend any session on process or pattern, you always have something to learn. It was an good interactive session but we had the same old discussion that instead getting to the factory method we ended up discussing the implementation (some may call it simple factory idom, but i dont) forgetting that patterns only talk about the behavior and interaction and not about implementation. Let me take a chance to explain the Factory Method Factory Method - I will use the common example of PizzaFactory as used by Head First to explain the factory method: Elements: Pizza (Product) SimplePizzaFactory (Creator) Definition: The essence of the Factory Pattern is to "Define an interface for creating an object, but let the subclasses decide which class to instantiate. The Factory method lets a...

Soap request from JavaFX

I was searching on net to know how to send soap request from JavaFX. I could not get a straight answer. While looking at the JavaFX 1.0 API, I did find java.io.http.HttpRequest class to send HTTP asynchronous requests. The document says that you can invoke RESTful weservices through the class. Since HTTPRequest supports POST as a method for sending the request, I though of sending the SOAP message over HTTP. I wrote a simple utility class to facilitate the same and it did help me achieve my goal. The example is a simple class keping in mind that usually soap request are known through WSDL but we do mistakes while preparing a complete XML soap message. I would like to share some of the points for anyone trying the same. 1. Create a simple SoapRequest class as follows: public class SoapRequest extends HttpRequest{ 2. Define the variables to create xml tags, Soap envelop and body tags // xml header  var XML_HEADER:String = "";  // namespace for SOAP 1.1 message, this...

Custom Exception with same name as JDK Exception

If I create an exception example IOException, will there be an conflict with the existion IOException of JDK? In a discussion the qustion popped up for a quick response and most us had it. But if someone has confusions, here is a quick explanation. Lets  create a custom exception IOException as stated below (IOException.java) package my.test; class IOException extends Exception { IOException() { super("MyIOException Has Raised"); } } Next lets create a test program to see what happens (TestException.java). package my.test; public class TestException { public static void main(String[] args) { try { throw new IOException(); } catch(IOException e) { System.out.println(e.getMessage()); } } } When we run the TestException.java file we get the following message: MyIOException Has Raised Now lets include an import statement to import java.io.IOException class. package my.test; import java.io.IOException; public class TestException { public static void main...

My Baby had seizures

My kid is 1.5 years old now (on the date I was writing this blog). When he was around five months old, we noticed some shaky movement while he used to be on mother's feed. We were not sure of what we noticed when he had these movements for initial couple of times. But when we started noticing it for more regular intervals with frequency being once in 10 days, we took it seriously and made a video to show to our pediatrician. She suspected some sort of seizures. According to her, in infants deficiency of calcium may be a cause for this behavior. Since she did not wanted to take chances, doctor wanted to do all sorts of tests like EEG and other scary Brain tests. We were getting a bit tensed. We were searching for the relevant information on internet. There were lot of similar behaviors reported but very less remedies and directions. This was my primary reason to write this blog to share my experience to benefit to some extent, those parents who might be confused at this point in tim...

Job - What is it?

An interesting topic isnt it. Thats what we are running around these days. Job feeds us both with our need and greed. You might be wondering whats there to write in it. Yes there is. Couple of days before I was having lunch in my canteen, and i just overheard few of the managers in my company takling "No company gives a managerial job to a fresher?". No I am not saying there is anything wrong or right in the statement, but the irony of today's world is that we have changed the meaning of 'Job'. Dictionary meaning of job says ' regular activity performed in exchange for payment'. Today 'Job' means position and money. We have forgotten the activity part of it. Not everyone can do each task perfectly, and the is no age of perfection. So i believe we should never try to relate 'Job' to seniority or salary. I have seen managers forcing themselves on their subordinates. But you dare ask these managers a straight answers in written, you might get ...