<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6087525184294050624</id><updated>2011-11-27T16:36:06.324-08:00</updated><category term='Roller'/><category term='WebSphere'/><category term='Blog'/><title type='text'>Cool Solutions</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://premiertech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://premiertech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rakesh Jain</name><uri>http://www.blogger.com/profile/10430850289584443085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6087525184294050624.post-5629910343727016985</id><published>2008-09-05T22:32:00.000-07:00</published><updated>2008-09-06T15:11:49.469-07:00</updated><title type='text'>Launching Browser from External Application</title><content type='html'>I have a standalone java/swing application, from which I want to launch a browser. There are various methods by which you can do so, but every time this java app calls Runtime.exec to launch, it creates a new browser window (unless the user has set browser such that for new urls, it opens in same window/tab).&lt;br /&gt;&lt;br /&gt;My objective is to launch the browser such that, if I want to target a specific browser window, it does that, or if I want to open a new window, it does that too.&lt;br /&gt;&lt;br /&gt;And, it should work with both IE and Firefox. Let's not talk about the Google's baby yet.&lt;br /&gt;&lt;br /&gt;Now, to target a specific browser window, javascript's window.open is the best choice. However, I can't execute javascript from my java app, I need to have it executed in the browser. What I can do is -&lt;br /&gt;&lt;br /&gt;1. Launch the browser from java app, to go to a intermediate URL (servlet/jsp), passing in the window name and the real target URL. This servlet/jsp will inject some javascript code in it to execute on load.&lt;br /&gt;2. This javascript will call window.open function, passing in the target URL and the window name.&lt;br /&gt;3. The target URL will be opened in the new window, or if a window with that name already exists, it will load that target URL page in that window.&lt;br /&gt;4. Use the same javascript code to close this particular window which was originally launched by the java app.&lt;br /&gt;&lt;br /&gt;This way, we have the target URL loaded into a named window.&lt;br /&gt;&lt;br /&gt;The javascript code snippet is:&lt;br /&gt;&lt;br /&gt;var winA=window.open(targetUrl, winName);&lt;br /&gt;window.opener='x'; // this is for IE only&lt;br /&gt;if(winA != window) window.close();&lt;br /&gt;&lt;br /&gt;And this works perfectly in IE. However, I have various problems with firefox 2/3.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Allow Javascript to Close Windows in Firefox&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Starting from firefox 2, it is not allowed to close a browser window, if that window was not opened by a script. In our case, since the original window was opened by java application, window.close() gives us the error - scripts can not close window not opened by script. The easy workaround for this is to change the firefox config, however, it depends on your specific solution, if you can ask your users to make this config change. I haven't explored the possibility of programatically checking/changing/prompting the users for this change.&lt;br /&gt;&lt;br /&gt;Anyway, the change is this - type about:config in firefox address bar. This will give you a bunch of config options. Filter on dom.allow. You should see a config:&lt;br /&gt;dom.allow_scripts_to_close_windows&lt;br /&gt;The default is false, toggle it to true.&lt;br /&gt;&lt;br /&gt;Now, you can close browser windows/tabs in firefox using javascript, even if the window/tab was not opened by javascript.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Same Origin Policy&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So far so good. The next problem I have is - getting handle of an already opened window.&lt;br /&gt;&lt;br /&gt;You would think that when you use window.open("http://www.google.com", "googleWin"); it will open a window with the name googleWin. This is only partially true. It will open a window, with the URL www.google.com loaded, however, it will not set the name of the window to "googleWin", unless you executed the javascript to load window somewhere from http://www.google.com/....../.&lt;br /&gt;&lt;br /&gt;This is a little known security feature of firefox, which I guess is dated back to Netscape days, called Same Origin Policy. According to Mozilla documentation,&lt;br /&gt;&lt;br /&gt;&lt;em&gt;The same origin policy prevents document or script loaded from one origin from getting or setting properties of a document from a different origin. Mozilla considers two pages to have the same origin if the protocol, port (if given), and host are the same for both pages.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;There's one exception to this rule, where you can allow domain changes upto some extent, for example from http://store.company.com/... to http://company.com/...&lt;br /&gt;&lt;br /&gt;Mozilla documentation is here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mozilla.org/projects/security/components/same-origin.html" target='_new' &gt;http://www.mozilla.org/projects/security/components/same-origin.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So, if you host the servlet/jsp which opens named window in the same server/protocol/port as the to be opened pages, you will be able to get handle to windows by name.&lt;div class="blogger-post-footer"&gt;By Rakesh Jain&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6087525184294050624-5629910343727016985?l=premiertech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://premiertech.blogspot.com/feeds/5629910343727016985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6087525184294050624&amp;postID=5629910343727016985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/5629910343727016985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/5629910343727016985'/><link rel='alternate' type='text/html' href='http://premiertech.blogspot.com/2008/09/launching-browser-from-external.html' title='Launching Browser from External Application'/><author><name>Rakesh Jain</name><uri>http://www.blogger.com/profile/10430850289584443085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6087525184294050624.post-570028618293017723</id><published>2008-09-01T20:16:00.000-07:00</published><updated>2008-09-26T14:19:38.408-07:00</updated><title type='text'>Square Architecture - Square Any Number Easy Way</title><content type='html'>While nothing interesting going on in the software world, I got to play with some Math tricks, and got interested in ancient Indian math called Vedic Mathematics. While learning some of it, I thought of writing about this particular method-&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;Finding Square of Any Number using Vedic Math&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The formula is called Dwandwa-yoga (Duplex combination process). Let's see how it works.&lt;br /&gt;Duplex (D) of a number is found as follows, examples later will make it more clear.&lt;br /&gt;For Duplex, in the number sequence we have to find square of, we take twice the product of the outermost pair, and then add twice the product of the next outermost pair, and so on until no pair is left.&lt;br /&gt;When there are odd number of digits in the original sequence there is one digit left by itself in the middle, then this enters as its square.&lt;br /&gt;&lt;br /&gt;So, if the number is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;                    a  then D -&gt; a&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;                    ab then D -&gt; 2(axb)&lt;br /&gt;                   abc then D -&gt; 2(axc) +b&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;                  abcd then D -&gt; 2(axd) + 2(bxc)&lt;br /&gt;                 abcde then D -&gt; 2(axe) + 2(bxd)+c&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;                ...and so on.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, finding duplex is so easy, and after that, it is just addition, so very simple. &lt;br /&gt;Before that, note that if we are given an n digit number to square, we will prepend that number with n-1 zeros.&lt;br /&gt;&lt;br /&gt;So, let's try this. Find square of 52. It is a two digit number, so, add 2-1=1 zero in the front.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;                                        052&lt;br /&gt;Now, let's find the Duplex:&lt;br /&gt;&lt;br /&gt;                         For 2,  D= 2&lt;sup&gt;2&lt;/sup&gt; = 4&lt;br /&gt;                         For 52, D=2(5x2) = 20&lt;br /&gt;                         For 052,D=2(0x2)+5&lt;sup&gt;2&lt;/sup&gt; = 25&lt;br /&gt;&lt;br /&gt;So, simple, now, just add the numbers we got:&lt;br /&gt;&lt;br /&gt;                                           04&lt;br /&gt;                                          20&lt;br /&gt;                                         25&lt;br /&gt;                                       _______&lt;br /&gt;                                         2704&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Let's try one more example:  109&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;A three digit number, so we have to add 3-1=2 zeros before it.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;                 00109&lt;br /&gt;Duplex:&lt;br /&gt;            For 9,            D=9&lt;sup&gt;2&lt;/sup&gt; = 81&lt;br /&gt;            For 09,           D= 2(0x9) = 0&lt;br /&gt;            For 109,          D=2(1x9)+0&lt;sup&gt;2&lt;/sup&gt; = 18&lt;br /&gt;            For 0109,         D=2(0x9)+2(1x0) = 0&lt;br /&gt;            For 00109,        D=2(0x9)+2(0x0)+1&lt;sup&gt;2&lt;/sup&gt; = 1&lt;br /&gt;&lt;br /&gt;Here we go:&lt;br /&gt;                                      81&lt;br /&gt;                                     00&lt;br /&gt;                                    18&lt;br /&gt;                                   00&lt;br /&gt;                                  01&lt;br /&gt;                                __________&lt;br /&gt;                                  011881 &lt;br /&gt;                          &lt;br /&gt;Indeed, that's the answer.&lt;br /&gt;&lt;br /&gt;Let's do an easy one: 15&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;                               015&lt;br /&gt;                            For 5,    D = 5&lt;sup&gt;2&lt;/sup&gt; = 25&lt;br /&gt;                            For 15,   D= 2(1x5) = 10&lt;br /&gt;                            For 015,  D=2(0x5)+1&lt;sup&gt;2&lt;/sup&gt; = 1&lt;br /&gt;And,&lt;br /&gt;                                          25&lt;br /&gt;                                         10&lt;br /&gt;                                        01&lt;br /&gt;                                     ________&lt;br /&gt;                                        0225 is the answer.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, that brings me to a special case, for even easier calculation. &lt;br /&gt;The special case is - the numbers which are ending with 5. Say, the number is of the form a5. The square of that number will be = a(a+1)|5&lt;sup&gt;2&lt;/sup&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;So, for 15&lt;sup&gt;2&lt;/sup&gt;, the result will be 1(1+1) | 5&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;                                i.e. 2 | 25 or 225.&lt;br /&gt;&lt;br /&gt;Similarly, 95&lt;sup&gt;2&lt;/sup&gt; will be 9(9+1) | 25&lt;br /&gt;                                        i.e. 9025.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, that is superfast, I am sure in some cases it is even faster than doing it on calculator.&lt;div class="blogger-post-footer"&gt;By Rakesh Jain&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6087525184294050624-570028618293017723?l=premiertech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://premiertech.blogspot.com/feeds/570028618293017723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6087525184294050624&amp;postID=570028618293017723' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/570028618293017723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/570028618293017723'/><link rel='alternate' type='text/html' href='http://premiertech.blogspot.com/2008/09/square-architecture-square-any-number.html' title='Square Architecture - Square Any Number Easy Way'/><author><name>Rakesh Jain</name><uri>http://www.blogger.com/profile/10430850289584443085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6087525184294050624.post-8157432559658732153</id><published>2007-09-25T21:37:00.000-07:00</published><updated>2008-09-06T22:10:59.569-07:00</updated><title type='text'>Installing Roller 3.1 on WebSphere 5.1 - Part 2</title><content type='html'>Before going into the null pointer issue we saw at the end of Part 1, I came across couple of more issues, which need to be addressed first.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Roller.tld&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This, needs to be defined in the web.xml, with right uri, otherwise, we get this error:&lt;br /&gt;/index.jsp(36,0) File "&lt;a href="http://www.rollerweblogger.org/tags"&gt;http://www.rollerweblogger.org/tags&lt;/a&gt;" not found&lt;br /&gt;&lt;br /&gt;&amp;lt;taglib id="tagLibRef_1"&amp;gt;&lt;br /&gt;&amp;lt;taglib-uri&amp;gt;http://www.rollerweblogger.org/tags&amp;lt;/taglib-uri&amp;gt;&lt;br /&gt;&amp;lt;taglib-location&amp;gt;/WEB-INF/tlds/roller.tld&amp;lt;/taglib-location&amp;gt;&lt;br /&gt;&amp;lt;/taglib&amp;gt;&lt;br /&gt;&lt;br /&gt;I moved the tld file from classes/META-INF/tlds/ to WEB-INF/tlds/.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;LocalTransactionContainment&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Whenever I access any roller page, I get the following error:&lt;br /&gt;[9/20/07 15:15:45:536 MDT] 23d768b9 WebAppTransac E WTRN0043I: LocalTransaction rolled-back due to setRollbackOnly.[9/20/07 15:15:45:538 MDT] 23d768b9 WebGroup E SRVE0026E: [Servlet Error]-[LocalTransaction rolled-back due to setRollbackOnly]: com.ibm.ws.LocalTransaction.RolledbackException at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.cleanup(LocalTranCoordImpl.java:1091)&lt;br /&gt;&lt;br /&gt;According to the Servlet 2.3 specifications, all transactions should be committed or rolled back within the transaction boundries, in this case, servlet method execution. Now, these could just be select statements also.&lt;br /&gt;&lt;br /&gt;One of the solutions to this issue, as described in WebSphere documentation is to edit the ibm-web-ext.xmi file, to include config for each servlet to have either commit or rollback the local transaction. I added this for all the servlets......but, no luck. Keep getting this error.&lt;br /&gt;&lt;br /&gt;I then realized that even though, it is printing whole stacktrace, it may not really be the root of errors. So, looking further down, I found this NullPointerException-&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;RollerRuntimeConfig&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So, the null pointers coming all the time is not allowing me to get to the registration page.&lt;br /&gt;&lt;br /&gt;javax.servlet.ServletException: ServletException in '/WEB-INF/jsps/tiles/tiles-simplepage.jsp': null&lt;br /&gt;&lt;br /&gt;The null pointer indicates that it is getting null for site.name etc. These are given default values in rollerRuntimeConfig.xml file. So, why null? Is that file not read?&lt;br /&gt;&lt;br /&gt;There is no error in the logs that this XML file could not be found or failed to load. I had to now look at the roller source code to figure out what's happening. Infact, I put more debug statements in the code to see the values for each of these config parameters.&lt;br /&gt;&lt;br /&gt;Well, everything is loaded fine. But, still null pointer when the jsp is looking for these parameters.&lt;br /&gt;&lt;br /&gt;Going further deep, it is found that the code, at initialization, reads this xml file, and then stores these properties in the roller_properties table. And when JSP or any other code is getting the values for these, they come from the database.&lt;br /&gt;&lt;br /&gt;Ok, lets check the database - roller_properties table. There is only one record, about database.version. No other properties read from XML are in there. That means the database insert is failing? How did it make just one entry though?&lt;br /&gt;&lt;br /&gt;No idea, but that was the root cause of all these null pointer exceptions. In order to move forward, I decided to manually enter the default properties in roller_properties table. After adding all the required default properties in the table, I was able to proceed.&lt;br /&gt;&lt;br /&gt;Like:&lt;br /&gt;insert into roller_properties values ('site.name', 'roller');&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Register First User&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ok, now, I can get beyond the first page. Infact, I can get to the registration page, and register the user. The first user registered will have all admin rights, so, this was really good.&lt;br /&gt;Registration is simple, got it fine. Then, I try to login.....grrr.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Acegi Security&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When I login with the registered userid and password, I get this:&lt;br /&gt;&lt;br /&gt;Error occurred while invoking error reporter com.ibm.ws.webcontainer.servlet.LoadTargetServletFailure: Failed to load target servlet [FormLoginServlet]&lt;br /&gt;&lt;br /&gt;FormLoginServlet, I guess this comes into picture only when Security is enabled in WAS. This is WebSphere specific servlet, and comes into play when login action is sent to j_security.&lt;br /&gt;&lt;br /&gt;Looking into login.jsp, it is sending it to j_security_check. Ok, but there is no security enabled in websphere, so, may be that's why it is not finding this servlet. But, I don't want to use WebSphere security. I want to, for now, use simple jdbc authentication so that I can get into roller as admin.&lt;br /&gt;&lt;br /&gt;This forced me to look at Acegi security documentation and code. It seemed simple that posting to non j_security_check should call the Acegi filters, rather than calling the app server's FormLoginServlet.&lt;br /&gt;&lt;br /&gt;Let's get into security.xml, and make sure jdbcAuthenticationDao bean has right property value set for jndiName.&lt;br /&gt;Next, look at authenticationProcessingFilter bean in same security.xml and update the property value from j_security_check to something else, I chose a_j_s for testing.&lt;br /&gt;Now, go to login.jsp, and change the action to go to a_j_s instead of j_security_check.&lt;br /&gt;&lt;br /&gt;Recycle the server. And wow...... I can login now!&lt;br /&gt;&lt;br /&gt;Couple of more things:&lt;br /&gt;rollerProperties.jsp - it uses JSTL 1.1 URI, so change it to use JSTL 1.0 URI, as we did in taglibs.jsp.&lt;br /&gt;Also, roller.properties file has upload and search index directories defned, make sure they have trailing slash, otherwise it will give - can't access directory error.&lt;br /&gt;&lt;br /&gt;Great.... now I am able to create the first blog.&lt;br /&gt;&lt;br /&gt;I am still getting transaction rolledback exception, but only initially, it must be coming out of Acegi code, as it uses Spring, and since that code is executed very minimal after you are authenticated and authorized, the error doesn't show up every time you do something. But still, the error/warning is present in the logs, without causing any known harm.&lt;div class="blogger-post-footer"&gt;By Rakesh Jain&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6087525184294050624-8157432559658732153?l=premiertech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://premiertech.blogspot.com/feeds/8157432559658732153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6087525184294050624&amp;postID=8157432559658732153' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/8157432559658732153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/8157432559658732153'/><link rel='alternate' type='text/html' href='http://premiertech.blogspot.com/2007/09/installing-roller-31-on-websphere-51_25.html' title='Installing Roller 3.1 on WebSphere 5.1 - Part 2'/><author><name>Rakesh Jain</name><uri>http://www.blogger.com/profile/10430850289584443085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6087525184294050624.post-884133168752834509</id><published>2007-09-24T14:45:00.000-07:00</published><updated>2007-09-26T11:20:58.514-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WebSphere'/><category scheme='http://www.blogger.com/atom/ns#' term='Roller'/><category scheme='http://www.blogger.com/atom/ns#' term='Blog'/><title type='text'>Installing Roller 3.1 on WebSphere 5.1 - Part1</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Roller weblogger, what I thought would be a simple installation, turned out to be a painful one. I am trying to put together some of the major issues I came across and how I fixed them. Partly to blame roller community here, no good documentation, hopefully this will help some of the users getting Roller working on WebSphere, specially, version 5.1.x, AIX 5.3.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Database &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;So, I started with database. I am using DB2 version 8.2. The OS is AIX 5.3.&lt;br /&gt;When I tried Roller more than a year ago, it did not have db2 scripts, but thankfully, they have it now. It was easy. But, I was installing in an existing database, so added a separate tablespace for roller tables, and updated the scripts to create tables in the new tablespace.&lt;br /&gt;Everything worked fine on DB side.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Datasource &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Since I will be using Type 4 driver, created a datasource in the WebSphere with jndi name jdbc/rollerdb. Verified the connection, all good.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The WAR file &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;As documented in the installation guide the war file needs to be updated with hibernate and related jar files. Got all that, and put them in WAR's lib directory. I did not add db2 driver libraries, because WebSphere has them all, and I will be using type4 driver configured in websphere.&lt;br /&gt;&lt;br /&gt;Updated the following config files:&lt;br /&gt;hibernate.xml - use DB2Dialect&lt;br /&gt;log4j.properties - specify the location of the log file on the server.&lt;br /&gt;roller.properties - updated the upload and cache directory paths. I chose /tmp to start with.&lt;br /&gt;Remove the &amp;lt;dispatcher&amp;gt; tags from filter section in web.xml, as documented there. This is because WAS 5.1 is servlet 2.3.&lt;br /&gt;&lt;br /&gt;Yes, roller documentation says not to update roller.properties file directly, but define a new one, and specify it in JVM settings. Well, test installation, and doesn't matter anyway.&lt;br /&gt;&lt;br /&gt;Just to be clear, WAS 5.1 is:&lt;br /&gt;Servlet 2.3,&lt;br /&gt;JSP 1.2 and&lt;br /&gt;JSTL 1.0&lt;br /&gt;(J2EE 1.3)&lt;br /&gt;&lt;br /&gt;I thought it is all set now, and will be so easy to install on WebSphere, as it was on Tomcat.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I am deploying the roller in an existing app server in my dev system. Nothing special in that app server, just some other ear files are installed and working great.&lt;br /&gt;Install the roller.war file, providing the context root as roller. Most of the installation takes default settings. And, fnally, see the message - roller_war.ear installed successfully. So far so good.&lt;br /&gt;&lt;br /&gt;Recycle the app server. And there is goes:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;em&gt;Module, roller.war, of application, roller_war.ear/deployments/roller_war, fa&lt;br /&gt;iled to start&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;That's it. No more information. No logs, nothing. Looking around on the web... not much information either. Somewhere I saw the problem could be with listeners denined in roller.tld file. The location of tld is also beyond my understanding. It is in ....WEB-INF/classes/META-INF/tlds/&lt;br /&gt;Open it and I see:&lt;br /&gt;&lt;br /&gt;&amp;lt;listener&amp;gt;&lt;br /&gt;&amp;lt;listener-class&amp;gt;org.apache.roller.ui.core.RollerSession&amp;gt;&amp;lt;/listener-class&amp;gt;&lt;br /&gt;&amp;lt;/listener&amp;gt;&lt;br /&gt;&amp;lt;listener&amp;gt;&lt;br /&gt;&amp;lt;listener-class&amp;gt;org.apache.roller.ui.core.RollerContext&amp;lt;/listener-class&amp;gt;&lt;br /&gt;&amp;lt;/listener&amp;gt;&lt;br /&gt;&lt;br /&gt;Removed both of these from the tld. I don't know why they are defined here, they exist in web.xml also, where they should be.&lt;br /&gt;&lt;br /&gt;Ok, start it again and see what happens now. Well, the application appear to do something more this time. Little better, got to see some errors in the logs now.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;em&gt;HibernateRoll F org.apache.roller.business.hibernate.HibernateRollerImpl TRAS0014I: The following excep&lt;br /&gt;tion was logged java.lang.VerifyError: (class: org/apache/roller/business/hibernate/HibernatePersistenceStrategy, method: &lt;init&gt;signature:&lt;br /&gt;(Ljava/lang/String;Ljava/lang/String;)V) Incompatible argument to method&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Ok, this means that the method being called has different arguments than what's being passed to it. Appeared to me that there might be two different versions of a class file in two different jars, and one, the old one is getting loaded first. Checked some obvious jars, found nothing suspicious. Let's fix the logging first.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Logging&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;I really wanted the log4j for roller working, so that I get the clue on what it is doing. So far, it was not creating the log file. Based on past experience with log4j, Apache commons-logging and WebSphere, I did this:&lt;br /&gt;Add to web.xml:&lt;br /&gt;&lt;br /&gt;&amp;lt;context-param id="ContextParam_id1"&amp;gt;&lt;br /&gt;&amp;lt;param-name&amp;gt;/log4jConfigLocation&amp;lt;/param-name&amp;gt;&lt;br /&gt;&amp;lt;param-value&amp;gt;/WEB-INF/classes/log4j.properties&amp;gt;&amp;lt;/param-value&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;br /&gt;Got to see my roller.log now :-)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Classloader issue? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Well, having worked with WebSphere and dealt with its nasty classloaders since version 3.x, I thought, lets try to change the classloader policy.&lt;br /&gt;So, the webapp's classloader policy is now set to PARENT_LAST. I did not want to do this, but nothing else was working.&lt;br /&gt;Ok, start it again, somewhat better.&lt;br /&gt;&lt;br /&gt;The VerifyError on Hibernate has gone now. Strange, I am not sure what it was conflicting with in parent.&lt;br /&gt;&lt;br /&gt;And, now, it comes with new problems, of course, classloader mode has changed, so you will have new problems.&lt;br /&gt;&lt;br /&gt;java.lang.LinkageError: Class org/xml/sax/EntityResolver violates loader constraints: definition mismatch between parent and child loaders&lt;br /&gt;at org.jdom.input.SAXBuilder.configureParser(SAXBuilder.java:608)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The xmlrpc-1.2-b1.jar &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There is org/xml/sax class files in this jar, which come with Java 1.4.2 also. easily tells you what the problem is. I removed all org/xml/sax class files from this jar keeping rest of them there.&lt;br /&gt;&lt;br /&gt;Recycle... let's see what happens now!&lt;br /&gt;&lt;br /&gt;New error:&lt;br /&gt;Could not find datasource: jdbc/rollerdb&lt;br /&gt;java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The jdbc2.0_ext.jar &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This problem I have seen many times, Easy, just delete this jar from WEB-INF/lib/. This is because websphere already has javax.sql.*.&lt;br /&gt;&lt;br /&gt;Ok, another recycle. See what it has got now:&lt;br /&gt;&lt;br /&gt;Could not obtain connection metadata&lt;br /&gt;java.sql.SQLException: null userid not supportedDSRA0010E: SQL State = null, Error Code = -99,999DSRA0010E: SQL State = null, Error Code = -&lt;br /&gt;99,999&lt;br /&gt;at com.ibm.db2.jcc.c.b.E(b.java:1975)&lt;br /&gt;at com.ibm.db2.jcc.c.b.a(b.java:1981)&lt;br /&gt;&lt;br /&gt;Ok, seen this before. That's my datasource. Need to use right authentication settings for container managed authentication. Fixed it, recycled it.&lt;br /&gt;&lt;br /&gt;Cool...... it started successfully. Very good. Lots of initializing messages. no errors. Let's see if we can access it now?&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:verdana;"&gt;JSTL 1.0 &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Nope, JSTL errors. Can't find the JSTL tags. I had dealt with this issue also in one of my other apps. Basically, the JSPs are using JSTL 1.1, but WebSphere 5.1 will support 1.0 version only.&lt;br /&gt;&lt;br /&gt;Ok, locate the file giving error, /taglibs.jsp. Replace the taglib uris-&lt;br /&gt;&lt;/span&gt;&lt;a href="http://java.sun.com/jsp/jstl/core"&gt;&lt;span style="font-family:verdana;"&gt;http://java.sun.com/jsp/jstl/core&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;with&lt;br /&gt;&lt;/span&gt;&lt;a href="http://java.sun.com/jstl/core"&gt;&lt;span style="font-family:verdana;"&gt;http://java.sun.com/jstl/core&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://java.sun.com/jsp/jstl/fmt"&gt;&lt;span style="font-family:verdana;"&gt;http://java.sun.com/jsp/jstl/fmt&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;with&lt;br /&gt;&lt;/span&gt;&lt;a href="http://java.sun.com/jstl/fmt"&gt;&lt;span style="font-family:verdana;"&gt;http://java.sun.com/jstl/fmt&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;And, replace the two jar files, standard.jar and jstl.jar with their 1.0 versions.&lt;br /&gt;&lt;br /&gt;Recycle, lets see if it is any better.......&lt;br /&gt;&lt;br /&gt;Nope..... ugly null pointer.&lt;br /&gt;&lt;br /&gt;RollerRuntimeConfig:getProperty - Trouble accessing property: site.shortName&lt;br /&gt;java.lang.NullPointerException&lt;br /&gt;at org.apache.roller.config.RollerRuntimeConfig.getProperty(RollerRuntimeConfig.java:67)&lt;br /&gt;at org.apache.jsp._tiles_2D_simplepage._jspService(_tiles_2D_simplepage.java:277)&lt;br /&gt;at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)&lt;br /&gt;&lt;br /&gt;Rest, we deal in part 2. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;By Rakesh Jain&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6087525184294050624-884133168752834509?l=premiertech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://premiertech.blogspot.com/feeds/884133168752834509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6087525184294050624&amp;postID=884133168752834509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/884133168752834509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6087525184294050624/posts/default/884133168752834509'/><link rel='alternate' type='text/html' href='http://premiertech.blogspot.com/2007/09/installing-roller-31-on-websphere-51.html' title='Installing Roller 3.1 on WebSphere 5.1 - Part1'/><author><name>Rakesh Jain</name><uri>http://www.blogger.com/profile/10430850289584443085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
