Sunday, June 29, 2014

Spring Web service and NTLM Authentication

NTLM is a proprietary authentication scheme developed by Microsoft and optimized for Windows operating system.

This post will explain how to invoke the NTLM authentication enabled web services from spring integration.

Spring Web Service uses the Apache HTTPClient to communicate to the NTLM authentication enabled services.

We named our spring bean as WebServiceNTLMAuhCommunicationClientImpl, it will extend the class

We have overridden the method initGateway to set the org.apache.commons.httpclient.NTCredentials object to CommonsHttpMessageSender.

The userName, password and the domain name should be provided to createthe NTCredential object.

The afterPropertiesSet method on CommonsHttpMessageSender class should be invoked after setting the credential - afterPropertiesSet method will set the credentials to HttPClient.

import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.NTCredentials;

public class WebServiceNTLMAuhCommunicationClientImpl extends WebServiceGatewaySupport {
 private String basicAuthUsername;
 private String basicAuthPassword;
 private String domain;
 private String hostname;

 public String getHostname() {
  return hostname;

  public void setHostname(String hostname) {
  this.hostname = hostname;

  public Object send(String url, Object request)
  return this.getWebServiceTemplate().marshalSendAndReceive(
    url, request, null);

 public void setBasicAuthPassword(String basicAuthPassword)
     this.basicAuthPassword = basicAuthPassword;

  public void setBasicAuthUsername(String basicAuthUsername)
     this.basicAuthUsername = basicAuthUsername;
 public String getDomain() {
  return domain;

  public void setDomain(String domain) {
  this.domain = domain;

    protected void initGateway() throws Exception
  if(this.basicAuthUsername != null || this.basicAuthPassword != null)

 private Credentials getCredentials() {
   return new NTCredentials(this.basicAuthUsername, this.basicAuthPassword, getHostname(), getDomain());


Wednesday, June 25, 2014 The configuration file, deployed-composites.xml, does not contain the composite-revision element

We were receiving the following exception while deploying the composite to the SOA server in Solaris.

The exception was thrown wile activating the component.

     [java] Connecting to: service:jmx:t3://localhost:8004/jndi/
     [java] connection initiated
     [java] The configuration file, deployed-composites.xml, does not contain the CRMASYNC/zz!5.3.19 composite-revision element.
     [java]     at

The actual exception is the component was not deployed successfully due to some exception and it is trying to activate the same .

The exception while deploying the component is

[deployComposite] setting user/password..., user=weblogic
[deployComposite] Processing sar=/shared/11g/soa_deploy/code/config/scripts/../../LoadBalancerProbe/zz/deploy/sca_zz_rev5.3.19.jar
[deployComposite] Adding sar file -/shared/11g/soa_deploy/code/config/scripts/../../LoadBalancerProbe/zz/deploy/sca_zz_rev5.3.19.jar
[deployComposite] INFO: Creating HTTP connection to host:localhost, port:8004
[deployComposite] INFO: Received HTTP response from the server, response code=500
[deployComposite] ---->response code=500, error:There was an error deploying/undeploying composite on SOA1: Error in reading data from deployer client.: /var/tmp/sar_base_dir_07be0448-8481-4ade-a2e9-253e5a8ba33c/sca_zz_rev5.3.19.jar (No such file or directory).

Based on the error, the deployer could not able to retrieve the jar file from the tmp location.
After analysis, the /var/tmp space is full and the script could not able to write the jar file.
We can use df -kh command to find the space utilization

To resolve the issue login as root user and clear the /var/tmp folder.

Thursday, June 12, 2014

Generating JAXB artifacts from XSD/WSDL through Maven

The maven-jaxb2-plugin can be used to generate the java classes from both XSD/WSDL.

The below plug in configuration can be used in the pom.xml file to generate the sources.

Change the include accordingly to generate for wsdl -   <include>*.wsdl</include>

To generate the sources, Right click on pom.xml-->Run As-->Maven generate-sources

This will generate all the java classes to src/main/java

Wednesday, June 11, 2014

Configuring JAXB2-Maven-Plugin not to clear the outputdirectory

JAXB2-Maven-Plugin will help us to generate the java classes from the xsd.
By default the plugin clears the existing contents in the ouputdirectory and generate the new java classes into the outputdirectory.

Some cases we may need to generate the java classes from multiple source xsd's so we have to configure the plugin not to clear the outputdirectory.

Yo have to add <clearOutputDir>false</clearOutputDir> in the plugin configuration.

                <!-- The schema directory or xsd files. -->
                <!-- The package in which the source files will be generated. -->
                <!-- The working directory to create the generated java source files. -->

Tuesday, June 10, 2014

Changing the default Maven repository location in eclipse

Sometimes we may required to modify the default mavan repository location to custom location for the eclipse project.
Eclipse project will have the variable M2_REPO defined as read only.

The following steps will help as to change the default Mavan repository location.

Modify the settings.xml file in the <<USER_HOME>>/.m2 and add the localRepository value accordingly.

If the .m2 folder ia not available in the USER_HOME create the same(md .m2) and also create a settings.xml file and update the file with the following contents(change the value of localrepository and the repository url accordingly)

Saturday, June 7, 2014

Load Balancing Rules for Oracle SOA Suite Infrastructure

This blog explain the details about the load balancer rule setup for Oracle SOA Suite infrastructure.

Download Load_Balancing_Rules_For_SOA.pdf

Sunday, June 1, 2014

Approach to Resolve the Load balancer routing the Oracle SOA Suite Request to Unavailable SOA-INFRA

The below document explain the approach to resolve the Load balancer routing the Oracle SOA Suite request to unavailable SOA-INFRA.

Download Load_Balancer_Probe_SOA-INFRA.pdf