Mobile Business Development seminar in Belgium and The Netherlands(4 and 6 June)

iAdvise organises a free seminar about Mobile Business Development on 4(Antwerp, Belgium) and 6(Breda, The Netherlands) June.

In this seminar we will discuss Mobile Development and Usability(UX – User Experience) in Mobile Development.
But we also compare different solutions, give pros and cons about: APEX Mobile, ADF Mobile and Tabris.

Of course we will also show you best practices, problems and solutions,…

More information(Dutch): http://www.iadvise.eu/seminars

Using ADF Logging in a non-ADF project

In a previous post (Starting with ADF 11G Logging), I explained how ADF logging is simple to set up, and how it will enable you to set the logging levels at runtime, without having to restart any server. When I showed this to a colleague of mine, he immedialtely popped the question : “Can’t we use this for all of our java applications, even the ones that don’t use ADF?”. Well, the answer is yes, and it turns out to be very easy. Just add the correct jar to your project and your done.

This blog will demonstrate how to get this working. I use Eclipse Juno to create a small webproject, only containing a servlet that does the logging. In fact I will use the same servlet I used in the previous post.

So I open my Eclipse , and started with a File -> New -> Dynamic Web project. Give it a name, set ‘Dynamic web module version’ to 2.5, click the  ‘Add project to an ear’ checkbox and click finish.

dyn_wb_prj

Now Eclipse has created a web and ear module for me.

Image

Now right click the web project (ADFLogging), and select New -> Servlet, give it a name, eg. TestServlet, and click finish.

Remove the generated code in the servlet, and copy the code from the servlet ‘ExecuteLogger’ from my previous post (here) and paste it in our new serlvet.

PS. : When you copied the code from my previous blog, don’t forget to set ADFLogger.createADFLogger to our current servlet class name : TestServlet.class.

We will get compile errors on HttpServletRequest,etc… and on the ADFLogger class because they are not defined in the classpath of the project. So we’ll add them in order to get our servlet compiled.  I get the 2 jar’s from a JDeveloper installation I did on my machine. We’ll only add these jar’s in order to get the servlet compiled in Eclipse. We will NOT deploy them, as they are already available on our Weblogic server.

To add the jar’s, right click on the web project, and go to Properties. In the Properties, click on ‘Java Build Path’.

buildpath

Click on ‘Add External JARs…’ , and go to the directory where you installed your JDeveloper, which in my case is : C:\Oracle\Middleware.

In that directory , get following jar’s from the sub-directory :

\oracle_common\modules\javax.servlet_1.0.0.0_2-5.jar : contains the servlet classes like HttpServletRequest/Response,etc…

\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-base.jar : contains the ADFLogger classes.

Now we see the the following jar’s added :

jars_added

Click OK and return to the servlet. In the servlet use CTRL-SHIFT-O to import the neccessary classes from the jar’s we just added.

Now all compile errors should be gone.

Generate the ear file as follow : File -> Export -> Ear file

Select the ear project and enter destination of the ear file

When you examine the ear, you will notice that the folder \WEB-INF\lib is empty.

As the servlet and ADFLogger jar is already available on Weblogic, there is no need to deploy it with our application.

Now deploy the ear to the Weblogic and test the servlet with following url. :

http://localhost:7101/ADFLogging/TestServlet

It will generate following output :

output

To check the logging done by this servlet :

As I used the integrated Weblogic of JDeveloper, I will look for my logs using JDeveloper, but in a production environment,

these logs can be viewed using the enterprise manager of Weblogic. For details, see my previous blog.

In the Oracle Diagnostics Logging configuration, I see my servlet after the deployment. No message level is defined, so it will take “Warning”, as this one is defined as default by the Root Logger

logger

After te execution, I see following log lines in the log analyzer.

result

So that’s it. So the bottom line is to add the ADFLogger jar to your non-ADF project, and you are ready to go !

OBUG Connect 2013: iAdvise presentation on ADF & Web Services

On 26 March OBUG Connect, the yearly Oracle Benelux User Group conference, will be held in Antwerp.

iAdvise will be presenting about ADF and web services.
We’ll show you how you can expose your ADF Business components as Web Services.
But also how you can consume Web Services in your application.

The presentation is session 3 in the “Middleware track”(track 7) and starts at 15.45.
We hope to see you in Antwerp!

 

Slides of the ODTUG Webinar: “Oracle ADF Immersion: How an Oracle Forms Developer Immersed Himself in the Oracle ADF World”

A few weeks ago we did an ODTUG Webinar: “Oracle ADF Immersion: How an Oracle Forms Developer Immersed Himself in the Oracle ADF World”.

About 186 followed the seminar online.
Those people received a link to the recorded session and the slides of the presentation.

For those who couldn’t attend, these are the slides of the presentation: ADF Immersion presentation
But the presentation was a lot more than a few slides, there was also a demo(>30 minutes).
So if you want to see the full recording, you can see all past webinars as a full ODTUG member.

If you need more info on ADF methodologies and ADF best practices or want to ask questions about these topics, check out the ADF EMG group.

Starting with ADF 11G Logging

In software development, logging is an indispensible part of the job. When developing  java programs, Log4j (Apache framework) is probably the most commonly used framework.

But when we are writing Java programs, using the Oracle ADF framework, there is another option : ADF Logger. This logger is integrated in the Weblogic enterprise manager, and gives you the flexibility to adjust your log-levels at runtime. This blog post briefly demonstrates how the ADF logging works, using a servlet that logs at all levels.

The first example is run on a remote Weblogic server. At the end of the post the same example is run within the integrated Weblogic server of JDeveloper.

First we start with viewing the loggers defined in Oracle Enterprise Manager (OEM) before our servlet is deployed :

em_go_to_logconfig_2

When we select ‘Log Configuration’ we get the Log Configuration screen, where some loggers are already defined and their loglevels can be configured :

em_initieel_2

We’ll deploy a servlet that uses the ADF Logger, change the loglevels at runtime, and check the logging to see what happens.

So fire up your JDeveloper and select a new Fusion Web Application (ADF) or download the JDeveloper project from  https://www.dropbox.com/s/mwkjdw8k265iadx/LoggerApp.zip

Then create a servlet like the one below, which is a simple servlet called ‘ExecuteLogger’ that logs a message on all loglevels :


package be.iadvise.loggerapp;

 import java.io.IOException;
 import java.io.PrintWriter;

 import java.util.Calendar;

 import javax.servlet.*;
 import javax.servlet.http.*;

 import oracle.adf.share.logging.ADFLogger;

 public class ExecuteLogger extends HttpServlet {
  private static final String CONTENT_TYPE = "text/html; charset=UTF-8";

 private static ADFLogger _log = ADFLogger.createADFLogger(ExecuteLogger.class);

  public void init(ServletConfig config) throws ServletException {
  super.init(config);
  }

 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  response.setContentType(CONTENT_TYPE);
  PrintWriter out = response.getWriter();
  out.println("<html>");
  out.println("<head><title>Executing logging with ADFLogging and System.out.println</title></head>");

 Calendar cal = Calendar.getInstance();
  String loggingId = Long.toString(cal.getTimeInMillis());
  out.println("<h1>Executing logging with ADFLogging and System.out.println</h1>");
  out.println("<h2>Used Logging id = "+loggingId+"</h2>");
  out.println("<p>The logging id is different for each request.</br>Use the logging id to search the log messages in the logfiles or EM for this request.");
  out.println("<p>Logger Name in EM = "+_log.getName());

  out.println("<p>****************** START LOGGING ******************");

  out.println("<table >");

 // FINEST
  _log.finest("Loglevel finest : This is a logmessage with the ADFLogger. Logging id = "+loggingId);
  System.out.println("Loglevel finest : This is a logmessage with the System.out.println. Logging id = "+loggingId);
  out.println("<tr><td>FINEST</td><td>Loglevel finest : logMessage written to ADFLogger and System.out.println. Logging id = "+loggingId+"</td></tr>");

  // FINER
  _log.finer("Loglevel finer : This is a logmessage with the ADFLogger. Logging id = "+loggingId);
  System.out.println("Loglevel finer : This is a logmessage with the System.out.println. Logging id = "+loggingId);
  out.println("<tr><td>FINER</td><td>Loglevel finer : logMessage written to ADFLogger and System.out.println. Logging id = "+loggingId+"</td></tr>");

  // FINE
  _log.fine("Loglevel fine : This is a logmessage with the ADFLogger. Logging id = "+loggingId);
  System.out.println("Loglevel fine : This is a logmessage with the System.out.println. Logging id = "+loggingId);
  out.println("<tr><td>FINE</td><td>Loglevel fine : logMessage written to ADFLogger and System.out.println. Logging id = "+loggingId+"</td></tr>");

  // CONFIG
  _log.config("Loglevel config : This is a logmessage with the ADFLogger. Logging id = "+loggingId);
  System.out.println("Loglevel config : This is a logmessage with the System.out.println. Logging id = "+loggingId);
  out.println("<tr><td>CONFIG</td><td>Loglevel config : logMessage written to ADFLogger and System.out.println. Logging id = "+loggingId+"</td></tr>");

  // INFO
  _log.info("Loglevel info : This is a logmessage with the ADFLogger. Logging id = "+loggingId);
  System.out.println("Loglevel info : This is a logmessage with the System.out.println. Logging id = "+loggingId);
  out.println("<tr><td>INFO</td><td>Loglevel info : logMessage written to ADFLogger and System.out.println. Logging id = "+loggingId+"</td></tr>");

  // WARNING
  _log.warning("Loglevel warning : This is a logmessage with the ADFLogger. Logging id = "+loggingId);
  System.out.println("Loglevel warning : This is a logmessage with the System.out.println. Logging id = "+loggingId);
  out.println("<tr><td>WARNING</td><td>Loglevel warning : logMessage written to ADFLogger and System.out.println. Logging id = "+loggingId+"</td></tr>");

  // SEVERE
  _log.severe("Loglevel severe : This is a logmessage with the ADFLogger. Logging id = "+loggingId);
  System.out.println("Loglevel severe : This is a logmessage with the System.out.println. Logging id = "+loggingId);
  out.println("<tr><td>SEVERE</td><td>Loglevel severe : logMessage written to ADFLogger and System.out.println. Logging id = "+loggingId+"</td></tr>");

  out.println("</table>");

  out.println("<p>****************** END LOGGING ******************");

  out.println("<body>");
  out.println("</body></html>");
  out.close();
  }
 }
 

Then, map this servlet in your web.xml as follows :

<servlet>
 <servlet-name>ExecuteLogging</servlet-name>
 <servlet-class>be.iadvise.loggerapp.ExecuteLogger</servlet-class>
 </servlet>
 <servlet-mapping>
 <servlet-name>ExecuteLogging</servlet-name>
 <url-pattern>/executeLogging</url-pattern>
 </servlet-mapping>

The line

private static ADFLogger _log = ADFLogger.createADFLogger(ExecuteLogger.class);

will create an entry in the ADF logging panel of OEM  for the class ‘be.iadvise.loggerapp.ExecuteLogger’ during the first execution of our servlet.

So generate the ear file (in JDeveloper : Application -> Deploy -> your application) , and deploy to an ear , and deploy the ear to your remote Weblogic.

Then, execute the servlet by entering following url in a browser http://server:port/appname/executeLogger

We will receive the following output where the logging id is a unique id for every request (this will help us find the log info logged for every run) :

output_servlet_3

and in our log configuration screen, the logger for our servlet is added automatically with level WARNING :

EM_na_uitvoeren_servlet_2

When we look to the logging itself, by selecting the following :

go_to_logmessages

We see that our servlet has logged 2 lines  : level WARNING and ERROR, as the logger was default created with level “warning”.

(We look in the log files for the id generated by the servlet to get our 2 lines)

output_first_log_2

Now let’s update our log level to TRACE (finest), press apply, confirm the update, execute the servlet again , and see what happens to our logging :

trace

confirm the update :

confirm

execute the servlet again (it generates a new logging id)

new_servlet

look for the generated logging :

new_logging

As we have set the loglevel to trace (finest), which is the lowest level, we see all the generated loglines.

Remark : When we undeploy the application, the logger will remain visible in the log configuration screen until the managed server is restarted.

Using the integrated Weblogic server in JDeveloper

This screen shot shows you how get to the log configuration and logging screen in JDeveloper :

1_go_log_screen

After executing the servlet locally, the Oracle Diagnostic Logging will show you the following :

2_log_config

and the analyze log :

3_logging_first_run

then we change the log level :

4_change_log_level

and execute the servlet again and watch the output :

5_output_logging_2

That’s it !!!

The big advantage of ADFLogging is the update of the loglevel at runtime, so whenever something seems to be going wrong, just set the loglevel to e.g. TRACE and check the logfiles. When the problem is solved reset it to WARNING or ERROR. And this without having to restart your application.

Also, being able to view and search the logfiles using the EM increases the userfriendlyness of this system. You don’t have to access the files directly on the system anymore.

ODTUG Webinar: “Oracle ADF Immersion: How an Oracle Forms Developer Immersed Himself in the Oracle ADF World”

On Oracle Open World we had the chance to present our “Oracle ADF Immersion” track thanks to the ADF EMG.
In case you couldn’t attend OOW or missed the session, you’ve got another chance: on january 10, 2013 we will present it as an ODTUG Webinar.

We will show you how you can start with ADF, coming from an Oracle Forms(or non-java) background.
You can register for the webinar here.

If you like to join the ADF EMG, don’t hesitate, it’s a free ADF usergroup!

Oracle Open World 2012: the first day

I hope today was the hardest day of the trip…
We landed In San Francisco on saturday afternoon.
From the airport to Moscone West for our conferences passes because we had our presentation at 9am on sunday morning.
A late dinner and off to bed, but after being awake for 24 hours, something called jetlag wakes you up in the middle of the night.
And like I said, we had to be at Moscone South at 9am for our session: “Oracle ADF Immersion: How an Oracle Forms Developer Immersed Himself in the Oracle ADF World“.
It was a session for ADF EMG, hosted by Chris Muir.
A nice turnout for a sunday morning, allthough I don’t think all 120 pre-registered were there that early.
I hope we could convince some Forms developers that they really can start with ADF and that they will conquer the barriers like the Oracle Forms Community blog writes.

The other sessions I followed of the ADF EMG were very interesting:

  • ” A Peek into the Oracle ADF Architecture of Oracle Fusion Applications”: Simon Haslam had invited Ken Mizuta of Oracle Applications and he answered questions about how they developed and set up Oracle Applications.
  • And the 3 hour live demo: “Oracle Fusion Middleware Live Application Development Demo ” of Lucas Jellema, Ronald van Luttikhuizen, Guido Schmutz, Luc Bors and Aino Andriessen.  Very interesting to see how they worked out a complete application with BPM, SOA and ADF.

Also two announcements at the ADF EMG sessions:

And of course at the end of the day there was the Keynote of Fujitsu(mainly about Big Data) and Larry Ellison.
A lot of strange faces when Larry had a remote control to change slides…everybody seemed to think ‘no more “Next slide, please!”?’, but then it happened…he said it.  On purpose?  Maybe :-)

Larry did some announcements:

  • IaaS(Infrastructure as a Service)
  • Private Cloud: you own cloud behind the firewall
  • Database 12C: the first multi-tenant database
  • Exadata X3 with……..26TB (flash)memory!

Off to bed now!

Oracle Forms community at Oracle Open World 2012

Less than 3 weeks before the biggest Oracle event in the world kicks off: Oracle Open World 2012!

I already wrote about some interesting events: ADF EMG Sunday and the Oracle Benelux Architectural event.

In case you’re into Oracle Forms, you can add an extra event to that: The Oracle Forms Community Event.

After the session of Mia Urman and Grant Ronald “CON5639 - Give Your Forms a Face-lift: Tips and Tricks for Oracle Forms GUI Modernization“(Tuesday, Oct 2, 11:45 AM – 12:45 PM – Marriott Marquis – Foothill F) there will be an “Ask the experts” event.
Here we will answer questions from the audience with Grant Ronald (Oracle Forms Product Manager) as our moderator and a panel of experts(with Lucas Jellema, Oracle Ace Director, as one of them) both solution providers and consultants.

I will be one of the experts too:
- 14 years of Oracle Forms experience
- Presented on several conferences and seminars on Forms and Forms Modernization(OOW, UKOUG, …)
- Presenting this year on OOW: UGF3783 - Oracle ADF Immersion: How an Oracle Forms Developer Immersed Himself in the Oracle ADF World

You can register and add questions using this form.