Search This Blog

Oracle weblogic 10.3. Silent mode Installation through Script Windows / Linux

Oracle weblogic 10.3. Silent mode Installation through Script Windows / Linux 


Oracle weblogic Silent mode Installation :

               Most of the developers  use GUI mode to create domain during their initial days , but when the doing it regularly get bored to do the GUI installation .what is the alternative solution ??


Scripting  !!!!!!.........


But how to start ??? ... Every one knows Script work in Linux / UNIX / AIX  / Solaris ...

Scripting works in windows ??????

Answer Yes ....


Way to create :

 1. GUI
 2. Installation though Console mode
 3. Silent mode (   script  )


Always you 64 bit version JDK ..use generic .jar weblogic installer ....

>> java -d64  -jar wls1033_generic.jar -mode=silent -silent_xml=path_to_silent.xml
  
if you want additional Logs use below

–log=path_to_logfile.



or  only with mode=silent to enter manually 

>> java -d64  -jar wls1033_generic.jar -mode=silent

The installation can end with 3 different exit codes:

0: Successful installation.

1: Installation failed due to a fatal error.

Could be a missing directory or missing permissions to the file locations,
which you specified in your XML.

• 2: Installation failed due to an internal XML parsing error.

This is normally a typo or a missing quote in your XML files.
** Error during execution, error code = 65280"


Installation Script :



<?xml version="1.0" encoding="UFF-8"?>
<bea-installer>
<input-fields>
<data-value name="BEAHOME" value="D:\Oracle\Middleware_Home" />
<data-value name="WLS_INSTALL_DIR" value="D:\Oracle\Middleware_Home\wlserver_10.3" />
<data-value name="COMPONENT_PATHS"  value="WebLogic Server/Core Application Server|WebLogic Server/Administration Console
|WebLogic Server/Configuration Wizard and Upgrade Framework
|WebLogic Server/Web 2.0 HTTP Pub-Sub Server
|WebLogic Server/WebLogic JDBC Drivers
|WebLogic Server/Third Party JDBC Drivers
|WebLogic Server/WebLogic Server Clients
|WebLogic Server/WebLogic Web Server Plugins
|WebLogic Server/UDDI and Xquery Support
|WebLogic Server/Server
Examples|Oracle Coherence/Coherence Product Files" />
<data-value name="INSTALL_NODE_MANAGER_SERVICE" value="yes" />
<data-value name="NODEMGR_PORT" value="5559" />
<data-value name="INSTALL_SHORTCUT_IN_ALL_USERS_FOLDER" value="yes"/>
<data-value name="LOCAL_JVMS" value="C:\Java\jdk1.6.0_38"/>
</input-fields>
</bea-installer>



Create Domain using silent script :



WSTL ( Weblogic Script Tool Language )

Python + Java = Jython




Custom Logging using Log4j in BPEL Oracle BPM 11g


Custom Logging using Log4j in BPEL


Step1: Download log4j jar from apache website

http://logging.apache.org/log4j/1.2/download.html


Step 2:  Extract the zip file and use the log4j.jar file from that and put the jar file at the server so that all the applications can use it.

1. Copy the log4j.jar at the following location /Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1/

2. Open the command prompt and go the above location.

3. Set the following environment variables

ANT_HOME -where your ant is installed 

ANT_HOME=D:\Oracle\oracle_Home\modules\org.apache.ant_1.7.1

PATH -path to bin folder of ant

PATH= D:\Oracle\oracle_Home\modules\org.apache.ant_1.7.1\bin

JAVA_HOME -path to jdk 

JAVA_HOME =D:\Oracle\oracle_Home\jdk160_29\bin

4. Run the ant command.  (Type ant in cmd prompt).

5. Check the oracle.soa.ext.jar file in the path log4j.jar path gets added in the jar file

6. Restart the managed server.


Step3:  checking the class path is added to the external jars.

Go to $ORACLE_HOME/soa/modules/oracle.soa.ext_11.1.1 directory.

Open the oracle.soa.ext.jar.
The Existing MANIFEST file will look like below.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 16.0-b13 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle
Implementation-Title: Oracle SOA EXT
Implementation-Version: 11.1.1
Product-Name: Oracle SOA EXT
Product-Version: 11.1.1.3.0
Specification-Version: 11.1.1
Extension-Name: oracle.soa.ext
Class-Path: classes/

In my case it has added the following..

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 14.2-b01 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle
Implementation-Title: Oracle SOA EXT
Implementation-Version: 11.1.1
Product-Name: Oracle SOA EXT
Product-Version: 11.1.1.4.0
Specification-Version: 11.1.1
Extension-Name: oracle.soa.ext
Class-Path: log4j-1.2.16.jar classes/

Step4:  create a property file log4j.properties file and place the file in some location say 

D:\Oracle\prop_file

 # logging: Log4j_BPEL
log4j.category.Log4j_BPEL=info,Log4j_BPEL
log4j.appender.Log4j_BPEL=org.apache.log4j.RollingFileAppender
log4j.appender.Log4j_BPEL.File=D:\\Log4j_BPEL.log
log4j.appender.Log4j_BPEL.MaxFileSize=5MB
log4j.appender.Log4j_BPEL.MaxBackupIndex=10
log4j.appender.Log4j_BPEL.layout=org.apache.log4j.PatternLayout
log4j.appender.Log4j_BPEL.layout.ConversionPattern=%d{ISO8601} %-5p [%t] [%c] [%x] %m%n

Step5: create a BPEL process 



Step6: copy the log4j-1.2.16.jar file to SCA-INF\lib

Step7: Import the log4j-1.2.16.jar file in the project properties.

Right click project->go to project Properties->Libraries and class path->add jars.


Step8: code inside the  java Embedding.

try{
         
     String sLog4jFile = "D:\\Oracle\\prop_file\\log4j.properties";                  
     PropertyConfigurator.configure(sLog4jFile);                  
     Logger logger = Logger.getLogger("Log4j_BPEL");           
     logger.info(">>>> This is from Java Embedding: " );           
     
     XMLElement input=        
      (XMLElement)getVariableData("inputVariable","payload","/client:process/client:input");              
      addAuditTrailEntry("input is: " + input.getTextContent());             
      logger.info("Input Value :"+input.getTextContent());     
      logger.warn("hi");  
      logger.debug("Test Application");  
         
}
catch(Exception e) {        
e.printStackTrace();         
}

Step9: Import the classes in .bpel file

<bpelx:exec import="org.apache.log4j.*"/>
 <bpelx:exec import="oracle.xml.parser.v2.XMLElement"/>

Deploy the composite and check log file gets created in the location mentioned in the properties file.


Thanks to Gopinath 



Human Task ( Payload ) Data Controls not refreshed when change happened in XSD ( BO )

Human Task ( Payload ) Data Controls not refreshed when change happened in XSD ( BO )


I came across the same problem few months ago. When ever I made some changes in BO ( Business Object ) created from XSD  datacontrols not refresh with my new changes .


Example : My  BO contains 3 elements.




ADF Data control :


Important :  when I created project in jdeveloper my complete system folder path.

C:\JDeveloper\mywork\DataControlsApp\DataControl_UI\


Reason why data controls not refreshed ?

Normally developers check in and check out  code on daily basics . Let us consider I check out my code in below system path


C:\JDeveloper\mywork\DataControlsApp\DataControl_UI\

Jdeveloper check before datacontrol refresh :



Step one   --   Open DataControl.dcx
Step Two  --   Open structure panel
Step Three -- Open  Property Inspector


Later point of time  I or my team mates check out my complete code base in some other location in same system or even a different machine let us assume 

D:\Mywork\Project\DataControlsApp\DataControl_UI\

If you see the system relative path in property inspector after Project path change. 


" Oh oh.......... "     --->  Humantask data control still point out to system path 

file:/C:/JDeveloper/mywork/DataControlsApp/DataControlsProject/xsd/DataControl_HumanTaskWorkflowTask.xsd


So no chance  for data control to refresh with new payload .

Solution :

1. Either create a same folder structure like  first created

C:\JDeveloper\mywork\DataControlsApp\DataControl_UI\

                                 or

2. change system relative path from C:\ to D:\ new location .


Best approach I suggest --- Go with First Solution .


Done ..............................................

No more pain .. bit relax ..............

ORA-12899: value too large for column "XXXXXX_SOAINFRA"."CUBE_INSTANCE"."PARENT_REF_ID" (actual: 183, maximum: 150)



ORA-12899: value too large for column "XXXXXX_SOAINFRA"."CUBE_INSTANCE"."PARENT_REF_ID" (actual: 183, maximum: 150)



most of the developer may face this issues , product bug in 11.1.1.6 ( RCU )


####<12-10-30 12:18:18> <Error> <EJB> <ngmlx474> <soa_dev01_BusinessServer01> <orabpel.invoke.pool-9.thread-16> <<anonymous>> <> <bf7983de9889d95f:-2434797f:13aa2dd1c6f:-8000-000000000005858b> <1351599498800> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliveryBean.handleInvoke(java.lang.String,boolean)],Xid=BEA1-2ADBF765566162A5A6AB(465613166),Status=Rolled back. [Reason=Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-12899: value too large for column "XXXXXXX_SOAINFRA"."CUBE_INSTANCE"."PARENT_REF_ID" (actual: 183, maximum: 150)


Solution :

The options available to solve this problem are
a) Modify the VARCHAR fields used by BPM so they store chars rather than bytes (using SQL)

b) Modify the database NLS_LENGTH_SEMANTICS parameter to indicate that VARCHAR fields are char-sized rather than byte-sized.


If NLS_LENGTH_SEMANTICS is set to BYTE in your database. We recommend to make this to set NLS_LENGTH_SEMANTICS = 'CHAR'


If you have other schemas also running in the database which dont support modifying the NLS_LENGTH_SEMANTICS = 'CHAR' then the option left is to modify the columns of the below tables which may raise the issue

using alter table modify column_name varchar(500) manually. Below are the list of columns that needs to be altered. Please take back up of the records which you are altering.


"SOAINFRA"."DLV_SUBSCRIPTION"."SUBSCRIBER_ID" 

"SOAINFRA"."BPM_AUDIT_QUERY"."FAULT_TYPE" 

"SOAINFRA"."WFTASK"."PARENTCOMPONENTINSTREFID" 

"SOAINFRA".""WFTASKHISTORY"."PARENTCOMPONENTINSTREFID" 

"SOAINFRA".""DLV_MESSAGE"."RES_SUBSCRIBER" 

"SOAINFRA"."CUBE_INSTANCE"."PARENT_REF_ID" 

"SOAINFRA"."WORK_ITEM"."CUSTOM_ID" 

"SOAINFRA".BPM_AUDIT_QUERY"."SCOPE_ID" 

"SOAINFRA"."WORK_ITEM"."NODE_ID" 

"SOAINFRA"."WORK_ITEM"."SCOPE_ID" 

"SOAINFRA"."BPM_CUBE_TASKPERFORMANCE"."SCOPEID"


Increase the size of these columns to 500.
Done...........................................................
Thank you

XSLT Mapping Simple Type to Complex Type ( MaxOccurs="unbounded" ) Oracle BPM 11g

XSLT Mapping Simple Type to Complex Type ( MaxOccurs="unbounded" )



XSL - XML Style Sheet 

Purpose of  XSL used to transform XML data from One form to another form. Let me show how to use
xslt to transform simple type to complex  type mapping.

Simple types:

Most of websites now a days have a provision to enter

PhoneNumber                            PhoneType

* Work Phone Number       -              01
* Mobile Phone Number     -              02
* Home Phone Number.      -              03


XSD Structure :


XSD Structure : (Simple Type) Flat Structure


<xsd:element name="SimpleEmelemnt">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="WorkPhoneNum" type="xsd:string"/>
        <xsd:element name="MobilePhoneNum" type="xsd:string"/>
        <xsd:element name="HomePhoneNum" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>



XSD Structure : ( Complex Type ) MaxOccurance - Unbound


<xsd:element name="ComplexElement">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="PhoneNum" type="PhoneNum" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

    <xsd:complexType name="PhoneNum">
      <xsd:sequence>
        <xsd:element name="PhoneType" type="xsd:string"/>
        <xsd:element name="PhoneNumber" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>



XSLT Mapping Simple Type to Complex Type ( MaxOccurs="unbounded" )





XSL Mapping Using For-each


 <xsl:template match="/">
    <ns0:ComplexElement>

      <xsl:for-each select="/ns0:SimpleEmelemnt/ns0:WorkPhoneNum">
        <ns0:PhoneNum>
          <ns0:PhoneType>
            <xsl:text disable-output-escaping="no">01</xsl:text>
          </ns0:PhoneType>
          <ns0:PhoneNumber>
            <xsl:value-of select="."/>
          </ns0:PhoneNumber>
        </ns0:PhoneNum>
      </xsl:for-each>

      <xsl:for-each select="/ns0:SimpleEmelemnt/ns0:MobilePhoneNum">
        <ns0:PhoneNum>
          <ns0:PhoneType>
            <xsl:text disable-output-escaping="no">02</xsl:text>
          </ns0:PhoneType>
          <ns0:PhoneNumber>
            <xsl:value-of select="."/>
          </ns0:PhoneNumber>
        </ns0:PhoneNum>
      </xsl:for-each>

      <xsl:for-each select="/ns0:SimpleEmelemnt/ns0:HomePhoneNum">
        <ns0:PhoneNum>
          <ns0:PhoneType>
            <xsl:text disable-output-escaping="no">03</xsl:text>
          </ns0:PhoneType>
          <ns0:PhoneNumber>
            <xsl:value-of select="."/>
          </ns0:PhoneNumber>
        </ns0:PhoneNum>
      </xsl:for-each>
    </ns0:ComplexElement>
  </xsl:template>



Done .......................................................................
Thank you.