Monday Aug 20, 2012

Book Review: Oracle WebLogic Server 12c: First Look

"Oracle WebLogic Server 12c: First Look" written by Michel Schildmeijer and published by Packt Publishing (ISBN 978-1-84968-718-8) is a well structured overview of new features in Java EE 6 and Oracle WebLogic Server 12c. On 117 pages (no typo on my side), Michel provides a well done digest of what you need to know about Java EE 6 development and deployment with WebLogic server 12c. Michel shows in depth expertise in the Java EE and open source landscape as well as in WebLogic server configuration and administration, as well as Oracle Exalogic.

  • Chapter 1 "Ready for the Cloud!" is a brief introduction to Oracle's WLS stratey and the features of Java EE.
  • Chapter 2 "Supporting the Java EE 6" shows an overview of interesting Java EE 6 features like CDI, EJB 3.1, JSF 2.1, JPA, Servlet 3.0 and REST. The book doesn't go in depth when describing the new features but gives you enough information to feed Google for more information.  From a developer perspective its a well written heads up on what you want to research further in preparation for JDeveloper 12c and WLS 12c.
  • Chapter 3 "Deployment, Installation and Configuration Features" lets you know about a lean start option of WLS, class loader analysis, Enterprise Manager functionality and additional packages for application performance monitoring. Again, a lot of heads up to follow up on.
  • Chapter 4 "Integrated and External Services" is about Grid Link and RAC integration, as well as new JDBC features. You also learn about WLS and Java EE security services and the work with RESTful services. Again, this chapter only scratches the surface and is more of a laundry list of what you want to follow up with for your future application development(I at least put down a lot of notes). If you are a project lead or manager (so no developer who need to know exactly how to do things), then this chapter however provides you all information you need to know of.
  • Chapter 5 "Integration and Management with Enterprise Manager 12c Cloud Control is - together with chapter 2 - my personal favorite and explains Enterprise management options a bit closer. Especially WebLogic Server 12c monitoring in this chapter is what I thought "this is what people really need to know about".
  • Chapter 6 "Oracle Weblogic 12c to the Cloud: Exalogic" is less in depth information on what Oracle Exalogic and Exadata is but again provides a reasonable bird's eye overview of the benefits this system provides

As mentioned, 117 pages full of information that are worthwhile reading. The perfect holiday novel for geeks. Definitive, this book is a best value you can get for the cost of if.

See: http://www.packtpub.com/oracle-weblogic-server-12c-first-look/book

Tuesday May 08, 2012

Managing component value state correctly

A frequent problem reported on OTN is about failure in saving component values using managed beans especially when multi-select components are used. Usually the problem arises when developers store select choice components values in managed beans they use for JSF component bindings as well (which then makes the managed bean becoming a backing bean). Backing beans however are saved in request scope (at least they should to not err again).

Request scope beans however reset their state after each request, which means that no user update in a select component is persisted beyond the request. The result is that user changes are not displayed in the UI or value change listeners don't execute.The proper way of handling the combination of backing beans and component values saved in a managed bean is to come up with a strategy in which the component value is written to a separate bean in a broader scope (I usually recommend viewScope) than the backing bean. The backing bean (request scope) would then access the bean in the larger scope using a ValueExpression or managed bean property to access the user selected data.

I was about to write this solution up in more detail but then found the following blog entry by Duncan Mills:

https://blogs.oracle.com/groundside/entry/the_uimanager_pattern

In his The UIManager Pattern blog entry, Duncan documented the same problem from a different angle. The programmer mistake Duncan observed was that component binding references (the Bindings property reference on an ADF Faces component) were stored in managed beans with a scope larger than request, which JavaServer Faces component don't support.

 In his write-up Duncan documents the same strategy I was about to document, which is to separate the value saving from the component reference using different managed beans in different scope. Well, I think that Duncan's blog entry saved me some time I today.

Friday May 04, 2012

Scope object serialization failed (object not serializable)

A common reason for the "SEVERE: ADFc: Scope object serialization failed (object not serializable)" error message is that application developers reference JSF components in managed beans with a scope larger than request. When using the JSF component Binding property to point to a managed bean, think backing bean and thus don't reference beans that are in scopes larger than request scope (don't: viewScope, pageFlowSope, sessionScope, applicationScope).

If, from a managed bean in a scope larger than request you need to have access to a component instance (though the other way around is a more common use case) then either

As mentioned, a more common use case is to access a bean in a scope larger than request from a backing bean. A use case for this is if you need to remember a specific state, like a list of selected values in a select many list, or the disclosure state of panel tabs.

In this case you would save the state information in a bean with a lifecycle that spans beyond request scope and access it from a request scope backing bean using a managed property or by resolving EL in Java.

Tuesday Feb 28, 2012

Accessing WebLogic Server JDBC DataSource from Java in JSF

There may be a requirement for you to access a JDBC data source defined on the WebLogic Server (for example to query a database or database schema other than the one the application's business service is connected with.

To access the JDBC DataSource, for example from a managed bean in JSF, you code like the following:

java.sql.Connection
connection = null;
try {
  javax.naming.Context initialContext = new javax.naming.InitialContext();
  javax.sql.DataSource dataSource = 
            (javax.sql.DataSource)initialContext.lookup("java:comp/env/jdbc/hrconnDS");
  connection = dataSource.getConnection();
  
 } catch(Exception e){
      e.printStackTrace();
      //or handle more gracefully 
 }
In the example above, the JDBC DataSource is defined in WLS as "hrconnDS"
About

The Oracle JDeveloper forum ranks in the Top 5 of the most active forums on the Oracle Technology Network (OTN).



The OTN Harvest blog is a summary of selected topics posted on the OTN Oracle JDeveloper forum.



It is an effort to turn knowledge exchange into an interesting read for developers who enjoy little nuggets of wisdom





Frank Nimphius

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today