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.



Wednesday, March 12, 2014

weblogic.management.ManagementException: [Deployer:149014]Target 'wlsbJMSServer' is not defined.

weblogic.management.ManagementException: [Deployer:149014]Target 'wlsbJMSServer' is not defined.

Sometimes we may receive the following exception when trying to deploy a web application from JDeveloper to weblogic server.

[02:44:09 PM] ----  Deployment started.  ----
[02:44:09 PM] Target platform is  (Weblogic 10.3).
[02:44:12 PM] Retrieving existing application information
[02:44:12 PM] Running dependency analysis...
[02:44:12 PM] Building...
[02:44:17 PM] ****  One or more compilation errors prevented deployment from continuing.
[02:44:17 PM] ****  Please correct all compilation errors before deploying.
[02:44:17 PM] ####  Deployment incomplete.  ####
[02:44:17 PM] ****  One or more compilation errors prevented deployment from continuing. (oracle.adfdt.common.deploy.impl.AdfLibraryBuildDeployer)
[02:45:08 PM] ----  Deployment started.  ----
[02:45:08 PM] Target platform is  (Weblogic 10.3).
[02:45:09 PM] Retrieving existing application information
[02:45:09 PM] Running dependency analysis...
[02:45:09 PM] Building...
[02:45:10 PM] Deploying profile...
[02:45:11 PM] Wrote Web Application Module to C:\JDeveloper\mywork\GettingPayload\GetPayloadWeb\deploy\GetPayloadWeb.war
[02:45:11 PM] Deploying Application...
[02:45:24 PM] Weblogic Server Exception: weblogic.management.ManagementException: [Deployer:149014]Target 'wlsbJMSServer' is not defined.
[02:45:24 PM]   See server logs or server console for more details.
[02:45:24 PM] weblogic.management.ManagementException: [Deployer:149014]Target 'wlsbJMSServer' is not defined.
[02:45:24 PM] ####  Deployment incomplete.  ####
[02:45:24 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)

The issue is due to wlsbJMSServer target is not defined in weblogic server.

We can avoid this error and continue with the deployment by selecting the option as Deploy to selected instances in the domain and selecting the particular server or cluster instead of selecting the option as Deploy to all instances in the domain from the JDeveloper deployment wizard.




This is a temporary solution to continue with the deployment but we have to correct the Target issue.


Wednesday, March 5, 2014

Wildcard SSL HostnameVerifier in Weblogic Server

Wildcard SSL HostnameVerifier in Weblogic Server

Before WLS release 10.3.5, weblogic  servers's hostname verification code did not supports the wildcard certificate by default we have to create a custom hostname verification code to handle this scenario but from WLS release 10.3.5, weblogic servers  hostname verification code  by default supports the wildcard certificates.

Wildcard SSL Certificates work the same way as a regular SSL Certificate, allowing you to secure the connection between the client and server(www.abc.com) but a single Wildcard SSL Certificate covers any and all of the sub-domains of the main domain(*.abc.com)

Configuring Wildcard SSL HostnameVerifier:

  • Launch WLS console
  • Click on Environment -> Servers and click on the server
  • Then go to SSL tab
  • Lock & Edit
  • Scroll down and expand advanced section
  • Change Hostname verification entry to Custom Hostname Verifier
  • Enter Below in Custom Hostname verifier "weblogic.security.utils.SSLWLSWildcardHostnameVerifier"

  • Make sure the option Use JSSE SSL is selected.


  • Restart the weblogic server.