Hobione's Weblog

Living & Breathing in Web 2.0 Era

ICEFaces 1.8.1 migration

I have recently needed for upgrade to 1.8 from 1.7.2. The main reason I needed 1.8 is because my Auto Complete pop up list would not stay. It showed up for split of second and went away. It did not give me any chance to pick one from list. It worked perfectly on Firefox but not on IE 6 or 7. Here are some steps I had to take to make it work with my existing source.

Step 1:
First, I changed the pom.xml file to 1.8.1, it should be a piece of cake but apparently it did not do a thing.

<dependency>
 <groupId>org.icefaces</groupId>
 <artifactId>icefaces</artifactId>
 <version>1.8.1</version>
 </dependency>
 <dependency>
 <groupId>org.icefaces</groupId>
 <artifactId>icefaces-comps</artifactId>
 <version>1.8.1</version>
 </dependency>
 <dependency>
 <groupId>org.icefaces</groupId>
 <artifactId>icefaces-facelets</artifactId>
 <version>1.8.1</version>
 </dependency>

Steps I had taken to make it work:

Stopped and started the Glassfish server.  Closed and restarted MyEclipse 7.1 with -clean command but still would not work.  Here are some sample errors I was getting:

java.lang.
<div id=":b0">IllegalArgumentException: Illegal null argument to ObjectInputStreamWithLoader

java.lang.RuntimeException: Cant copy Serializable object: Caused by: java.lang.IllegalArgumentException: Illegal null argument to ObjectInputStreamWithLoader

[#|2009-07-28T19:59:38.107-0500|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=pool-1-thread-2;|19:59:38,107  INFO D2DViewHandler:84 -
ICEsoft Technologies, Inc.
ICEfaces 1.7.2
 Build number: 17
Revision: 17749</div>
<div>

As you may noticed that, even though I changed the pom to ICEfaces 1.8.1 but the server console showed 1.7.2.  I should thought about the server’s cache issue but instead I did these following long steps.

I installed MyEclipse 7.5 which I meant to install it anyway and also 1.8 comes with MyEclipse 7.5.  So after install the MyEclipse 7.5, I was still getting errors.  Then, I created a brand new project using MyEclipse 7.5 and copied src, web and pom.xml to the new project.

Eeeeh, still would not work.  Finally I logged in to the admin console for Glassfish and undeployed all old 1.7.2 related project, stopped the server, restarted the server but wait, still negative.  I was getting this weird error.

java.lang.OutOfMemoryError: PermGen space</div>
<div>
I Googled it and found out that “It’s easy to reproduce this problem by reloading the context over and over again until you get an OutOfMemoryError (10 times was enough for a simple app)”.  So, I had to take a break to deploy the app and at last, it worked. Thank you my LORD.

ICEfaces rock! MyEclipse rocks!! my application rocks!!!

autoComplete

July 29, 2009 Posted by | GlassFish, ICEfaces, MyEclipse IDE | 1 Comment

Liferay Portal on Glassfish App Server

I was able to install Liferay Portal 5.1.1 on Sun Java Application Server 9 UR 2 aka Glassfish. Here are some steps I have followed.
1. Downloaded these following files from SourceFge.net

  1. liferay-portal-dependencies-5.1.1.zip
  2. liferay-portal-ext-5.1.1.zip
  3. liferay-portal-5.1.1.war

2. Copy all five jar files from liferay-portal-dependencies-5.1.1 into $GLASSFISH_HOME/domains/domain1/lib
3. Copy xercesImpl.jar and JDBC driver into the same place. You can find xercesImpl.jar under liferay-portal-ext-5.1.1
4. $GLASSFISH_HOME/domains/domain1/lib  should looks like this.

9jarfiles

5. Login to your Glassfish app server Admin GUI and do as follows:

  1. Setup JDBC connection pool
  2. Liferay Pool Setup

  3. Setup JNDI lookup
  4. LiferayJNDILookup

  5. Setup Java Mail
  6. LiferayJavaMailSetup

  7. Log out of the Administration Console and stop Glassfish.

6. You can deploy Liferay in two ways.

  1. Copy liferay-portal-5.1.1.war to glassfish-v2ur2\domains\domain1\autodeploy
  2. Use Glassfish Admin GUI to deploy

Dilemma: I needed to run the Portal server under a different context other than root, so URL would look like this. http://atowxx.abc.gov/idmsportal

Solution: I had to unwar the liferay-portal-5.1.1.war file by using this command. jar -xvf liferay-portal-5.1.1.war

Here is the directory structure should look like after unwar the file.
unwar
I have added a new properties file under \WEB-INF\classes an named it portal-ext.properties
Open up the portal-ext.properties with Textpad and add this line at the very top.
portal.ctx=/idmsportal
Now, rewar everything by using this command,  jar cvf liferay-portal-5.1.1.war .

Caution: Make sure there is no sub directory has been created (match with above directory structure).  The best way to test this to use jar tvf liferay-portal-5.1.1.war to see the list view or unwar your newly created war file to see directory structor. If you create the war file successfully with original directory structor, it’s ready to deploy. You can do auto deploy or using Admin GUI to deploy the Portal on Glassfish.

References:
1. Rich Sezov’s blog (A must read)
2. Sun Joins Liferay Open Source Community

December 8, 2008 Posted by | GlassFish, Portal-Liferay | , | 1 Comment

GlassFish V3 Prelude Admin GUI Blurry Icons in Netbeans 6.5

I’ve just downloaded Netbeans 6.5 and GlassFish V3 Prelude bundle from Netbeans.org and I notice that “Registration” icon, and “Update Tool” icon are very blurry in Admin Console GUI.
Here is my machine spec.
Windows XP, sp 2
IE 6, sp2
BTW, those icons show up fine in my FireFox and also in IE 7

GlassFish v3

GlassFish v3

So far I am liking Netbeans 6.5 and V3 released alot. I am amazed to see how fast Netbeans loads in 6.5 released. It is almost as fast as opening up a Textpad. I was also able to do a clean and build without stop the app server. My favorite so far is auto Compile on Save, I think it will speed up some development time. For V3, I wish there were Stop and Start button in Admin Gui to stop and start the server but I guess, I have to wait till the next version get released. Pretty soon I will be looking for ICEfaces, Facelets and Maven’s plugin for Netbeans 6.5

November 19, 2008 Posted by | GlassFish | 1 Comment

Glassfish Virtual Server

Scenario: We are running Glassfish on our production server as the default mode.  Here is a screen shot for the default serve.

Glassfish default server

Glassfish default server

The ip for the server, 111.25.000.69 which alias to http://abc.amc.xxx.info and Default Web Module is “Root” app.

Dilemma: We wanted to set up a virtual server for a new URL, http://idms.abc.xxx.info and register the Default Web Module to ” iDMSCommingsoon” app.

How the world can we do that?  We are not running any Appache on top of Glassfish,  is Glassfish smart enough to figure it out which application to respond based on URL, etc.  The answer is YES. It is so easy to set that up by using Glassfish admin tool.

Solutions:  Here are few choices I had, were recommended by Sun’s Technician:
“I’m sure you know this, but it bears mention now. A combo of IP+Port number can have only one process/program binding to it… thus if you have 1 IP address, any port there, can be “used/bound to” only once. This is true for all Web or App Servers or any Server for that matter.

The SJAS/Glassfish, works around this limitation by using the concept of Listeners and Virtual Servers.
A Listener can be instructed to listen/respond to different domains (web domains, not App Server domains) such as http://www.aaa.com and http://www.bbb.com
You can then have and configure your Virtual Servers to use those listeners.

Couple of scenarios you could approach.
-If you have available more IP addresses, you can create another listener, assign it to use Port 80 and create your Virtual Servers to use it.
Or
-If you have only one IP available, you can modify existing listener to also respond to new site (idms.faa.gov) and configure the new Virtual Server to use
the same listener.

Either way, DNS will need to be modified accordingly, whether you point 1 domain (HTTP domain, not App Server domain) to that IP or have 2 or more domains pointing to that IP (absolutely possible).

More about it can be seen here:
http://docs.sun.com/app/docs/doc/819-3671/ablsw?a=view&#8221;

This is how we have tackled this issue initially:
1. We have aliased http://idms.amc.xxx.gov to the same ip 112.25.000.69 as the other URL has been using for years.
2. We have changed few things on setting as follows.

Virtual Server Setup

Virtual Server Setup

You may notice that idms Virtual Server is using the same Listeners for other server, so they are sharing listeners.

3. Here is the same old way to deploy a .war but only thing I have changed is server name.

Deploy app on a Virtual Serve

Deploy app on a Virtual Serve

What a surprise, it worked!
Here is my lame drawing to show the big picture.

Concern: I have a concern about performance.   Since both URLs are using same ip and listeners, what are chances for the bottleneck when both URLs starting get many hits simultaneously.

Here what expert said: Since there are two services/sites/hostnames using one resource, yes, it could become an issue…however  monitoring, testing, baselining and tuning are always recommended, in that respect the following should hopefully help:
http://docs.sun.com/app/docs/doc/819-3681

specifically, these two should help, but the entire Tuning Guide is a good read:

http://docs.sun.com/app/docs/doc/819-3681/abedw?a=view
http://docs.sun.com/app/docs/doc/819-3681/abefk?a=view (See Req processing and Keep Alive).

Hope information helps.

October 2, 2008 Posted by | GlassFish | | 6 Comments

Regain search engine on Glassfish app server

“Regain is a Java search engine based on Jakarta Lucene. It provides indexing and searching files for plenty of formats (currently HTML, XML, Excel, Powerpoint, Word, PDF and RTF).  A TagLibrary eases integrating search results in your JSP based web page.”  You may download the production version from http://regain.sourceforge.net/ or beta version from http://www.assembla.com/spaces/regain2/documents

Our NAS division inTranet web site needed a search look up like Google search.  I came across with Regain Search engine after done some research.  It is pretty simple to install on a server (Solaris box).  Regain does not do any database search, but if you have a link that requires to go to database, Regain will crwal up the link store that file metadata in the index. Hibernate search or Lucene search does the full scale database search, I have not used them yet but that’s what I hear.

Here are few steps to install Regain on Glassfish: (Unzip regain_v1.5.0-preview-80717-1556_server.zip)

  1. Create a directory under ../SUNWappserver/domains/domain1
    1. Name it regain
    2. Copy the crawler directory from c:\regain\runtime (after unzipped) and paste it to domain1/regain/
  2. Under crawler dir, you will find CrawlerConfiguration.xml
    1. Modify the xml file with your domain name etc.
    2. Create a directory and call it searchindex under crawler
  3. Now the fun part is to build indexing
    1. Change directory (cd) to domian1/regain/crawler dir and run this following command
    2. java -jar regain-crawler.jar or,  java -jar regain-crawler.jar –help (more options)
  4. Copy conf dir, it's sub directories and the xml file (all three –> conf\regain\SearchConfiguration.xml ) from the downloaded zip-file (can be found under regain\runtime\search) and paste 'em directly under domian1/application
  5. Modify the SearchConfiguration.xml file mainly line 74, 80 and 83
  6. Deploy the regain.war file via app server’s beautiful admin gui.
  7. Modify the web.xml (domain1\applications\j2ee-modules\regain\WEB-INF). You have to specify the regain webapp where to look for search configuration file.
<!-- The location of the configuration file -->
<context-param>
<param-name>searchConfigFile</param-name>
<param-value>../conf/regain/SearchConfiguration.xml</param-value>

</context-param>

Regain webapp’s web.xml map to SearchConfiguration.xml and SearchConfiguration.xml know where to find searchindex dir to bring up the query results.  (Three steps).

7. Open up a browser and type http://yourdomainname/contextName, i.e. http://axous2.abc.aaa.info/search

Happy searching!

Home page: http://regain.sourceforge.net/
Open Source Full Text Search Engines Written In Java: http://www.manageability.org/blog/stuff/full-text-lucene-jxta-search-engine-java-xml

August 1, 2008 Posted by | GlassFish, Search Engine | 24 Comments

Wow, this is great, many thanks to Sun Microsystems

I’d like to express my huge appreciation and gratitude to Sun for the free commercial based application server. The GlassFish forum has been very helpful to resolve many of the issues that we have experienced during the migration. Also, and importantly, thank you for the very nice gift–Apple iPod Touch 8 GB. I am enjoying it everyday which proves that how much Sun cares about its open source projects and also how close they are with developers. My wife has also noticed that I cannot keep my eyes off watching music video in iPod touch. Click here or here to see the full Glassfish success story.

May 15, 2008 Posted by | GlassFish | | 3 Comments

What’s under GlassFish application server?

Hobi: Is Glassfish sitting on any web server like Apache or does it have its own container?

Alexis: GlassFish comes with it’s integrated HTTP server implemented using Grizzly. It performs extremely well (better than Apache in some cases). So, if you have a simple network topology with no need for a DMZ or load-balancing in a web-server tier, you can do without Apache. Settings for the integrated HTTP server in GlassFish are available in the admin console: Configuration > HTTP Service. The documentation is here: http://docs.sun.com/app/docs/doc/819-3671/ablsw?a=view
Having said this, you can use Apache as a front end to GlassFish if you want to leverage existing Apache knowledge.

March 26, 2008 Posted by | GlassFish | Leave a comment

Glassfish jdbc connection pool or jdbc datasource setup

Please refer :
http://blogs.sun.com/JagadishPrasath/entry/creating_jdbc_connection_pool_resource


http://blogs.sun.com/JagadishPrasath/entry/jdbc_connection_pool_templates_glassfish

February 19, 2008 Posted by | GlassFish | Leave a comment

Glassfish Default Welcome File List

http://test.amc.gov instead http://test.amc.gov/index.jsp

Under domains/domain1/cofig/default-web.xml

<!– ==Default Welcome File List========== –>

When a request URI refers to a directory, the default servlet looks for a “welcome file” within that directory and, if present, to the corresponding resource URI for display. If no welcome file is present, the default servlet either serves a directory listing, or returns a 404 status, depending on how it is configured.
If you define welcome files in your own application’s web.xml deployment descriptor, that list *replaces* the list configured here, so be sure that you include any of the default values that you wish to include.

 

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

 

It did not work so I went ahead added to my root application web.xml

 

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>

 

After redeploy my app, it worked.
Now I can access my domain or app without typing index.jsp/index.html/index.htm

February 14, 2008 Posted by | GlassFish | Leave a comment

Application Server – Mime type set up

 \SunAppServer9.1Update1\domains\domain1\config\default-web.xml

<mime-mapping>
<extension>ppt</extension>
<mime-type>application/powerpoint</mime-type>
</mime-mapping>

Details in David WB’s blog … 

February 12, 2008 Posted by | GlassFish | Leave a comment