Skip to main content

Posts

Showing posts with the label java

Error while configuring Spring with FreeMarker

Today I got a strange problem while configuring FreeMarker with Spring . The project compiles well without any error. All seems to be fine. When I tried to run the application strangely I got following error: Spring in Action, 4ed (Manning) java.lang.NoSuchMethodError: freemarker.template.Configuration. Lfreemarker/template/Version;)V Now for struggling and googling for around one hour I got the answer :) Instant FreeMarker Starter I am using Spring 4.3.5.RELEASE and FreeMarker 2.3.20 before I found the answer. This isstrange but the actual problem lies with the version compatibility of FreeMarker with Spring . It seems that Spring had some issues with FreeMarker . After changing the FreeMarker version from 2.3.20 to 2.3.23 all works fine. Hope this solution help the developers out there configuring FreeMarker with Spring. Enjoy coding!

AWS S3 processing with JetS3t library

In this post we will see how we can use the Amazon AWS S3 to store objects. We will be using the JetS3t library to process our objects.  JetS3t  library also known as Jet Set, is widely used for processing the AWS S3 i.e. Amazon Web Services, Simple Storage Service . Before working on AWS S3, you need to have a valid account on AWS with S3 key and S3 password. You can register here  free of cost. Amazon Web Services in Action (MANNING) Here we will using 4 API of jets3t i.e. Upload a document Download a document Listing of documents Delete a document We will upload images of user on S3 and then process them as specified above. Upload : to upload image to the S3 we will be using putObject () method of the S3Service class. Download : To download image we will be using getObject () method of S3Service class. List : To list images we will be using listObjects () method of S3Service class. Delete : To delete image we will be using deleteObjects () method of S3

IndicThreads '16 - Day 2

In my previous post  I had given details about the first day of the IndicThreads conference. Today I will try to cover sessions for 2nd day. The day was full of excitement as I have learned many new things. Sessions for today includes Go Language, HTTP/2, MicroServices, RxJava(Reactive Programming), Bitcoin and Blockchain. Go Language with Angular In this session Navneet Karnani , from Mandrake Technologies defines the scope of the Go language. He started with why we need a new language and how it can be used. He said that Go is a compiled language and it is also Open Sourced, so anybody can see code and change it to make it more better. Session is full of code and I swear it takes a lot of effort for him to make a such a great session on Go. This session is break in 2 parts where in first part he explains about the nuisances of language and in second part he shows the integration with AngularJS RxJava, Reactive Programming Praveer Gupta , from ThoughWorks who had given sess

JUnit issue with Eclipse and Maven

In this post I am trying to resolve one issue of JUnit with Eclipse and Maven. Sometimes while using JUnit with Eclipse and Maven we have to face certain issues. And one of them is whenever we try to run the independent test case it will run fine and will not give any type of error. But when we run to try to compile the whole project, the same test will not compile at all. This is an annoying issue if someone does not know about the functionality of how Eclipse works with JUnit and Maven. JUnit in Action Since there is such no exception seen in file, but project compilation fails due to same file it is very frustrated for developer to figure out the issue. I am facing this issue and found a solution by googling around many forums. Problem : You have created a JUnit test case in the project and it is running fine, but fails to compile the whole project when try to build using Maven. Solution : Check that the test case you have created exist in the src/test/java folder and no

Java Bloggers Meet Oracle IDC Hyderabad

Oracle India had organized a Java Bloggers meet on 13th Jun 2015, at their office at Hyderabad on the occasion of Java completing 20 years. I was also invited to the event which is very exciting for me. I am on cloud nine when I got invited for the event. Oracle India had celebrated the event by organizing speeches by Sanket Atal - Group Vice President, R&D, Harshad Oak - Java Champion and Oracle ACE Director, and a live demonstration by Debraj Dutta , of a Bot-So a robot designed by Edifixio India and is based on IoT and fully developed using Java 8 features like streams for concurrency. Event started by Vandana Shenoy - Director Corporate Communications , by giving a small introduction about the event and a formal introduction of the speakers. Sanket Atal The presentation by him is more like a discussion. We have discussed and have fun question answers, quiz in between it. Below are the points he discussed: Java was started in 1991 under the name Project Stealth

20 year celebration of Java

We at Chandigarh celebrated Java's 20th birthday on 23rd May. This was the first time that @ChdJUG had celebrated this event. It is very enjoyable and memorable event. We had enjoyed a lot and cut a special cake on this occasion.  We hope to increase our community at Chandigarh and next year I am sure it will be bigger one :) You can follow me on Twitter @vinodkashyap and Chandigarh JUG @ChdJUG for more updates. 

RESTful Web Services - POST, PUT, GET, DELETE

Web services are very common these days as everything or most of the implementation is now API based. Every social network is providing API for fetching their data. Like if you take a case of TWITTER, it provides it's API to fetch different data related to user or for analytic. There are 2 types of web services namely: SOAP REST SOAP is based on WSDL and return data in XML format. But I will not talk about it here. I will be discussing about REST , an acronym for RE presentational S tate T ransfer methods. RESTful web services are very simple to learn and implement. They are basically stateless. It is based on HTTP URI and everything is implemented using URL. In this post I will explain about the four methods that are used with REST. POST PUT GET DELETE Let's dive deep into each of these methods of the REST. RESTful Java Web Services: Master Core REST Concepts and Create RESTful Web Services in Java POST It is used for creating a new entity. It is basically us

Singleton Pattern revisited

As the name suggest, Singleton Pattern restricts to the creation of one and only one object of a class. This is very useful whenever we want to restrict the creation of an object to single instance . This is very small and sweet type pattern that is used in many cases. Let's take an example and see how it is used in the code public class SingleObject { private static SingleObject singleObject; private SingleObject() { } public static SingleObject createInstance() { if (singleObject == null) { singleObject = new SingleObject(); } return singleObject; } } Line by line explanation Line 2 : creates private instance of the class Line 4 : constructor is private, so that no outer class can create object of this class Line 7 : creating a static method to get an instance of the class. We have defined method as static so that we don't need to create a object to call this method. Since it is static we can call this method by name of the class i.e. SingleO

IndicThreads Java Conference 2010

This is my second consecutive Java conference from IndicThreads. Here are some of the topics and the speakers who had share their valuable information. The conference is great and I recommend all to visit it once and see the difference Harshad Oak Harshad is the man of few words. He is the organizer and owner of the indicthreads conference. He is the Java Champion and Oracle Ace. He started conference with the topic Java: Riding the Change where he discusses the changing the nature of the Java. What is around the corner and what Java guys need to be in mind in the coming time. He discusses the language changes and the Oracle view on the Java. He had given his experienced thought on the many of the scripting languages like groovy, jython etc. He clarifies that the place of Java is more superior to any of the other languages. Java superiority will be continued. He had also told about the 5 - 95 rule which says that 5% of the people think java will be lost in the near future an

IndicThreads.com Conference On Java

IndicThreads.com Conference On Java is going to held on 11th and 12th Dec '09 at Pune, India. This is very intersting event especially for java passioniors and lovers. You can join the conference by visiting the website http://j09.indicthreads.com/ or clicking on the logo on the right side of this page displaying the event like this. I hope you will enjoy the event and the future of java and many other intersting technologies. I love to be there.

"Java Is Dead, Long Live Java!" – The Future of Java

"Java Is Dead, Long Live Java!" – The Future of Java — 'Because of its prominence,' writes Bryan Taylor, 'Java gets a lot of attention and with it much criticism, some of it valid.' What many may not realize, Taylor notes, is that some big breakthroughs have arrived and that the Java development landscape is solving important problems. In this column he takes a view of where Java is going to go in the next year or two as these ideas gain traction. Trackback URL :  Click Here

Java Code Names

Yesterday I was crawling web and found some intersting things about java. Firstly when java was release its name is Oak. After some time the creator of java found the name Java . I found some of the intersting things like the code names of the reeases of the java which I am going to describe below. VERSION CODE NAME RELEASE DATE Version Description of Code Name Code Name Date of Release JDK 1.1.4 Sparkler Sept 12, 1997 JDK 1.1.5 Pumpkin Dec 3, 1997 JDK 1.1.6 A female character in Bible Abigail April 24, 1998 JDK 1.1.7 Roman cognomen used by several politicians Brutus Sept 28, 1998 JDK 1.1.8 Name of a person/Football club Chelsea April 8, 1999 J2SE 1.2 Playground Playground Dec 4, 1998 J2SE 1.2.1 (none) March 30, 1999 J2SE 1.2.2 Cricket July 8, 1999 J2SE 1.3 Kestrel May 8, 2000 J2SE 1.3.1 Ladybird May 17, 2001 J2SE 1.4.0 Merlin Feb 13, 2002 J2SE 1.4.1 Hopper Sept 16, 2002 J2SE 1.4.2 Mantis June 26, 2003 J2SE 5.0 (1.5.0) Tiger Sept 29, 2004 Java SE 6 Mustang Java SE 7 Dolphin You

Performance Increase

Many of us passes through the same situation of having a low performance of our application. But if you follow some of the tips and tricks below you will soon realize the increase in the performance. Collections Always assign size to ArrayLists and other collections. Ex: Collection c = new ArrayList(10); Strings Always use String abc = "I love Java";instead of String abc = new String("I love Java"); JDBC Always close these statements after use: < Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection("databaseUrl","username","password"); Statement stmt = conn.createStatement(); String strSql = "select * from abc"; ResultSet rs = stmt.executeQuery("strSql");// close these stmt.close(); rs.close(); conn.close(); strSql=null; Use only the required columns in select query: Select FIRSTNAME,LASTNAME from PERSON; instead of Select * from Person; JSP

Everywhere Java

Java is everywhere from your shoes to mars and from mobiles to big dream machines and from your favorite bike to space shuttles. You can't even escape Java if you are a programmer or a developer.