Monday, May 31, 2010

JRules, using Java BOM to pass an input parameter

Having done the tutorial on how to write a Business Rule with Java BOM, once I deploy and try to get the WSDL the RES (Rule Execution Server) tells me:

This ruleset cannot be parsed. It uses a Java XOM, which is not supported by the hosted transparent decision service., error code: XU-WS10010

Yet, the "New Rule Project" gives you a template "Rule Project with a BOM" and it says:

This template creates a rule project using the following standard options :
Java XOM settings. Path on java folders, jars or projects.
Dynamic XOM settings. Path on XML schemas or dynamic XOM files.
Rule project references. Optional rule project dependencies.
In addition, BOM entries and verbalization are automatically created for each XOM specified.
The generated project enables you to edit rules and execute them.




Note: A XOM is a "Execution Object Model".

If you wonder what a "transparent" decision service is, you might have a read here, basically "transparent" means "exposed through WS":

http://publib.boulder.ibm.com/infocenter/brjrules/v7r0m2/index.jsp?topic=/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global800.html

"A hosted transparent decision service: this is essentially a ruleset deployed as a Web service. It is installed on the same application server as Rule Execution Server, then integrated with Rule Execution Server." It's also nicknamed htds.

So basically should I resort to using XSDs to specify input parameters, in order to expose my Rules as Web Services? Oh my my.... what an I missing?

JRules exposed via Web Services

Typically you have a RuleApp, which contains several RuleSets.

When you produce a RuleSet, you can write several BusinessRules in it.

Here http://publib.boulder.ibm.com/infocenter/brjrules/v7r0m2/index.jsp?topic=/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global800.html it says:

The decision service automatically generates a Web Services Description Language (WSDL) file for each deployed ruleset archive

In our example, helloWorldRuleApp contains helloWorldRuleApp,
and helloWorldRuleApp contains 2 BusinessRule: greetingsItalian and greetingsEnglish.
They will return respectively Buongiorno and Good morning!.

JRules  exposes them automatically via Web Services, the endpoint looks like:

http://localhost:8080/DecisionService/ws/helloWorldRuleApp/1.0/greetingsRuleset/1.0

This will fire all the Rules inside the greetingsRuleset.


The result will be:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.ilog.com/rules/DecisionService">
   <soapenv:Body>
      <DecisionServiceResponse xmlns="http://www.ilog.com/rules/DecisionService">
         <ilog.rules.outputString>Buongiorno
Good morning!</ilog.rules.outputString>
         <ilog.rules.firedRulesCount>2</ilog.rules.firedRulesCount>
      </DecisionServiceResponse>
   </soapenv:Body>
</soapenv:Envelope>


that is:
ilog.rules.outputString is the output of all the Rules invoked
ilog.rules.firedRulesCount is the count of the rules fired


The WSDL associated to the Web Service is:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.ilog.com/rules/DecisionService" xmlns:tns="http://www.ilog.com/rules/DecisionService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.ilog.com/rules/DecisionService" xmlns:param="http://www.ilog.com/rules/param" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsd:import namespace="http://www.ilog.com/rules/param"/>
<xsd:element name="DecisionServiceRequest">
<xsd:complexType>
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>

</xsd:element>
<xsd:element name="DecisionServiceResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ilog.rules.outputString" type="xsd:string"/>
<xsd:element name="ilog.rules.firedRulesCount" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="DecisionServiceException">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="exception" nillable="false" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema targetNamespace="http://www.ilog.com/rules/param" xmlns:ns0="http://www.ilog.com/rules/param"/>

</wsdl:types>
<wsdl:message name="DecisionServiceSoapResponse">
<wsdl:part name="parameters" element="tns:DecisionServiceResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="DecisionServiceSoapFault">
<wsdl:part name="fault" element="tns:DecisionServiceException">
</wsdl:part>
</wsdl:message>

<wsdl:message name="DecisionServiceSoapRequest">
<wsdl:part name="parameters" element="tns:DecisionServiceRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="DecisionServiceJRulesPVHelloWorld">
<wsdl:operation name="executeDecisionService">
<wsdl:input message="tns:DecisionServiceSoapRequest">
</wsdl:input>
<wsdl:output message="tns:DecisionServiceSoapResponse">

</wsdl:output>
<wsdl:fault name="DecisionServiceSoapFault" message="tns:DecisionServiceSoapFault">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DecisionServiceSOAP" type="tns:DecisionServiceJRulesPVHelloWorld">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="executeDecisionService">
<soap:operation soapAction="executeDecisionService" style="document"/>

<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DecisionServiceSoapFault">
<soap:fault name="DecisionServiceSoapFault" use="literal"/>
</wsdl:fault>

</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DecisionServiceJRulesPVHelloWorld">
<wsdl:port name="DecisionServiceSOAPesp50ws17206.crb.acme.net" binding="tns:DecisionServiceSOAP">
<soap:address location="http://localhost:8080/DecisionService/ws/helloWorldRuleApp/1.0/greetingsRuleset/1.0"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


Let's watch an example where you pass an XML parameter (thank you David Selman for your excellent presentation, but next time can you ask a beautiful girl to show her face instead of yours :O)? We are all men in this business and seing a girl once in a while would help...):




In fact it's all about invoking a Web Service, the video shows how to do it with a Eclipse Plugin and Axis2 Java generated code.


The way I see it is that there is a DecisionService servlet serving all RuleApps and acting as a Proxy to the Rules Engine.

Saturday, May 29, 2010

WLST development with PyDev in Eclipse

My understanding is that Satya Ghattu has not been working on WLST for quite some time (cmiiaw)
and his blog doesn't say much on this topic.
I really wish Oracle put some development effort in WLST as honestly it's a bit primitive and lacks many features that for a Java Developer are essential (debugging, remote debugging, a proper IDE etc).
When people say "just use notepad" it makes me FURIOUS, it's like saying a surgeon "just use a Swiss Army knife instead of a bisturi"....

So in an attempt to make my WLST life easier...

download Python 2.6.5 here (is Python required? I don't think so)
http://www.python.org/ftp/python/2.6.5/python-2.6.5.msi

and Jython here (Is Jython required? NO! You already have C:\bea11\oracle_common\util\jython\jython.jar !)
http://sourceforge.net/projects/jython/files/jython/jython_installer-2.5.1.jar


install into Eclipse the PyDev plugin by following their instructions:

http://pydev.org/manual_101_install.html

DO NOT declare the system variable PYTHONPATH as c:\Python26, since this will be done automatically by the Intepreter configuration wizard

Configure the Intepreter (Window/Preferences/Pydev/Interpreter Jython...)
specifying C:\Python26\python.exe for Python
http://pydev.org/manual_101_interpreter.html

and accept the path proposed by default.

Configure the Jython Intepreter (WLST IS Jython, so.... who cares about the Python interpreter!)
and specify
C:\bea11\oracle_common\util\jython\jython.jar

and accept the defaults.

mmm it doesn't seem to recognize the WLST commands, like connect and edit... there must be some trick...

ok I give up for lack of time and itnerest, if anyone knows the answer please write a comment.

Friday, May 28, 2010

OSB inspection through WSIL

There are 2 interesting Servlet mappings available:

http://localhost:7001/sbinspection.wsil/

this will give you:

<ins:inspection>
<ins:link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/" location="http://localhost:7001/sbinspection.wsil?refpath=OSBProject1">
<ins:abstract>OSBProject1</ins:abstract>
<ins:abstract>LinkType: Project</ins:abstract>
</ins:link>
<ins:link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/" location="http://localhost:7001/sbinspection.wsil?refpath=CoherenceEJBProject">
<ins:abstract>CoherenceEJBProject</ins:abstract>
<ins:abstract>LinkType: Project</ins:abstract>
</ins:link>
<ins:link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/" location="http://localhost:7001/sbinspection.wsil?refpath=MichalProject">
<ins:abstract>MichalProject</ins:abstract>
<ins:abstract>LinkType: Project</ins:abstract>
</ins:link>
</ins:inspection>


and

http://localhost:7001/inspection.wsil/

 this will give

<?xml version="1.0" encoding="UTF-8" ?>
<inspection xmlns="http://schemas.xmlsoap.org/ws/2001/10/inspection/">
    <link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/" location="http://localhost:7001/inspection.wsil?appname=WS Transport Async Applcation">
        <abstract>WS Transport Async Applcation</abstract>
    </link>
    <link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/" location="http://localhost:7001/inspection.wsil?appname=ALSB Subscription Listener">
        <abstract>ALSB Subscription Listener</abstract>
    </link>
    <link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/" location="http://localhost:7001/inspection.wsil?appname=wls-wsat">

        <abstract>wls-wsat</abstract>
    </link>
    <link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/" location="http://localhost:7001/inspection.wsil?appname=bea_wls9_async_response">
        <abstract>bea_wls9_async_response</abstract>
    </link>
</inspection>


JRules: Getting Started in 3 minutes (aka JRules for Dummies)

Installation is easy, anyway here
http://www.jaceklaskowski.pl/docs/GettingStartedWithIBMWebSphereILOGJRules7.0.2Trial-installation.pdf

you have some instructions.

After you complete installation, run  IBM WebSphere ILOG JRules V7.0.2/Samples Console

It will take a couple of minutes to start Tomcat. When you see
28-05-2010 09:36:15 org.apache.catalina.startup.Catalina start
INFO: Server startup in 138229 ms

open a browser, Rule Team Server console is:
http://localhost:8080/teamserver
rtsUser1/rtsUser1
rtsConfig/rtsConfig
rtsAdmin/rtsAdmin


and Rule Execution Server console is:
http://localhost:8080/res
resAdmin/resAdmin
resMonitor/resMonitor
resDeployer/resDeployer

Some acronyms:
ILR = ILOG Rule Language
XU = Execution Unit
XOM = XML Object Model


Now, in Eclipse Studio right click, new Rule Project, select Hello World Rule Project. I will call it JRulesPVHelloWorld.
Right click, export Ruleset Archive, ruleProject=/JRulesPVHelloWorld, save to C:\temp\greetings.jar


This will create a IRL, META-INF and RESOURCES directories, with some irl etc files:


main-rfl.irl file:

flowtask main {
  property mainflowtask = true;
  body {
    main#helloworld;
  }
};

ruletask main#helloworld {
  algorithm = default;
  ordering = dynamic;
  body {
    helloworld.*
  }
};



greetings-brl.irl file:

package helloworld {
   rule greetings {
      property status = "new";
      when {
         IlrContext() from ?context;
         evaluate (helloworld.Clock.currentTime.compareTo(new ilog.rules.brl.Time(ilog.rules.brl.IlrDateUtil.getLocalTime(1970, 0, 1, 0, 0, 0, 0, 1))) < 0);
      } then {
         ilog.rules.brl.System.printMessage("Good morning!");
      } else {
         ilog.rules.brl.System.printMessage("Good afternoon!");
      }
   }
}

plus a descriptor file with all the BOM and XOM and METADATA. The b2x files contain some horrendous XML to map Java code into functions that JRules engine can use.... XML! Mothers, keep your childer home, XML is around!


Anyway.... log into http://localhost:8080/res , add RuleApp (I call it PVRuleApp), add Ruleset, I call it PVGreetingsRuleset, and choose as archive the JAR exported from Eclipse...


Click on the WSDL, copy the URL, open SoapUI, create a new project and give it the WSDL url.... and off you go, you are ready to invoke the rule via WS!


Here you can find a more complete presentation, including how to pass parameters to a Ruleset



Thursday, May 27, 2010

OSB integration with JRules through SOAP or EJB

First, let's get familiar with this new baby, JRules; this can be done simply by playing with her.

Documentation:
http://publib.boulder.ibm.com/infocenter/brjrules/v7r0/index.jsp

Download JRules 7.0 binaries (including Tomcat, Derby etc):

https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=swg-iwilogjt70&S_PKG=dl&S_TACT=104CBW71<=en_US&cp=UTF-8&dlmethod=http


(you need to have an account with IBM, it's free anyhow)


You can deploy JRules to WebLogic - it's only a bunch of EARs. In this case you access this way:
http://localhost:7001/res

The Console gives you:

Explorer - this contains the Navigator, to display the RuleApps and the Decision Services
You can Create a RuleApp, add RuleSet to a RuleApp by provinding a Ruleset Archive.

Decision Warehouse

Diagnostics

Server Info


In WebLogic console, view the JNDI tree and you will see this:

Binding Name: eis.XUConnectionFactory

Class: ilog.rules.res.xu.cci.IlrXUConnectionFactory


Unfortunately the JRules manual says:

"EJB3 bindings are supported for the JBoss 4.2/5.0, WebSphere 7;0 application servers."

which doesn't sound good if you use WebLogic.


Anyway ilog/rules/res/xu/cci/IlrXUConnectionFactory.class is in these 2 JARs:

C:\Program Files\IBM\WebSphereILOGJRules702\executionserver\lib\jrules-res-execution.jar:
C:\Program Files\IBM\WebSphereILOGJRules702\executionserver\lib\jrules-res-session-java.jar:

Here
http://publib.boulder.ibm.com/infocenter/brjrules/v7r0m2/index.jsp?topic=/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global1674.html

it mentions:
"how to execute a simple stateless rule session on a Java EE application server...by using a Java client."

and here

http://publib.boulder.ibm.com/infocenter/brjrules/v7r0m2/index.jsp?topic=/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global308.html

a promising tutorial on how to invoke JRules from WebLogic Workshop.

WIP....

Wednesday, May 26, 2010

OSB and EJB 3.0 Client Jar File

Now, we want to expose an EJB 3.0 Stateless Session Bean in a Business Service in OSB11.

Create an EJB 3.0 Project, and ASSOCIATE IT to a EAR, and enable generation of EJB Client Jar.

The EJB will look like this:

package com.lassi.mejb;
import javax.ejb.Stateless;

/**
 * Session Bean implementation class LassiEJB
 */
@Stateless(mappedName="
LassiEJB")
public class LassiEJB implements LassiEJBRemote, LassiEJBLocal {

    /**
     * Default constructor.
     */
    public LassiEJB() {
        // TODO Auto-generated constructor stub
    }

    @Override
    public String hello(String message) {
        System.out.println("message=" + message);
        return "hello " + message;
    }

    @Override
    public String helloLocal(String message) {
        System.out.println("messagelocal=" + message);
        return "hellolocal " + message;
    }

   
}




and the interfaces:


package com.lassi.mejb;
import javax.ejb.Remote;

@Remote
public interface LassiEJBRemote {
    String hello(String message);
}



and


package com.lassi.mejb;
import javax.ejb.Local;

@Local
public interface LassiEJBLocal {
    String helloLocal(String message);
}



To generate the Client EJB Jar, just export the EAR project as an EAR, then unzip it.
You will get a LassiEJBProjectClient.jar in APP-INF/lib.
Otherwise you can right-click on the EJB project, choose Java EE  Tools and Generate EJB Client JAR.

Make sure that your Local and Remote interfaces are created in the EJBClient project, otherwise your EJB Client JAR will contain only the manifest.mf file and you will be very disappointed.

THIS EJB Client JAR is the JAR you need to import into OSB.

To find the JNDI name of your EJB click on the WLServer in the console and look into "View JNDI tree".
It should be something like LassiEARLassiEJBProject_jarLassiEJB_Home
Also, in OSB create a JNDI provider with t3://localhost:7001 and call it myjndiprovider

Create a Business Service, Transport Typed,
the URI will be like ejb:myjndiprovider:LassiEJB#com.lassi.mejb.LassiEJBRemote

In the Business Interface  you can choose the Local or the Remote interface (of course if you choose Local it will be faster! But if you use the JNDI name of the Remote interface it will not work... I presume ???? )....


At the end, if you get a

java.lang.ClassCastException: weblogic.ejb.container.internal.StatelessEJBHomeImpl

or a


java.lang.ClassCastException: $Proxy224
 at com.bea.wli.sb.transports.ejb.Jws.hellopierrelocal(Unknown Source)



most likely it means you are binding to the wrong JNDI name...

Tuesday, May 25, 2010

OSB: what is deployed in the OSB domain?

FMW Welcome Page Application:
C:/bea11/oracle_common/modules/oracle.jrf_11.1.1/fmw-welcome.ear


this is the Fusion MiddleWare welcome page (???? what is this exactly?)


DMS Application
C:/bea11/oracle_common/modules/oracle.dms_11.1.1/dms.war

DMS is Dynamic Monitoring System
(The Oracle Dynamic Monitoring Service (DMS) consists of a small set of simple Sensor classes that help Java programmers to measure important events and status values in their applications.)

http://download.oracle.com/docs/cd/B10464_05/core.904/b12020/oracle/dms/instrument/DMSConsole.html


wsil-wls
C:/bea11/oracle_common/modules/oracle.webservices_11.1.1/wsil-wls.ear

(WSIL is the Web Service Inspection Language)

FileAdapter
C:/bea11/Oracle_OSB11/soa/connectors/FileAdapter.rar

DbAdapter
C:/bea11/Oracle_OSB11/soa/connectors/DbAdapter.rar

JmsAdapter
C:/bea11/Oracle_OSB11/soa/connectors/JmsAdapter.rar

AqAdapter
C:/bea11/Oracle_OSB11/soa/connectors/AqAdapter.rar

FtpAdapter
C:/bea11/Oracle_OSB11/soa/connectors/FtpAdapter.rar

SocketAdapter
C:/bea11/Oracle_OSB11/soa/connectors/SocketAdapter.rar

MQSeriesAdapter
C:/bea11/Oracle_OSB11/soa/connectors/MQSeriesAdapter.rar

OracleAppsAdapter
C:/bea11/Oracle_OSB11/soa/connectors/AppsAdapter.rar

OracleBamAdapter
C:/bea11/Oracle_OSB11/soa/connectors/OracleBamAdapter.rar


ALSB Cluster Singleton Marker Application
C:/bea11/Oracle_OSB11/lib/common/clustersingletonmarker.ear

Its listener is com.bea.wli.sb.init.MarkerAppListener 
which is in sb-kernel-wls.jar


ALSB Domain Singleton Marker Application
C:/bea11/Oracle_OSB11/lib/common/domainsingletonmarker.ear
The ALSB Domain Singleton Marker Application is responsible for the collection and aggregation of data from all managed servers in the domain.

Its listener is com.bea.wli.sb.init.MarkerAppListener 
which is in sb-kernel-wls.jar and which does absolutely nothing.

 
ALSB Framework Starter Application
C:/bea11/Oracle_OSB11/lib/common/frameworkstarter.ear

ALSB Coherence Cache Provider
C:/bea11/Oracle_OSB11/lib/coherence.ear

XBus Kernel
C:/bea11/Oracle_OSB11/lib/kernelEar

with subdeployment
XBus HTTP Transport Webapp
/httpTransport

ALSB UDDI Manager
C:/bea11/Oracle_OSB11/lib/uddiEar

ALSB Subscription Listener
C:/bea11/Oracle_OSB11/lib/uddi_subscription

JMS Reporting Provider
C:/bea11/Oracle_OSB11/lib/common/jmsreportprovider.ear

Message Reporting Purger
C:/bea11/Oracle_OSB11/lib/common/msgpurger.ear

...... more to come.... I want to discover who is who...and who does what...

OSB Local Transport with Java Request Message Type

I am invoking a Proxy Service defined as
"Local Transport with Java Request Message Type and Java Response Message Type"

and, not matter whan I specify as a payload, I get a:
BEA-382054 :

Expected [[http://www.bea.com/wli/sb/context]java-content] element under $body is missing or invalid

The documentation says:

http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e15034/Router.html


BEA-382054
Error: Expected [[http://www.bea.com/wli/sb/context]java-content] element under $body is missing or invalid

Description
Services of Messaging Type : Java are expected to contain a valid [[http://www.bea.com/wli/sb/context]java-content] child element under $body.
Action
Make sure the contents of $body conforms to expected format. One can use Log action to log and examine the contents of any message context variable, including $body



but the OSB11 documentation doesn't mention Java Request Message Type... so I am not sure what should the java-content  should look like....

This http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1106656  might give some clues... in fact you are supposed to have in the body an element


<java-content ref="cid:kkkkeeeeyyyy"/>

Monday, May 24, 2010

AmberPoint for Dummies

So, you are lined up for a telephone inteview where you must pretend to have working experience with AmberPoint. Here is some BS you might reuse. If you get hired, send me a penny.

Amberpoint Management System (AMS) can be configured using these components:

plug-in agents
proxy agents
nano-agents (for EJBs, JDBC and RMI services, made by observer + monitor)
client side agents (to act as Security and Performance Monitoring proxy on the client side)

It offers:

- Container Discovery of Services (at startup)
- Publication of Services to a UDDI registry



- Dynamic Discovery of Service interdependency- at operation level
- Monitoring of Service/Operation performance
- Monitoring of Service/Operation faults
- Establish Correlations (=interrelated service operation calls)
- Monitor Correlations performance and faults
- Create "Conditions" (=observable pattern on a Service invokation) based on faults or on specific error response codes
- Report a configurable timeout on a Correlation

- Identify Service consumers (Customers) and provide statistics of Service Utilization per Customer
- Monitor SLA (performance, availability)

- Message Routing
- Message Logging on a per-service level
-


Using Environment Monitor (EM) enables:
- Automatic Fault Resolution, by constructing an action list

Sunday, May 23, 2010

Java Classpath Sucks

I am planning to develop this concept as I brood more over it...
Anyway here is my initial thought:

As a developer, I am interested to develop and test code.
Anything else is a pain in the neck.
I HATE configuration work. It's boring, it's non-creative, it's conceptually very low level.
YET I find myself wasting HUMONGOUS amount of time troubleshooting configuration issues, ESPECIALLY bloody CLASSPATH issues.

Classpath issues come mainly in 3 flavour:

1A) the JAR containing the class  is not available on your HD (go, download the right version, add the jar to your CLASSPATH)
or
1B) you have the JAR but it's not in your CLASSPATH (add it to the classpath)

2) you have the JAR, but it's the wrong version - you will notice usually for some unexpected exception, you will google and hopefully you will find someone saying "if you use version N of library Y then you must use version M or library X...).... download the right version, remove the previous from the CLASSPATH and add the right one

3) you have the same class in 2 different JARs, and of course the WRONG version of the class is in the JAR which appears first in the CLASSPATH.... this is a VERY nasty case, usually very hard to detect.

Now, Maven has done a good job at organizing dependencies, BUT you must use Maven, and be very organized.

So, why on earth the Java language doesn't contain some internal mechanisms to address these issues? Like, an internal Maven-like mechanisms which analyzes your code for dependencies, knows where to download the JAR and automatically does it for you and add it to your classpath?
Or, some expert system detecting the known incompatibilities and flagging them to you? Or, an automated way to detect multiple instances of the same class in the classpath?

We still have a long way to go before the Java developer job is made hassle-free.... probably by then Java will be extinct and maintained only by some nostalgic old developer.

Java founding fathers probably were aware that point 3 would be an issue, so they introduced the JAR SEALING feature.... which is basically never used by anybody and in any case addresses only some basic issues.

In Java 7 they will introduce MODULES, so a class can be accessed only by classes belonging to the same module. This adds a new  dimension to the class versioning technology. A class is no longer GLOBAL, exposed via a CLASSPATH, but only LOCAL to a MODULE.

Here http://www.slideshare.net/gal.marder/whats-expected-in-java-7-1116123 a cool presentation on what is new in Java 7.

Saturday, May 22, 2010

OSB, Eclipse and Axis2

If you plan to use Axis2 as a runtime for Web Services clients, remember that you should download axis2-1.4.1, and not the latest release, otherwise you will get :


java.lang.NoClassDefFoundError: org/apache/http/HttpResponseFactory
    at org.apache.axis2.transport.http.SimpleHTTPServer.init(SimpleHTTPServer.java:116)
    at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:74)
    at org.apache.axis2.context.ConfigurationContext.getListenerManager(ConfigurationContext.java:692)
    at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:163)
    at org.apache.axis2.client.ServiceClient.(ServiceClient.java:143)


All this is very sad. There is never a bloody compatibility check in Java classes and Jars... all the time you must discover which version goes with which by trial and error, exceptions and painful googling for explanations.... I would expect in 2010 a mature language like Java would enforce a standardization on library compatibility...

Amberpoint Amberpoint on the wall, who in the land is fairest of all?

I am reading the Introduction to Amberpoint Management System, I felt this absolutely touching, story of my life:

Monitoring this process that crosses application, container, and network boundaries
poses many challenges. Are users experiencing significant delays? Are faults being
generated? If transactions are failing, at what point are they failing? What is the dollar
cost per fault being generated? Typically, these questions can only be answered by
trolling through reams of log files gathered from distributed machines, potentially
owned by different development teams. Worse, this work is usually forensic in nature.
The transaction has already failed and there is little that can be done until all of the
logs are collected and the various teams have sorted through the problems. Any
corrections must go through the development and deployment process, further
magnifying the expense of time and money.


To address these challenges, the complete transaction should be visible in real time:
each cooperating piece of infrastructure and service should be able to obtain the
policies that indicate how requests should be treated and how to report information
about performance, errors, and conditions of interest to the business owner. One
possibility would be to have all SOA components (services, containers, logging
infrastructure, security infrastructure) provide standard management handles that
enable them to transmit performance and dependency information and to enforce
policies that align performance with business goals. Unfortunately, these standards do
not yet exist
. Even if they did exist, it is unlikely they could be sufficiently broad to
accommodate the heterogeneity of SOA or to anticipate component types yet to be
invented. An alternative solution would be to support management functions by
instrumenting the environment in which SOA applications run. By adding a
configurable management layer, it would be possible to retain all the advantages of
SOA design without incurring additional costs at production time.




Friday, May 21, 2010

OSB: coherence and caching

this
http://www.oracle.com/technology/architect/enterprise_solution_cookbook/data_tier_caching_for_soa.html

makes a good reading just to get an idea of how to make a CacheService invoking Coherence. The service can be exposed with a LOCAL transport protocol to avoid marshalling/unmarshalling.

In a nutshell it says: you can cache either Service State (e.g. for a BPM the serialized state of a Process Instance) or Service Result (the result of a DB query).

Cache-aside means: 1) readFromCache 2) miss 3) retrieveFromDB 4) storeInCache
next time you read the same key, you have a hit.

This is very illuminating:

Oracle Coherence offers a Java API; a native service call from BPEL to Coherence was a preference over a standard web service interface. The performance overhead of invoking web service operations is several orders of magnitude larger than that of invoking native Java classes. That's because marshaling and un-marshaling XML, processing SOAP envelopes, etc. are expensive operations.

Note the use of


thread.setContextClassLoader(com.tangosol.net.NamedCache.class.getClassLoader());


to avoid creating a different cache per each classloader in the application! Well done!
(don't forget to set the classloader again to its previous value!)

OSB: performance monitoring

It's important to understand which JEE modules are involved in a request processing.
I am here hammering with 100 concurrent threads a simple Proxy Service, /OSBProject1/ProxyService1, which appears in the Web Applications list but as "Unprepared".

There are many wars involved: xbuslogging.war, xbuspublish.war, xbusrouting.war, xbustransform.war, but mainly it's httpTransport.war  who seems to be the entry point for each request.

httpTransport.war is deployed in a kernelEar (C:\bea11\Oracle_OSB11\lib\kernelEar), whose application name is XBus Kernel. This animal contains a HttpEndPointCreator, which probably is responsible for the dynamic creation of the /OSBProject1/ProxyService1 endpoint.



Web Applications (Filtered - More Columns Exist)



Context Root 
State  Source Information  Maximum Sessions on Any Server  Application  Servlets 

Active fmw-welcome.war 0 FMW Welcome Page Application (11.1.0.0.0) 3
/alsb-uddi Active com/bea/wli/sb/uddi/auto/UDDISubscriptionListenerImpl.war 0 ALSB Subscription Listener 4
/alsb/ws/_async Active bea_alsb_ws_async_response.war 0 WS Transport Async Applcation 9
/dms Active dms.war 0 DMS Application (11.1.1.1.0) 4
/httpTransport Active httpTransport.war 0 XBus Kernel 3
/inspection.wsil Active wsil.war 0 wsil-wls 4
/OSBProject1/ProxyService1 Unprepared httpTransport.war 0 XBus Kernel 4
/sbconsole Active webapp 1 ServiceBus_Console 14
/sbinspection.wsil Active wsil.war 0 ALSB WSIL 4
/sbresource Active sbresource.war 0 ALSB Resource 4
/sbtestservice Active sbTestFwk.war 0 ALSB Test Framework 4
/xbuslogging Active xbuslogging.war 0 ALSB Logging 6
/xbuspublish Active xbuspublish.war 0 ALSB Publish 6
/xbusrouting Active xbusrouting.war 0 ALSB Routing 6
/xbustransform Active xbustransform.war 0 ALSB Transform 6








OSB thread dump on XQuery parser

 I am logging $body during this Thread Dump.... interesting stuff... OSB internally uses Apache XMLBeans and Apache Piccolo Sax Parser

Also interesting that whenever XQuery wants to read a variable it calls

com/bea/wli/sb/context/MessageContextImpl.getVariableValue(MessageContextImpl.java:202)


I have put in BOLD the focal points.



            "[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" id=18 idx=0x48 tid=928 prio=5 alive, native_blocked, daemon
         
                at org/apache/xmlbeans/impl/piccolo/util/CharStringConverter.hashKey(CharStringConverter.java:168)
         
                at org/apache/xmlbeans/impl/piccolo/util/CharStringConverter.convert(CharStringConverter.java:97)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseCdataLiteral(PiccoloLexer.java:3025)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseQuotedTagValue(PiccoloLexer.java:2936)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseAttributesNS(PiccoloLexer.java:1754)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseOpenTagNS(PiccoloLexer.java:1521)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseTagNS(PiccoloLexer.java:1362)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.yylex(PiccoloLexer.java:4678)
         
                at org/apache/xmlbeans/impl/piccolo/xml/Piccolo.yylex(Piccolo.java:1290)
         
                at org/apache/xmlbeans/impl/piccolo/xml/Piccolo.yyparse(Piccolo.java:1400)
         
                at org/apache/xmlbeans/impl/piccolo/xml/Piccolo.parse(Piccolo.java:714)
         
                at org/apache/xmlbeans/impl/store/Locale$SaxLoader.load(Locale.java:3456)
         
                at org/apache/xmlbeans/impl/store/Locale.parseToXmlObject(Locale.java:1278)
         
                at org/apache/xmlbeans/impl/store/Locale.parseToXmlObject(Locale.java:1252)
         
                at org/apache/xmlbeans/impl/schema/SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
         
                at org/apache/xmlbeans/XmlObject$Factory.parse(XmlObject.java:747)
         
                at com/bea/wli/sb/sources/XmlObjectSource.getInstance(XmlObjectSource.java:203)
         
                at com/bea/wli/sb/sources/XmlObjectTransformer.getXmlObjectSource(XmlObjectTransformer.java:199)
         
                at com/bea/wli/sb/sources/XmlObjectTransformer.transform(XmlObjectTransformer.java:111)
         
                at com/bea/wli/sb/sources/MetaTransformer.doTransform(MetaTransformer.java:138)
         
                at com/bea/wli/sb/sources/MetaTransformer.transform(MetaTransformer.java:89)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl$LazyInitTransformer.transform(PipelineContextImpl.java:1426)
         
                at com/bea/wli/sb/context/SOAPMessageImpl.parseCheckEnvelope(SOAPMessageImpl.java:1143)
         
                at com/bea/wli/sb/context/SOAPMessageImpl.unpack(SOAPMessageImpl.java:705)
         
                at com/bea/wli/sb/context/SOAPMessageImpl.getBody(SOAPMessageImpl.java:248)
         
                at com/bea/wli/sb/context/BodyVariable.getTypedValue(BodyVariable.java:106)
         
                at com/bea/wli/sb/context/BodyVariable.getTypedValue(BodyVariable.java:25)
         
                at com/bea/wli/sb/context/SystemVariable.getValue(SystemVariable.java:49)
         
                at com/bea/wli/sb/context/MessageContextImpl.getVariableValue(MessageContextImpl.java:202)
         
                at com/bea/wli/sb/stages/expressions/xquery/XQueryExprExecutor.getVariables(XQueryExprExecutor.java:182)
         
                at com/bea/wli/sb/stages/expressions/xquery/XQueryExprExecutor.executeJavaObject(XQueryExprExecutor.java:129)
         
                at stages/logging/runtime/LogRuntimeStep.processMessage(LogRuntimeStep.java:109)
         
                at com/bea/wli/sb/pipeline/debug/DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
         
                at com/bea/wli/sb/stages/StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
         
                at com/bea/wli/sb/pipeline/PipelineStage.processMessage(PipelineStage.java:84)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl.execute(PipelineContextImpl.java:922)
         
                at com/bea/wli/sb/pipeline/Pipeline.processMessage(Pipeline.java:141)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl.execute(PipelineContextImpl.java:922)
         
                at com/bea/wli/sb/pipeline/PipelineNode.doRequest(PipelineNode.java:55)
         
                at com/bea/wli/sb/pipeline/Node.processMessage(Node.java:67)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl.execute(PipelineContextImpl.java:922)
         
                at com/bea/wli/sb/pipeline/Router.processMessage(Router.java:214)
         
                at com/bea/wli/sb/pipeline/MessageProcessor.processRequest(MessageProcessor.java:99)
         
                at com/bea/wli/sb/pipeline/RouterManager$1.run(RouterManager.java:593)
         
                at com/bea/wli/sb/pipeline/RouterManager$1.run(RouterManager.java:591)
         
                at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         
                at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:147)
         
                at com/bea/wli/sb/security/WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
         
                at com/bea/wli/sb/pipeline/RouterManager.processMessage(RouterManager.java:590)
         
                at com/bea/wli/sb/transports/TransportManagerImpl.receiveMessage(TransportManagerImpl.java:375)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase$1.run(RequestHelperBase.java:154)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase$1.run(RequestHelperBase.java:152)
         
                at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         
                at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:147)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase.securedInvoke(RequestHelperBase.java:151)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase.service(RequestHelperBase.java:107)
         
                at com/bea/wli/sb/transports/http/wls/HttpTransportServlet.service(HttpTransportServlet.java:127)
         
                at weblogic/servlet/FutureResponseServlet.service(FutureResponseServlet.java:24)
         
                at javax/servlet/http/HttpServlet.service(HttpServlet.java:820)
         
                at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         
                at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         
                at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)
         
                at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:183)
         
                at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
         
                at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         
                at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         
                at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:121)
         
                at weblogic/servlet/internal/WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         
                at weblogic/servlet/internal/WebAppServletContext.execute(WebAppServletContext.java:2174)
         
                at weblogic/servlet/internal/ServletRequestImpl.run(ServletRequestImpl.java:1446)
         
                at weblogic/work/ExecuteThread.execute(ExecuteThread.java:201)
         
                at weblogic/work/ExecuteThread.run(ExecuteThread.java:173)
         
                at jrockit/vm/RNI.c2java(IIIII)V(Native Method)

Thursday, May 20, 2010

WebLogic 11g, OSB11 and Web Service client

Glory to Oracle, they have introduced Eclipse 3.5.2, wow!

AT LAST Oracle introduced a wizard to generate a Java Web Service Client without having to struggle for zip and jar files and classpaths for hours... Long Live Oracle!

Do New, Other, and you have 2 options:
Web Service Client and
WebLogic Web Service Client

With Web Service Client
you have the option to
Monitor SOAP traffic and
Customize namespace to Java packages mapping (cool!)



and here is the code you should use


HelloWorldSOAP12BindingQSServiceLocator locator = new HelloWorldSOAP12BindingQSServiceLocator();
HelloWorldPortType pt = locator.getHelloWorldSOAP12BindingQSPort();
pt.helloWorld("vaffanculo");

OSB and Java Callout, a fierce discussion

here is my take:

During a discussion, somebody said that we should use Java Callouts with great care, because
A) they introduce an extra artifact, a JAR file (or multiple JAR files) to maintain;

and

B) because there are performance issues tied to Java Callouts.

For point A, I can only say that Ant exists :o) , so there is no real need to generate and deploy JARs by hand. Here http://ant.apache.org/ is Ant :o) , your friend.

For point B, I am still looking for some documentation or actual POC proving that Java Callouts introduce a performance hit, and under which circumstances, and of which extent. So if you are aware of anything, please show us.

I am not saying we SHOULD use Java Callouts, but I am not ruling out the technology in specific cases where it really makes sense.


Anyway here is the documentation from Oracle
http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/pojo.html


I found this particularly interesting:

A single POJO can be invoked by one or more proxy services. All the threads in the proxy services invoke the same POJO. Therefore, the POJO must be thread safe. A class or method on a POJO can be synchronized, in which case it serializes access across all threads in all of the invoking proxy services. Any finer-grained concurrency (for example, to control access to a DB read results cache and implement stale cache entry handling) must be implemented by the POJO code.

It is generally a bad practice for POJOs to create threads. 




Wednesday, May 19, 2010

XmlAccessType.FIELD vs XmlAccessType.PROPERTY

As a Java guy, I feel disturbed by using XmlAccessType.FIELD
(see
http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlAccessType.html )
in JAXB while "exposing" a JavaBean as a XML data type.

XmlAccessType.FIELD will expose ANY Java attribute, even the private ones, even those that you didn't mean to expose, UNLESS you annotate them as @XmlTransient .


MY vision, which I assume matches the JavaBean vision, is that you expose only properties which are explicitly associated with a getter (setter if they are writable), and that you should really never access directly the attribute as a field. This leads to a more method-centric programming style, as opposed to a data-centric programming style.

For this reason, I privilege the XmlAccessType.PROPERTY approach.

Web Services faults caught from a Java client

If your WS returns you a fault, in Java this will be mapped to a

javax.xml.ws.soap.SOAPFaultException

which is filled with a detailedMessage 

Failed to invoke end component com.acme.dbaccess.CompanyDBWS (POJO), operation=insertCompany
 -> Failed to invoke method
 -> UNABLE_TO_EXECUTE_SQL


and a fault (name is SOAP-ENV:Fault) with QName {http://schemas.xmlsoap.org/soap/envelope/}Fault

WebLogic: building a Java client for a Web Service

1) create a WebLogic Web Service project - separate from the WebService service project

2) copy the C:\beaosb\wlserver_10.3\server\lib\wseeclient.zip to the lib directory and UNZIP IT (huge amount of jars there)

3) add all the jars to the project classpath

4) add C:\beaosb\modules\org.apache.ant_1.6.5\lib\ant.jar  to the classpath

5) copy the WSDL, run the clientgen wizard, generate the client jar and add it to the classpath


6) write this kind of code:

        CompanyDBWSService service = new CompanyDBWSService();
        Company company = new Company();
        company.setId(1234L);
        company.setName("PierreIsAPig");
        company.setCreationDate(1961);
        service.getCompanyDBWSSoapPort().insertCompany(company);


here are the official instructions:

http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webserv/client.html#wp229351

see also this thread

http://forums.oracle.com/forums/thread.jspa?threadID=723357&tstart=-1

FML and MFL

When working with Tuxedo one gets confused between FML and FML.


The way I understand it is that:

FML is a data format standard proprietary to Tuxedo.
MFL is a METADATA about an arbitrary binary data format.



FML

http://en.wikipedia.org/wiki/Tuxedo_%28software%29

Flexible buffer formats

Tuxedo applications can utilize a variety of message formats depending upon the type of data that is to be passed. One of the most popular formats is the FML buffer format which is much like a binary XML or ASN.1 format. FML buffers can contain an arbitrary number of named fields of arbitrary type. Fields can be repeated and nested. As it is a self describing binary format, the processing of fields incurs very little overhead in comparison to the parsing necessary to support something like XML. VIEW buffers are essentially records, C structures, or COBOL copybooks. A VIEW buffer has an external description which allows Tuxedo to access the fields within it if necessary for things like data dependent routing. Other buffer formats include XML, CARRAY (opaque binary data), STRING, and MBSTRING (a string buffer containing multibyte characters.) Tuxedo can automatically and transparently convert FML buffers to and from XML buffers.

There is also support for user-developed buffer types (for example JamFlex buffers defined by Tuxedo version of Panther RAD toolset).



MFL

http://download.oracle.com/docs/cd/E13171_01/alsb/docs25/consolehelp/mfls.html

A Message Format Language (MFL) document is a specialized XML document used to describe the layout of binary data. It is a BEA proprietary language used to define rules to transform formatted binary data into XML data. An MFL document conforms to the mfl.dtd, which includes elements and attributes used to describe each field of data, as well as groupings of fields (groups), repetition, and aggregation.

When you create a business services or proxy services of Messaging Service type, you can select MFL types as the request message type or the response message type of the service.

You use BEA Format Builder to create MFLs. When you define the hierarchy of a binary record, the layout of fields, and the grouping of fields and groups, the information is saved as an MFL document that can then be used to perform run-time translations. An MFL document can also be used in Format Builder to generate the corresponding DTD that describes its content model. To learn how to use the Format Builder, see the Format Builder Online Help.

Monday, May 17, 2010

OSB: transports available per Proxy Service type

In this table I am summarizing the type of Proxy Service you should use when the transport is defined:


WSDL Web service Any SOAP Service Any XML Service Transport Typed Service Messaging Type Service
DSP X X X
HTTP X X X
JMS X X X X
JPD X X X
Local X X X X
SB X X X
WS X
E-mail X X
File X X
FTP X X
HTTP GET X X
MQ X X
SFTP X X
TUXEDO X
EJB X
Flow X


PDF generation in Java

This is what a friend suggests:

You can use Apache FOP.
iText is very low-level,
so I'd suggest using Jasper Reports.
I also heard some good things about Eclipse Birt

XQuery to change the local name of an element

returning to the problem of changing operation in a body, that is turning:

<dbac:insertCompany xmlns:dbac="http://com/acme/dbaccess">
  <dbac:company xmlns:java="java:com.acme.dbaccess">
    <java:CreationDate>3</java:CreationDate>
    <java:Id>10</java:Id>
    <java:Name>string</java:Name>
  </dbac:company>
</dbac:insertCompany>



into

<dbac:updateCompany xmlns:dbac="http://com/acme/dbaccess">
  <dbac:company xmlns:java="java:com.acme.dbaccess">
    <java:CreationDate>3</java:CreationDate>
    <java:Id>10</java:Id>
    <java:Name>string</java:Name>
  </dbac:company>
</dbac:
updateCompany>


of course one way would be to turn all the payload into a String, do a fn:replace(thestring, oldoperation, newoperation) and then turning it back into a element(*); but it's very unsafe as it replaces everything.

There is a reliable way using this XQuery:


declare namespace functx = "http://www.functx.com";
declare namespace dbac = "http://com/acme/dbaccess";

declare function functx:replace-beginning
  ( $arg as element(*), $name as xs:string,$newName as xs:string)  as element() {
    if (fn:ends-with(string(node-name($arg)), $name) = xs:boolean('true')) then
     element{$newName}{$arg/node()}      
    else
     Error Message
 } ;

declare variable $arg as element(*) external;
declare variable $name as xs:string external;
declare variable $newName as xs:string external;
functx:replace-beginning($arg, $name, $newName)

This is an excellent demonstration of how to instantiate a node (element($newName)} and insert into it portion of the old element.

Saturday, May 15, 2010

Excellent XQuery book


http://oreilly.com/catalog/9780596006341

This is the kind of book that you would like to have available for every new technology you want to learn.
Normally men are drifting away when they write computer books; this book, written by a woman, proves the superior communication skills of women.


Examples from this book are available here.

Friday, May 14, 2010

OSB: a looong StackTrace showing something of the internal mechanism

 I put a breakpoint in a Java Callout (the Java class is ChangeOperation). The client is the Web Console.


Daemon Thread [[STUCK] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'] (Suspended (breakpoint at line 15 in ChangeOperation))   
    ChangeOperation.changeOperation(XmlObject, String) line: 15   
    NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]   
    NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39   
    DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25   
    Method.invoke(Object, Object...) line: 597   
    JavaCalloutRuntimeStep$1.run() line: 158   
    AuthenticatedSubject.doAs(AbstractSubject, PrivilegedExceptionAction) line: 363   
    SecurityManager.runAs(AuthenticatedSubject, AuthenticatedSubject, PrivilegedExceptionAction) line: not available   
    Security.runAs(Subject, PrivilegedExceptionAction) line: 61   
    JavaCalloutRuntimeStep.processMessage(MessageContext, PipelineContext) line: 179   
    DebuggerRuntimeStep.processMessage(MessageContext, PipelineContext) line: 74   
    StageMetadataImpl$WrapperRuntimeStep.processMessage(MessageContext, PipelineContext) line: 346   
    SequenceRuntimeStep.processMessage(MessageContext, PipelineContext) line: 33   
    WsCalloutRuntimeStep.processMessage(MessageContext, PipelineContext) line: 182   
    DebuggerRuntimeStep.processMessage(MessageContext, PipelineContext) line: 74   
    StageMetadataImpl$WrapperRuntimeStep.processMessage(MessageContext, PipelineContext) line: 346   
    SequenceRuntimeStep.processMessage(MessageContext, PipelineContext) line: 33   
    IfThenElseRuntimeStep.processMessage(MessageContext, PipelineContext) line: 86   
    DebuggerRuntimeStep.processMessage(MessageContext, PipelineContext) line: 74   
    StageMetadataImpl$WrapperRuntimeStep.processMessage(MessageContext, PipelineContext) line: 346   
    SequenceRuntimeStep.processMessage(MessageContext, PipelineContext) line: 33   
    WsCalloutRuntimeStep.processMessage(MessageContext, PipelineContext) line: 243   
    DebuggerRuntimeStep.processMessage(MessageContext, PipelineContext) line: 74   
    StageMetadataImpl$WrapperRuntimeStep.processMessage(MessageContext, PipelineContext) line: 346   
    SequenceRuntimeStep.processMessage(MessageContext, PipelineContext) line: 33   
    PipelineStage.processMessage(MessageContext, InternalPipelineContext) line: 84   
    PipelineContextImpl.execute(RuntimeComponent, MessageContext) line: 866   
    Pipeline.processMessage(MessageContext, InternalPipelineContext) line: 141   
    PipelineContextImpl.handleError(MessageContext, Throwable) line: 961   
    PipelineContextImpl.execute(RuntimeComponent, MessageContext) line: 877   
    Pipeline.processMessage(MessageContext, InternalPipelineContext) line: 141   
    PipelineContextImpl.execute(RuntimeComponent, MessageContext) line: 866   
    PipelineNode.doRequest(MessageContext, InternalPipelineContext) line: 55   
    PipelineNode(Node).processMessage(MessageContext, InternalPipelineContext) line: 67   
    PipelineContextImpl.execute(RuntimeComponent, MessageContext) line: 866   
    Router.processMessage(MessageContext, InternalPipelineContext) line: 191   
    MessageProcessor.processRequest(RouterContext) line: 75   
    RouterManager$1.run() line: 508   
    RouterManager$1.run() line: 506   
    AuthenticatedSubject.doAs(AbstractSubject, PrivilegedExceptionAction) line: 363   
    SecurityManager.runAs(AuthenticatedSubject, AuthenticatedSubject, PrivilegedExceptionAction) line: not available   
    WLSSecurityContextService.runAs(AuthenticatedSubject, PrivilegedExceptionAction<T>) line: 55   
    RouterManager.processMessage(InboundTransportMessageContext, RouterOptions) line: 505   
    ServiceMessageSender.send0(ConfigService, Service, ServiceInvocationRequestType, AuthenticatedSubject) line: 263   
    ServiceMessageSender.access$000(ServiceMessageSender, ConfigService, Service, ServiceInvocationRequestType, AuthenticatedSubject) line: 68   
    ServiceMessageSender$1.run() line: 125   
    ServiceMessageSender$1.run() line: 123   
    AuthenticatedSubject.doAs(AbstractSubject, PrivilegedExceptionAction) line: 363   
    SecurityManager.runAs(AuthenticatedSubject, AuthenticatedSubject, PrivilegedExceptionAction) line: not available   
    WLSSecurityContextService.runAs(AuthenticatedSubject, PrivilegedExceptionAction<T>) line: 55   
    ServiceMessageSender.send(ConfigService, Service, ServiceInvocationRequestType) line: 128   
    ServiceProcessor.invoke(String, Ref, InvocationRequestType) line: 441   
    TestServiceImpl.invoke(String, Ref, InvocationRequestType) line: 169   
    TestService_sqr59p_Impl(TestServiceEJBBean).invoke(String, Ref, InvocationRequestType) line: 136   
    TestService_sqr59p_EOImpl.invoke(String, Ref, InvocationRequestType) line: 572   
    TestService_sqr59p_EOImpl_WLSkel.invoke(int, Object[], Object) line: not available   
    ServerRequest.sendReceive() line: 174   
    ClusterableRemoteRef.invoke(RemoteReference, RuntimeMethodDescriptor, Object[], Method) line: 345   
    ClusterableRemoteRef.invoke(Remote, RuntimeMethodDescriptor, Object[], Method) line: 259   
    TestService_sqr59p_EOImpl_1030_WLStub.invoke(String, Ref, InvocationRequestType) line: not available   
    TestServiceClient.invoke(HttpServletRequest, Ref, InvocationRequestType) line: 179   
    ServiceRequestAction(DefaultRequestAction).invoke(HttpServletRequest, TestActionForm, ITestObject) line: 117   
    ServiceRequestAction(DefaultRequestAction).execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 70   
    ServiceRequestAction.execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 80   
    SBConsoleRequestProcessor(RequestProcessor).processActionPerform(HttpServletRequest, HttpServletResponse, Action, ActionForm, ActionMapping) line: 431   
    PageFlowRequestProcessor.access$201(PageFlowRequestProcessor, HttpServletRequest, HttpServletResponse, Action, ActionForm, ActionMapping) line: 97   
    PageFlowRequestProcessor$ActionRunner.execute() line: 2044   
    ActionInterceptors.wrapAction(ActionInterceptorContext, List, ActionInterceptors$ActionExecutor) line: 91   
    SBConsoleRequestProcessor(PageFlowRequestProcessor).processActionPerform(HttpServletRequest, HttpServletResponse, Action, ActionForm, ActionMapping) line: 2116   
    SBConsoleRequestProcessor.processActionPerform(HttpServletRequest, HttpServletResponse, Action, ActionForm, ActionMapping) line: 91   
    SBConsoleRequestProcessor(RequestProcessor).process(HttpServletRequest, HttpServletResponse) line: 236   
    SBConsoleRequestProcessor(PageFlowRequestProcessor).processInternal(HttpServletRequest, HttpServletResponse) line: 556   
    SBConsoleRequestProcessor(PageFlowRequestProcessor).process(HttpServletRequest, HttpServletResponse) line: 853   
    SBConsoleRequestProcessor.process(HttpServletRequest, HttpServletResponse) line: 191   
    SBConsoleActionServlet(AutoRegisterActionServlet).process(HttpServletRequest, HttpServletResponse) line: 631   
    SBConsoleActionServlet(PageFlowActionServlet).process(HttpServletRequest, HttpServletResponse) line: 158   
    SBConsoleActionServlet(ConsoleActionServlet).process(HttpServletRequest, HttpServletResponse) line: 256   
    SBConsoleActionServlet(ActionServlet).doGet(HttpServletRequest, HttpServletResponse) line: 414   
    SBConsoleActionServlet(ConsoleActionServlet).doGet(HttpServletRequest, HttpServletResponse) line: 133   
    SBConsoleActionServlet(SBConsoleActionServlet).doGet(HttpServletRequest, HttpServletResponse) line: 49   
    PageFlowUtils.strutsLookup(ServletContext, ServletRequest, HttpServletResponse, String, String[], boolean) line: 1199   
    PageFlowUtils.strutsLookup(ServletContext, ServletRequest, HttpServletResponse, String, String[]) line: 1129   
    StrutsStubImpl(ScopedContentCommonSupport).executeAction(ServletContext, ScopedRequest, ScopedResponse, RequestState, ResponseState, ActionResolver, boolean, boolean) line: 687   
    StrutsStubImpl(ScopedContentCommonSupport).processActionInternal(HttpServletRequest, HttpServletResponse, ServletContext, RequestState, ResponseState, boolean) line: 142   
    StrutsStubImpl.processAction(HttpServletRequest, HttpServletResponse, ServletContext, RequestState, boolean) line: 76   
    StrutsActionHandler(NetuiActionHandler).raiseScopedAction(String, String, String, boolean, boolean, ActionForm, ServletContext, boolean) line: 111   
    StrutsContent(NetuiContent).raiseScopedAction(String, String, boolean, boolean, ActionForm, boolean) line: 181   
    StrutsContent(NetuiContent).raiseScopedAction(boolean, boolean) line: 167   
    StrutsContent(NetuiContent).handlePostbackData(String) line: 225   
    ControlLifecycle$2.visit(UIControl, Object) line: 180   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 324   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walkRecursive(VisitorType, UIControl, Object, boolean) line: 334   
    ControlTreeWalker.walk(VisitorType, UIControl, IControlTreeWalkerPool) line: 130   
    Lifecycle.processLifecycles(int, int, VisitorType[], UIControl, UIContext, IControlTreeWalkerPool, boolean) line: 395   
    Lifecycle.processLifecycles(int, VisitorType[], UIControl, UIContext, IControlTreeWalkerPool) line: 361   
    Lifecycle.processLifecycles(int, VisitorType[], UIControl, IControlTreeWalkerPool) line: 352   
    Lifecycle.runInbound(UIContext) line: 184   
    Lifecycle.run(UIContext, IControlTreeWalkerPool) line: 159   
    SingleFileServlet(UIServlet).runLifecycle(UIContext, HttpServletRequest) line: 388   
    SingleFileServlet(UIServlet).doPost(HttpServletRequest, HttpServletResponse) line: 258   
    SingleFileServlet(UIServlet).service(HttpServletRequest, HttpServletResponse) line: 199   
    SingleFileServlet.service(HttpServletRequest, HttpServletResponse) line: 251   
    SingleFileServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 820   
    AsyncInitServlet.service(ServletRequest, ServletResponse) line: 130   
    StubSecurityHelper$ServletServiceAction.run() line: 227   
    StubSecurityHelper.invokeServlet(ServletRequest, HttpServletRequest, ServletRequestImpl, ServletResponse, HttpServletResponse, Servlet) line: 125   
    ServletStubImpl.execute(ServletRequest, ServletResponse, FilterChainImpl) line: 292   
    TailFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 26   
    FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 42   
    RequestEventsFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 27   
    FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 42   
    WebAppServletContext$ServletInvocationAction.run() line: 3496   
    AuthenticatedSubject.doAs(AbstractSubject, PrivilegedAction) line: 321   
    SecurityManager.runAs(AuthenticatedSubject, AuthenticatedSubject, PrivilegedAction) line: not available   
    WebAppServletContext.securedExecute(HttpServletRequest, HttpServletResponse, boolean) line: 2180   
    WebAppServletContext.execute(ServletRequestImpl, ServletResponseImpl) line: 2086   
    ServletRequestImpl.run() line: 1406   
    ExecuteThread.execute(Runnable) line: 201   
    ExecuteThread.run() line: 173