Monday, August 30, 2010

Javatar vs .NOT

simply BRILLIANT!!!

Saturday, August 28, 2010

Eclipse JPA project broken when mavenized: Invalid content (no root node)

My Eclipse JPA project was broken once mavenized: 
I get a message:
Invalid content (no root node)

I have had some allucinating time reading this

How sad.... anyway I found a workaround to get rid of the message:
I copy META-INF/persistence.xml in all the source folders of my project (in my case, the src/test/java folder).

Long live Eclipse! Long live Maven! One day hopefully these products will be remembered as one of the biggest trash of history.... unfortunately these days we have to learn how to coexist with them, just like Iraqis learn to coexist with US Marines.

Eclipse and SVN: how to change username

Since I am using SVNKit, I need to clear the .keyring file.
The location of .keyring is

It's a binary file, so don't try to look inside or you could be petrified, as you had watched the Gorgon. Don't look at it in the eyes, just kill it.


I found this wonderful script (thank you to my Indian friends for sharing)

This post

again maintained by an Indian, explains how to create a userconfig file

East or West, India is the best :o)

To make a long story short:
connect('${wlusername}', '${wlpw}', 't3://${wlhostname}:${port}')
storeUserConfig('',  '')

you get a lovely warning:

Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or n

and a lovely confirmation:

The username and password that were used for this WebLogic Server connection are stored in and


After that, you can connect by doing this:


Remember that to explore the JMSDestinationRuntime you must connect to the MS, not to the Admin:

connect('bla', 'bla', 't3://hostname:port_of_ms')

jmsdestlist = home.getMBeansByType('JMSDestinationRuntime')

if you want to navigate to them, you should do:

print cmo.getMessagesCurrentCount()

Friday, August 27, 2010

Toad For Oracle Xpert is your friend

Tonight we were facing a Tx timeout while persisting data to a Oracle DB using EclipseLink JPA.
We downloaded Toad For Oracle Xpert (trial edition, 30 days) and connected to the DB and done a Browse Session, identified our session based on the IP address and username of the originator, and found out the SQL which was being executed and the Execution Plan (an horrific FULL TABLE SCAN immediately evidenced by Toad).

This tool is simply fantastic. You can't live without.

Gant looks better than Ant

Nice tutorial here:

Ant sucks, but its advantage is a huge library of tools.... Gant seems to be able to make Ant power available in a real programming language.... way to go!

Thursday, August 26, 2010

NewJMSMessagePoller.ReportingMDB causing tx rollback for timeout

NewJMSMessagePoller.ReportingMDB ? In doubt, I untarget JMS Reporting Provider and Message Reporting Purger.

####     <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tun
ing)'> <> <> <7f52c101a04e4ebd:-564cb206:12aaa480612:-7fe8-0000000000000129> <1282780816350>  
nsaction Xid=BEA1-1627D2EB148FC1B950DB(388951180),Status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction has timed out when
 making request to XAResource 'WLStore_dev3OsbLABDomain_WseeFileStore_auto_1'.],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=31,seconds left
assigned=dev3OsbLABMs1),xar=WLStore_dev3OsbLABDomain_WseeFileStore_auto_1457582409,re-Registered = false),XAServerResourceInfo[MQParserDataSource_dev3OsbLABD
omain]=(ServerResourceInfo[MQParserDataSource_dev3OsbLABDomain]=(state=rolledback,assigned=dev3OsbLABMs1),xar=MQParserDataSource,re-Registered = false),SCInf
o[dev3OsbLABDomain+dev3OsbLABMs1]=(state=rolledback),local properties=({weblogic.jdbc.jta.MQParserDataSource=[ No XAConnection is attached to this TxInfo ]})
,OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(, XAResource
s={eis/tibjms/Queue, eis/activemq/Queue, WLStore_dev3OsbLABDomain__WLS_dev3OsbLABMs1, eis/AQ/aqSample, MQParserDataSource_dev3OsbLABDomain, eis/fioranomq/Top
ic, eis/jbossmq/Queue, WLStore_dev3OsbLABDomain_MQGEOFileStore, eis/Apps/Apps, DBConnectionREFData_dev3OsbLABDomain, eis/webspheremq/Queue, WSATGatewayRM_dev
3OsbLABMs1_dev3OsbLABDomain, eis/aqjms/Queue, WLStore_dev3OsbLABDomain_WseeJaxwsFileStore_auto_1, eis/pramati/Queue, DBConnectionACME_dev3OsbLABDomain, eis/
tibjms/Topic, eis/tibjmsDirect/Queue, eis/wls/Queue, WLStore_dev3OsbLABDomain_WseeFileStore_auto_1, WLStore_dev3OsbLABDomain_FileStore_auto_1, eis/tibjmsDire
ct/Topic, eis/wls/Topic, eis/sunmq/Queue, eis/aqjms/Topic},NonXAResources={})],
+t3+): weblogic.transaction.RollbackException: Transaction has timed out when making request to XAResource 'WLStore_dev3OsbLABDomain_WseeFileStore_auto_1'.
        at weblogic.transaction.internal.TransactionImpl.throwRollbackException(
        at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(
        at weblogic.transaction.internal.ServerTransactionImpl.commit(
        at weblogic.ejb.container.internal.MDListener.onMessage(
        at weblogic.ejb.container.internal.MDListener.onMessage(
        at weblogic.jms.client.JMSSession.onMessage(
        at weblogic.jms.client.JMSSession.execute(
        at weblogic.jms.client.JMSSession.executeMessage(
        at weblogic.jms.client.JMSSession.access$000(
        at weblogic.jms.client.JMSSession$
Caused by: weblogic.transaction.internal.TimedOutException: Transaction has timed out when making request to XAResource 'WLStore_dev3OsbLABDomain_WseeFileStore_auto_1'.
        at weblogic.transaction.internal.XAResourceDescriptor.startResourceUse(
        at weblogic.transaction.internal.XAServerResourceInfo.prepare(
        at weblogic.transaction.internal.XAServerResourceInfo.prepare(
        at weblogic.transaction.internal.ServerSCInfo.startPrepare(
        at weblogic.transaction.internal.ServerTransactionImpl.localPrepare(
        at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(
        at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(
        at weblogic.transaction.internal.ServerTransactionImpl.commit(
        at weblogic.ejb.container.internal.MDListener.execute(
        at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(
        at weblogic.ejb.container.internal.MDListener.onMessage(
        at weblogic.jms.client.JMSSession.onMessage(
        at weblogic.jms.client.JMSSession.execute(
        at weblogic.jms.client.JMSSession.executeMessage(
        ... 5 more


Domain Health



I am starting using now... looks good... will report on this in the future

Wednesday, August 25, 2010

Weblogic Wonders!

I have discovered this blog and added to my Google reader, these guys do a WONDERFUL job at explaining Weblogic stuff...
EXCELLENT! You guys are born teachers,every topic is explained with plenty of examples and in a simple language. Top stuff.

Oops, now they moved to

Monday, August 23, 2010

How to create a MDB

I am writing down all the steps so I don't forget again:

(ms1 means Managed Server 1)


create a Persistent Store MQGEOFileStore, target it on MS1.
create a MQGEOJMSServer, back it up with the MQGEOFileStore, target it on MS1.
create a MQGEOSystemModule, target it to MS1.
inside it create a MQGEOSubDeployment, and target it to MQGEOJMSServer.

create also a MQGEOConnectionFactory with JNDI name MQGEOConnectionFactory, and use for it the MQGEOSubDeployment (click on Advanced targeting)... remember to make it "XA Connection Factory Enabled"
and a MQGEOQueue, JNDI name MQGEOQueue, and use MQGEOSubDeployment

This is the WLST Python (it's not included the "XA Connection Factory Enabled"):


set('Targets',jarray.array([ObjectName('com.bea:Name=dev2WlsCBMs1,Type=Server')], ObjectName))


set('Targets',jarray.array([ObjectName('com.bea:Name=dev2WlsCBMs1,Type=Server')], ObjectName))


set('Targets',jarray.array([ObjectName('com.bea:Name=dev2WlsCBMs1,Type=Server')], ObjectName))

set('Targets',jarray.array([ObjectName('com.bea:Name=MQGEOJMSServer,Type=JMSServer')], ObjectName))




set('Targets',jarray.array([ObjectName('com.bea:Name=MQGEOJMSServer,Type=JMSServer')], ObjectName))




set('Targets',jarray.array([ObjectName('com.bea:Name=MQGEOJMSServer,Type=JMSServer')], ObjectName))


For the MDB, it should start like this:

 activationConfig = { @ActivationConfigProperty(propertyName = "ConnectionFactoryJndiName", propertyValue = "MQGEOConnectionFactory"),     
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"
  ) }, 
 mappedName = "MQGEOQueue")

public class MQGeoFeedMDB implements MessageListener {
public void onMessage(Message message) {
     TextMessage tm = (TextMessage)message;
        String text = tm.getText();

and, last but not least, the DD:


Funnily, these operations succeed on my standalone Admin, but they fail on a proper domain with an Admin and a cluster....the error is:

one or more registered update listeners reported activation problems. The following failures occurred: -- The following failures occurred: --
This probably because I didn't activate changes after each operation....WL doesn't execute oeprations in the right order....

and in the logs I find
Failed to start JMS Server "MQGEOJMSS
erver" due to The persistent store "MQGEOFileStore" does not exist.

[Store:280044]The file store directory "/acme/domains/dev2OsbCBDomain/servers/dev2OsbCBAdmin/data/store/MQGEOFileStore" does not exist.

I do a /acme/domains/dev2OsbCBDomain/servers/dev2OsbCBAdmin/data/store/MQGEOFileStore
to fix the problem.

Actually at the end I had to remove the target for MQGEOSystemModule and let the subdeployment take care of targetting.... Houston, these targetting with Subdeployment still have big problems.
I still get a message:
MDB application MQParserEARfromlocalJMSQueue is NOT connected to messaging system.

Reading in the logs I find:

The Message-Driven EJB: MQGeoFeedMDB is unable to connect to the JMS destination: MQGEOQueue. The Error was:
[EJB:015027]The Message-Driven EJB is transactional but JMS connection factory referenced by the JNDI name: MQGEOConnectionFactory is not a JMS XA connection factory.

On the whole, my impression is that

1) WebLogic error messages related to the JMS module are very poorly done, the error message appearing on the Console tells nothing about the root cause of the problem

2) Subdeployments have been poorly engineered, they still overlap with traditional targetting and they are not completely alternative to it, nor they can be completely replaced with traditional targeting...

3) When you perform several operations without activating, WebLogic should be smart enough to perform the activation activities in the proper order, without obliging you to perform an operation at a time and activate it.

3A) We really miss in WebLogic the ability to execute WLST code directly from the console, without having to run weblogic.WLST from a shell; and the ability to export objects as WLST script, in order to import them into another domain. Right now the only option is copy/paste sections of config.xml, which stinks.

4) but all of the above is a good news, it means that there is room for improvement

Sunday, August 22, 2010

Java Decompiler

DJ Decompiler is pretty good:
( I have bought it myself)

but I am told by Luciano to preprocess classes with this:

especially when they are written with Java 5 (generics) syntax
see also:

Very useful the Eclipse Jad Plugin, here the wiki

Actually it seems that JAD is outdated, and now you should use jdeclipse
(just choose the update site )

WebLogic 11g and MQ 7.... when the game gets tough...

(see also a previous post...

I am following the instructions

and I get

Aug 22, 2010 2:26:30 PM CEST Debug EjbDeployment BEA-000000 [EJBModule] activate() on module : EJBModule(MQReceiver) : activating module
Aug 22, 2010 2:26:30 PM CEST Debug EjbDeployment BEA-000000 [MessageDrivenBeanInfoImpl] Calling JMS MDB helper with providerURL=null
Aug 22, 2010 2:26:30 PM CEST Debug JMSCDS BEA-000000 getSubject: before looking up jms/WLReceiverQueue providerIRL = null isLocal = true
Aug 22, 2010 2:26:30 PM CEST Debug JMSCDS BEA-000000 Successfully created the initial context for the JNDIName jms/WLReceiverQueue
Aug 22, 2010 2:26:33 PM CEST Warning EJB BEA-010061 The Message-Driven EJB: TestMDB is unable to connect to the JMS destination: jms/WLReceiverQueue. The Error was:

 javax.jms.JMSException: JMSCS0006: An internal problem occurred. Diagnostic information for service was written to '/Oracle/Middleware/user_projects/domains/OSBDomainBasic/FFDC/JMSCC0004.FDC'. Please terminate the application as the product is in an inconsistent internal state.
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at weblogic.rmi.extensions.server.CBVInputStream.readObject(
        at weblogic.jndi.internal.JNDIHelper.copyObject(
        at weblogic.jndi.WLSJNDIEnvironmentImpl.copyObject(
        at weblogic.jndi.internal.WLEventContextImpl.copyObject(
        at weblogic.jndi.internal.WLEventContextImpl.lookup(
        at weblogic.jndi.internal.WLContextImpl.lookup(
        at javax.naming.InitialContext.lookup(
        at weblogic.jms.common.CDS$
        at weblogic.jms.common.CrossDomainSecurityManager.runAs(
        at weblogic.jms.common.CDS.lookupDestination(
        at weblogic.jms.common.CDS.getDDMembershipInformation(
        at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.createMDManagers(
        at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.activate(
        at weblogic.ejb.container.deployer.EJBDeployer.activate(
        at weblogic.ejb.container.deployer.EJBModule.activate(
        at weblogic.application.internal.flow.ModuleListenerInvoker.activate(
        at weblogic.application.internal.flow.DeploymentCallbackFlow$
        at weblogic.application.utils.StateMachineDriver.nextState(
        at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(
        at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(
        at weblogic.application.internal.BaseDeployment$
        at weblogic.application.utils.StateMachineDriver.nextState(
        at weblogic.application.internal.BaseDeployment.activate(
        at weblogic.application.internal.EarDeployment.activate(
        at weblogic.application.internal.DeploymentStateChecker.activate(
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(
        at weblogic.deploy.internal.targetserver.BasicDeployment.activate(
        at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(

I also get
Exception in thread "Thread-39" java.lang.NoClassDefFoundError: com/ibm/mq/internal/MQCommonServices

which seems to be addressed here:
In this post it mentions some extra JARs for JNDI support, like mqcontext.jar....let's keep an eye on this.... this is the support pack...

I target WLEventContextImpl and I find this:

Found: WLEventContextImpl
Class: weblogic.jndi.internal.WLEventContextImpl
Package: weblogic.jndi.internal
Library Name: wlfullclient.jar
Library Path: /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar

Found: WLEventContextImpl
Class: weblogic.jndi.internal.WLEventContextImpl
Package: weblogic.jndi.internal
Library Name: weblogic.jar
Library Path: /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar

Found: WLEventContextImpl
Class: weblogic.jndi.internal.WLEventContextImpl
Package: weblogic.jndi.internal
Library Name: wlthint3client.jar
Library Path: /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar

I get the one in weblogic.jar, decompile the weblogic.jndi.internal.WLEventContextImpl class, and find that there is no debug statement in it.... I add some sysout in the lookup and copyObject methods to find out which class is causing the error, and copy the modified weblogic.jar back...

my patched class file is in /home/osb/workspacePVPreMaven/WLPatchForMQ/bin/weblogic/jndi/internal/WLEventContextImpl.class

I run these commands to copy the 3 jars in a temp directory and patch them:

cp /home/osb/workspacePVPreMaven/WLPatchForMQ/bin/weblogic/jndi/internal/WLEventContextImpl.class ./weblogic/jndi/internal/WLEventContextImpl.class

cp /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar .
cp /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar .
cp /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar .
cp wlfullclient.jar wlfullclient.jar.ORI
cp weblogic.jar weblogic.jar.ORI
cp wlthint3client.jar wlthint3client.jar.ORI

jar uvf weblogic.jar weblogic/jndi/internal/WLEventContextImpl.class
cp weblogic.jar /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar

jar uvf wlfullclient.jar weblogic/jndi/internal/WLEventContextImpl.class
cp wlfullclient.jar /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar

jar uvf wlthint3client.jar weblogic/jndi/internal/WLEventContextImpl.class
cp wlthint3client.jar /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar

and to restore the files:

cp weblogic.jar.ORI /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar
cp wlfullclient.jar.ORI /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar
cp wlthint3client.jar.ORI /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar

Unfortunately the patch WORKS and traces the calls to JNDI lookups, but the decompilation must have messed it up because itcannot find a queue and the WLS crashes.

With some terror I discover that connector.jar delivered with MQ 7 dates back to 2001 (JDK 1.3) and providerutil.jar dates back to 2000 (JDK 1.2).

Enabling EJB, JMS, JNDI, ClassLoader flags doesn't help. Most likely the remote JMS destination deserialization fails.

Jan-2011: interesting post here

Jarspace, the Ultimate Swiss Knife

There are a number of tools to help you cope with the Jar Hell:

the excellent jarscan to help you find the occurrences of a class in any number of jars recursively from a base directory

jdepend which helps you detect the package dependency

duplicate class finder

my own small Java app to list all files in all jars :

I will blog more as I find them...

I really wish there was a tool to consolidate all these functions in an easy-to-use UI based AND scriptable interface....If I have time (no, I will not have) I will write it and call it Jarspace. Actually, I should call it JarHell. Or JarSucks?

The amount of time wasted troubleshooting JAR issues is worrysome. PS such a tool more or less exists :

Saturday, August 21, 2010

Development vs Operations

Too much knowledge is kept in the head of individuals,
and little is explained on the internal wiki
In a really Agile project, people should directly document stuff as they do it.
We are all lazy - including me - and we don't do it.

Ideally, it would be nice to have a person who doesn't deliver anything, she (ideally a blonde with big boobs) would simply go around from developer to developer and ask him "so, explain me everything", and as he explains she writes down everything on the Wiki.

When we turn over the system to Operations, they need to be taught. If everything is already written somewhere (or documented with podcasts, videos, anything) this will avoid hell in production.

Even at operations level, we developers have our bag of tricks to test, troubleshoot etc.
This bag of tricks is often very valuable and should be made public and available to Operations.

The huge gap between Development and Operation is historical and omnipresent in IT projects, and causes immense frustration and damage to the company.

Pragmatic SOA, CS-SOA : common sense SOA

you might disagree on some statements, but the presentation is brilliant, loaded with information and though-provoking.

Here the company of this smart fellow.


  • Application Architecture vs Integration Architecture
  • It's more important to standardize formats and protocols, than force everything through a set of interfaces
  • Don't put a ESB in the middle of everything
  • Avoid Doodleware tools
  • Don't generate code from XML Schemas
  • Use Groovy to generate XML
  • Don't let your application objects leak

Rumors, Hysteria and Panic-driven decision making

(you can buy the cartoon here )

Yesterday an application went offline for a minor networking problem. Everything was under control and the application was shortly after put online again. Yet the rumor spread that the application was unusable and we needed to put in place a workaround. It took some effort to quell the rumors - which I am sure are still alive somewhere in the organization, it takes a moment to destroy the reputation and a lifetime to build it.

Mass hysteria is not confined to human beings. I once saw a photograph of a large herd of wild elephants in Central Africa Seeing an airplane for the first time, and all in a state of wild collective terror. As, however, there were no journalists among them, the terror died down when the airplane was out of sight. [Bertrand Russell, Abr. T.F.D. p 7]

Continuous Delivery

Continuous Delivery

I am reading the book, it's extremely interesting and a must for any IT specialist. It focuses on concepts rather than specific products, although it does mention best-of-the-breed products for each thing. The technical level is very high, these people talk out of a huge field experience.

Yet I feel that some repetition could have been avoided, they repeat at least 30 times that "manual steps are bad bad bad", ok, I got the concept, no need to repeat it so often.

This post is really great, and summarizes the entire book.


I can't emphasize enough the role of asking people to explain their ideas,
their feelings, their current way of doing things and asking questions on how things can be improved.

My favorite question is "so, what are your feelings about this". The question being generic, it aims to let the important points emerge, since normally feelings concentrate about the important points. And the questions can be a catalysts of debate with colleagues and decision making.

Don't expect things to be good from day one, they become good with an iterative process of revisions and revisiting.

Socratically speaking, truth is latent inside us and as a baby she needs some little help to emerge. We can be the midwives of our own ideas and processes, but better ask a little help from our friends, as Joe Cocker said. We are social animals and isolation can bring to aberration.

Tuesday, August 17, 2010

WebLogic integration with MQ series using JMS Foreign Server

I am taking some notes just to track:

one must configure the MDB to use a foreign JMS connection factory in addition to the foreign JMS

Error getting JMSServer member info NestedException Message is :javax.naming.Reference

If MQ and WLS are NOT on the same box, make sure you choose the transport=MQClient on MQ, this will generate a .bindings file totally different from the previous one; remember to copy this file to WebLogic.

To verify that your MDB is actually registered as a consumer of the MQ queue, "check value of IPProcs attribute in queue. This value gives the current number of threads listening for messages. If this value is 0 then there is no thread listening. " ( I am quoting a OTN thread)

This is a very interesting reading on how to configure the number of listeners on the MQ queue.

This script is useful to create the resources:


set('Targets',jarray.array([ObjectName('com.bea:Name=dev2WlsCBMs1,Type=Server')], ObjectName))







Sunday, August 15, 2010

Welcome Eclipse 3.6 and WLST support!

Eclipse 3.5 = GALILEO
Eclipse 3.6 = HELIOS

download WLS 11gR1 BUT it's still with Eclipse 3.5.2 :o(

here you get OEPE with 3.6, but not integrated with WebLogic.
Basically this is

here some comments:

it says:

WebLogic Scripting Tool (WLST) features – bring new Oracle WebLogic Server administration support to Eclipse with:
Jython/Python IDE for WLST, based on PyDev – provides full syntax highlighting, validation, and code completion for WLST scripts;
Define and reuse WLST templates – accelerate WLST script editing;
Oracle WebLogic MBean explorer – visualizes the server MBean tree for easy drag and drop to the WLST script;
Integrated WLST console – provides script execution and debugging tools from within Eclipse in both online and offline modes;
WLST integrated help – makes it easy to access documentation for WLST commands.


Create a Utility project, set a runtime target WL 11g patchset 2, choose the WL home.
Project, Project Facets, enable WLST.
New WLST script. Give a .py extension.

It opens a template:

#Conditionally import wlstModule only when script is executed with jython
if __name__ == '__main__': 
    from wlstModule import *#@UnusedWildImport

print 'starting the script ....'
username = 'weblogic'
password = 'welcome1'



    print "script returns SUCCESS"   
except Exception, e:
    print e 
    print "Error while trying to save and/or activate!!!"

Do Show/View/ WLST Help.

Search Eclipse help for WLST, there is interesting information.

Start WebLogic,
Add the WL server to the list of servers in the Servers view,
then Window, Show View, WebLogic MBean Explorer

Show/Console/WLST and you go into wls:/offline

To run the .py script, right-click, run as WLST Run, or WLST Debug.

Saturday, August 14, 2010

Maven sucks like hell

IMHO Maven is CRAP, the underlying concept is good but the implementation is repulsive, with all the xml to be handcrafted. It should not be hard to create a DSL and a nice IDE, yet people get carried away by this XML junk and we spit blood juggling with confusing documentation and endless xml snippets.

As here says:
"All of this can make using maven very time consuming and frustrating. I do think that maven is a good project but that it could be great if managed correctly."
Simply said, my head and Maven  Designer head are made in incompatible ways.

Incidentally at office they had endless discussions on Maven vs Ant. I am not interested in choosing between a hard place and a rock: I want a modern tool to address my needs and get my stuff done in a breeze.

Whoever asserts that you should build a complex project modeling or a complex procedural deployment script based on XML is simply UNHEALTHY.

I have seen Maven "experts" struggle for hours even to get the basic done, and still their stuff breaks again and again. It's like if in Eclipse or NetBeans it would take me one day to create an empty EJB project.

Creating the structure for a EAR with a ejb-client, a war, a ejb module and dependencies from other Java projects (jar) should be a matter of a few clicks or a command.... in Maven the maven-ear-plugin is very poorly designed, I have surfed for hours and searched several book for a clear example, in vain. And everything is a matter of copying and pasting XML.

There is a decent plugin for Eclipse, with an extensive reference book:

This plugin seems to make Maven use POSSIBLE for a regular human being, without incurring in several nervous breakdowns. In fact, even this plugin has been designed without a proper specialized wizard for each project topology, so you are left alone to juggle in a myriad of options without a clear path to follow.

Maven, even with the Eclipse plugin, is for the maven, not for the accidental user. There is nothing like 1-2-3-easy, unless you do the really basic stuff.

I am simply trying to create a structure for an EAR with an EJB and a WAR and some dependencies from some Java projects.
With a NORMAL tool I would assume I can get it done with:

create EAR myEAR including WAR myWar, EJB myEJB depends on JAR myJAR1, myJAR2

They give you only this example, and it's your problem to recreate the entire directory structure.

Instead of using and abusing XML, they should have designed a Domain Specific Language and integrate in Groovy.

Here more on why Maven sucks.

Excellent tutorial:

+X turns on debugger
-e enables exception tracing

In c:/apps/maven/conf/settings.xml you find several interesting properties, such as the local-repository and the proxy.

mvn --version

mvn archetype:generate -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

cd my-app/
less pom.xml
mvn package
java -cp target/my-app-1.0-SNAPSHOT.jar
ls target/classes/
mvn test
mvn test-compile

ls ~/.m2/repository

to build offline:
mvn -o package

mvn eclipse:eclipse


mvn process-resources


This is how to create an ear:


This article on ClassLoaders in WebLogic is extremely interesting:

I have taken some notes:

bootstrap classloader
extensions classloader
system classpath classloader

application classloaders
(EAR: root classloader for EJBs, child classloader for each WAR)

in weblogic-application.xml with classloader-structure you can customize the classloaders


manifest Class-Path entry

when 2 modules share the same classloader, call by reference is possible. Otherwise call-by-value is used.

classes in $CLASSPATH are always loaded before than whose in application classpath, unless you specify a FilteringClassLoader.
a FilteringClassLoader allows you to load classes locally to your classloader
add prefer-application-packages descriptor element to the weblogic-application.xml

Friday, August 13, 2010

Learn Java in 21 years

I have watched this interview:

it's very touching to see old men value craftsmanship, the skill of people who - year after year - have spilled their blood to learn best practices and achieve best quality in code.

At minute 37:00 :

"Large corporations and the current business rhetoric doesn't seem to get it across:
at the end, "people who THINK" are important, "people who SOLVE problems" are important, and "TEAMS who can work together" are important, and SMALL teams get things done"

Deploying JPA solution to WebLogic

After having successfully tested a JPA module using TopLink Essentials,
I want to deploy it in WebLogic as part of an EAR.

I read that WebLogic recommends using the


persistence provider, rather than the


At this point I remove the toplink-essentials.jar, but the javax.persistence imports are not satisfied any more. So from the Weblogic System Library I add the javax.persistence module.

I also switch from




and make sure you remane all your

property name="toplink.blablabla"


property name="javax.persistence.blablabla"

(remember that "property eclipselink.jdbc.user is deprecated")

I get also a

"bla has transactionType RESOURCE_LOCAL and therefore jtaDataSource will be ignored"


will help understand how to configure the JNDI

This is my fantastic persistence.xml - which has made suffer generations of developers:






Here you have the XSD, you can notice it's pathetically generic.

Funny errors while using the OSB console

Could not deserialize session data. com.bea.console.taglib.html.model.TableModel

followed by

Could not deserialize session data.
java.lang.ClassCastException: cannot assign instance of com.bea.console.handles.JMXHandle to field com.bea.console.actionforms.ConsoleValidatorForm.handle of type com.bea.console.handles.Handle in instance of
 at weblogic.common.internal.PassivationUtils.toObject(
 at weblogic.common.internal.PassivationUtils.toObject(
 at weblogic.common.internal.PassivationUtils.copy(
 at weblogic.servlet.internal.AttributeWrapper.getObject(
 at weblogic.servlet.internal.AttributeWrapper.getObject(
 at weblogic.servlet.internal.session.SessionData.getAttribute(
 at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.updateSessionId(
 at weblogic.servlet.internal.WebAppServletContext.securedExecute(
 at weblogic.servlet.internal.WebAppServletContext.execute(

never seen before.... trying to identify the cause....

Tuesday, August 10, 2010

Error creating logFile: EmbeddedLDAP.log (Permission denied)

This is what happens when you forget that you are root and you start weblogic (never install and run weblogic as root!).... the access rights of some files get changed...

chown -R osbuser /path/to/your/domain
run as root

should bring you back to normal life

Sunday, August 8, 2010

WSDL Generation with Groovy

I am fed up of crafting WSDL by hand, it's mostly fluff and it can be generated from a template.

I don't like template languages like Velocity either.

So I have decided to generate my WSDL in Grovvy.

I have installed the Eclipse Plugin:


Here a good example of how to parse XML with Groovy:

The XML defining the service is:



First create a Groovy Project, then a Groovy class - this is only a POC on how to parse XML:

class WSDLGenerator {

 static main(args) {
  File file = new File("resources/geowsdl.xml");
  def records = new XmlParser().parseText(file.getText());
  def servicename = records.servicename.text();
  def version = records.version.text();
  def schemalocation = records.schemalocation.text();
  def operations = records.operations;
  for (operation in operations.operation) {
   println operation.text();

It's as simple as that! In Java it would have taken me 5 times more code!

I will never edit manually a WSDL again, all you need is a XSD with your domain model, and you can generate the blessed WSDL by script.

Wednesday, August 4, 2010

Fedora updates

Flash Player:

yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl


yum upgrade
yum --enablerepo=updates-testing upgrade wine
yum install wine


rpm -Uhv sqldeveloper-


vi /etc/resolv.conf

domain localdomain
search localdomain

The brain that changes itself

I am really enjoying this book, providing infinite insights in the inner working of human (and other animals) brain.

I wish some neuroscientist could spend some time in a development floor, and write about his findings on the mental and social mechanisms involved in IT team work ... it would be so fascinating to understand what makes us tick and why IT projects are so often completely f...ed up because of personal and interpersonal behavioral and psychological issues.

Sunday, August 1, 2010


After a virus has contaminated several machines in the organization, many of us have installed a dual partition system with UBUNTU and Windows XP 32 bits. Actually most people have wiped out Windows altogether.

Everyone else chose UBUNTU 32 bits, I have installed the 64 bits version, which seems quite stable and happily addresses all my 6 GB RAM.

In UBUNTU we run a VMWare virtual machine (4 GB Ram) running Fedora and Weblogic + OSB 11. It's a bit slower, but it has the great advantage that I can make a backup every day and we can replicate a new dev env in seconds.

The title is because a friend of mine always call it UBRUNTU, plus it reminds me Julius Caesar and Brutus. WIDOWS because men commit suicide for the depression of using Windows.

com.bea.xml.XmlException: error: The document is not a WLJMSMessage@

When importing a message in a Queue in WebLogic, make sure the XML complies to a specific schema:

element WLJMSMessage

An empty message looks like:

<?xml version="1.0" encoding="UTF-8"?>
<mes:WLJMSMessage xmlns:mes="">

If you process this message with a MDB,

public void onMessage(Message message) {
TextMessage tm = (TextMessage)message;
try {
System.out.println("!!!message " + tm.getText());
} catch (JMSException e) {


you will get this:

MessageDrivenBean threw an Exception in onMessage(). The exception was: java.lang.ClassCastException: weblogic.jms.common.HdrMessageImpl

Since delivery fails, I also get this:

The Message-Driven EJB: MQGeoFeedMDB is throwing exception when processing the messages. Delivery failed after 139 attempts. The EJB container will suspend the message delivery for 60 seconds before retry.

A complete sample WL Message has this format:

<?xml version="1.0" encoding="UTF-8"?>
<mes:WLJMSMessage xmlns:mes="">
<mes:property name="JMSXDeliveryCount">
<mes:Text>your message here</mes:Text>

JPS-01538: The default policy provider was not found

All of a sudden I am getting this message when starting OSB on Fedora...
it is accompanied by: JPS-01514: The default context is missing in jps-config.xml.

and by /Oracle/Middleware/user_projects/domains/OSBDomainBasic/./config/jps-config.xml (No such file or directory)

googling around I found this: has being filled with %DOMAIN_HOME%/config/fmwconfig/jps-config.xml ok ?

(at )

In fact, in $DOMAIN_HOME/bin/ there is:${DOMAIN_HOME}/config/fmwconfig/jps-config.xml

Make sure that your $DOMAIN_HOME/ contains at the beginning:

export DOMAIN_HOME="/Oracle/Middleware/user_projects/domains/OSBDomainBasic"

(make sure "export" is there...)

and make sure you have not messed up the
EXTRA_JAVA_PROPERTIES and the JAVA_PROPERTIES and the JAVA_OPTIONS variable assignments in the

And, of course, verify that the jps-config.xml file is actually where it's supposed to be and with the right read access.

In fact, in my case I had forgotten to correctly put a " in the JAVA_OPTIONS.

Unfortunately shell scripts can be very nasty to debug. This is a good reason to keep their complexity to a bare minumum, and use Groovy or other languages.

WebLogic Toplink

In WebLogic we already have TopLink:

it says clearly that

Toplink Essentials Provider oracle.toplink.essentials.PersistenceProvider in toplink-essentials.jar

is NOT supported in WebLogic, and we should use the

EclipseLink org.eclipse.persistence.jpa.PersistenceProvider

A jarscan for PersistenceProvider in Weblogic says:

Found: PersistenceProvider
Class: kodo.persistence.PersistenceProviderImpl
Package: kodo.persistence
Library Name: com.bea.core.kodo_1.2.0.0_4-2-1.jar
Library Path: C:\bea11\modules\com.bea.core.kodo_1.2.0.0_4-2-1.jar

Found: PersistenceProvider
Class: javax.persistence.spi.PersistenceProvider
Package: javax.persistence.spi
Library Name: javax.persistence_1.0.0.0_1-0-2.jar
Library Path: C:\bea11\modules\javax.persistence_1.0.0.0_1-0-2.jar

Found: PersistenceProvider
Class: org.apache.openjpa.persistence.PersistenceProviderImpl$1
Package: org.apache.openjpa.persistence
Library Name: org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
Library Path: C:\bea11\modules\org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar

Found: PersistenceProvider
Class: org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerIm
Package: org.apache.openjpa.persistence
Library Name: org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
Library Path: C:\bea11\modules\org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar

Found: PersistenceProvider
Class: org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerIm
Package: org.apache.openjpa.persistence
Library Name: org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
Library Path: C:\bea11\modules\org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar

Found: PersistenceProvider
Class: org.apache.openjpa.persistence.PersistenceProviderImpl
Package: org.apache.openjpa.persistence
Library Name: org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
Library Path: C:\bea11\modules\org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar

Found: PersistenceProvider
Class: org.eclipse.persistence.jpa.PersistenceProvider
Package: org.eclipse.persistence.jpa
Library Name: org.eclipse.persistence_1.0.0.0_2-0.jar
Library Path: C:\bea11\modules\org.eclipse.persistence_1.0.0.0_2-0.jar

Found: PersistenceProvider
Class: org.eclipse.persistence.jpa.osgi.PersistenceProvider
Package: org.eclipse.persistence.jpa.osgi
Library Name: org.eclipse.persistence_1.0.0.0_2-0.jar
Library Path: C:\bea11\modules\org.eclipse.persistence_1.0.0.0_2-0.jar

Found: PersistenceProvider
Class: javax.persistence.spi.PersistenceProvider
Package: javax.persistence.spi
Library Name: wsclient_extended.jar
Library Path: C:\bea11\oracle_common\webservices\wsclient_extended.jar

Found: PersistenceProvider
Class: org.eclipse.persistence.jpa.PersistenceProvider
Package: org.eclipse.persistence.jpa
Library Name: wsclient_extended.jar
Library Path: C:\bea11\oracle_common\webservices\wsclient_extended.jar

so the best candidate seems


IF you want to use Toplink Essentials, follow this path: