Tag Archives: Java

Java

Installing an all 64 bit JDK JDeveloper set on Windows7

You might know that JDeveloper is supported on 64 bit versions of Java and Windows since release 11.1.1.4. Fusion Middleware is supported on JDK7 both 11g and 12c versions since May 2012. So I decided to try to install an 64 bit JDK7, 64 bit JDeveloper on Windows 7 64 bit.

Since most of my JDeveloper work is aimed at SOA Suite, BPM and non-ADF Java, I choose the JDeveloper 11g IDE. On the JDK site I started with JDK7u6. However a security thingie got in the way and I switch to JDK7u7. I’m assuming you have a PC/laptop/VirtualMachine running a 64 bit version of Windows7.

Install JDK7 update 7


The latest JDeveloper support/certification info states:

  • 64 bit JDK supported for Windows as of JDeveloper 11.1.1.4.0
  • For JDK 6, update 24 or later is recommended
  • For JDK 7, update 3 or later is recommended

However due to the security vulnerabilities in all earlier JDK 7 versions (on all OSes and their browsers) it is recommended to install only JDK7 update 7 and up.

Download JDK 7 for Windows 7 64bit. To install JDK7 on Windows7 double click the downloaded file.

Install JDeveloper 11.1.1.6


Since we have chosen a 64 bit JDK ourselves we downloading the jdevstudio11116install.jar from OTN Developer Tools site.

Before installing we check whether the correct JDK version will be used (from the command prompt (cmd)):
C:\Oracle\jdk7u7\bin>java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

C:\Oracle\jdk7u6\bin>

And then to install JDeveloper from the command prompt (cmd):

C:\Users\deltalounge\Downloads>java -jar jdevstudio11116install.jar
Extracting 0%...................................................................
.................................100%

Then a GUI starts and the most important screens are:

Install SOA Suite, BPM and AIA extensions


Follow the guidance of these post to install JDeveloper extensions:

And you are ready to go.

How to VirtualBox overview

VirtualBoxIn this post we’ll share some VirtualBox resources that will help you to use Oracle virtualization product VirtualBox.

Installing an Operating System in VirtualBox

There are several great blog post on how to install an Operating System (OS) in VirtualBox. The install Ubuntu 11.04 in VirtualBox not only offers a good step by step guide to install Ubuntu (also check the more recent Ubuntu 12.04 ) , the steps also provide great insights when you want to install other operating systems. It is fairly easy to get from there to installing Windows8 in VirtualBox.

VirtualBox appliances and extending them

There are several great VirtualBox Appliances for Developers. Oracle offers for example both an appliance to test drive SOA Suite 11g and BPM 11g and a very recent appliance running WebLogic Server 12c , including a bunch of Java tools (including NetBeans, OEPE, Subversion, Hudson, Maven).

These VirtualBox Appliances can easily be extended for example with Oracle OSB as described in installing OSB on SOA Suite 11g appliance and extend SOA Suite appliance with Oracle Service Bus. The latter showing you how to extend the SOA domain and the first how to install OSB in a seperate domain.

Dealing with real world problems using VirtualBox

There a several examples on the web. I’d like to share three of them. The first shows you how to create a duplicate disk for use in an additional virtual machine. The second shows you how to update a Vagrant box.

On the side: Vagrant uses Oracle’s VirtualBox to build configurable, lightweight, and portable virtual machines dynamically. It uses Chef or Puppet to provision them. Vagrant is used so other developers can get up and running in just a couple commands.

The third shows you how we solved VBOX_E_FILE_ERROR (0x80BB0004) :
VBoxManage.exe: error: Code VBOX_E_FILE_ERROR (0x80BB0004) – File not accessible or erroneous file contents (extended info not available)

Or how to solve VirtualBox VERR_VMX_MSR_LOCKED_OR_DISABLED (0x80004005)
Failed to open a session for the virtual machine Ubuntu 12.10.
VT-x features locked or unavailable in MSR. (VERR_VMX_MSR_LOCKED_OR_DISABLED).

Since Virtual Machines can be quite demanding for resources on your PC or laptop: Here are some hints to increase appliance performance in VirtualBox.

Have Fun!

VirtualBox Appliance for WLS development with Eclipse, Maven, and Hudson

With the Oracle Technet Virtual Developer Day coming up a great VirtualBox appliance came available. The developer day focusses on developing Java EE6 applications and Oracle WebLogic Suite 12c.

WebLogic Server 12.1.1 VirtualBox Appliance

The virtual machine contains:

  • Oracle Linux 5, JDK 1.6 +
  • Oracle WebLogic Server 12.1.1
  • Oracle Coherence 3.7
  • Oracle TopLink 12.1.1
  • Hudson 2.2
  • Subversion 1.4.2
  • Apache Maven 3.0.1
  • NetBeans IDE 7.1 RC2
  • Oracle Enterprise Pack for Eclipse 12.1.1 / Eclipse 3.7
  • Easter Egg: Introductory Labs for Oracle Coherence 3.7

All details on download and importing the appliance can be found on the VirtualBox instructions page. No need to say that the appliance has been released for development and testing purposes.

Labs

The image contains four Labs:

  • Total Oracle WebLogic Server Development with Eclipse, Maven, and Hudson
  • Hands on with an end-to-end Java EE6 Application
  • A Step-By-Step Guide to Oracle Coherence
  • Running the Coherence Examples Project in Eclipse

These can be found in the /home/oracle/labs/ directory. Web links to these Labs can be found here.

Memory issues after installing OER

OER assetsAfter installing Oracle Enterprise Repository (OER) we experience some memory issues. Besides the messages in the log files, we also couldn’t use the console and em as we did before (when we were just running SOA Suite). It turned out the installation of OER in the same Weblogic domain resulted in some unexpected things.

The WebLogic Server and SOA Suite are started using the startWebLogic script (for windows .cmd and on Linux/Unix .sh). This script uses the setDomainEnv script to set the environment variable for the domain. The setDomainEnv script in turn calls the setSOADomainEnv that actually sets the USER_MEM_ARGS. That in the end are used in the startWebLogic script.

After the installation of OER the setDomainEnv not only calls the setSOADomainEnv. It also calls a script that sets the USER_MEM_ARGS for the oer_server in the domain. Apparently the memory required for OER is less than needed for the SOA Suite. Since the script for OER is executed last, memory setting remain low. As shown in the smippet taken from the setDomainEnv.cmd:

call "%WL_HOME%\common\bin\commEnv.cmd"
call "%DOMAIN_HOME%\bin\setSOADomainEnv.cmd"
call "%DOMAIN_HOME%\bin\setOERDomainEnv.cmd"

To solve the memory issue when starting the WebLogic Server using the startWebLogic script we alter the sequence so the setOERDomainEnv.cmd goes before the setSOADomainEnv.cmd.

If the installer put a second call to setSOADomainEnv.cmd in the setDomainEnv.cmd. That doesn’t work because the setSOADomainEnv.cmd contains the following check:

REM Skip running this script again if it was run once
if "%XENGINE_DIR%" == "" goto set_env
echo *********************************************************
echo ** SOA specific environment is already set. Skipping ...
goto end_set_env

.

Installing JRockit on Ubuntu

This post will show you how to install JRockit on Ubuntu 11.04. In later posts this will be used to run both WebLogic Server and Oracle Service Bus (OSB).

First download the installer from the JRockit download page. Make sure that the .bin file is executable. You can use chmod +x filename to make the file executable.

The installation guide for JRockit can be obtained from the JRockit Documentation page.

  • Start the installer: ./jrockit-jdk1.6.0_24-R28.1.3-4.0.1-linux-x64.bin from the directory you download it or copied it to. Extracting can take some time.
  • Click Next on the Welcome screen.
  • Choose the product installation directory eg /oracle/jrockit-jdk1.6.0_24 and click Next
  • Check optional components if you need them and click Next
  • Watch the progress bar 😉
  • The installation is complete so press Done.

The screenshots of the installation process are in this gallery:

JDeveloper 11.1.1.4. supports 64-bit versions of Windows and Java

There is a small note in the JDeveloper 11.1.1.4 Installation Guide:

This release of Oracle JDeveloper supports the 64-bit versions of Windows and Java.

More on the question What is 64-bit Java?, can be found on this Java Hotspot FAQ.

The Installation Guide mentioned before doesn’t show additional details on How-To get JDeveloper working on Windows 7 with an 64 bit Java version….
To get this working:

  • Download and install a recent 64 bit JDK for Windows 7 64 bit, eg jdk-6u24-windows-x64
  • go to the $Middleware_Home$\jdeveloper\jdev\bin directory and edit the jdev.conf
  • Alter the SetJavaHome to the directory in which you just installed the JDK:
#
# Directive SetJavaHome is not required by default, except for the base
# install, since the launcher will determine the JAVA_HOME.  On Windows
# it looks in ..\..\jdk, on UNIX it first looks in ../../jdk. If no JDK
# is found there, it looks in the PATH.
#
#SetJavaHome C:\Oracle\Middleware\jdk160_21
SetJavaHome C:\Program Files\Java\jdk1.6.0_24
  • And then start the jdev64W.exe in the $Middleware_Home$\jdeveloper\jdev\bin directory.

Additional hints

February 2012 Spyros Doulgeridis posted on his blog on Running JDeveloper in 64 bits. He shows additional guiding on:

  • Adjust JDeveloper’s memory settings in in the C:\Oracle\Middleware\jdeveloper\ide\bin\ide.conf
  • Increasing the memory of the embedded weblogic – in the setDomainEnv.cmd file
  • Configure Windows pagefile – to avoid the Virtual Memory Minimum Too Low error in Windows

Using Quartz with SOA Suite 11g

Already in 2006 Clemens posted on scheduling BPEL processes. More recently with BPEL in SOA Suite 11g a bug ( 8927175: PROVIDE QUARTZ SCHEDULER) was submitted. The rquest text:

The product does not have schedular to schedule BPEL processes. Need to schedule the BPEL processes through SOA11G and not through unsupported softwares(Quartz).

And the business need:

Some processes need to be scheduled at a particular time and at a particular day and should not be started Manually, increases the maintenance cost of the software.

These together indicate a clear need to schedule reoccurring processes. Although I’m not so sure that this functionality should be provided by this platform. One could see advantages in centralizing all scheduling task. There a good commercial product available for cases like that (Redwood’s Cronacle for example).

On Oracle Technet there is a good document on Configure a SOAScheduler for a composite in SOA Suite 11.

One Job, multiple Schedules

We need a Class that implements Job. Something like:

package net.deltalounge.quartzdemo;
 
import java.util.Map;
 
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;
 
public class DemoJob implements Job {
    public DemoJob() {
        super();
    }
 
  public void execute(JobExecutionContext context)
     {
      Map dataMap = context.getJobDetail().getJobDataMap();
      RunMeTask task = new RunMeTask();
      String someString ="init";
      someString = context.getTrigger().getName();
      System.out.println("Quartz demo output: "+someString);      
    }
}

And we need a Class that creates and starts the Scheduler. This Class can also schedule the jobs. Here we actually see that although one Job Class is enough we need to declare mutiple JobDetails.

package net.deltalounge.quartzdemo;
 
import java.util.Map;
 
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.impl.StdSchedulerFactory;
 
public class QuartzAppCronTrigger {
  public static void main( String[] args ) throws Exception
      {
        //scheduler task details
        JobDetail job = new JobDetail();
        job.setName("someJob");
        job.setJobClass(DemoJob.class);
        //
        JobDetail job2 = new JobDetail();
        job2.setName("someOtherJob");
        job2.setJobClass(DemoJob.class);
 
        //configure scheduler time
        CronTrigger trigger = new CronTrigger();
        trigger.setName("someJobTrigger");
        trigger.setCronExpression("0/30 * * * * ?");
 
        //configure scheduler time 2
        CronTrigger trigger2 = new CronTrigger();
        trigger2.setName("someOtherTrigger");
        trigger2.setCronExpression("0/20 * * * * ?");
 
        //create the schedule
        Scheduler scheduler = new StdSchedulerFactory().getScheduler();
        scheduler.start();
        scheduler.scheduleJob(job, trigger);
        scheduler.scheduleJob(job2, trigger2);
      }
 
}

If you don’t define multiple jobs prepare for an error like:

Exception in thread "main" org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'someJob' and group: 'DEFAULT', because one already exists with this identification.
	at org.quartz.simpl.RAMJobStore.storeJob(RAMJobStore.java:222)
	at org.quartz.simpl.RAMJobStore.storeJobAndTrigger(RAMJobStore.java:195)
	at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:732)
	at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:265)
	at net.deltalounge.quartzdemo.QuartzAppCronTrigger.main(QuartzAppCronTrigger.java:36)

VirtualBox Appliances for Developers

I’m a fan of ready to use appliances for development and demo purposes. Recently it was announced that additional developer Virtual Machines have been released by Oracle. These in addition to the SOA Suite and BPM appliance mentioned before.

Developers can simply download a few files, assemble them with a script , and then import and run the resulting pre-built VM in VirtualBox. This makes starting with these technologies even easier. Each appliance contains some Hands-On-Labs to start learning.

Java Developement

This VirtualBox Appliance contains:

  • Java SE (JDK) 1.6.0 u20 (note: Mac OS X 10.5 users must use Apple update)
  • Java FX 1.3.1 runtime
  • NetBeans IDE 6.9.1
  • GlassFish Server Open Source Edition 3.0.1 (installed with NetBeans)

The Aquarium says about this Java EE6 VM:

This is everything you need to get started with Java EE 6 development and you’ll even find three labs (with code and instructions) to start using JSF 2, JAX-RS 1.1, EJB 3.1, Servlet 3.0, JPA 2.0 and CDI 1.0!

For detailed instructions and downloads go here…

Oracle Database Development

This VirtualBox Appliance contains:

  • Oracle Enterprise Linux 5
  • Oracle Database 11g Release 2 Enterprise Edition
  • Oracle TimesTen In-Memory Database Cache
  • Oracle XML DB
  • Oracle SQL Developer
  • Oracle SQL Developer Data Modeler
  • Oracle Application Express 4.0
  • Oracle JDeveloper
  • Hands-On-Labs (accessed via the Toolbar Menu in Firefox)

For detailed instructions.

It is expected that more flavors will be available in 2011.

Sharing artifacts using the MDS Repository

Both during development and maintenance of code, deployment strategies relying on copying of artifacts will fail, or at least complicate the task at hand and frustrate reuse. SOA Suite offers a centralized storage for artifacts (like WSDL, XSD, and XSL files) that can be accessed both at design time and at run-time. It is called the MDS Repository, and comes with Metadata Services on top of it. It is part of the SOA Suite and doesn’t require additional installation. This blogpost will show you how to upload an artifact to the central MDS Repository, and how to use the uploaded artifact in your source code.

Locate and copy the WSDL

Locate the WSDL file in your project on the local file system, for example: C:\JDeveloper\mywork\AIApocBOUW\CreateInventoryTransactionRIBRMSProvABCSImpl.wsdl. In which a convention like C:\JDeveloper\mywork\__Workspace__\__project__ is used. You can also determine this path in JDeveloper by selecting the WSDL file and use CRTL-SHIFT-C (or by selecting contextmenu – Copy Path).

Use an FTP tool to move the file to the server running the SOA Suite. The path to use on the server depends on the application, version and component type. Typically in AIA there is a structure like $AIA_HOME/AIAMetaData/AIAComponents/ApplicationConnectorServiceLibrary/__Application__/__version__/__componentType__ . Where in AIA component types are ABCS Provider, ABCS Requestor, EBS, et cetera. In other environments you can create your own structure. Since you no longer need a local copy of the WSDL, remove it from your local file system.

Load the WSDL in the MDS Repository

To load the WSDL and other artifacts to the MDS repository there is an ANT script available on the server. To use ANT, make sure the needed environment settings are made correctly. When you installed AIA there is a Shell script available the will source both AIA and ANT environments: aiaenv.sh. This script can be found in ...../weblogic/aia30/aia_instances/aia30poc/bin. It can be convenient to copy this to your home directory.

  • Source AIA and ANT environment: source ./aiaenv.sh.
  • Alter the UpdateMetaDataDP.xml configuration file. It can be found in ...../weblogic/aia30/aia_instances/aia30poc/config.

In case your vi isn’t up to par use a tool like WinSCP and choose Edit in the context menu:

In the UpdateMetaDataDP.xml file alter the file set. In the example on which the screenshot is based
AIAComponents/ApplicationConnectorServiceLibrary/Retail/V1/RequesterABCS/CreateStockChangeLOCUSReqABCSImpl.wsdl
is added.

And now you are ready to run ANT using the actual loading script:
ant –f /fs01/app/oracle/esbtst01/weblogic/aia30/Infrastructure/Install/scripts/UpdateMetaData.xml


Check the output of the ANT script:

  • check that the correct number of files has been copied.
  • the server gave a HTTP response 200.
  • The deployment of the composite was successful.

Another check to verify a correct load into the MDS Repository is to use the MDS Browser in JDeveloper to find the file you just uploaded. A refresh of the view could be needed to include the latest changes and additions.

Using the WSDL in the MDS Repository in your source code

The last step is to reference to the WSDL in the MDS Repository, since the file has been removed from the local file system. Double click the Exposed Service to open the wizard:

Choose Existing WSDL to select the WSDL from the MDS Repository:

Check the change using the source view. In the import of the WSDL in the composite.xml there should now be an URL referring to oramds:, like in the example below:

<import namespace="http://xmlns.oracle.com/ABCSImpl/LOCUS/Core/CreateStockChangeLOCUSReqABCSImpl/V1"
        location="oramds:/apps/AIAMetaData/AIAComponents/ApplicationConnectorServiceLibrary/Locus/V1/RequesterABCS/CreateStockChangeLOCUSReqABCSImpl.wsdl"
        importType="wsdl"/>