Thursday, March 27, 2014

java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener

java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener

While deploying Oracle ADF application sometimes we may receive the following exception

weblogic.management.DeploymentException:
at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:184)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:112)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:103)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListeners(HeadLifecycleFlow.java:175)
at weblogic.application.internal.flow.HeadLifecycleFlow.prepare(HeadLifecycleFlow.java:281)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:59)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused By: java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at

The issue is due to  missing ADF web Run-time libraries in the war file.This can be resolved by adding the ADF web Runtime libraries into the war file.

Steps to resolve the issue

If you are deploying through JDeveloper then follow the below steps.

Add the ADF Web Runtime to the project libraries.


Include the ADF Web Runtime library as part of the war. 
    Project Properties-->Edit the deployment profile.
    Select the ADF Web Runtime library as part of WEB-INF/lib contributors.





Getting the Audit Detail of a BPEL instance in JAVA - Oracle SOA Suite

Getting the Audit Detail of a BPEL instance in JAVA - Oracle SOA Suite

In Oracle SOA Suite 11g and Oracle SOA Suite 12c,the audit trail of the BPEL is stored in the table AUDIT_TRAIL.If the size of the payload crossed the threshold size configured in the EM console then the details are stored in the AUDIT_DETAILS table.


The payload in the AUDIT_DETAILS table is in compressed binary form, you can use the below approach to get the actual payload.

import java.sql.*;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
public class GetPayload {
    public static Connection getConnection() throws Exception {
        Context ctx = null;
        Hashtable ht = new Hashtable();
        ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
        ht.put(Context.PROVIDER_URL, "t3://:8000");
        ctx = new InitialContext(ht);
        javax.sql.DataSource ds =(javax.sql.DataSource)ctx.lookup("jdbc/SOADataSource");
        return ds.getConnection();
    }

    public static String getPayload() {

        Statement stmt = null;
        Connection connection = null;
        ResultSet rs = null;
        
        String query="select  UTL_COMPRESS.LZ_UNCOMPRESS(b.bin) DOC from audit_details b where cikey='5148077' and rownum<2";
       
        String payload = "";
        try {
            connection = getConnection();
            stmt = connection.createStatement();
            rs = stmt.executeQuery(query);
            while (rs.next()) {                    
                Blob blob=rs.getBlob("DOC");
                byte[] sdata = blob.getBytes(1, (int) blob.length());;
                payload = new String(sdata);             
                
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (rs != null)
                    rs.close();
                if (stmt != null)
                    stmt.close();
                if (connection != null)
                    connection.close();
            } catch (Exception e) {

            }
        }
        return payload;

    }
}




Wednesday, March 26, 2014

Recovering the composites to JDeveloper from MDS - Oracle SOA Suite

Recovering the composites to JDeveloper from MDS - Oracle SOA Suite

Sometimes there is a possibility the latest code changes of the deployed composite in JDeveloper might have lost in other hand some cases we will not be having the implementation code for the deployed composites.

These scenarios the Oracle SOA Suite composite artifacts can be exported from MDS through em console and the same can be converted to design time artifact in JDeveloper.

This post will explain the steps to recover the composite to JDeveloper from MDS.

Steps to recover the composite from MDS

Login to Em console, right click on the particular composite and click on Export


Select the appropriate options as shown and click on Export


Tuesday, March 18, 2014

Not able to save the projects into the JWS file(Application) in JDeveloper

Not able to save the projects into the JWS file(Application) in JDeveloper

I was facing a issue while saving the project to the application JWS file and getting "Unable to save GettingPayload.jws".

Receiving the following exception in the JDeveloper console.

java.io.IOException
at oracle.ide.marshal.xml.StructureIO.loadUsingSAX(StructureIO.java:251)
at oracle.ide.marshal.xml.StructureIO.loadImpl(StructureIO.java:167)
at oracle.ide.marshal.xml.StructureIO.loadImpl(StructureIO.java:156)
at oracle.ide.marshal.xml.HashStructureIO.load(HashStructureIO.java:46)
at oracle.ideimpl.extension.RoleManagerImpl.getRolePreferences(RoleManagerImpl.java:80)
at oracle.ideimpl.extension.ExtensionManagerImpl.runRoleSelectionDialog(ExtensionManagerImpl.java:1112)
at oracle.ideimpl.extension.ExtensionManagerImpl.initialize(ExtensionManagerImpl.java:943)
at javax.ide.Service.getService(Service.java:68)
at javax.ide.extension.ExtensionRegistry.getExtensionRegistry(ExtensionRegistry.java:400)
at oracle.ide.ExtensionRegistry.getExtensionRegistry(ExtensionRegistry.java:191)
at oracle.ide.IdeCore.startupImpl(IdeCore.java:1384)
at oracle.ide.Ide.startup(Ide.java:703)

While restating the JDeveloper,  i could not able to see the projects listed under the corresponding applications, i have to manually add them to the application.



Not able to connect to Remote Oracle SOA Suite Server through JDeveloper – Oracle SOA Suite

Not able to connect to Remote Oracle SOA Suite Server through JDeveloper – Oracle SOA Suite 

Sometimes we could have faced the issue to establish the connection to remote Oracle SOA Suite Server through JDeveloper; this might be due to different reasons. Below are some of the basic steps to resolve the connection issue.

Verify whether the Weblogic Server’s user name, password, IP Address, Port and the domain name are entered in the connection wizard properly.



Make sure the option “Always use SSL” in the connection wizard has not been set.


Make sure the option “Use HTTP Proxy Server” in the JDeveloper has not been set. Disable the proxy settings: Tools -> Preferences -> Web Browser and Proxy -> Uncheck 'Use HTTP Proxy Server' option.