Pages

Monday, 22 February 2010

ADF automated deployment: Hudson and WLST

As I told in my previous post on Hudson I had the wish/idea to extend my Hudson build script in a way that it would fully automate the deployment of the ear file to a WebLogic server.

So I gave it a try…

With the help of a blog post of Jay senSharma it actually was quite an easy job.

Step 1:
I copied the MIDDLEWARE_HOME\wlserver_10.3\server\bin\setWLSEnv.cmd to C:\Hudson_Slave_Node\workspace, and renamed it to deployWLS.cmd

Step 2
I created a python script file called deployDummy.py and added it to the same directory.

This is the content of the python file
connect('weblogic','weblogic1','t3://localhost:7101')
edit()
startEdit()
deploy('dummy_application1','C:\Hudson_Slave_Node\workspace\trunk\dummy.ear',targets='DefaultServer')
save()
activate()
startApplication(' dummy_application1')




Step 3:
I changed the bottom of deployWLS.cmd to look like:

@echo Your environment has been set.

@echo Deploy to WLS
java weblogic.WLST C:\Hudson_Slave_Node\workspace\deployDummy.py
@echo Deploy to WLS Finished

:finish

Step 4:
I added a new ‘Windows batch command’ Build step in Hudson that executes the deployWLS.cmd file.



Step 5:
Grab a pint of (Belgium) Beer, sit down, relax and see how the job is now done for you... :-)

Troubleshooting

If you receive the following error:

weblogic.application.ModuleException:
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:290)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare ModuleListenerInvoker.java:93)
...
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: weblogic.common.ResourceException: java.security.PrivilegedActionException: weblogic.common.ResourceException: java.security.PrivilegedActionException: weblogic.common.ResourceException: No credential mapper entry found for password indirection user=cm for data source CM
at weblogic.jdbc.common.internal.DataSourceConnectionPoolConfig.getPoolProperties(DataSourceConnectionPoolConfig.java:84)
...
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:252)

You have to adjust your application properties in a way that they‘ll not include the weblogic-jdbc.xml. It’s not possible to automatically deploy your ear file with this option. So uncheck this option and add a DataSource with the correct JNDI name via the WLS console.




References
Jaysensharma's Blog
Forum: WebLogic Server - Upgrade / Install / Environment / Migration
Thread: WLST to deploy ear file
Using the WebLogic Scripting Tool
WLST Command and Variable Reference

Sunday, 14 February 2010

ADF Methodology: Customization

I started a new thread in the ADF Enterprise Methodology Group about customization.

I’ll share my question also here on my blog. If you would like to comment on this subject I suggest you do it in the thread at the ADF Enterprise Methodology Group.

This is the question...

Hi All,
We’re currently developing a product with ADF 11g technology (Rich Faces/BC).We already finished our first version and are busy with our first customer’s implementations. Since it’s a product it’s the idea to have the same basic product (core) installed for all the customers (for a specific version) and to do individual customizations (if necessary) for each one of them.

For the customizations there are two important requirements:
-The implementation has to be maintainable (we don’t’ want to do bugfixing for each individual implementation but only in our shared product core). So the implementations of the customizations have to guarantee not to pollute the product core.
-Secondly our product has to remain upgradeable. If our product core evolves to a new version it has to be possible to do an upgrade without rewriting the customizations.

To achieve this we already used the following strategy:
-The use of flexible fields and flexible tab pages (which doesn’t require any coding)
-The use of a Business rules engine
-The use of a flexible BPM engine

This makes it possible to reduce the amount of necessary customizations to a minimum but as always extra customization is sometimes needed. (For example the integration with another system, an extra application, ... )For these we still have two ideas/options:
-Modularization (this subject probably needs a thread for its own)
-MDS: first consideration here is that every site customization is implemented in the same code base, so with every customization our core would grow bigger and bigger….and therefore MDS seems not to be an option.

So the main question is how to approach customization? Are we making the wrong considerations? Are there other options?

The ideal world would give us the possibility to have our core packaged in a separate install (ear file), and to lets us do our customizations in a separate workspace with the possibility to override most of the core functionality… Is this possible within ADF?

Note: for clarity we are not speaking about personalization here (and the MDS possibilities for this issue).

Regards,
Gert

Friday, 12 February 2010

JDeveloper & Hudson

Since a while I was looking for a description on how to do continuous integration with Hudson based on a JDeveloper project without any luck.

Last Wednesday however I read the blog post of Geoff Waymark ‘Ultra quick Hudson setup to build a JDeveloper ADF application’ and in no time I fished the job.
Geoff’s blog post is very complete and detailed but since I was not familiar with Hudson and scripting at all, I’ will go on a bit more detail on Hudson’s workspace variable and ojdeploy.

The %WORKSPACE% variable just represents the directory specified under ‘Remote FS root’ completed with your ‘Project name’.




So in my case C:\Hudson_Slave_Node\dummy-trunk

Secondly to get the Windows batch command right I read Steve Muench blog post ‘Online Help for ojdeploy Utility’ which brought me to the JDeveloper Help page ‘About Deploying from the Command Line’.



There you can find all the info you need to know about the ojdeploy utility.
You find the profile parameter under ‘Application Properties ’ > ‘Deploy’.



This is my batch code:
del *.ear
%OJDEPLOY% -profile dummy_application1 -workspace %WORKSPACE%\trunk\dummy.jws
copy %WORKSPACE%\trunk\deploy\*.ear %WORKSPACE%
rmdir /S /Q %WORKSPACE%\trunk

Job’s done.

Next thing on my wish list now is automatic deployment of my ear file to a WLS via the usage of WLST.

Monday, 8 February 2010

BeJUG

Oh yeah another thing, since I’m also a steering member of BeJUG (Belgian Java User Group) allow me to do some advertising…

Since 2009 BeJUG organizes bi-weekly evening sessions (In Belgium of course).

The first talks for our 2010 schedule are defined and can be found here
As you can see the first one (on Google App Engine) is just in two days….

ADF Enterprise Methodology Group

Last December I visited the UK OUG conference at Birmingham, I focused my schedule on the ADF sessions en talks and saw some interesting stuff, but the peak for me was the discovery of the ‘ADF Enterprise Methodology Group’ via a round table session I attended at the conference.

So what is the aim of this group? Let me try to situate them a bit for you….

At the one hand you have the JDeveloper and ADF forum, the blogs, otn, and a lot of other websites which all help you to solve your technical questions en issues.

But me and my colleagues had some questions (more related to methodology and best practices) for which we didn’t found the answer and for which we didn’t found a forum to ask those questions. And that’s where the ‘ADF Enterprise Methodology Group’ comes into the picture. Here you can find very nice threads which try to solve all your other questions. Some examples:
  • Best Practice for Organizing Business Logic code for large applications
  • Back to the basic question: How big/ how small is my AM should be?
  • Best Practice for Organizing Business Logic code for large applications
  • AM pools, connections pools & ADF scalability
  • Design for Performance or Tune After development?
  • ADF Coding Standards 2010
  • How many ADF library versions on one WLS installation?
  • ADF Applications Hardware Sizing?
  • ...

So if you’re dealing with the same ‘ADF methodology‘ questions the ADF Methodology Google Group is the place to look for the answers…

Monday, 1 February 2010

First Oracle ADF 11g based product release



Since the beginning of last year we were working on a brand new ADF Based product for ‘Case Management’ called (surprisingly :-) ) ‘Axi Case Management’.
On the 18the of January we fished our first release and installed it for the first time at a client.
The deadline for this release is mainly responsible for the small amount of blog posts I made the last months.
The great news is that our product runs very fine in any way (performance, reliability,...).
I hope i can post the customer case of this product development on the Oracle ADF website soon. In the meantime can you find a whitepaper here?

JBoss

Currently I’m also trying to run an ADF application on a JBoss server. No luck yet. But once I get this job done I promise to publish an overview of my work here.