Tuesday, April 23, 2013

Using CDATA to handle embedded XML

We ran into an issue when we were trying to pass embedded XML through one of our OSB processes.  The problem came up when we had duplicate namespaces between the embedded XML and the XML for our process.   OSB was combining namespace declarations and removing the namespace declaration from our embedded XML since it was already declared in the XML for our OSB process.

The solution was to wrap the embedded xml in a CDATA wrapper.  This is very easy to do in OSB by using the fn-bea:serialize function shown below.

     <content>{fn-bea:serialize($body/*)}</content>
Removing the  CDATA wrapper is also easy and can be done using the fn-bea:inlinedXML function.

  {fn-bea:inlinedXML($body/content)}



Weblogic Server Not Starting Due to Expired Database Accounts



If you are unable to start your weblogic server and you are getting the following errors, it is being caused by your oracle accounts expiring and the fix is quite easy.

Errors

####<Apr 23, 2013 9:09:16 AM MST> <Error> <Deployer> <localhost.osbsoavm> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <0000JsrdyCXFw000jzwkno1HTf7V000002> <1366733356615> <BEA-149205> <Failed to initialize the application 'wlsbjmsrpDataSource' due to error weblogic.application.ModuleException: .
weblogic.application.ModuleException:
 .........
Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: ORA-28001: the password has expired

<BEA-280061> <The persistent store "JDBCStore-0" could not be deployed: weblogic.store.PersistentStoreException: Can't find JDBC DataSource wlsbjmsrpDataSource: javax.naming.NameNotFoundException: Unable to resolve 'wlsbjmsrpDataSource'. Resolved ''; remaining name 'wlsbjmsrpDataSource'
weblogic.store.PersistentStoreException: Can't find JDBC DataSource wlsbjmsrpDataSource: javax.naming.NameNotFoundException: Unable to resolve 'wlsbjmsrpDataSource'. Resolved ''; remaining name 'wlsbjmsrpDataSource'


Fix 

            1. Check to see if any of the accounts are expired
                           select username, profile, account_status, expiry_date from dba_users;
2. If no accounts are expired, you can skip to step 7
3.  Dynamically create SQL that will unexpired the expired accounts.  You can unexpired the 
     account by resetting the password.   NOTE: You will need to substitute <password> for the password you are using for your user.
                            select 'ALTER USER ' || username || ' identified by <password>;'
                            from dba_users where account_status like 'EXPIRED%' and username != 'XS$NULL';
                  4. Execute the SQL generated in Step 3
                  5.  Dynamically create SQL that will unlock the locked accounts.
                             select 'ALTER USER ' || username || ' account unlock;' from dba_users where 
                             account_status like 'LOCKED%' and username != 'XS$NULL';
6.  Execute the SQL generated in Step 5
7. Modify the profile assigned to the accounts that you don’t want to expire so the 
    PASSWORD_LIFE_TIME is set to UNLIMITED.  This will keep them from expiring 
    again.  In my case, I needed to update the DEFAULT profile.
alter profile DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED ;