Posts tagged jee

Sharing session state between JEE web applications through WebLogic session descriptor of sharing-enabled

Session state in Java Web application is associated with a single (user) browser session on the one hand and typically with a specific web application on the other (server side) hand. Session state is created and maintained in the context of a usually a single web application. However…

We ran into a situation where our web application was assuming gigantic proportions. To complex to quickly deploy or even easily build, compile and test. On closer inspection, it was quickly revealed that the application really consisted of a number of relatively independent modules – say one for each of the options in the main menu and one for the entry point – main menu, login, manage user preferences etc. From a functional point of view, the big web app monster was by and large a collection of almost individual web applications. Almost because a substantial number of navigations took place between pages in these modules. And some context data – including credentials – should be passed on these navigations. The application was developed with such information stored in the session scope – as all modules always have access to a (shared) session scope, it was thought.

We got to the point where for many reasons we would like the big fat web application to be split in one web application per module. This would allow much easier development, administration, release management etc. However, we could not resolve this issue of shared session state that should be maintained across the web applications-per-module.

We contemplated moving this shared session state to a memory grid – but the impact on the existing application would be quite substantial (although an interesting challenge: introduce a new scope for managed beans (superapplication, cross-application or application-cluster) and create an EL resolver that knows where to find beans referred to with expressions like #{super-application.bean.property}; find a way for all applications in the applicationcluster to identify a user session in the same way to ensure the bean instance associated with the current session in the current application is retrieved).

An easier solution presented itself – after briefly conferring with Mike Lehmann of Oracle’s Application Server team – in the form of WebLogic Server’s session sharing capabilities.

Read the rest of this entry »

JavaOne 2010 – Keynote by Thomas Kurian – Java Strategy and Directions

JavaOne started this morning with the first many dozens sessions and the Java Pavilion & Exhibition hall. The official kick off so to speak took place tonight, with Thomas Kurian’s keynote, in which he unfolded Oracle’s plans for Java. He wants to make it abundantly clear how important Java is to Oracle, how important the unity of the community around Java is and how urgent it is for him (almost on a personal level) to see the Java platform and community regain momentum, after a period of FUD and near stand-still. His keynote contained a number of very concrete statements and plans that Oracle intends to execute. He did not necessarily say this out loud – but between the lines I clearly read that Sun had fantastic ideas but not necessarily the capacity (and at some point obviously the budget) to deliver on them and that Oracle intends to bring its ability to execute and deliver (see for example the acquisition and subsequent integration of BEA and others) to the table and get Java moving once more.

His announcements included:

  • Java SE 7 will be available in the Summer of 2011 -provided JCP joins in and approves.
  • Java SE 8 will follow in 12-18 months after SE 7 – provided JCP….
  • the process for defining Java EE 7 will commence shortly
  • Java (through Java FX) will be the premier development technology for rich user interface applications (on any platform); JavaFX will be integrated into the Java programming language, JavaFX script will disappear (this will take two stages, one until Summer 2011, the other one until the year after)
  • JavaFX will offer native, two-way interoperability with JavaScript and HTML 5/DOM. JavaScript can access the FX SceneGraph, JavaFX can access the DOM tree and (rich) HTML can be rendered inside FX apps; FX will get databinding facilities with REST, JDBC, JSON, XML etc.
  • JavaFX UI Controls will be released into Open Source.
  • As JavaFX will be integrated into Java and run on the JVM, its capabilities for Rich Media handling and 2D and 3D rendering will be available to any other language running on the JVM as well, meaning that for example Groovy, Scala and JRuby can integrate JavaFX capabilities
  • Oracle is also planning to deliver a hardware-accelerated graphics engine that will enable JavaFX applications to render stunning interactive 2D and 3D experiences in real-time.
  • Plans for Java ME – Oracle’s preferred flavor of Java on mobile – that will let the stack render HTML, CSS, and Javascript by default. Java ME is going to include WebKit Engine, JavaScript Engine, and Java/JavaScript Bridge, which will mean phones running future versions of Java ME can access web services and apps outside of a browser and – potentially – without any performance bugs or performance issues.

    The engine will plug into the Java ME virtual machine and into Java FX.

    Oracle’s Java ME engine will make use of what modern graphics hardware accelerators can do in term of (60 frames/s) rendering of 2D and 3D.” (Direct X from Microsoft for Windows in addition to OpenGL or “better”). Java ME is going to be optimized for the ARM7 and ARM9 chipsets licensed by handset component makers Broadcom, Samsung, NEC, Texas Instruments, and others with the stack also updated to include APIs that take advantage of phone features such as payment, telephony, and location.

  • Oracle – proud owner of two JVMs, the Sun Hotspot JVM and the BEA JRockit JVM – will merge these two together, making many of the enhancements in JRockit available under the same (liberal, largely free) conditions that apply for the Sun JVM today. This converged JVM will be based on OpenJDK. JRockit Mission Control will be available for the Hotspot JVM.
  • Oracle will release two new releases of Glassfish in 2011; Glassfish will be improbed through the inclusion of several features from WebLogic and will very much be continued. It is both an open source product (as well as reference implementation for JEE) and a commercial (support) offering from Oracle (that includes a number of high end facilities also available with WLS). Glassfish will always be first to ship for JEE (for obvious reasons).
  • Oracle also commits to two new NetBeans releases in 2011

Read the rest of this entry »

What questions to get answered at Java One 2010

It is a very early morning in Redwood City. I am currently in a hotel with a great view on the imposing towers of Oracle’s Head Quarters (although it is dark and only a vague outline of the towers can actally be discerned). The largest Oracle show on the planet, the yearly Oracle Open World conference, is about to commence. This year, the largest Java show on Earth – JavaOne – has been incorporated, so that is about to get going too.

Oracle CEO Larry Ellison and top development executive Thomas Kurian are scheduled to discuss “Oracle’s vision for strengthened investment and innovation in Java and describe how Java will continue to grow as the most powerful, scalable, secure, and open platform for the global developer community,” according to an official description of their planned talk.

Today, I will be in the Oracle ACE Director product briefing. This is a gathering of the ACE Directors – a fairly select group of experts and community representatives in various areas of Oracle’s product portfolio, including Database, Fusion Middleware, Oracle Applications and various development tools. Product managers and other Oracle staff – including Thomas Kurian, Executive Vice President Product Development – will enlighten this group about upcoming products and releases. Of course, some serious discussion and (sometimes critical) Q&A will take place. The information made available to this group will soon find its way in blogs, articles and presentations by the ACEDs – decorated of course with their personal views, interpretations and comments. Note that some information may be confidential at the present.

Whenever I attend conferences like these, I set out with a number of questions in my mind that I would like to get answered. These questions are almost like a guide through the conference program and sessions like today’s briefing. Below, I list some of the questions I would like to dive into during this OOW & J1 conference, as this will help me plan my next moves and help my customers with their future plans and timelines.

Read the rest of this entry »

Project Experience with Acegi Security, Spring MVC and Oracle MapViewer

For a customer with an interesting business we had to build a web application that has a RIA front end, displays data on maps, authenticates thru a web service that is connected with a back office customer subscription system, and that can handle any kind of data (for example shops, garages or whatever) as long as it conforms to a certain format. Depending on the specific dataset the application is configured in a different way and behaves differently. I call it a meta data driven application.

Anyway, taken all these aspects together, the building process has been an exciting adventure. From all frameworks we took the latest versions, and came up with the following tech stack: Spring 2.0, Acegi Security System 1.0, Dojo Javascript toolkit, Oracle (Ajax based) MapViewer 10.1.3.1 (released a month ago!) and Oracle 10g database. Spring formed the ecosystem for our application in which we plugged the Javascript presentation layer at the front end, and the unbreakable Oracle database at the back end. In the same container the Oracle MapViewer application is running. Ajax calls are made from the main application to mapViewer server in order to manage map standard behavior like panning and to display fields of interest (FOIs). Apart from these larger components of the architecture, there are other technologies used, for instance: Xfire Java SOAP framework, Commons file upload, JFreeChart, Junit, Log4j and more (yeah, Bruce Tate is probably right when he states in Beyond Java, that
developing a web application nowadays involves too many technologies and frameworks). Looking at this technological cathedral, I just like to mention – in the story below – some parts and experiences that I personally liked or disliked. The different subjects below are:

  • Upgrading from Acegi Security version 0.8 to 1.0
  • Providing authentication in Acegi Security by a webservice
  • Integrating Spring SimpleFormController and Dojo dojo.io.FormBind
  • Using Javascript API of Oracle Mapviewer.

Read the rest of this entry »

Verslag van SpringOne

Op 15 en 16 juni vond in Antwerpen de SpringOne conferentie plaats. Dit event bestond uit vier keynotes, zes zogenaamde university talks, veertig (parallelle) presentaties en 48 sprekers. Dit alles werd bezocht door zo’n 400 ontwikkelaars en andere belangstellenden, afkomstig uit maar liefst 25 landen. In de gangen en zalen hoorde ik veel Engels, Frans, Duits, Italiaans, Spaans, Slavisch en Nederlands. Dit was de eerste conferentie in Europa die specifiek is gericht op het Spring platform. Het grote bezoekersaantal is een indicatie voor de huidige positie in de Java arena, die door Rod Johnson, de grondlegger van Spring, werd aangeduid als “world’s favorite application framework”..... Read the rest of this entry »

Pulling the rug from under your feet while keeping standing – Using the Hot Swappable Target Source in Spring AOP

Spring AOP offers a wealth of new options in programming as well as designing Java applications. A somewhat more advanced feature is the Hot Swappable Target Source. The concept of a hot swappable target source is linked to the use of proxies instead of concrete object implementations, which is the heart of standard, run-time JDK based AOP. To advise an object with aspects, such as described in my previous post Getting into Spring AOP – Implementing simple business logic on top of Domain Objects using Aspect Oriented Programming, a proxy is created. This proxy intercepts method calls intended for the underlying target object and applies aspects for all specified pointcuts. Usually the wrapped target object still gets called somewhere in the middle of executing all the aspects that were advised. Note that the code using the proxy is not aware of the fact that it is not using a 'normal' implementation of the interface it is programmed against but instead a proxy. It does not matter for the code; only when you ask for the myobject.getClass() will get quite another classname than you would expect. However myobject instanceof interface will still result in true. Suppose we have advised an object implementing the Employee interface. The advise adds some validation logic that is executed just prior to invoking the set-methods on the Employee interface (for example to ensure that Salesmen do not get paid too much and that no employee is called John Doe). Since the code using the object is now in reality using a proxy that itself refers a 'real' EmployeeImpl object (EmployeeImpl is a class that implements the Employee interface), it should theoretically be possible to swap one EmployeeImpl currently use as proxy target with another one. Without the program noticing it, it would all of a sudden deal with a completely new underlying object. We will first show that such a thing is indeed possible – and in a fairly simple manner, and then we will discuss why you might one to do something like that. Read the rest of this entry »