Search This Blog

Friday, October 05, 2012

How to Capture offending sql of ORA-00001 error


Using sql*plus run the sql
alter system set events='0001 trace name errorstack level 12';

Now login to other session and run the command ,

SQL> oradebug setmypid
Statement processed.
SQL> oradebug eventdump system
1 trace name ERRORSTACK level 12 >>>> This indicates event is present in the DB

Please also check the folloine note , to check for the events in the db
How To List All The Named Events Set For A Database (Doc ID 436036.1)

Simulate the error of ORA-00001 ,

create table a1(a number primary key);
insert into a1 values (1);

SQL> insert into a1 values (1);
insert into a1 values (1)
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.SYS_C0079247) violated

SQL> show parameters user_dump_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      /home/ias/oracle/product/10.2.0/db10gr2/admin/db10gr2/udump

In the latest file you will find the entries as ,

*** 2012-10-05 14:00:11.038
ksedmp: internal or fatal error
ORA-00001: unique constraint (SCOTT.SYS_C0079247) violated
Current SQL statement for this session:
insert into a1 values (1)
----- Call Stack Trace -----

Turn off the debug logs ,
SQL> alter system set events='1 trace name errorstack off';

To confirm whether the event is off or not run the following ,

SQL> oradebug setmypid
Statement processed.
SQL> oradebug eventdump system

Statement processed.

Monday, September 24, 2012

Using DocFetcher tool as local search engine

DocFetcher is an open source desktop search application that runs on Microsoft Windows, Mac OS X and Linux.
It is written in Java and has a Standard Widget Toolkit based graphical user interface.

DocFetcher's indexing and searching facilities are based on Apache Lucene, a widely used open source search engine.

    1 Features
    2 Portability
    3 Pairing of HTML files
    4 See also
    5 External links


    Supports all major document formats, including PDF, HTML, Microsoft Office and
    Supported archive formats: zip, 7z, rar, tar.*
    Can search in Outlook emails (PST files)
    Can be customized to index any kind of source code file
    Automatically updates its indexes whenever files are modified
    Exclusion of files from indexing based on regular expressions


DocFetcher is available as a portable version, which allows the user to bundle DocFetcher and his or her personal files in order to create a portable and searchable "document repository". Portable means the user may for instance carry around this repository on a USB drive, or a synchronize it over multiple computers via a file synchronization service. Also, due to the fact that DocFetcher is Java-based, this repository can be accessed from different platforms, e.g. from Windows as well as from Linux.
Pairing of HTML files

How to use DocFetcher tool to Index your book mark pages and other online pages that of interest to you

You can use the ScrapBook (Firefox plugin) for this purpose.

ScrapBook is a Firefox plugins that allows you to save web pages and manage your collection of saved pages.
DocFetcher can be used for full-text search in your ScrapBook collection.

Store all the scrapbook collection to some directory and add this directory to the DocFether tool for indexing.

SOA 11g NTLM Setup

This article explains how to configure NTLM protected web Service from the SOA 11g , 

This contains all the steps required to configure a Active Directory , DNS Server and NTLM based Web Service and integrating with SOA 11g etc.

As the setup needs lot of manual setup's I documented all the important steps so that you will not be wasting much time like I did in this case ,

Important points :-
Create a AD Domain first , make sure you select the DNS Server part of this AD Setup , if you do not select this step then NTLM may not work properly.

You can use the tool , dcpromo for this purpose ,

Refer to this blog for the Active Directory Install ,

Open the DNS Server Setup on the Windows 2003 machine and put your actual DNS machine as forward DNS to this DNS Sever. 


And Add the DNS Servers To the list , 


and restart the Windows 2003 domain , 

Now login in to the test Windows XP machine

In the DNS Server specificy the your Active Directory Machine name , As you have to setup your main DNS Server

as the forward DNS in the Windows 2003 , you will not have any problems in accessing the other machines in your setup.


Go to My Computer Properties and use the AD Domain machine , for example ,


Create a test user from Windows 2003 domain and use this user to login to Windows 2003 domain , for example


Now install the IIS Server on the Windows 2003 machine , Click on Add or Remove programs and Add/Remove Windows Components


Install .Net FrameWork SDK , i.e .NET 4.0.X on this machine ,

Invoke the inetmgr (IIS Admin tool ) and Create a Virtual Directory say c:\temp\test1


Under Directory Server for this Virtual Directory remove the Enable Anonymous access and click 

on Integrated Windows Authentication ,


Create a Simple HTML File with the following on this ,

<meta content="text/html; charset=ISO-8859-1"
<title>Test Page IIS</title>
Hello Test<br>

Access the URL using ,

This asks for a username and password on a plain machine , 

If you access this URL using a machine , that is already logged in to this domain , then it will not ask for the password. This is what NTLM about.

For testing the ASP.Net file create the following test.aspx file ,

<%@ Page Language="C#" %>
<title>ASP.NET Hello World</title>
<body bgcolor="#FFFFFF">
<p><%= "Hello World!" %></p>
<p><%= User.Identity.Name %></p>

Copy this file in c:\temp\test1 directory and run the

This displays the o/p as 

Hello World!


Using Visual C# Studio create a Sample Web Service 

In the Web.config file have the following entries ,


<?xml version="1.0"?>
        The <authentication> section enables configuration
        of the security authentication mode used by
        ASP.NET to identify an incoming user.
    <authentication mode="Windows" />
        The <customErrors> section enables configuration
        of what to do if/when an unhandled error occurs
        during the execution of a request. Specifically,
        it enables developers to configure html error pages
        to be displayed in place of a error stack trace.
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
         <error statusCode="403" redirect="NoAccess.htm"/>
         <error statusCode="404" redirect="FileNotFound.htm"/>
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
    <directoryBrowse enabled="true"/>
      <service name="WcfService3.Service1" behaviorConfiguration="WcfService3.Service1Behavior">
        <!-- Service Endpoints -->
        <endpoint address="" binding="basicHttpBinding"  bindingConfiguration="BasicHttpEndpointBinding" contract="WcfService3.IService1">
              Upon deployment, the following identity element should be removed or replaced to reflect the
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity
            <dns value="localhost"/>
        <endpoint address="mex" binding="basicHttpBinding"    contract="IMetadataExchange" bindingConfiguration="BasicHttpEndpointBinding" />
        <behavior name="WcfService3.Service1Behavior">
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />


The important one's are 

<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />

  <endpoint address="" binding="basicHttpBinding"  bindingConfiguration="BasicHttpEndpointBinding" contract="WcfService3.IService1">

   <endpoint address="mex" binding="basicHttpBinding"    contract="IMetadataExchange" bindingConfiguration="BasicHttpEndpointBinding" />

With out this , you may get lot of exceptions like 'anonymous' users are not allowed etc ,

Web Service Code 


using System;

using System.Collections.Generic;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.Text;

using System.Web;

using System.ServiceModel;

namespace WcfService3


// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.

// NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.

public class Service1 : IService1


public string GetData( int value)


//  OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name

// Create stream writer object and pass it the file path

StringBuilder sw = new StringBuilder ();

            sw.AppendLine( "--------> " + value);

return string.Format( "You entered: {0}", sw.ToString());


public CompositeType GetDataUsingDataContract(CompositeType composite)


if (composite == null)


throw new ArgumentNullException("composite" );


if (composite.BoolValue)


                composite.StringValue += "Suffix";


return composite;




Web Services Interface Code 


using System;

using System.Collections.Generic;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.Text;

namespace WcfService3


// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.


public interface IService1


        [ OperationContract]

string GetData( int value);

        [ OperationContract]

CompositeType GetDataUsingDataContract(CompositeType composite);

// TODO: Add your service operations here


// Use a data contract as illustrated in the sample below to add composite types to service operations.


public class CompositeType


bool boolValue = true;

string stringValue = "Hello ";

        [ DataMember]

public bool BoolValue


get { return boolValue; }

set { boolValue = value; }


        [ DataMember]

public string StringValue


get { return stringValue; }

set { stringValue = value; }




From Visual Studio Create a New Publish Profile with the directory as say c:\temp\test

and publish this Web Service to this directory.

If the C# Visual studio and IIS server are there on a different machines then copy the  contents c:\temp\test to the IIS Server directory.

From the Browser access the URL ,

This should ask for a password, enter the username as test and Welcome1.

Now from SOAP UI 



Click on Auth from the SOAP UI


From JDeveloper you have to first download the wsdl file and the related XSD files manually ,

First download the wsdl file ,

In this wsdl file , you will find you need 3 xsd files ,

<xsd:import schemaLocation="" namespace=""/>

<xsd:import schemaLocation="" namespace=""/>

<xsd:import schemaLocation="" namespace=""/>

Download the xsd files , as xsd0.xsd  as xsd1.xsd  as xsd2.xsd

and change the downloaded wsdl file 

<xsd:import schemaLocation="xsd/xsd0.xsd" namespace=""/>

<xsd:import schemaLocation="xsd/xsd2.xsd" namespace=""/>

<xsd:import schemaLocation="xsd/xsd2.xsd" namespace=""/>

And create a simple BPEL to call this service , 

In the composite.xml file have the following entries ,



oracle.webservices.preemptiveBasicAuth as false ,

for example , 

< port=""
                location="test1.wsdl" soapVersion="1.1">
      <property name="weblogic.wsee.wsat.transaction.flowOption"
                type="xs:string" many="false">WSDLDriven</property>
                 <property name="oracle.webservices.auth.username"  type="xs:string" many="false">test</property>
                 <property name="oracle.webservices.auth.password"  type="xs:string" many="false">Welcome1</property>
                 <property name="oracle.webservices.preemptiveBasicAuth"  type="xs:string" many="false">false</property>

You can also set these properties from EM Console , 

Click on your SOA project , and Services and References

and Click on Web Service you are calling and Click on the Proprties TAB , here you can enter the values for 





Thursday, July 12, 2012

How to run a unix command remotely using java


Download the jar file from ,

package test1;
import com.jcraft.jsch.*;
public class Class2 {
  public Class2() {
  public static void main(String[] args) throws Exception {
      public static void testconnect() throws JSchException, IOException {
           String userName = "xxxx";
           String password ="xxxx";
           String hostName = "";
           int port = 22;
        String sdstestCommand = "env";
              JSch jsch = new JSch();
              Session session = jsch.getSession(userName, hostName, port);
              session.setConfig("StrictHostKeyChecking", "no");
              ChannelExec channel = (ChannelExec) session.openChannel("exec");
              ((ChannelExec) channel).setErrStream(System.err);
              InputStream in = channel.getInputStream();
              System.out.println("Unix system connected...");
              byte[] tmp = new byte[1024];
              while (true){
                  while (in.available() > 0) {
                      int i =, 0, 1024);
                      if (i < 0) {
                      String line = new String(tmp, 0, i);
                      System.out.println("Unix system console output: " +line);
                  if (channel.isClosed()){
                  try {
                  } catch (Exception ee){

Wednesday, July 11, 2012

SOA 11g using ant scripts to deploy and undeploy


1. First Set JAVA_HOME

set JAVA_HOME=D:\fmw1115\Middleware\jdk160_24

2. set PATH=D:\fmw1115\Middleware\modules\org.apache.ant_1.7.1\bin;%PATH%
3. cd D:\fmw1115\Middleware\jdeveloper\bin

4. Note the down the directory where your SOA Project is there 


5. Compile and package the soa project

ant -f ant-sca-package.xml -DcompositeDir=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\HelloSOA  -DcompositeName=HelloSOA  -Drevision=1.0  -Dscac.application.home=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest
6. Deploy the SOA Project
ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001  -DsarLocation=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\HelloSOA\deploy\sca_HelloSOA_rev1.0.jar  -Doverwrite=true  -Duser=weblogic  -Dpassword=xxxxx
7. To undeploy use the following command ,
ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001    -Duser=weblogic  -Dpassword=xxxx  -DcompositeName=BR_FndIntg_SimpleRuleIVP -Drevision=6.18 undeploy


Using this batch script , you can deploy the same composite with say 100 revisions

@REM initialize test value to be "true"
@SET intCounter=1
@REM test condition
@IF %intCounter% GTR 100 (GOTO wend)
@REM procedure where condition is "true"
@echo ==============================================================================================================
@echo %intCounter%
Rem call ant -f ant-sca-package.xml -DcompositeDir=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\SimpleRule  -DcompositeName=SimpleRule  -Drevision=%intCounter%.0  -Dscac.application.home=D:\bugs-download
Rem call ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001  -DsarLocation=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\SimpleRule\deploy\sca_SimpleRule_rev%intCounter%.0.jar  -Doverwrite=true  -
Duser=weblogic  -Dpassword=xxxxxx
call ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001    -Duser=weblogic  -Dpassword=xxxxx-DcompositeName=SimpleRule  -Drevision=%intCounter%.0 undeploy
@REM set new test value
@SET /a intCounter=intCounter+1
@REM loop
@echo ==============================================================================================================
@GOTO while


Monday, June 04, 2012

How to Check whether the Schema is Valid or not in a Java Program


import javax.xml.XMLConstants;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
public class Test {
  public static void main(String[] args) throws Exception{
      SchemaFactory sf =
    Schema schema =    sf.newSchema(new

Thursday, April 19, 2012

SOA Email James Configuration

Download from

Unzip to a directory of your choice

Start James

by running the run.bat or

on linux you have to start the as root user , stop the sendmailservice before running

service sendmail stop

telnet localhost 4555 (use the password as root/root)
adduser bpelsender welcome1
adduser bpelreceiver welcome1
adduser jcooper welcome1 

Configure Email client for jcooper, bpelsender etc.
·Configure your email client e.g. thunderbird
File->New->Mail Account 

Give the email account name and email  as jcooper@localhost

Thursday, March 22, 2012

Execute commands remotely from unix shell


The ssh command on linux does not support passing the passwords at the command line ,

You need to use the sshpass command. It is a utility designed for running ssh using the mode referred to as "keyboard-interactive" password authentication, but in non-interactive mode. You can install it as follows:

rpm –ivh

sshpass -p 'root-password' ssh -o StrictHostKeyChecking=no  root@localhost " du  --exclude=/shared  --exclude=/shared2 -Sm / | sort -nr | head -10"

sshpass -p 'root-password' ssh -o StrictHostKeyChecking=no  root@localhost " uptime "

Tuesday, March 13, 2012

Steps to Apply the JDeveloper stand alone patches


First download the standalone opatch using the patch number  5912518.
Assuming my JDev Home is : d:\fmw1115\Middleware\jdeveloper
copy d:\ cd d:\fmw1115\Middleware\jdeveloper
cd d:\fmw1115\Middleware\jdeveloper
unzip -d .
set  ORACLE_HOME=d:\fmw1115\Middleware\jdeveloper
set PATH=d:\fmw1115\Middleware\jdeveloper\OPatch;%PATH%
cd C:\temp\13607268
First try ,
opatch version -jdk d:\fmw1115\Middleware\jdk160_24
Invoking Standalone OPatch
OPatch Version:
OPatch succeeded.
Now Apply the patch using ,
opatch apply -jdk d:\fmw1115\Middleware\jdk160_24
If you are applying the patch for the first time then you will see ,
> OPatch finds no 'product.xml' in Oracle Home and will attempt to create 'product.xml' file.
> Attempting to retrieve patch inventory's "product" and its "version" information...
> Please enter your choice to enable OPatch to create 'product.xml' file or quit creation...
> Choice Product Version
> ------ ------- -------
> 2. If you wish, quit 'product.xml' creation
> Please enter [1-2]:
> 1
> User Responded with: 1
> OPatch will put the information of selected product 'SA_JDEV' and selected version ''
> in product.xml during inventory updation.
> "
Now run the command to verify whether the patch applied or not ,
C:\temp\13607268>opatch lsinventory -jdk d:\fmw1115\Middleware\jdk160_24
To remove the patch  run the command ,
cd C:\temp\13607268
opatch rollback -id 13607268 -jdk d:\fmw1115\Middleware\jdk160_24

How to apply patches to a BPM and/or SOA environment in (Doc ID 1288864.1)

Friday, March 09, 2012

How to measure the time it takes to load a web page


Many times you need to find out the how long a web page takes to load when troubleshooting performance related

Here are the steps that you can use with the WebLogic Server 11g.

Home >Summary of Servers >AdminServer
Click on Loggin TAB -> HTTP and go to the Advanced Options

Select the Format as "Extended"
and add the field " time-taken" to the Extended Logging Format Fields.
For example after adding it will be
"date time cs-method cs-uri sc-status time-taken"

After this you need to restart the Server ,

This is the WLST script to do the same ,

connect('weblogic', 'Welcome1', 't3://localhost:7001')

cmo.setELFFields('date time cs-method cs-uri sc-status time-taken')


After this you need to restart the Server ,

Check the access_log file entries ,

2012-03-09      14:19:16        GET     /em/faces/targetauth/emasLogin?target=Farm_soa_domain&type=oracle_ias_farm&FromContextInitFilter=true&_afrLoop=18992901037066&_afrWindowMode=0&_afrWindowId=null    200     0.066
2012-03-09      14:19:20        GET     /em/LoginStatusServlet?loginReqTime4emas=rlt_1331282958512_0.31560349677888955  2000.0040

The last column indicates the time.

You can measure the timings from browser also ,

for this use the FireFox version > 4.0 , here you can use the Tools-> Web Console or Tools -> Web Developer -> Web Console option.

Or you can use the fiddler tool to measure the time it takes to load web page ,
download the fiddler from ,

Fiddle tool can be used with IE or firefox.

Wednesday, March 07, 2012

Unable to start the WebLogic Server Authentication for user weblogic denied


Getting the following exception when trying to start the WebLogic Server

<Mar 7, 2012 3:57:29 PM IST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: Authentication for user weblogic denied Authentication for user weblogic denied
        Truncated. see log file for complete stacktrace
Caused By: [Security:090303]Authentication Failed: User weblogic [Security:090295]caught unexpected exception
        at Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        Truncated. see log file for complete stacktrace

Follow the following steps:
1: remove the file completely from the managed server directory.
2: remove the ManagedServerDir/data/ldap directory completely.
3: Always keep backup of files before removing it.
4: Now try to start the server from the command prompt and provide the username/password used to login to the Admin Console.

Monday, March 05, 2012

WLST SOA MBeans Examples


// Get the deployed Composites

connect('weblogic', 'Welcome1', 't3://localhost:7001')
soaBean = ObjectName('oracle.soa.config:Location=AdminServer,name=soa-infra,j2eeType=CompositeLifecycleConfig,Application=soa-infra')
print soaBean
composites = mbs.getAttribute(soaBean, 'DeployedComposites')
for composite in composites: 
print 'composite: ',composite 

// Change the Composite auditLevel to Development

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



helloworldComposite = ObjectName('oracle.soa.config:Location=AdminServer,partition=default,j2eeType=SCAComposite,revision=1.0,label=soa_2073ceb3-d703-453f-8867-79d3b44d637c,Application=soa-infra,wsconfigtype=WebServicesConfig,name="File1"')
print helloworldComposite
params = ['auditLevel','Development']
sign = ['java.lang.String','java.lang.String']
mbs.invoke(helloworldComposite, 'setProperty', params, sign)
print mbs.getAttribute(helloworldComposite, 'Properties')

// Print the Composite Properties

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



helloworldComposite = ObjectName('oracle.soa.config:SCAComposite.SCAService=Test1,name=AdapterBinding,revision=1.0,partition=default,SCAComposite="File1",Location=AdminServer,label=soa_2073ceb3-d703-453f-8867-79d3b44d637c,j2eeType=SCAComposite.SCAService.SCABinding,Application=soa-infra')
print helloworldComposite
print mbs.getAttribute(helloworldComposite, 'Properties')

// Change the ExcludeFiles property of the File Adapter

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



helloworldComposite = ObjectName('oracle.soa.config:SCAComposite.SCAService=Test1,name=AdapterBinding,revision=1.0,partition=default,SCAComposite="File1",Location=AdminServer,label=soa_2073ceb3-d703-453f-8867-79d3b44d637c,j2eeType=SCAComposite.SCAService.SCABinding,Application=soa-infra')
print helloworldComposite
print '-----------Before Changes------------------'
print mbs.getAttribute(helloworldComposite, 'Properties')
params = ['ExcludeFiles','*.akshay*']
sign = ['java.lang.String','java.lang.String']
mbs.invoke(helloworldComposite, 'setStringProperty', params, sign)
print '-----------After Changes------------------'
print mbs.getAttribute(helloworldComposite, 'Properties')

// Display the MDS listPartitions

connect('weblogic', 'Welcome1', 't3://localhost:7001')

mdsBean = ObjectName('oracle.mds.lcm:name=MDSDomainRuntime,type=MDSDomainRuntime')

print 'invoke listRepositories without parameters on mds bean'
repositories = mbs.invoke(mdsBean, 'listRepositories',None,None)
for repository in repositories:
mdsObject = ObjectName(repository)
Name = mbs.getAttribute(mdsObject, 'Name')
print 'mds repository object: ', Name
params = [Name]
sign = ['java.lang.String']
partitions = mbs.invoke(mdsBean, "listPartitions", params, sign)
for partition in partitions:
   print 'partition: ', partition

Thursday, February 23, 2012

BPEL Process to display the IP Address of a hostname


Create a BPEL process with the following java embded code ,
<bpelx:exec import="*"/>
    <bpelx:exec name="Java_Embedding_1" language="java" version="1.3">
      <![CDATA[String ipaddr = (String)getVariableData("stringvar");   
try { 
        InetAddress addr1 = InetAddress.getByName(ipaddr); 
          byte[] ipAddr = addr1.getAddress(); 
          // Convert to dot representation 
          String ipAddrStr = ""; 
          for (int i=0; i<ipAddr.length; i++) { 
              if (i > 0) { 
                  ipAddrStr += "."; 
              ipAddrStr += ipAddr[i]&0xFF; 
      System.out.println(" Lookup Host Name " +addr1 +" --> " +ipAddrStr); 
      ipaddr = ipAddrStr;

catch(Exception e1) { 
Please refer to the Java Doc for the API call's that you can use in BPEL java

Thursday, February 02, 2012

EJB Out Bound Example in SOA


1. Create a Simple EJB HelloWorld Application and deploy this to the WebLogic Server

Refer to the file below for the example ,

Hello EJB Example

2. Create a new composite and create a mediator component ,

3. In the External Reference drop the ejb Service and specify the EJB JNDI Binding Name  say


EJB-Jar file :

and Java Interface : test.os9.model.HelloEJB

4. Wire the EJB Outbound Service to the mediator and perform the XML transformations and run the example ,

Refer to the file in the link given below ,

Calling EJB from Mediator/BPEL

Simple inbound ejb example ,


1. Create a java file with the following contents

package test.os9;
//import javax.ejb.Remote;
public interface Hello {
public String sayHello(String input);

Compile this file , create a class file and create a jar file and copy the jar file to SCA-INF\lib directory

2. Create an EJB Binding in the Services lane, based on this Java interface. Specify the JNDI Name for this EJB. For example: ejb/EjbBind and select the above interface file and the jar

3. Create a Mediator with no interface definition and Wire this mediator to this EJB Service

4. Create a BPEL process and wire this to the Medaitor

5. Create the mappings for the mediator

6. Create an EJB Client with the following code ,

package test.os9;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class EjbClient {
  public EjbClient() {
  public static void main(String[] args) {
    EjbClient ejbClient = new EjbClient();
    try {
     final Context context = getInitialContext();
     Hello hello = (Hello)context.lookup("ejb/EjbBind");
     System.out.println(hello.sayHello("hello ravi"));
     } catch (Exception ex) {
  private static Context getInitialContext() throws NamingException {
  Hashtable env = new Hashtable();
  // WebLogic Server 10.x connection details
  env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
  env.put(Context.PROVIDER_URL, "t3://");
  return new InitialContext( env );

Add the following libraries to compile the class files 

   "EJB 3.0" and "WebLogic 10.3 Remote-Client"

Here is the example ,

Download Example

Tuesday, January 24, 2012

How to increase JVM Memory Size for JDeveloper 11g

Open the file D:\fmw1115\Middleware\jdeveloper\ide\bin\ide.conf

and change the lines

AddVMOption -Xmx1024M
AddVMOption -Xms128M

Also open the file D:\fmw1115\Middleware\jdeveloper\jdev\bin\jdev.conf

and change the line

AddVMOption -XX:MaxPermSize=256M