When there are lot of classes to be loaded, we may come across this error; Solution is simple; Open \jboss-4.2.0.GA\bin\run.conf and update as follows; if [ "x$JAVA_OPTS" = "x" ]; then JAVA_OPTS=”-Xms256m -Xmx1024m -XX:MaxPermSize=512m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000″ fi That will fix the issue.
Archive for the ‘Java’ Category
JBoss throwing java.lang.OutOfMemoryError: PermGen space
Posted in Java, JBOSS on January 21, 2012 | Leave a Comment »
Struts2 – No result defined for action and result input
Posted in Java, Struts 2 on January 18, 2012 | Leave a Comment »
1. Make sure you have defined result name input in your struts.xml file. <action name=”tes” method=”testPhase”> <result name=”input”>/Project.jsp</result> </action> 2. Give fully qualified name under the tag class=”” in struts.xml for the particular action.
Error: no ‘server’ JVM at …. ‘jvm.dll’
Posted in Java on December 5, 2011 | Leave a Comment »
If you see the error; Error: no `server’ JVM at `C:\Program Files\Java\jre1.6.0\bin\server\jvm.dll’ There is a little trick to get the server JVM up and running: Copy ‘server’ folder from the JDK’s JRE’s bin folder (example: C:\Program Files\Java\jdk1.6.0\jre\bin\server) and Paste the ‘server’ folder to JRE’s bin folder(example: C:\Program Files\Java\jre1.6.0\bin) Done!
Java Constructor Properties
Posted in Java on December 1, 2011 | Leave a Comment »
1. Constructor cannot return a value. 2. Interface cannot have constructor. 3. “A constructor cannot be abstract, static, final, native, strictfp, or synchronized”. 4. A constructor can be private. 5. Abstract class can have constructor. 6. A constructor can be overloaded. 7. Constructors are not members of a class. For this reason, constructors cannot be [...]
[Java] Constructor Vs Static Initialization Block
Posted in Java on December 1, 2011 | Leave a Comment »
A static initializer block will execute when a class is initialized — right after the class is loaded. This will happen (basically) the first time the class is referenced in the program. No instances need to be created. The static block will only be executed once (or in any case, only once each time the [...]
[Java] Path vs ClassPath
Posted in Java on November 18, 2011 | Leave a Comment »
The PATH variable contains directories where binary files (e.g. EXE files in Windows) will be looked for. If you open a command prompt and type “javac”, you’re supposed to have the “bin” directory of your sdk into the PATH, otherwise you’ll get an infamous “Command not found” error message. The CLASSPATH contains directories (or JAR [...]
[Java] Why bytecode not native code?
Posted in Java on November 18, 2011 | Leave a Comment »
Portability Each kind of computer has its unique instruction set. While some processors include the instructions for their predecessors, it’s generally true that a program that runs on one kind of computer won’t run on any other. Add in the services provided by the operating system, which each system describes in its own unique way, [...]
Java as a platform
Posted in Java on November 18, 2011 | Leave a Comment »
A platform is the hardware or software environment in which a program runs. We’ve already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms in [...]
Why Java?
Posted in Java on November 18, 2011 | Leave a Comment »
Get started quickly Although the Java programming language is a powerful object-oriented language, it’s easy to learn, especially for programmers already familiar with C or C++. Write less code Comparisons of program metrics (class counts, method counts, and so on) suggest that a program written in the Java programming language can be four times smaller [...]
The difference between “JDK”, JVM and “JRE”
Posted in Java on November 18, 2011 | Leave a Comment »
JVM: The use of the JVM is simple : – To change the byte code into the machine specific code. So the JVM converts the byte code(ie the code which we get when we compile the .java class) into the code that your machine/OS understands. JVM is machine specific. So JVM for windows will be [...]