Friday, October 10, 2008

Plesk Apache-Tomcat

I am first time Plesk user. I thought it will help me to speed up my configuration process but it wasn't as quick as I thought. First I installed tomcat and then created domain using Plesk. I started modifying httpd.conf with mod_jk module to redirect request to tomcat via ajp13. But it just didn't work. After few trial-error and with help of GOOGLE, I found that Plesk uses different configuration files for apache configuration. So, modify httpd.conf doesn't help. Go to plesk /vhosts/conf directory and you will see httpd.include directory. But don't modify that file. Just read the comment and you will find that you need to create new vhost.conf file to do any custom setup.

After I did that setup, I tried few different things but that just didn't work because httpd.include doesn't include vhost file by default so, once you create vhost.conf then you will have to run

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name= command. That will modify httpd.include to include vhost.conf

Once you setup workers.properties and JkMount setup in your vhost.conf then Apache to Tomcat connection will work.

Monday, October 06, 2008

JMS


Technique to keep clustered environment in-memory chance in sync


http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk6.html

Wednesday, September 03, 2008

Wednesday, August 13, 2008

Medowlake Reflection


Medowlake Reflection, originally uploaded by ShahStudio.

Medowlake View


Medowlake View, originally uploaded by ShahStudio.

This picture was taken at Medowlake Botanical Garden. www.nvrpa.org/parks/meadowlark/index.php. It is really very scenic and nice place to take snaps.

Sunday, August 03, 2008

Wednesday, July 23, 2008

Sunday, May 18, 2008

SVN Authorization Setup - Windows

1. Install Tortoise SVN
2. Create repository directory e.g c:\MyProject
3. Right click on C:\MyProject -> Select Tortoise SVN -> create new repository

That will create default files to enable SVN repository

4. Go to C:\MyProject\conf\ and open svnserve.conf file and uncomment following lines

auth-access = write
password-db = passwd
realm = My First Repository

5. Go to C:\MyProject\conf\ and open passwd file and add users

e.g.
[users]
user1 = user1pwd
user2 = user2pwd

Friday, May 02, 2008

Oracle AS Blog


It is hard to find good documentation on Oracle AS. If you search on oracle site then you get thousand links in your search result and then it is your job to find which document is useful ( If you are OracleAS user then you know what I am talking ;) )

Mike Lehmann blog is very useful for Oracle AS users  http://mike-lehmann.blogspot.com

AQ Detail

http://mike-lehmann.blogspot.com/2006/09/simple-mdb-with-oracle-database-jms.html

Thursday, May 01, 2008

Ruby scaling issue

This is breaking news for me :) I have discussed with few of you that I have doubt about scaling Ruby on Rail Apps

Twitter is thinking to move to Java or PHP due to scaling issues.

http://www.techcrunch.com/2008/05/01/twitter-said-to-be-abandoning-ruby-on-rails/

Only time will tell whether Twitter is having problem due to the way Ruby works or whether their code has design problem.

Well still there are many Ruby fans who are moving from Java to Ruby.

To me - If you like to learn new things then learn Ruby. Ruby is fun but don't use it for any enterprise level apps. Java is proven technology so, I think it is better to stay away from Ruby for sometime and let someone else take a risk :)

Hacker Arguments

http://news.ycombinator.com/item?id=178917

Version Control

Many version control systems are available in market. I have used quite a few during my IT carrier. Version control is very important part of every project and it makes sense that people are coming up with new version control systems to fix existing issues.

Today I came across blog which is giving some detail about GIT. First time I heard but it seems like it is not that new and it seems better than SVN. Which version control system are you using?

GIT vs SVN

http://www.russellbeattie.com/blog/distributed-revision-control-systems-git-vs-mercurial-vs-svn


GIT

http://www.kernel.org/pub/software/scm/git/docs/user-manual.html

http://github.com/guides

Quote From Christopher Morley

Read, every day, something no one else is reading. Think, every day, something no one else is thinking. Do, every day, something no one else would be silly enough to do. It is bad for the mind to be always part of unanimity.
-
Christopher Morley

Tuesday, April 29, 2008

Ruby Ajax.Autocompleter with callback


To implement dynamic autocomplete with additional parameter


1. Include


                <%= javascript_include_tag :defaults%>
                    <script src="/include/prototype.js" type="text/javascript"></script>
                        <script src="/include/scriptaculous.js" type="text/javascript"></script>

     prototype.js & scriptaculous.js are available on http://wiki.script.aculo.us/


2.
        <input type="text" id="autocomplete" name="attribute_lookup"/>
        <div class="autocomplete" id="attribute_lookup_auto_complete"></div>
        <%= javascript_tag("new Ajax.Autocompleter('autocomplete', 'attribute_lookup_auto_complete','/server/url', { fullSearch: true, frequency: 0, minChars: 1, callback: eventDateCallback});")%>


3.


Write javascript to handle callback

<SCRIPT language=javascript>

function eventDateCallback(element, entry) {

return entry + "&additionalParam=" + document.myForm.additionalparam.value;
}

</SCRIPT>


4. 

Add autocomplete CSS

  div.autocomplete {
      position:absolute;
      width:250px;
      background-color:white;
      border:1px solid #888;
      margin:0px;
      padding:0px;
    }
    div.autocomplete ul {
      list-style-type:none;
      margin:0px;
      padding:0px;
    }
    div.autocomplete ul li.selected { background-color: #ffb;}
    div.autocomplete ul li {
      list-style-type:none;
      display:block;
      margin:0;
      padding:2px;
      height:32px;
      cursor:pointer;
    }


5.

Add method in controller which returns array of string

6.

Implement view for returned items. Return list should looks like e.g.

<ul>
   <li>Item1</li>
   <li>Item2</li>
</ul>



       

Saturday, April 26, 2008

Soccer day for 3 year old

Its hard to handle one kid in open ground but this coach is really handling bunch of little monkeys very easily.

Friday, April 25, 2008

Are you using FriendFeed ?

My FriendFeed address is http://friendfeed.com/jigneshshah

Send Attachment over SOAP - Passing files to WebService ( Steps for JDeveloper )

Pre-req: Create Workspace and a project inside that workspace with index.html

1. Write an implementation class with method which takes AttachmentPart as an input

public String processAttachment(int id,
AttachmentPart attachment) throws RemoteException {

try {


Object attachmentObj = attachment.getContent();

//Add code to process input attachment

} catch (Exception se) {
//Exception handling
}


return "Test";

}

2. Go to File->New->Business Tier->Web Services and select Java Web Services (J2EE 1.4 or 1.3 version) and click OK

3. Go to Next

4. Give "Web Service Name" e.g MyTestWebService

5. Select your implementation class

6. Click Next

7. Click Next

8. Click Next

9. Click Next

10. Select your method e.g processAttachment to expose as webservice.

11. Finish ( This will generate WSDL and all related classes )

12. Now go to your WebService in "System Navigator"

13. Right Click on WebService (MyTestWebService) and click on Generate WebService Proxy

14. Select "Run against a service deployed to an external server" radio button and click OK.

15. Run your project

16. Go to ....SoapHttpPortClient.java and add following method

public AttachmentPart getAttachmentPart() throws RemoteException {

AttachmentPart impl = null;
try {
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
//change file://c:\\a.txt to a file you want to attach
impl =
message.createAttachmentPart(new DataHandler(new URL("file:\\C:\\a.txt")));
// add attachment to message
message.addAttachmentPart(impl);

} catch (SOAPException ex) {
return null;
} catch (Exception ex) {
return null;
}
return impl;
}

and call that method from main(). It will look like

public static void main(String[] args) {
try {
MyTestWebServiceSoapHttpPortClient myPort =
new MyTestWebServiceSoapHttpPortClient();

myPort.processAttachment(0, myPort.getAttachmentPart());
// Add your own code here

} catch (Exception ex) {
ex.printStackTrace();
}
}

17. Run Your Client to test your webservice

Note: JDeveloper is generating .wsdl and ..Stub.java with port 8888. If your embedded oc4j is running on different port then you will have to modify .wsdl and ..Stub.java

Give a try. Good Luck!

Thursday, April 24, 2008

SLC Apt view


View Larger Map

My First job in the US was in Salt Lake City. I was staying in this apt. complex.

Deal with desi news sites

We All desi likes to read news very regularly. But sites like timesofindia.com and rediff.com are just a junk. Best way to deal with those popups is to install firefox

1. Go to http://www.mozilla.com/en-US/firefox/ and download
2. Download Adblock Plus https://addons.mozilla.org/en-US/firefox/addon/1865
3. Subscribe to any one adblock plus default list..

Hope that helps :)

Shril's Picture

Posted via email.

Testing : Fitnesse - Selenium

Read Anubhav's blog for fitnesse with selenium

http://anubhavas.blogspot.com/2008/03/jump-start-fitnesse-with-selenium.html

Many to Many relations in Ruby

http://jrhicks.net/Projects/rails/has_many_and_belongs_to_many.pdf explains how to handle many to many relations between two models.

But if you want to store more information into your relational table then you have to use has_many through..
http://wiki.rubyonrails.org/rails/pages/Beginner+Howto+on+has_many+:through

Maven Internal Repository Management

1. Setup Apache and change httpd.conf to point to .m2 repository location

2. To manage local repository - Download http://www.jfrog.org/sites/artifactory/latest/ and Deploy artifcatory on Tomcat

3. Modify user's setting.xml ( under .m2/repository..) to point to local repository rather than external repository

Anti Virus

If you don't wanna buy anti virus then best free one is

Go to http://www.free-av.com/en/download/index.html and download (Avira AntiVir Personal - FREE Antivirus)

I am using it for sometime and so far I am happy with it.

Maven With JDeveloper

By default Maven doesn't work with JDeveloper but there are few ways to make it work.

Steps

Follow http://www.oracle.com/technology/products/jdev/howtos/1013/maven/maven.html

1. Create Maven Project

2. Run

mvn org.apache.myfaces.trinidadbuild:maven-jdev-plugin:jdev

to generate .jpr file

3. Go to JDeveloper and create new workspace

4. Add maven project .jpr into workspace

5. If you have ejb in your project then go to project properties (right click on your project and select project properties)

6. Select EJB Module option and set ejb-jar.xml path

Startup Motivation Fuel.

http://www.foundersatwork.com/joel-spolksy.html
Livingston: What advice would you give to a programmer who's thinking about starting a company?

Spolsky: I've got a lot: [laughs] Don't do it. It's going to suck. You're going to hate it. Can I steal one from Paul? Don't start a company unless you can convince one other person to go along with you. If you don't have two people (or I would even say three) that you've convinced to devote their lives to doing this, it's just going to be a different thing. There are a lot of programmers that are very tentative about starting their own companies. There are a lot of working programmers doing something they hate, with some company that they hate, but they need money to pay the mortgage. So they figure, "I'll develop something in my spare time. I'll put in 1 hour every night and 2 hours on the weekends and I'll start selling it by downloads." And you say to them, "Who's your cofounder?" And they say, "My significant other—husband or wife. My cat." But because they never really take the leap and quit their job, they can give up their dream at any time. And 99.9 percent of them will actually give up their dream. If they take the leap, quit their job, go do it full-time—no matter how much it sucks—and convince one other person to do the same thing with them, they're going to have a much, much higher chance of actually getting somewhere. Because they either have to succeed or get a job. Sometimes "succeed" seems like the easier path than actually getting a job, which is depressing. So quit your day job. Have one other founder, at least. I'd say that's the minimum bar to getting anywhere.