Wednesday, February 16, 2011

Apache Tomcat V6x

Issue: OutOfMemoryError: Java heap space, PermGen space
To increase the memory in tomcat, edit catalina.bat file  (<tomcat-install>\bin\catalina.bat) and include
-Xms256m
-Xmx1024m
-XX:MaxPermSize=512m

Example:
set JAVA_OPTS=%JAVA_OPTS% 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
-Xms256m
-Xmx1024m
-XX:MaxPermSize=512m

Thursday, January 20, 2011

GWT with Maven

  1. Install the plugins depending on your eclipse version(my eclipse version is 3.5) - gwt for eclipse(http://dl.google.com/eclipse/plugin/3.5), m2eclipse(http://m2eclipse.sonatype.org/sites/m2e)
  2. To create a maven based gwt project with GWT's webAppCreator utility, simply specifiy send -maven -noant as options. Say for example, webAppCreator -maven -noant -out C:\sample -junit C:\eclipse\plugins\org.junit4_4.5.0.v20090824\junit.jar com.testing.sample.sample
  3. Once the folder structure is created, use mvn eclipse:eclipse and import the project to eclipse
  4. Apply the tool kit settings to your project: Select your project - Right click - Google -Web Toolkit settings - check the use Google Web Toolkit and select the appropriate gwt version
  5. Compile: Select your project - Right click - Google - GWT compile
  6. Run: Select your project - Right click - Run as - Web Application
Maven Issues:
[ISSUE] M2_REPO (non modifiable)

Eclipse picks the value of M2_REPO from $MAVEN_HOME/conf/settings.xml using <localRepository> element. If nothing is specified, then ${user.home}/.m2 becomes the m2_repo path. Also verify the version of the maven from eclipse (preferences->maven->user settings).

Build Issues:
[ISSUE] The project doesn't have GWT SDK on its build path
check the order of your GWT SDK in the 'order and export' tab on your project build path.  gwt sdk library must appear before the maven dependencies. so, move it up in the order.


Compiler Issues:
[ERROR] Line 12: No source code is available for type com.google.gwt.junit.client.GWTTestCase; did you forget to inherit a required module?
add this to your *.gwt.xml <inherits name="com.google.gwt.junit.JUnit"/>

Run Issues:
[ERROR] Could not find host pages in the project 
Go to the project properties -> build path -> configure build path -> Select Google - WebApplication -> check 'This project has a WAR directory' - specify war directory as 'src/main/webapp'

Thursday, November 18, 2010

Ant Installation

Follow the below steps:
  1. Download: Download the binary distribution from here
  2. Installation: Unzip the downloaded the binary distribution, say C:\apache-ant-1.7.1
  3. Configuration: It's time to set up the environment variables,
    1. JAVA_HOME: make sure to set this up  to the installed JDK path
    2. ANT_HOME : C:\apache-ant-1.7.1
    3. PATH: %ANT_HOME%\bin\; (append this to the exisitng path so that we can run ant from command line. Make sure not to include any blank spaces in the path)
  4. Test: Test the complete setup by entering ant on command line
    1. Success if you get this error msg - Buildfile: build.xml doesn't exist! Build failed (since no build.xml file exists in the current directory)
    2. Failure if not. Check the paths once again in step 3.
  5. Note: Don't ever set CLASSPATH. Ant does not need it, it only causes confusion and breaks things

Monday, November 1, 2010

How to add Weblogic server 8.1 in eclipse galileo


If you don't see the required version of weblogic in the server configuration wizard on eclipse galileo, don't panic. Just follow the below steps. It worked for me.
  1. Browse the eclipse configuration settings (C:\eclipse\eclipse.ini) 
    • update its memory settings to -Xmx768m -Xms256m  
    • Check for the allowArraySyntax. -Dsun.lang.ClassLoader.allowArraySyntax=true  Add the line if its not there
  2. Start Eclipse
  3. Make sure to have your Weblogic server configured in "Development" mode
  4. Go to Window -> Preferences -> Server -> Runtime Environments -> Add ->  
    • click on download additional server adapters hyperlink
    • select "Oracle Web Logic Server Tools" and install it
  5. As an alternative, you can add http://download.oracle.com/otn_software/oepe/galileo as updated site in Eclipse and install the Eclipse pack from Oracle.
  6.  Restart Eclipse
  7. Browse to the server configuration wizard, your WL8.1 adapter will be there now 
    • Window -> Show View -> Servers
    • Right click add -> server -> Oracle - choose the required WL version
  8. In the next screen, select your JRE and Weblogic installation directory ..\bea\weblogic
  9. Click next
  10. Provide the Weblogic domain directory ..\bea\weblogic\myproj\domains\myd, provide the Weblogic port e.g. 7001 and user id/password for the Weblogic server.
  11. Click finish.
  12. Double click on the server; it will open server details in the editor. Make sure to publish automatically check box is check. If not checked, check it, save and close it.
  13. You can notice the new configured Weblogic server in server pane.
  14. Select the server, rightclick and add/remove projects from your workspace to this server.

My First Post

Whoo... hoo... time to fly !!! :)
I am quite excited to see my first blog.