It seems that LOCAL doesn’t load balance stuff..."Local" means "NOT Remote", so all calls are within the same JVM.

I have done this test:

CLIENT -> HTTP PS deployed in cluster -> publish to LOCAL PS

Client sends all requests to only 1 HTTP service on server ms1 of the cluster made by ms1,ms2.

Only the LOCAL PS on the ms1 is invoked. ms2 shows no activity.

What if instead of LOCAL protocol I use some remotable protocol like HTTP? Is Server Affinity going to kick in, so all requests will stay anyway local? I am too lazy to test this now... maybe one day...

Wednesday, December 28, 2011

I was unable to test a Proxy/Business service, and getting the error message
"Test Console service is not running. Contact administrator to start this service"

I opened the AdminServer logs and it was full of:

An exception [java.lang.StackOverflowError] was thrown while rendering the content at [/jsp/dashboard/DashboardAlerts.jsp].
javax.servlet.ServletException: java.lang.StackOverflowError
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.apache.beehive.netui.pageflow.PageFlowPageFilter.continueChainNoWrapper(PageFlowPageFilter.java:455)
at org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowPageFilter.java:114)

It is unclear how the server got itself in that state.... anyway restarting AdminServer and Managed Servers fixed the issue.... weird.

If in the JCA file adapter file you specify PublishSize=1, the file translator will
consider that every LINE (up to EOL) in your file is a MESSAGE.

Even if the Root Element of my message is a complexType made by a sequence of subtypes, the NXSDTranslator will dispatch a message to OSB PER EACH LINE, and the message will contain ONLY THE SUBTYPE, not the Root Element.

Even if you specify uniqueMessageSeparator="someweirdstring", it will keep doing the same trick.

In the log, you see:

jca.file.BatchIndex=1 (2, 3... up to the number of lines in the file)
jca.file.Batch=CsHjmLiOA8VinpSTERKIh6cfUYmxQvUbZzfDlDH0DRI

(all the messages in the same Batch (=file) have the same jca.file.Batch property)

The only way to avoid this DEBATCHING (split a message in multiple submessages) is to explicitly set the PublishSize to a BLANK value (default is 1).

PublishSize: This property indicates whether the file contains multiple messages and how many messages to publish to the BPEL process at a time. The parameter is of type int and is not mandatory. The default value is 1.

For example, if a certain file has 11 records and this parameter is set to 2, then the file will be processed 2 records at a time and the final record will be processed in the sixth iteration.

Pay attention to the JCA file, the PublishSize can be nested there.
Look in the nXSD file, there can be a nxsd:publishSize clause, set it to "" (an empty string)

In the logs, per each batch element you will see a separate invocation to the translator:

Zillions of times I have wished in my life to be able to tell which methods are being executed in an application deployed in WLS, and the values of the parameters and return values. Call it "tracing method execution in weblogic".
If no debug statements exist in the WLS code or in the application, the only way is to weave the classes with some AOP product.

In setDomainEnv there is a property JAVA_PROFILE
I set it to
-javaagent:C:/apps/aspectj/lib/aspectjweaver.jar

after checking the WLS classpath, I see that the . directory (C:\Oracle\Middleware\user_projects\domains\base_domain) is in the classpath (because I have a System Variable CLASSPATH=.)
I create then a C:\Oracle\Middleware\user_projects\domains\base_domain\META-INF\aop.xml file where I define an INLINE ASPECT (no need to precompile separately with ajc):

Here is the aspect, to be compiled and put in the classpath (you will need to add the AspectJ jars to the Eclipse project)

<aspectj>
<aspects>
<!-- define a concrete aspect inline -->
<concrete-aspect name="com.pierre.aop.MyTracing" extends="com.pierre.aop.AbstractAspect">
<!--pointcut name="tracingScope" expression="within(com.pierre.*)"/-->
</concrete-aspect>
<!-- Of the set of aspects declared to the weaver
use aspects matching the type pattern "com.pierre..*" for weaving. -->
<include within="com.pierre..*"/>
</aspects>
<weaver options="-verbose">
<!-- Weave types that are within the javax.* or org.aspectj.*
packages. Also weave all types in the foo package that do
not have the @NoWeave annotation. -->
<include within="com.pierre.*"/>
<!-- Dump all types within the "somepack" package,
both before are after they are woven,
to the "./_ajdump" folder on disk (for diagnostic purposes) -->
<dump within="com.pierre.*" />
</weaver>
</aspectj>

Saturday, December 24, 2011

Unable to create a server socket for listening on channel "Default". The address 10.83.17.84 might be incorrect or another process is
using port 7001: java.net.BindException: Cannot assign requested address: JVM_Bind.

Of course there is no running process who listens on the 7001 port, I have done netstat -a to check...

It turned out that I have a dynamic IP on my laptop - with hostname pierrepc - and foolishly I have made an entry in my hosts file saying

10.83.17.84 pierrepc

Idiot me! The IP address is not static, so once I get assigned a different IP, WebLogic still tries to use the 10.83.17.84 IP to create a Socket...

Some Googling taught me that is related to the 64 bit installation of OEPE, I can confirm this as I have built the same artifacts from the same projects on a 32 bits OEPE using the same scripts and they work.

I have tried everything to install Grid Control.
I have also tried to "show empty homes" and remove them: it hangs forever and in the log C:\bea11\oracle_common\cfgtoollogs\cfgfw\CfmLogger_2011-12-18_04-17-32-PM.log it shows:

WARNING: Validation of XML schema is disabled because AggregateDescriptions.xsd could not be found
INFO: Creating new CFM connection
WARNING: A CfwClient was destroyed without a proper call to disconnect!

I will start again tomorrow.... but.... what a battle to install Grid Control...

This is an evolving post... it's a collection of posh-"sounds-so-difficult" names for old, well known stuff.

The more difficult we talk, the more people will worship us as gurus and we can avoid any actual physical work and we can avoid having to ACTUALLY solve problems.
This was a common practice in the Middle Ages, professionals (doctors, lawyers, priests) would put enormous energies into learning Latin, so that nobody could understand what they were saying.

Synthetic transactions

http://www.nextslm.org/fishman.html#synthetic

Synthetic transactions are a way to check the availability of an application across a network. By definition, a synthetic transaction constitutes an automated, self-contained set of user operations that can be executed against a service in the same way a real consumer of the service operates an application. For example, on the Internet, a synthetic transaction includes a script that goes a stock trading site, tries to look up a stock's price or portfolio valuation, and reports if the series of operations completed successfully. In other words, any fixed set of user operations that can be automated reliably may be defined as a synthetic transactions.

"Synthetic" sounds like Alien technology, something that only Extraterrestrial intelligences can master.... cool!

Hydrate is being used (often incorrectly) instead of the well known "populate" or "persist"... again, its association to a Chemistry term evokes a world of knowledge available only to few specialists...

Agile

I have been doing Agile for the first 10 years of my career, when I was coding for food... we were working on VERY tight budgets and even tighter deadlines.... we used to call it "get your fat stinky ass off that chair, work harder, when stuck raise a flag and get things done". It used to work like wonders, and we were delivering at least 10 times faster
than any corporate project I have ever seen.

Stakeholder

As defined here, "stakeholder is anyone who will make use of, develop, or have an impact on any aspect of your project". It sounds sooooo much cooler than "people concerned" !

Semantics

Some people say "the language doesn't have the SEMANTICS to do this".
Here an very clear definition of SEMANTICS:"Semantics is the study of the meaning of linguistic expressions."

Probably if they used "the capability" or "the API" they would be more.... semantically correct!

Taxonomy is another of those wonderful words to impress your audience. It means nothing more nothing less than Classification, but it will allow you to impersonate the Darwin or the Linnaeus of the block, leaving around you an aura of scientificity and holiness.

Patterns

Let's give the word credits: Patterns is an excellent sound bite, with the voiceless bilabial plosive "P" at the beginning sending your opponent to the ground.

Saturday, December 17, 2011

BEWARE: It tries to install Babylon on your machine (I simply hate Babylon, for having been their customer and having been harassed multiple times by their policy to revoke your license if you install it on a different PC.... I change computer every 3 months, so you can imagine....)...

at Chapter 3 I gave up... .on the whole I find that the official Oracle documentation uses a simpler and more concise language.
From a technical book I expect some real customer stories, some use cases, a more colloquial and entertaining language.

If your Oracle Linux VirtualBox doesn't start, and shows a
"memory for crash kernel (0x0 to 0x0) not within permissible range" error (in reality it's only a warning, and presumably not the cause for the crash),

With this acknowledgement mode, the session automatically acknowledges a client's receipt of a message when it has either successfully returned from a call to receive or the message listener it has called to process the message successfully returns.

CLIENT_ACKNOWLEDGE

public static final int CLIENT_ACKNOWLEDGE

With this acknowledgement mode, the client acknowledges a message by calling a message's acknowledge method. Acknowledging a message acknowledges all messages that the Session has consumed.

When client acknowledgment mode is used, a client may build up a large number of unacknowledged messages while attempting to process them. A JMS provider should provide administrators with a way to limit client over-run so that clients are not driven to resource exhaustion and ensuing failure when some resource they are using is temporarily blocked.

DUPS_OK_ACKNOWLEDGE

public static final int DUPS_OK_ACKNOWLEDGE

This acknowledgement mode instructs the session to lazily acknowledge the delivery of messages. This is likely to result in the delivery of some duplicate messages if JMS fails, it should only be used by consumers that are tolerant of duplicate messages. Its benefit is the reduction of session overhead achieved by minimizing the work the session does to prevent duplicates.

My understanding is that AUTO_ACKNOWLEDGE means "ACKNOWLEDGE if the transaction was successful" (default behaviour, unless you "raise error" in OSB).

Wednesday, December 14, 2011

I consume the messages with a JMS PS, no transaction required, I use the default JMS XA connection factory weblogic.jms.XAConnectionFactory.

If I "reply with success", the JMS message is consumed immediately.

If I "reply with error", the JMS message is consumed immediately.

I set the "Transaction Required" on the Proxy Service, I "reply with error", and the JMS message is consumed immediately.

In all the above cases, in the Operations/Monitoring tab, I see 1 message and 0 errors for the Proxy.

I "Raise Error" and the JMS message is played 4 times (redelivered 3 times + 1 time the first attempt) at 10 seconds interval and then it is consumed and redirected to the Error Destination, where it appears with a JMS_BEA_DeliveryFailureReason=2 and JMSXDeliveryCount=0.
In the Operations/Monitoring tab, I see 4 messages and 4 errors for the Proxy.

Same as above, without "Transaction Required", and it behaves the same way.

IMF stands for International Monetary Fund, of course. Of the two characters in the Tv screen, one is for sure our glorious Pope Ratzinger, the other seems Bush but I am not sure. On the bottom it says "World bank"

The naked white man might represent the average citizen of the West. His SUV must be parked outside.

I have a EDI document, made by several fixed length segments.
Each segment starts with a fixed label.
Each segment contains multiple fixed length fields.
Segment can appear in groups (sequence of many segments).
Groups can appear multiple times.

Lesson learned:

* since there is no fixed sequence of segments, you should use this construct
xsd:choice minOccurs="0" maxOccurs="1000"
xsd:element name="ACME0001" type="tns:ACME0001_Type" nxsd:startsWith="ACME0001"

Often, when confronted with something (people, products, methodologies...) which is clearly underperforming, management is in denial and comes up with all sort of workarounds (rather than burying the horse and buying a new one) as the famous "flog the dead horse" story teaches:

Buying a stronger whip.

Changing riders.

Say things like, “This is the way we have always ridden this horse.”

Appointing a committee to study the horse.

Arranging to visit other sites to see how they ride dead horses.

Increasing the standards to ride dead horses.

Appointing a tiger team to revive the dead horse.

Creating a training session to increase our riding ability.

Comparing the state of dead horses in today’s environment.

Change the requirements declaring that “This horse is not dead.”

Hire contractors to ride the dead horse.

Harnessing several dead horses together for increased speed.

Declaring that “No horse is too dead to beat.”

Providing additional funding to increase the horse’s performance.

Do a Cost Analysis study to see if contractors can ride it cheaper.

Purchase a product to make dead horses run faster.

Declare the horse is “better, faster and cheaper” dead.

Form a quality circle to find uses for dead horses.

Revisit the performance requirements for horses.

Say this horse was procured with cost as an independent variable.

Promote the dead horse to a supervisory position.

I will add more as they come to my mind:

22. ask a consultant to provide the dead horse detailed instructions on how to trot
23. ask a consultant to define SLAs to prove that the horse is actually dead and not simply agonizing

(this things come to my mind because I have desperately tried to push a developer to actually deliver something.... had I done it myself it would have cost me a lot less energies)

information about the line and column in the native stream where the error was encountered is not provided by top-level validation.

Field-Level Validation -> nxsd:fieldValidation="true"

only on inbound payloads

information about the exact line and character where the error was encountered is displayed.

So, what is the difference between

a) NOT using any validation at JCA level
b) using nxsd:validation="true" in the nXSD file
c) using nxsd:fieldValidation="true" in the nXSD file
d) using both nxsd:validation="true" and nxsd:fieldValidation="true" in the nXSD file

and submitting a file which has a correct structure but a validation error in a field.

In case a), the file passes the JCA adapter and is handed over to the Proxy Service

In case b), the file is rejected in the JCA adapter, with this message:

at oracle.tip.pc.services.translation.framework.XlatorHelper.validateDOMNode(XlatorHelper.java:701)
at oracle.tip.pc.services.translation.framework.XlatorHelper.validate(XlatorHelper.java:667)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.translateFromNative(NXSDTranslatorImpl.java:612)
at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.xlate(InboundTranslatorDelegate.java:314)
at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.doXlate(InboundTranslatorDelegate.java:121)
at oracle.tip.adapter.file.inbound.ProcessorDelegate.doXlate(ProcessorDelegate.java:388)
at oracle.tip.adapter.file.inbound.ProcessorDelegate.process(ProcessorDelegate.java:174)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:349)
at weblogic.work.ContextWrap.run(ContextWrap.java:41)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

Saturday, December 3, 2011

This is quite interesting.
- If a global transaction already exists, the transport provider propagates it in the request

- if Service Callouts or Publish actions have the outbound quality of service parameter set to best-effort (the default), Oracle Service Bus executes those actions outside of the transaction context. To have Oracle Service Bus execute those actions in the same request transaction context, set quality of service on those actions to exactly-once.

« Publish « is executed in a separate transaction only if the Quality of Service is “best effort”. If you use “exactly once”, the Publish is executed in the same TX

If FTP of file2 fails, you don't want to leave file1 hanging around.
So you should add a fastidious compensation action in the Error Handler of "FTP file2" to undo the "FTP file1" operation.
Also, fastidiously the file could be picked up by remote system before I end transferring it (it should not happen, I guess it depends on the FTP server implementation, it's just one extra concern I have).

I have seen this problem a number of times.
Two people login with the same credentials, and at the time one activates (or even discard!) a OSB Session, he gets this message.

The only solution known to me is to restart the whole environment.
Possibly you must also delete the session in ${DOMAIN_HOME}/osb/config/sessions
Ideally you should create a WebLogic user per operator, to avoid these kind of issues.

If the validation/transformation fail, I don't want to retry the message.

In both cases, I want to fail the transaction, so that the appropriate statistics are shown at monitoring level.

It turns out that you cannot acknowledge a JMS message in OSB independently from the result of the transaction. Here it says: OSB proxies always work in AUTO_ACKNOWLEDGE mode:
Tx rollback - > JMS message NOT ack'ed
Tx commit - > JMS message ack'ed

So, if you want to consume immediately the JMS message without retries, your only option is to "Reply with Success" in the error handler.

If the fault happened in the FTP_BS, at monitoring level (Operations/Service Health) you will find the error reported.
If the fault happened in the JMS_PS and you replied with success, the error will not appear in the Monitoring page.

A possible workaround could be:
never redeliver the JMS message, always acknowledge it, and upon FTP failure send the message to a RedeliveryQueue, from which it will be resubmitted in future (WebLogic supports delivery in future) to the main JMSQUEUE. Obviously this sucks.

so that you separate validation/transformation from the FTPing.
This also sucks.

I cannot think of any other workaround.

Obviously this is not ideal, I hate committing a transaction when in reality we had a validation error, only for the sake of consuming immediately the JMS message.
I wish we had more control on the JMS message.

Redelivery at FTP_BS level (retries) is not an option, because they will keep a transaction open for a long time.

So in this case the message will be tried 3 times (2 retries) before erroring out. The local transaction only is retried, while the global transaction is still active. This makes the global transaction last 60 seconds.

Be aware that these local transactions are executed as part of the Proxy Service transaction: if you define 10 retries at 1 minute interval, your global transaction will be open for 10 minutes. So this is not a viable solution.

Tuesday, November 22, 2011

In a fault handler, we decide to fail the Transaction by using the "Reply with failure" Action.

For HTTP Proxy Services, this returns a HTTP 500 error code to the caller. For JMS, it will set the JMS_BEA_Error to true.

For JCA File Adapter Proxy Services, this mechanism doesn't work. The adapter doesn't receive the information that the Transaction failed (even if I set the Proxy as "Transaction required" and "Same Transaction for Response"). The file is archived and not sent to the Error directory.

The funny thing is that I have enabled all the debug flags for weblogic.jca , plus all the alsbdebug.xml flags... and it shows clearly that the isFailure=true, the message "OSB is rolling back a transaction BEA1-xxxx started by it", YET the AlsbJcaFrameworkAdapter says "successfully sent message to Adapter Framework".

If you want the Transaction to fail, the only way is to "Raise Error" in the Error Handler - or simply don't "Reply" at all.

Probably this (weird) behaviour will be addressed in future. JCA in OSB was introduced recently. IMHO the current behavious quite counter-intuitive.

Sunday, November 20, 2011

you can watch the recorded presentation join the launching webcast, I have managed to register only after giving up on my UK ZIP address and adopting a numbers-only one... tell me about US-centricity...

Wednesday, November 16, 2011

By default, the JCA File Adapter will write bad files into $DOMAIN_HOME/jca/Read/rejectedMessages, renaming them to a filename like:

INVALID_MSG_154330703_Read_20111109_103658_0898.dat

If you specify in your JCA file the property PhysicalErrorArchiveDirectory=/path/to/my/errorDirectory, the bad files will be written here and not to the $DOMAIN_HOME/jca/Read/rejectedMessages directory.

To retry a "failed" file (only those who are not directly rejected by the Adapter, but for instance those who fail validation in the Proxy Service), you can specify in the JCA Transport Configuration of the Proxy Service:

jca.retry.count = "3"
jca.retry.interval = "40"

If you want to change the destination, there is a property rejectedMessageHandlers to be set (see oracle.tip.adapter.file. package). In SOA Suite you would set it in bpel.xml, in OSB it's a bit tricky: