Coming soon...
Java Is My Passion
Be as a Java Professional.
Popular Posts
-
Here’s the best 20 Java websites in my collections, which provides latest Java news, articles and tutorials. If you have other great Jav...
-
Here are the top 8 Java people, they’re created frameworks, products, tools or books that contributed to the Java community , and change...
-
Coming soon...
-
There are 10 Exceptions that come freequently in real time usuage. 1.NullPointerEexception. -If we are trying to access a members(...
-
Exception in thread "main" java.lang.UnsatisfiedLinkError: no cb in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.jav...
-
JNDI stands for Java Naming and Directory interface . It is a specification and API that can be used to access any type directory servi...
-
If you get the exception java.lang.OutOfMemoryError: PermGen space we need to set the following environment variable as follows. Goto My...
-
Issue 1. Sometimes we need to find out what is our Tomcat version installed in our server . We can check Tomcat version with following...
-
Coming soon.....
Wednesday, June 1, 2011
Thursday, February 17, 2011
JNDI Introduction
JNDI stands for Java Naming and Directory interface. It is a specification and API that can be used to access any type directory service. For example, a particular implementation of JNDI specification can be used to access the LDAP Repository. JNDI is used heavily by the J2EE Applications to store Application specific data and business objects.
Imagine the case of a J2EE Application, where it is having a Web module and a EJB Module. A Web module is used to handle the Http Request from the Browser client, process it and then will return the Http Response back to the client. It basically will contain a collection of Servlet components and JSP's. The Web module may use the EJB module for accessing the Enterprise Beans for data manipulation. Suppose, say that we want to store data that is common to both Web and EJB Module. Where we can store this information, in the Web Module or in the EJB Module?. It doesn't make sense to store the data in any of the Modules, because the data is a common data and it is not particularly restricted to any of the Modules.
Here comes the JNDI Repository. The Application Server Container will provide an implementation for the JNDI Repository for storing the global data (data that is common across the modules) and the clients (either the Enterprise Beans, or the Servlets or even the Application client) can use the JNDI API to query the information available in the JNDI Repository. It is also possible to store the Business Objects (like Session Beans, Message Driven beans) in the JNDI Repository. In this case, a Servlet may be the client in getting a reference to the Enterprise Bean from the Repository. It is not necessary for an Application Developer to manually store the Business Objects into the JNDI Repository as the Container will take care of all these things, like constructing the JNDI Tree, storing the Business objects etc.
Monday, February 7, 2011
java.lang.UnsatisfiedLinkError
Exception in thread "main" java.lang.UnsatisfiedLinkError:
no cb in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1413)
at java.lang.Runtime.loadLibrary0(Runtime.java:775)
at java.lang.System.loadLibrary(System.java:835)
at codebase.Code4jni.<init>(Code4jni.java:61)
at test.main(read.java:10)This exception occurs when creating a new Code4jni object with CodeBase for the Java Programming Language. The exception occurs because the CodeBase native library (DLL on Windows) cannot be found. On UNIX and other systems, it can also be caused by a version difference between the run-time libraries on the system and the run-time libraries associated with with pre-built CodeBase native libraries. In addition, the -Xbootclasspath option will cause this.Solution (Windows)
Locate the DLL32 folder. This folder should contain one or more DLLs. Each of these DLLs represents an index file format (FoxPro, dBASE, Clipper). Select the DLL that corresponds to your preferred index format. Rename that DLL to cb.dll and place it in your the library path. To determine your library path, you can run this piece of code:class getLibraryPath
{
public static void main(String[] args)
{
String path = System.getProperty("java.library.path");
System.out.println(path);
}
}Explaining java.lang.OutOfMemoryError: PermGen space
If you get the exception java.lang.OutOfMemoryError: PermGen space
we need to set the following environment variable as follows.
Goto MyComputer - RightClick->Advanced tab- RightClick->EnvironmentVariables -RightClick->
SystemVariable-> Click on New button
and add the below.
Variable name is JAVA_OPTS and
Variable Value is -Xms1024m -Xmx1024m -XX:MaxPermSize=128m
we need to set the following environment variable as follows.
Goto MyComputer - RightClick->Advanced tab- RightClick->EnvironmentVariables -RightClick->
SystemVariable-> Click on New button
and add the below.
Variable name is JAVA_OPTS and
Variable Value is -Xms1024m -Xmx1024m -XX:MaxPermSize=128m
Thursday, January 27, 2011
Tuesday, January 25, 2011
Top 10 Exceptions In Real Time
There are 10 Exceptions that come freequently in real time usuage.
1.NullPointerEexception.
-If we are trying to access a members(data variables or methods) of a class by using an object of the class,which has null reference.
Eg: public class NPETest{
public static void main(String[] args){
NPETest reference = null;
reference.display();
// this statement will throw NullPointerException.
}
public static void display(){
// some code goes here...
}
}
2.ClassCastException.
3.NumberFormateException.
4.ArrayIndexOutOfBoundsException
1.NullPointerEexception.
-If we are trying to access a members(data variables or methods) of a class by using an object of the class,which has null reference.
Eg: public class NPETest{
public static void main(String[] args){
NPETest reference = null;
reference.display();
// this statement will throw NullPointerException.
}
public static void display(){
// some code goes here...
}
}
2.ClassCastException.
3.NumberFormateException.
4.ArrayIndexOutOfBoundsException
Best 20 Java websites
Here’s the best 20 Java websites in my collections, which provides latest Java news, articles and tutorials. If you have other great Java websites, please leave a comment to share with others.



















1. O’Reilly Java

URL : http://www.onjava.com/
Since : 10-feb-2000
Rss : http://www.oreillynet.com/pub/feed/7?format=rss2
Description : O’Reilly’s, contains latest Java technology news, quality code snippets, full example and detail explanation.
Since : 10-feb-2000
Rss : http://www.oreillynet.com/pub/feed/7?format=rss2
Description : O’Reilly’s, contains latest Java technology news, quality code snippets, full example and detail explanation.
2. Sun Developer Network (SDN)

URL : http://java.sun.com/
Since : 19-mar-1986
Rss : http://developers.sun.com/rss/java.xml
Description : The official Java developer website, always get the latest Java related news here.
Since : 19-mar-1986
Rss : http://developers.sun.com/rss/java.xml
Description : The official Java developer website, always get the latest Java related news here.
3. Developer.com

URL : http://www.developer.com/java/
Since : 21-dec-1995
Rss : http://www.developer.com/icom_includes/feeds/developer/dev-25.xml
Description : Java news and articles in developer.com
Since : 21-dec-1995
Rss : http://www.developer.com/icom_includes/feeds/developer/dev-25.xml
Description : Java news and articles in developer.com
4. Java.net

URL : http://www.java.net/
Since : 18-jun-1997
Rss : None
Description : The Java community website hosted by Oracle.
Since : 18-jun-1997
Rss : None
Description : The Java community website hosted by Oracle.
5. IBM’s Developerworks

URL : https://www.ibm.com/developerworks/java/
Since : 19-mar-1986
Rss : http://www.ibm.com/developerworks/views/java/rss/libraryview.jsp
Description : Java news and articles in IBM’s Developerworks.
Since : 19-mar-1986
Rss : http://www.ibm.com/developerworks/views/java/rss/libraryview.jsp
Description : Java news and articles in IBM’s Developerworks.
6. Java World

URL : http://www.javaworld.com/
Since : 22-nov-1995
Rss : http://www.javaworld.com/rss/index.html
Description : Well-known Java websites, you just can’t miss this one.
Since : 22-nov-1995
Rss : http://www.javaworld.com/rss/index.html
Description : Well-known Java websites, you just can’t miss this one.
7. Devx

URL : http://www.devx.com/Java/Door/6972
Since : 26-sep-1997
Rss : http://feeds.feedburner.com/DevxLatestJavaArticles
Description : Java news and articles in Devx.com.
Since : 26-sep-1997
Rss : http://feeds.feedburner.com/DevxLatestJavaArticles
Description : Java news and articles in Devx.com.
8. TheServerSide.com

URL : http://www.theserverside.com/
Since : 05-jan-2000
Rss : http://www.theserverside.com/rss
Description : Java community to discuss the server side development.
Since : 05-jan-2000
Rss : http://www.theserverside.com/rss
Description : Java community to discuss the server side development.
9. Big Moose Saloon

URL : http://www.coderanch.com/
Since : 27-aug-2004
Rss : Vary in topic, visit http://www.coderanch.com/forums
Description : Friendly and popular Java forum.
Since : 27-aug-2004
Rss : Vary in topic, visit http://www.coderanch.com/forums
Description : Friendly and popular Java forum.
10. Stack Overflow

URL : http://stackoverflow.com/
Since : 26-dec-2003
Rss : http://stackoverflow.com/feeds
Description : Well-known generic programming Q & A site organized by tags. Java topics included.
Since : 26-dec-2003
Rss : http://stackoverflow.com/feeds
Description : Well-known generic programming Q & A site organized by tags. Java topics included.
11. jGuru

URL : http://www.jguru.com/
Since : 16-sep-1997
Rss : None
Description : Java articles and Q&A style forum.
Since : 16-sep-1997
Rss : None
Description : Java articles and Q&A style forum.
12. Official Java Tutorials

URL : http://download-llnw.oracle.com/docs/cd/E17409_01/javase/tutorial/
Since : Unknown
Rss : None
Description : The Official Java tutorials from Oracle.
Since : Unknown
Rss : None
Description : The Official Java tutorials from Oracle.
13. Java Blogs Aggregator

URL : http://www.javablogs.com/
Since : 25-nov-2002
Rss : http://javablogs.com/ViewDaysBlogs.action?view=rss
Description : Blogs aggregator for many active Java-based blogs.
Since : 25-nov-2002
Rss : http://javablogs.com/ViewDaysBlogs.action?view=rss
Description : Blogs aggregator for many active Java-based blogs.
14. Java-Source.Net

URL : http://www.java-source.net/
Since : 25-feb-2004
Rss : None
Description : Java frameworks collection site. Well organized.
Since : 25-feb-2004
Rss : None
Description : Java frameworks collection site. Well organized.
15. Java Lobby

URL : http://java.dzone.com/
Since : 17-may-1998
Rss : http://www.dzone.com/feed/frontpage/rss.xml
Description : The heart of the Java developer community.
Since : 17-may-1998
Rss : http://www.dzone.com/feed/frontpage/rss.xml
Description : The heart of the Java developer community.
16. Jdocs

URL : http://www.jdocs.com/
Since : 01-jul-2004
Rss : None
Description : Search engine for Java API documentation.
Since : 01-jul-2004
Rss : None
Description : Search engine for Java API documentation.
17. Java2s.com

URL : http://www.java2s.com/
Since : 07-nov-2004
Rss : None
Description : Many Java programming tutorials and source code example, well organized by categories.
Since : 07-nov-2004
Rss : None
Description : Many Java programming tutorials and source code example, well organized by categories.
18. Java Tips

URL : http://www.java-tips.org/
Since : 22-Apr-2005
Rss : None
Description : Many quick and Java source code example.
Since : 22-Apr-2005
Rss : None
Description : Many quick and Java source code example.
19. RoseIndia

URL : http://www.roseindia.net/
Since : 23-may-2000
Rss : None
Description : Collection of Java tutorials, cover wide range of Java topics.
Since : 23-may-2000
Rss : None
Description : Collection of Java tutorials, cover wide range of Java topics.
Subscribe to:
Posts (Atom)