Recently i had to configure a development environment for a new project. Since it is interesting thought of posting it here.
Tools, etc used
Maven-AppFuse
SVN
TeamCity
Maven-AppFuse
This project is build using Maven with AppFuse. AppFuse is great to develop web application using java. With Maven its amazing. We used Struts 2,Spring, Hibernate. Since there is Maven pluging for AppFuse you can create a simple application in a minute. Also there are very good design pricipals they have used. Ether you can just use it or you can modify it. Struts 2 magic with Maven and Appfuse
SVN
Since the company having few issues with the CVS they decided to go with SVN for this new project. Intalling svn is not a big deal. Follow the steps here (SVN on CentOS). Some of the useful SVN commands also in there. Then you can add your project to it.
TeamCity
TeamCity used as the Continuous Integration server. Again this is also very easy thaks to jetbrains. Just download it and run the "runAll" script.
After installation you have to add projects to it. For that you can use the TeamCity Documentation. You have set your build tool (Maven/Ant,etc) and Version control system (SVN,CVS) and set build triggers.
Thursday, April 28, 2011
Tuesday, October 12, 2010
Really Good Articles
Here are two nice articles.
http://weblog.madebymonsieur.com/developers-should-know-how-what-and-why/
http://weblog.madebymonsieur.com/no-i-wont-do-it-it-would-not-be-professional/
Read n have fun
http://weblog.madebymonsieur.com/developers-should-know-how-what-and-why/
http://weblog.madebymonsieur.com/no-i-wont-do-it-it-would-not-be-professional/
Read n have fun
Thursday, August 12, 2010
Debugging techniques
Here are some debugging techniques which will be help full for java buddies.
1st the basic one putting system outs. This is not a good practice but if you don’t have any other way to check it then this might be the only option. But the most important thing is make sure to remove these system outs in the production code.
2nd instead of system outs you can use a logging tool like log4J. Using its functionalities you can put debug level logs and check the logging files. Here if you use good pattern for logging you can find all most all information you want to know. Like Class, line number, time and others.
3rd debug using the IDE. This will help to identify how the code works for each different scenario which you can do with your system. There are lots of features available to understand the behavior of the code. But some times you might have a problem if you are dealing with a multi-thread application. Because if different thread access you debugging point; you might be disconnected or mislead by it. So in those cases 2nd approach will be helpful. You can find more information related to this in your favorite IDE related documents.
4th Remote deguging. This is like 3rd but you can debug and application running remotely. For this what you have to do is enable debugging on the remote application. To enable this you have to pass Parameters to JVM saing which port is available to remote access. After you enable it what you have to do is connect to remote port using local code base and debug it.
1st the basic one putting system outs. This is not a good practice but if you don’t have any other way to check it then this might be the only option. But the most important thing is make sure to remove these system outs in the production code.
2nd instead of system outs you can use a logging tool like log4J. Using its functionalities you can put debug level logs and check the logging files. Here if you use good pattern for logging you can find all most all information you want to know. Like Class, line number, time and others.
3rd debug using the IDE. This will help to identify how the code works for each different scenario which you can do with your system. There are lots of features available to understand the behavior of the code. But some times you might have a problem if you are dealing with a multi-thread application. Because if different thread access you debugging point; you might be disconnected or mislead by it. So in those cases 2nd approach will be helpful. You can find more information related to this in your favorite IDE related documents.
4th Remote deguging. This is like 3rd but you can debug and application running remotely. For this what you have to do is enable debugging on the remote application. To enable this you have to pass Parameters to JVM saing which port is available to remote access. After you enable it what you have to do is connect to remote port using local code base and debug it.
Tuesday, April 6, 2010
Speed Broadband for Firefox
Here's something for broadband people that will really speed Firefox up:
* Type "about:config" into the address bar and hit return. Scroll down and look for the following entries:
network.http.pipelining
network.http.proxy.pipelining
network.http.pipelining.maxrequests
Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.
* Alter the entries as follows:
Set "network.http.pipelining" to "true"
Set "network.http.proxy.pipelining" to "true"
Set "network.http.pipelining.maxrequests" to some number like 30. This means it will make 30 requests at once.
* Lastly right-click anywhere and select New-> Integer. Name it "nglayout.initialpaint.delay" and set its value to "0". This value is the amount of time the browser waits before it acts on information it recieves.
If you're using a broadband connection you'll load pages MUCH faster now..
This really work for me.
* Type "about:config" into the address bar and hit return. Scroll down and look for the following entries:
network.http.pipelining
network.http.proxy.pipelining
network.http.pipelining.maxrequests
Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.
* Alter the entries as follows:
Set "network.http.pipelining" to "true"
Set "network.http.proxy.pipelining" to "true"
Set "network.http.pipelining.maxrequests" to some number like 30. This means it will make 30 requests at once.
* Lastly right-click anywhere and select New-> Integer. Name it "nglayout.initialpaint.delay" and set its value to "0". This value is the amount of time the browser waits before it acts on information it recieves.
If you're using a broadband connection you'll load pages MUCH faster now..
This really work for me.
Saturday, May 9, 2009
Spring PropertyPlaceholderConfigurer
Here is the code to use PropertyPlaceholderConfigurer with XMLBeanFactory
XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("test.xml"));
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
cfg.setLocation(new ClassPathResource("jdbc.properties"));
// now actually do the replacement
cfg.postProcessBeanFactory(factory);
MyBean bean = (MyBean)factory.getBean("myBean");
System.out.println(bean .getProperty());
XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("test.xml"));
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
cfg.setLocation(new ClassPathResource("jdbc.properties"));
// now actually do the replacement
cfg.postProcessBeanFactory(factory);
MyBean bean = (MyBean)factory.getBean("myBean");
System.out.println(bean .getProperty());
Thursday, May 7, 2009
Struts common configurations
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
Wednesday, February 11, 2009
Eclipse class change error
While I am using Eclipse I got this error few times and do lots of things finally I clear my eclipse Workspace it works.
Sunday, December 21, 2008
Unit testing with mocking (JMock)
After a long time I thought to write again in my blog :). Because I got a good experience by writing unit tests with mocking (hoping to share it with you all).
Earlier what I did was try to write Unit testing with using all other 'Active' services. Here what I meant from this 'Active' is, with out using Mock objects I used real EJB and other services. Actually it was a very cruel and bad practice( what I am thinking now :), and it is Integration testing not unit testing :) ). Because if there is a problem with the services which we used, our time will waste on that. ( Remember here I am talking about Unit Testing not about Integration Testing). And if you have to work in a an existing system where you are a new fellow for it, You have to think and understand those other services which will be more time consuming. (Again I am totally agree with you if u say it is good to understand those services as well but first thing is we have to write a correct code.. keep in mind Unit Test).
So a Best thing is Mocking the all other dependent services and test our code as a single Unit. When all the unit tests are passing correctly we know that our single unit is working expectedly.
To mock our dependent services we use Jmock http://www.jmock.org/jmock1.html. It will make our life more easier. These were minor issues but still I think its very good for Unit Testing.
Expecting your comments...
Earlier what I did was try to write Unit testing with using all other 'Active' services. Here what I meant from this 'Active' is, with out using Mock objects I used real EJB and other services. Actually it was a very cruel and bad practice( what I am thinking now :), and it is Integration testing not unit testing :) ). Because if there is a problem with the services which we used, our time will waste on that. ( Remember here I am talking about Unit Testing not about Integration Testing). And if you have to work in a an existing system where you are a new fellow for it, You have to think and understand those other services which will be more time consuming. (Again I am totally agree with you if u say it is good to understand those services as well but first thing is we have to write a correct code.. keep in mind Unit Test).
So a Best thing is Mocking the all other dependent services and test our code as a single Unit. When all the unit tests are passing correctly we know that our single unit is working expectedly.
To mock our dependent services we use Jmock http://www.jmock.org/jmock1.html. It will make our life more easier. These were minor issues but still I think its very good for Unit Testing.
Expecting your comments...
Wednesday, May 28, 2008
Google hosting service
Google has announced pricing for its App Engine service for web application hosting, offering a free entry level service and then charging for storage of more than 500MB of data. Read More
Sunday, May 25, 2008
A Java answer to Mambo/Joomla/Drupal?
dotCMS recently released version 1.6, a mature and actively developed open source wCMS written entirely in Java. dotCMS is easy for web developers to grok, provides total flexibility in template design/content delivery and uses an architecture that is extendable and developer friendly. It was even runner up in PacktPub's most promising new open source CMS awards. Why hasn’t anyone in the Java community heard of it? [Editor's note: because we have?]
I often see posts asking about a Java equivalent of the popular PHP CMSes like Mambo, Joomla or Drupal. Java shops are looking for a web management solution that marry familiar technologies and architecture with ease of use. These shops need a solution that can be integrated with legacy and enterprise systems. And while there are literally hundreds, if not thousands of open source php+MySQL CMS solutions, there are far fewer true Java CMS options. Read More
I often see posts asking about a Java equivalent of the popular PHP CMSes like Mambo, Joomla or Drupal. Java shops are looking for a web management solution that marry familiar technologies and architecture with ease of use. These shops need a solution that can be integrated with legacy and enterprise systems. And while there are literally hundreds, if not thousands of open source php+MySQL CMS solutions, there are far fewer true Java CMS options. Read More
Learn about the server-side capabilities of OpenOffice.org
As functionality traditionally associated with desktop applications moves to the Web, developers are looking for new ways to handle that computational heavy lifting on the server side. But if you need to create a Web-based application that behaves like an office suite, there's no need to reinvent the wheel: the open source OpenOffice.org suite can actually serve as the powerhouse behind a Web application. In this article, you'll learn how to combine OpenOffice.org and Dojo to create a simple Ajax-based spreadsheet application much like Google Spreadsheets. Read More
25% of web projects over budget
A quarter of web projects fail to meet their budgets, and 31 percent are delivered late, according to a new report.
The main factors affecting projects are frequently changing requirements, too many stakeholders having a say in the matter, and not enough budget or time being allocated, the report said.
Some 21 percent of projects fail to meet stakeholder requirements, according to a survey of 100 IT managers and directors, conducted by Ruby on Rails software developer New Bamboo.
About half of web projects are run by in-house development teams, and 28 percent are outsourced to third parties, the survey found.
Damien Tanner, co-founder of New Bamboo, said it was critical businesses did not accept failings, even in the development processes for smaller projects.
“The end goal is to deliver business value - yet rigid requirements make it difficult to react to the changes that inevitably occur as knowledge and environments evolve,” he said. “Requirements that have been omitted are generally picked up late in the process - by which time they are awkward and costly to implement.”
What's more, failings were set to become more prominent as businesses attempted to develop complex projects such as social networking, e-commence and web 2.0 sites, the survey concluded. Read More
The main factors affecting projects are frequently changing requirements, too many stakeholders having a say in the matter, and not enough budget or time being allocated, the report said.
Some 21 percent of projects fail to meet stakeholder requirements, according to a survey of 100 IT managers and directors, conducted by Ruby on Rails software developer New Bamboo.
About half of web projects are run by in-house development teams, and 28 percent are outsourced to third parties, the survey found.
Damien Tanner, co-founder of New Bamboo, said it was critical businesses did not accept failings, even in the development processes for smaller projects.
“The end goal is to deliver business value - yet rigid requirements make it difficult to react to the changes that inevitably occur as knowledge and environments evolve,” he said. “Requirements that have been omitted are generally picked up late in the process - by which time they are awkward and costly to implement.”
What's more, failings were set to become more prominent as businesses attempted to develop complex projects such as social networking, e-commence and web 2.0 sites, the survey concluded. Read More
Sunday, March 23, 2008
Microsoft working with Eclipse on Vista apps
Microsoft and the Eclipse Foundation have announced they are working together to enable use of Eclipse technology to build Java applications for Windows Vista.Other possible collaborations also were cited. Ramji said he and Milinkovich have talked about Microsoft building a C# IDE at Eclipse.do you want more...
Monday, January 28, 2008
Past Present and Future of the JAVA
If you are New or a Master in java here is a very nice tutorials. read it.........
Past Present and Future of the JAVA
Past Present and Future of the JAVA
Monday, December 31, 2007
Monday, December 24, 2007
Free scjp 1.5 ( 5 ) mock exam
There are explanations for most of the questions (99%). But in some questions answers are bit different (Eg: compiler warning as compile errors). Again this is really very good mock exam. download exam. Read more…. click here
Wednesday, November 21, 2007
java SFTP API
this is a good java API for SFTP. and it is free. there is no help document for this, but it is easy to use.(if any one have a doc please let us know )
http://sourceforge.net/projects/jsch/
http://sourceforge.net/projects/jsch/
Monday, November 19, 2007
Subscribe to:
Posts (Atom)