I made a comparison in one of my previous posts that needs some corrections. So I'll just start the comparison from the beginning to avoid any confusion.
The purpose of this post is to compare, from an application server administrator's perpspective, GlassFish and OAS. Say we have 55.000 Euros to spend for a linux application server, hardware and software.
In case we buy oas enterprise edition 10g, its price goes to about 25.000 Euros per core (More like per two cores according to Oracle). So with 50.000 Euros we get a dual core (4 cores) license and with the remaining 5.000 we can get a machine with the best quad core in the market, and 8GB of memory. Let's assume that the rest of the hardware will be the same.
In case we choose glassfish, the oracle ADF Framework licensing amounts to 4000 Euros per core (per two cores). So, with 40.000 Eurow we get a 10 core (20 cores) licensing and with the remaining 15.000 Euros we get a machine (from dell's site) with 20 cores (2x6cores + 2X4cores) and 40GB memory.
With both servers we get clustering and support. And I need to add that glassfish community support is as good as oracle's.
It doesn't matter how fast OAS is compared to GlassFish. It may even be twice as fast (which isn't true). With those money and GlassFish one can buy 5 times more cpu power and memory.
And as a last stroke, I need to add the yearly support fee to Oracle. Instead of paying support and licensing fees, which amount to about 20% the initial cost per year. If we save this money, we can invest them in a new system every four or five years. (And the rest of the money can go to seminars!)
A clear win for open source and glassfish against oracle application server!
Showing posts with label toplink. Show all posts
Showing posts with label toplink. Show all posts
Wednesday, January 27, 2010
Sunday, January 10, 2010
GlassFish and Toplink ( ..continued )
My experience with GlassFish has increased since my last post.
There is already an ADF Faces - JPA eclipselink application that runs smoothly now for a few weeks on GlassFish. The only problem that came up after the successful code tests, was the Connection Pool leakage. There are some differences between the OAS and the GlassFish Connection Pooling. As a result, I had to tweak the preferences a little. In the 'General' tab I disabled the 'Connection Validation Required' checkbox to save time on connection gets. Also, at the 'Advanced' tab I set the 'Leak Reclaim' to true and the 'Leak Timeout' to 120 secs. The leak timeout may vary depending on the application. These two tweaks have stabilized the application.
The other important thing that I need to mention, is the difficulty that I found in installing two different versions of toplink. So the workaround is to install a new GlassFish installation for every toplink version (because the toplink libraries are installed in the installations's lib directory). I am lucky to have only two toplink versions (10.1.3.5 and 10.1.3.3) to handle!
But it is a serious thing to be considered in the following GlassFish versions: The library loader per version and the grouping of libraries. It is the one thing that I miss OAS for!
p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.
There is already an ADF Faces - JPA eclipselink application that runs smoothly now for a few weeks on GlassFish. The only problem that came up after the successful code tests, was the Connection Pool leakage. There are some differences between the OAS and the GlassFish Connection Pooling. As a result, I had to tweak the preferences a little. In the 'General' tab I disabled the 'Connection Validation Required' checkbox to save time on connection gets. Also, at the 'Advanced' tab I set the 'Leak Reclaim' to true and the 'Leak Timeout' to 120 secs. The leak timeout may vary depending on the application. These two tweaks have stabilized the application.
The other important thing that I need to mention, is the difficulty that I found in installing two different versions of toplink. So the workaround is to install a new GlassFish installation for every toplink version (because the toplink libraries are installed in the installations's lib directory). I am lucky to have only two toplink versions (10.1.3.5 and 10.1.3.3) to handle!
But it is a serious thing to be considered in the following GlassFish versions: The library loader per version and the grouping of libraries. It is the one thing that I miss OAS for!
p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.
Monday, December 7, 2009
GlassFish and Adf Toplink 10g (2)
As a followup to the previous post I feel the obligation to add my testing experience of a small but full featured ADF Faces and ADF Toplink application in glassfish.
The way to call the Transaction Manager in Glassfish is:
java:appserver/TransactionManager
We need to create a new class named GFTransactionController:
===============================================v
package oracle.toplink.transaction.gf;
import javax.transaction.TransactionManager;
import oracle.toplink.transaction.JTATransactionController;
public class GFTransactionController extends JTATransactionController {
public GFTransactionController() { }
protected TransactionManager acquireTransactionManager() throws Exception {
return (TransactionManager)jndiLookup("java:appserver/TransactionManager");
}
public static final String JNDI_TRANSACTION_MANAGER_NAME = "java:appserver/TransactionManager";
}
===============================================
We also need to change the Transaction Controller in our project.
Open your adf model project in Jdeveloper and follow these instructions:
===============================================
1. In the Applications Navigator, select DataModel --> Application Sources --> TopLink.
2. Select sessions.xml. In the Structure pane, double-click 'default' (or whatever you have named it).
3. On the General page, select the External Transaction Controller check box in Options.
4. Enter the following transaction class:
oracle.toplink.transaction.gf.GFTransactionController
===============================================
< web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" >
===============================================
with
===============================================
< web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" >
===============================================
Now redeploy your project and all ejb junctionality is working correctly.
As I have already mentioned in a previous post, 90% of the problems is a path translation error, because the two servers handle paths a little differently.
The basic problem I stumbled upon was the External Transaction Controller. Toplink.jar does not provide a TransactionController for GlassFish, although there is one for Oc4j, JBoss, WebSphere and Weblogic. As a result, we have to create one on our own.
The way to call the Transaction Manager in Glassfish is:
java:appserver/TransactionManager
We need to create a new class named GFTransactionController:
===============================================v
package oracle.toplink.transaction.gf;
import javax.transaction.TransactionManager;
import oracle.toplink.transaction.JTATransactionController;
public class GFTransactionController extends JTATransactionController {
public GFTransactionController() { }
protected TransactionManager acquireTransactionManager() throws Exception {
return (TransactionManager)jndiLookup("java:appserver/TransactionManager");
}
public static final String JNDI_TRANSACTION_MANAGER_NAME = "java:appserver/TransactionManager";
}
===============================================
In order to compile this class one needs toplink.jar ({jdev_install}/toplink/jlib) and j2ee.jar ({glassfish_install}/lib) in the classpath.
Then we open toplink.jar (the one inside glassfish) with winrar. We navigate to folder oracle/toplink/transaction. Right click --> Create new folder --> gf. Navigate to gf and drag and drop the GFTransactionController.class file inside. Our new toplink.jar is ready. We copy the new toplink.jar in {glassfish_install}/lib.
We also need to change the Transaction Controller in our project.
Open your adf model project in Jdeveloper and follow these instructions:
===============================================
1. In the Applications Navigator, select DataModel --> Application Sources --> TopLink.
2. Select sessions.xml. In the Structure pane, double-click 'default' (or whatever you have named it).
3. On the General page, select the External Transaction Controller check box in Options.
4. Enter the following transaction class:
oracle.toplink.transaction.gf.GFTransactionController
===============================================
The other problem that I found was at web.xml. JDeveloper creates by default a new web project with a 2.4 xsd for web.xml. We need to change that to a 2.5 xsd. So we open our web.xml and replace our
===============================================< web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" >
===============================================
with
===============================================
< web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" >
===============================================
Now redeploy your project and all ejb junctionality is working correctly.
Another minor change is the result of this command: getServletConfig().getServletContext().getRealPath("/test/");
Oc4j returns a slash at the end, while Glassfish does not. A simple solution is to add the last slash after the command:
getServletConfig().getServletContext().getRealPath("/test")+"/";As I have already mentioned in a previous post, 90% of the problems is a path translation error, because the two servers handle paths a little differently.
As a conlcusion, I need to note that GlassFish can successfully run an ADF Faces with ADF Toplink (EJB 3) Application with only a few configuration changes and some slight code modifications! Apart from TransactionController, all the others pass in OC4J too. So, there is no need to start using glassfish as a testing server if you are already using JDeveloper!
p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.
p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.
Sunday, December 6, 2009
GlassFish and Adf Toplink 10g
After my success in deploying an ADF Faces web application in Glassfish (2.1.1), I got a crazy idea. Why not try deploying an ADF Faces with ADF Toplink (EJB 3.0 SessionBean with Pojos) enterprise application in GlassFish? Oracle has deploying instructions for JBoss and WebLogic. What these application Servers have more than GlassFish? Exactly. Nothing!
So I put my thoughts into work. The first success came when I put toplink.jar in ${glassfish}/lib, restarted the server and the model was successfully deployed with no errors! Then I started adding one by one all the runtime libraries that where reported missing by glassfish deployer. Finally I reached a point where deployment was successful, but there were still runtime errors. I continued adding more libraries, one by one. But when I added xmlparserv2.jar library I returned to square one. The deployment was once again unsuccessful. I googled the error:
------------------------------------------------
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.DocumentBuilderFactory.setSchema(DocumentBuilderFactory.java:561)
...
-----------------------------------------------
All hits I got for this error was about using an older xml parser. But I could not figure out why. I searched inside the xmlparserv2.jar and found some javax.* classes apart from oracle.* classes. So I deleted all javax.* classes from inside the jar in order not to override the default classes, and I created a new xmlparserv2.jar (I also removed from xmlparserv2.jar the directory META-INF/services). I renamed it to oxmlparserv2.jar and added it to project libraries.
The application was deployed once again. I was really happy. But my troubles weren't over yet. Not even a simple query would run without giving the error:
----------------------------------------------
javax.servlet.ServletException: javax.el.MethodNotFoundException: Method not found: findItemByName.execute(javax.faces.event.ActionEvent)
root cause
javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: Method not found: findItemByName.execute(javax.faces.event.ActionEvent)
root cause
javax.el.MethodNotFoundException: Method not found: findItemByName.execute(javax.faces.event.ActionEvent)
----------------------------------------------
This was an even more obscure error. I presumed it would still have to do with some missing library. All I needed was to find which library. But there was no error 'noClassDefFoundError' to help me this time! Then I remembered that JDeveloper supports installing all of its runtime libraries to various applications servers, why not glassfish too? Since there is no glassfish installation process in JDeveloper, I improvised. I downloaded a JBoss v4 and installed it. I opened JDeveloper 10.1.3.5 and then I followed the menu:
Tools --> ADF Runtime Installer --> JBoss.
I completed the installation throught the wizard. Jdev then displayed a summary of the installed libraries. Based on this list I figured out that I only needed to use those libraries that were installed in {server}/default/lib directory of JBoss. The others did not seem very important. Here is a list of those that worked form me:
----------------------------------------------------
adf-connections.jar
adfbinding.jar
adfcm.jar
adfm.jar
adfmtl.jar
adfmweb.jar
adfshare.jar
adfui.jar
antlr.jar
bc4jct.jar
bc4jctejb.jar
bc4jdomgnrc.jar
bc4jdomorcl.jar
bc4jimdomains.jar
bc4jmt.jar
bc4jmtejb.jar
cache.jar
collections.jar
commons-cli-1.0.jar
commons-el.jar
concurrent.jar
dc-adapters.jar
dms.jar
http_client.jar
jazncore.jar
jdev-cm.jar
jsp-el-api.jar
libs.txt
mdsrt.jar
ojdbc14.jar
ojpse.jar
oracle-el.jar
oraclepki.jar
ordhttp.jar
ordim.jar
osdt_cert.jar
osdt_core.jar
osdt_saml.jar
osdt_wss.jar
osdt_xmlsec.jar
oxml.jar
oxmlparserv2.jar
runtime12.jar
share.jar
toplink-agent.jar
toplink.jar
translator.jar
xmlef.jar
xsqlserializers.jar
xsu12.jar
----------------------------------------------------
So I copied them to my {glassfish}/lib dir. Except for xml.jar and xmlparserv2.jar. For those two I deleted all javax.* classes from the jar and then I copied them with new names, as oxmlparserv2.jar and oxml.jar, in order to distinguish them in the future.
The result was astounding. The application was deployed successfully and run a query! Total Success!
All that is left to do now, is run thorough tests on every adf-toplink application that needs to be deployed in glassfish, so as to find any minor inconsistencies. As a hint, I have found that the path is handled differently between the two servers. This thought will solve almost 90% of the rest of the incompatibility problems.
Concluding, I need to say that glassfish server has already surpassed my expectations. It is a free open source application server that can compete evenly with other commercial application servers. And if it can run oracle's applications, then it can run any j2ee application!
I want to add as a last thought, as a big organization's application server administrator, a comparison, between glassfish and oas. Say we have 35.000 Euros to spent for a linux application server, hardware and software.
In case we buy oas enterprise edition, its price goes to about 15.000 Euros a core. So with 35.000 Euros we get a dual core license and that leaves 5.000 to get a machine with the best dual core in the market, and at least 10GB of memory. Let's assume that the rest of the hardware will be the same.
In case we choose glassfish, all the money goes to hardware. What do we buy with 35.000 Euros? Two machines (as I saw at dell's site) with 24 cores ( 4 x Intel 6cores) and 48GB memory each. Which sums up to 48 cores running almost at top speed and 96GB of memory. With both servers we get clustering and support. And I need to add that glassfish community support is as good as oracle's.
What I make of it? I don't care how fast oas is. It may even be twice as fast (or even thrice as fast) as glassfish. Who cares? With those money and glassfish one can buy 24 times more cpus and memory.
And as a last stroke, I need to add the yearly support fee to oracle. Instead of paying support and licensing fees, which amount in around 20% a year. If we save this money, we can invest them in a new system every four or five years. (And all the rest of the money can go to seminars!)
A clear win for open source and glassfish against oracle application server!
P.S.
There is an error in this comparison. While GlassFish is open source and therefore free, the use of ADF framework is not. I have a more accurate comparison here.
So I put my thoughts into work. The first success came when I put toplink.jar in ${glassfish}/lib, restarted the server and the model was successfully deployed with no errors! Then I started adding one by one all the runtime libraries that where reported missing by glassfish deployer. Finally I reached a point where deployment was successful, but there were still runtime errors. I continued adding more libraries, one by one. But when I added xmlparserv2.jar library I returned to square one. The deployment was once again unsuccessful. I googled the error:
------------------------------------------------
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.DocumentBuilderFactory.setSchema(DocumentBuilderFactory.java:561)
...
-----------------------------------------------
All hits I got for this error was about using an older xml parser. But I could not figure out why. I searched inside the xmlparserv2.jar and found some javax.* classes apart from oracle.* classes. So I deleted all javax.* classes from inside the jar in order not to override the default classes, and I created a new xmlparserv2.jar (I also removed from xmlparserv2.jar the directory META-INF/services). I renamed it to oxmlparserv2.jar and added it to project libraries.
The application was deployed once again. I was really happy. But my troubles weren't over yet. Not even a simple query would run without giving the error:
----------------------------------------------
javax.servlet.ServletException: javax.el.MethodNotFoundException: Method not found: findItemByName.execute(javax.faces.event.ActionEvent)
root cause
javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: Method not found: findItemByName.execute(javax.faces.event.ActionEvent)
root cause
javax.el.MethodNotFoundException: Method not found: findItemByName.execute(javax.faces.event.ActionEvent)
----------------------------------------------
This was an even more obscure error. I presumed it would still have to do with some missing library. All I needed was to find which library. But there was no error 'noClassDefFoundError' to help me this time! Then I remembered that JDeveloper supports installing all of its runtime libraries to various applications servers, why not glassfish too? Since there is no glassfish installation process in JDeveloper, I improvised. I downloaded a JBoss v4 and installed it. I opened JDeveloper 10.1.3.5 and then I followed the menu:
Tools --> ADF Runtime Installer --> JBoss.
I completed the installation throught the wizard. Jdev then displayed a summary of the installed libraries. Based on this list I figured out that I only needed to use those libraries that were installed in {server}/default/lib directory of JBoss. The others did not seem very important. Here is a list of those that worked form me:
----------------------------------------------------
adf-connections.jar
adfbinding.jar
adfcm.jar
adfm.jar
adfmtl.jar
adfmweb.jar
adfshare.jar
adfui.jar
antlr.jar
bc4jct.jar
bc4jctejb.jar
bc4jdomgnrc.jar
bc4jdomorcl.jar
bc4jimdomains.jar
bc4jmt.jar
bc4jmtejb.jar
cache.jar
collections.jar
commons-cli-1.0.jar
commons-el.jar
concurrent.jar
dc-adapters.jar
dms.jar
http_client.jar
jazncore.jar
jdev-cm.jar
jsp-el-api.jar
libs.txt
mdsrt.jar
ojdbc14.jar
ojpse.jar
oracle-el.jar
oraclepki.jar
ordhttp.jar
ordim.jar
osdt_cert.jar
osdt_core.jar
osdt_saml.jar
osdt_wss.jar
osdt_xmlsec.jar
oxml.jar
oxmlparserv2.jar
runtime12.jar
share.jar
toplink-agent.jar
toplink.jar
translator.jar
xmlef.jar
xsqlserializers.jar
xsu12.jar
----------------------------------------------------
So I copied them to my {glassfish}/lib dir. Except for xml.jar and xmlparserv2.jar. For those two I deleted all javax.* classes from the jar and then I copied them with new names, as oxmlparserv2.jar and oxml.jar, in order to distinguish them in the future.
The result was astounding. The application was deployed successfully and run a query! Total Success!
All that is left to do now, is run thorough tests on every adf-toplink application that needs to be deployed in glassfish, so as to find any minor inconsistencies. As a hint, I have found that the path is handled differently between the two servers. This thought will solve almost 90% of the rest of the incompatibility problems.
Concluding, I need to say that glassfish server has already surpassed my expectations. It is a free open source application server that can compete evenly with other commercial application servers. And if it can run oracle's applications, then it can run any j2ee application!
In case we buy oas enterprise edition, its price goes to about 15.000 Euros a core. So with 35.000 Euros we get a dual core license and that leaves 5.000 to get a machine with the best dual core in the market, and at least 10GB of memory. Let's assume that the rest of the hardware will be the same.
In case we choose glassfish, all the money goes to hardware. What do we buy with 35.000 Euros? Two machines (as I saw at dell's site) with 24 cores ( 4 x Intel 6cores) and 48GB memory each. Which sums up to 48 cores running almost at top speed and 96GB of memory. With both servers we get clustering and support. And I need to add that glassfish community support is as good as oracle's.
What I make of it? I don't care how fast oas is. It may even be twice as fast (or even thrice as fast) as glassfish. Who cares? With those money and glassfish one can buy 24 times more cpus and memory.
And as a last stroke, I need to add the yearly support fee to oracle. Instead of paying support and licensing fees, which amount in around 20% a year. If we save this money, we can invest them in a new system every four or five years. (And all the rest of the money can go to seminars!)
A clear win for open source and glassfish against oracle application server!
P.S.
There is an error in this comparison. While GlassFish is open source and therefore free, the use of ADF framework is not. I have a more accurate comparison here.
Subscribe to:
Posts (Atom)