Showing posts with label SOA. Show all posts
Showing posts with label SOA. Show all posts

Tuesday, July 2, 2013

How to get the list of partitions of em using java - SOA 11g



The following java code will  get all the partitions available in em


public static ArrayList getPartitions(String host,String port,String username,String password) throws Exception
{
 System.out.println("Trying list all partitions in "+host);
  ArrayList partitions = new ArrayList();
    boolean found = false;

String contextFactory = "weblogic.jndi.WLInitialContextFactory";

String mbeanRuntime = "weblogic.management.mbeanservers.runtime";
String jmxProtoProviderPackages = "weblogic.management.remote";

String mBeanNamePartition = "oracle.soa.config:Application=soa-infra,j2eeType=FolderLifecycleConfig,name=soa-infra";
MBeanServerConnection mbsc = TestComposite.getMbeanServerConnection(host, port, username, password,mbeanRuntime,jmxProtoProviderPackages);


ObjectName mbeanpartition = new ObjectName(mBeanNamePartition);

Object FolderArray = mbsc.getAttribute(mbeanpartition, "Folders");
System.out.println("FolderArray ="+FolderArray);
Folder[] folderData = (Folder[]) FolderArray;
for (int i = 0; i < folderData.length; i++) {
System.out.println("Folder Data"+folderData[i].getName());
partitions.add(folderData[i].getName());
}


System.out.println("partitions size"+partitions.size());
return partitions;

}

Friday, February 8, 2013

Failed to resolve outbound connection pool JNDI for Adapter

There are situations the Adapter outbound connection pool configuration might not reflect at run time and often the service invocation fails due to failure to locate the JNDI.

If we verify the Adapter Configuration screen, the outboundconnection pool JNDIs will be visible.
So why does this error happen?

In such situations its worth to check whether the connection pool JNDI configuration is really updated in the weblogic-ra.xml file.

The weblogic-ra.xml file is located inside every Adapter.rar/META-INF

Most probably the entries we seen in the console will not be available in the weblogic-ra.xml.

To resolve this isssue, unzip the Adapter.rar file to a location, add the connection instance details manually to weblogic-ra.xml and repack the Adapter.rar .


Now copy this Adapter.rar to a new location under the domain.




Before installing the new RAR file, delete the existing adapter from admin console

Goto admin console ->deployments->Goto the respective adatper and delete it .






Once it is deleted , install the newly packed Adapter.rar file from the new location.








At the end select the plan.xml from the same folder itself.

Once the adapter is installed, verify the outbound connection pool configuration and ensure that all the JNDIs are visible over there
Note : If any change done to this JNDI configuration, then the adapter has to be updated to reflect the change.

Thursday, November 29, 2012

Remote archiving with FTP Adapter (JCA)

The file archiving location can be local or remote. To enable the remote archiving in the FTP adapter add the property  UseRemoteArchive with value as true to the jca file.

Apart from the above change ensure the LogicalArchiveDirectory/PhysicalArchiveDirectory is existing on the FTP server and the folders have write permission enabled



<adapter-config name="ReadOperation" adapter="Ftp Adapter" wsdlLocation="ReadOperation.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
 
  <connection-factory location="eis/ftp/TestFTP" UIincludeWildcard="Process*.txt" adapterRef=""/>
  <endpoint-activation portType="Get_ptt" operation="Get">
    <activation-spec className="oracle.tip.adapter.ftp.inbound.FTPActivationSpec">
      <property name="FileType" value="ascii"/>
      <property name="UseHeaders" value="false"/>
      <property name="AsAttachment" value="true"/>
      <property name="LogicalDirectory" value="inbound"/>
      <property name="UseRemoteArchive" value="true"/>
      <property name="Recursive" value="true"/>
      <property name="LogicalArchiveDirectory" value="archive"/>
      <property name="DeleteFile" value="true"/>
      <property name="IncludeFiles" value="Process.*\.txt"/>
      <property name="PollingFrequency" value="30"/>
      <property name="MinimumAge" value="0"/>
         </activation-spec>
  </endpoint-activation>

</adapter-config>

Cannot call Connection.rollback in distributed transaction. Transaction Manager will commit the resource manager when the distributed transaction is committed

If we take care the configuration details for the data source and connection pool, often transaction roll back exceptions can be avoided

For e.g the below error happened due to the incorrect configuration of d atasource

Internal Exception: java.sql.SQLException: Cannot call Connection.rollback in distributed transaction.  Transaction Manager will commit the resource manager when the distributed transaction is committed

In such situations verify the connection pool and check the type of datasource whether it is XA or non-XA.

If a non-XA data source is used in the connection pool, ensure you unchecked the 'Supports Global Transactions' option in the data source configuration





Wednesday, November 28, 2012

ORA-28001: the password has expired

There is an expiry date for the passwords we set for user account in oracle. Once the password expired the SOA infra will fail to load.

We can check the account status using

select USERNAME,ACCOUNT_STATUS,EXPIRY_DATE from dba_users where USERNAME  like '%DEV%'

If any of the user account_status is expired, using the following query we can see the values for PASSWORD_LIFE_TIME and PASSWORD_GRACE_TIME

SELECT * FROM dba_profiles WHERE profile = 'DEFAULT' AND resource_type = 'PASSWORD'




Set these values to unlimited using the query


ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

ALTER PROFILE DEFAULT LIMIT PASSWORD_GRACE_TIME  UNLIMITED;



After this for every user name set the new password as follows

 alter user <username> identified by <password>;
 for eg.
 alter user DEV1_ESS identified by manager;

Now execute the query once again to see the account status
select USERNAME,ACCOUNT_STATUS,EXPIRY_DATE from dba_users where USERNAME  like '%DEV%'