Meet ojdeploy's big brother ojserver

Just over a year ago Oracle released the 11gR2 branch of JDeveloper starting at version 11.1.2.0.0.  The primary reason for that release was giving customer's JSF2.0 support in ADF, though our 11gR1 branch remains for various reasons.


While JSF2.0 is the primary reason to check out 11gR2, there are some minor other benefits including that of ojserver, which is ojdeploy's big brother.

I first became aware of ojserver when Oracle ACE John Stegeman mentioned it when he spotted in 11.1.2.0.0, it's come up on the ADF EMG a number of times, and I've been curious about it ever since.  Part of that curiosity is peaked by the fact that ojdeploy is one of Oracle's, let's say, least loved products.  I'm not utterly convinced by the naysayers' arguments about ojdeploy, but putting that aside, it does leave us wondering what ojserver does and what problem it attempts to rectify for ojdeploy.

Why ojserver was invented was to address an issue with the Fusion Applications build.  To date the statistics for the size and number of libraries in Fusion Apps is rather impressive.  And it is ojdeploy's task to build all those libraries and the resulting application.  At one stage it was observed the Fusion Apps build times were becoming rather long, and with a bit of analysis it was determined that the start and stopping of ojdeploy for each build component was a large time sink.

Why was this?  ojdeploy is ultimately a "headless" JDeveloper which requires it's own JVM to start, run and stop.  As you can appreciate that lifecycle takes time.  If you call it seven hundred times, that's seven hundred times ojdeploy needs to be start, run and stop.  There's not much we can do about the run bit, that's the bit when ojdeploy is actually doing it's real job, but is there anything Oracle could do to fix the start and stop cycle?

Enter odeploy's big brother ojserver.

ojserver is essentially a server version of ojdeploy, in the sense that once started it stays alive and can be asked to, well serve stuff ;-)  As such what you can ask ojdeploy to do is rather than build each library itself, just hand the request off to ojserver instead, which has already been started.  Brilliant.  We no longer have to start and stop the ojdeploy process for each build item, we just start it once at the beginning, and stop it once at the end.

To start ojserver you simply execute the following from the jdeveloper/jdev/bin directory:

ojserver -start

This will start the service on localhost port 2010 by default.  You can override this by specifying the address after the -start flag.  On starting the server you will eventually see:

INFO: Server ready.

We're now ready to rock n roll with ojdeploy.  The following shows you an example of how to call ojserver from ojdeploy from a separate command line, note the additional -ojserver and -address flags: 

ojdeploy -workspace /Users/chris/jdev/mywork/Demo/Demo.jws -project ViewController -profile DemoVCProfile -ojserver -address localhost:2010

In context of ojdeploy you will not see much activity in the logs.  Rather all activity include build output, errors and more will come from the ojserver logs.

One thing to keep in mind is if you're accessing ojserver remotely from ojdeploy remotely, for the given paths for the ojdeploy -workspace flag and more, ojserver must have access to those paths and the source code.  Remember ojserver is just a server version of ojdeploy, there's no magic copying of files between ojserver and ojdeploy, so in terms of building applications and the files it needs, it's the same as ojdeploy.

Note there is currently one known limitation with using ojserver and ojdeploy via Ant (as separate to the command line call above).  At the moment the OJDeployAnt taskDef that you define in Ant to call ojdeploy currently does not support parameters for calling ojserver.  ER 14464838 has been raised to address this limitation.

Reference: ojserver documentation

--Errata--

In addressing the last comment about OJDeployAnt, there is a known workaround to add <arg> elements to the taskDef as follows:

<ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
     executable="${oracle.jdev.ojdeploy.path}"
     ora:buildscript="${oracle.jdev.deploy.dir}/ojdeploy-build.xml"
     ora:statuslog="${oracle.jdev.deploy.dir}/ojdeploy-statuslog.xml">
  <arg value="-ojserver"/>
  <arg value="-address "/>
  <arg value="localhost:2010"/>
  <ora:deploy>
    <ora:parameter name="workspace" value="${oracle.jdev.workspace.path}"/>
    <ora:parameter name="profile" value="${oracle.jdev.deploy.profile.name}"/>
    <ora:parameter name="nocompile" value="false"/>
    <ora:parameter name="outputfile" value="${oracle.jdev.deploy.outputfile}"/>
  </ora:deploy>
</ora:ojdeploy>

In the above example I've truncated some of the Ant property names using "jdev" rather than "jdeveloper" so the code will fit in the width of the blog.  Ensure to double check these with your own Ant property names.

Comments:

hi Chris

- about "... ojserver was invented was to address an issue with the Fusion Applications build ..."
So, ojserver most likely resolves that issue somehow, but ...

- you write "... it was determined that the start and stopping of ojdeploy for each build component was a large time sink ... but is there anything Oracle could do to fix the start and stop cycle ... ojserver ... We no longer have to start and stop the ojdeploy process for each build item, we just start it once at the beginning, and stop it once at the end. ..."

- and you write "... call ojserver from ojdeploy from a separate command line ..."

So, doesn't this still require the same amout of starting and stopping of ojdeploy (but with additional -ojserver and -address flags)?

many thanks
Jan Vervecken

Posted by guest on August 24, 2012 at 07:40 PM WST #

Hi Jan

Good pickup, I've been a bit loose in my language.

Agreed, the number of ojdeploy start/stops are the same, but my understanding is when calling ojserver in this case, ojdeploy just hands the job off to ojserver without starting/stoping the full headless JDev and internal build engine.

CM.

Posted by guest on August 27, 2012 at 01:55 PM WST #

Hi Chris,

it would be nice that ojserver could automatic update jdeveloper extension from a update site.

By this way you can provide new/updated libraries to the build server using ojserver without do it by hand. (Start JDeveloper, choose Update Site etc.)

ugb

Posted by guest on September 14, 2012 at 03:17 PM WST #

Ulrich, could you comment on a specific use case and technical/business need please?

Posted by guest on September 15, 2012 at 07:55 AM WST #

Hi,

i build up a short sketch about the business need / benefit of this function...

http://goo.gl/bwEg2

ugb

Posted by ugb on September 17, 2012 at 07:18 PM WST #

Thanks for the sketch. However could you give me an English text description as this is what I would need to lodge an ER please. I'm also specifically interested in what extensions you think this is needed for and why this currently is a pain to your business - surely extensions aren't updated that often or have you written your own internal extensions? A proper description on your part will aid your cause.

Also are you implying the update server is provided by Oracle, or would the idea be clients would need their own? If the later how do you see this working?

In turn I don't believe (correct me if I'm wrong) the IDE itself has the ability to automatically update extensions, so is putting your request here for ojdeploy/ojserver to have this feature putting the cart before the horse?

If we were to provide such an automatic update feature wouldn't this be dangerous in environments where applications need be regression tested before they can be migrated to new versions of JDev/extensions/whatever?

Posted by Chris Muir on September 18, 2012 at 11:26 AM WST #

Post a Comment:
Comments are closed for this entry.
About

Chris Muir - Oracle ADF Product Manager - The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

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