6 Replies Latest reply on Mar 2, 2020 6:03 AM by Prasanna G

    AES128 (org.apache.commons.codec.binary.Base64)

    user13313952

      Have a java api that uses AES128 logic from the package org.apache.commons.codec.binary.Base64. Interacts thru spring context in SOA BPEL 12c (jdev version 12.2.1.1.0.0).

      While testing , i get the below error (it was successful with java.util.Base64 package). the compatible jar is "commons-codec-1.8" was added to the build path and also on the server. Java version 1.8

      Any quick thoughts is really appreciable.

       

      <part name="summary">

      <summary>oracle.fabric.common.FabricInvocationException: weblogic.sca.api.ScaException: java.lang.NullPointerException</summary>

      </part>

        • 1. Re: AES128 (org.apache.commons.codec.binary.Base64)
          Prasanna G

          Please paste the complete error that got returned in the detail section. The given error does not contain any details.

          • 2. Re: AES128 (org.apache.commons.codec.binary.Base64)
            user13313952

            Thanks for the response Prasanna.

             

            I was able to identify the cause. The Weblogic Server by default has a commons-codec-1.2.jar in its server webform location. And my application uses commons-codec-1.8.jar. So obviously during run time, it is reading servers 1.2 jar. And throwing null pointer as it is unable find that specific class (Base64).

            Now i need help with this piece where i want to override this behavior to read commons-codec-1.8.jar file instead of the 1.2 version. How can i do this?

            I bundled the 1.8 version jar along with my app and deployed and also tried to set the bpelclasspath with the WLS jar location . Did not work.

            • 3. Re: AES128 (org.apache.commons.codec.binary.Base64)
              Prasanna G

              Are you saying that you have both commons-codec-1.2.jar and commons-codec-1.8.jar in the weblogic server and your service is by default taking 1.2 version at runtime?

               

              Please check if you have followed the below process -

               

              1. Copy the commons-codec-1.8.jar file to SCA-INF/lib folder of your SOA composite.

              2. From SOA composite's Project Properties, select Libraries and Classpath and add the jars from above lib to the project.

              3. These jars should also be placed in weblogic server's domain\lib folder.

              4. After server restart and deployment of the composite, you should see that the code is referring to the latest version.

               

              We also had scenarios, where we maintained two versions of jars, but with the above steps followed, we could get our code working with latest jar.

               

              Also, all latest version of jars would definitely include the classes from their previous versions. So, please check if you really need the older version and maintain just one in the server.

              • 4. Re: AES128 (org.apache.commons.codec.binary.Base64)
                user13313952

                Yes, i did with no success, except for step 3 which i will do it now. Below is the snapshot of my local path, do i hv to place the 1.8 version jar in default domain folder, server restart and try again?

                 

                Also, looks like commons-codec-1.2.jar came with soa 12c installation and by default it is residing in our server folder  (file:/xxxx/app/oracle/product/Oracle_Home/soa/soa/modules/webform). We are not sure if we delete this jar, something else might break, so we are thinking of raising an SR with Oracle for a solution. However, we definitely need an alternate permanent solution without getting rid of its default installation.

                I will try with Step 3 as you mentioned and keep you posted.

                 

                • 5. Re: AES128 (org.apache.commons.codec.binary.Base64)
                  user13313952

                  Looks like my default server domain is C:\JDeveloper\mywork\system12.2.1.1.42.160607.2047\DefaultDomain\lib path. i placed the jar here and it worked thanks for your help! Appreciate it

                  • 6. Re: AES128 (org.apache.commons.codec.binary.Base64)
                    Prasanna G

                    Thats great. Please do mark my response as answered so that there would be a track of the solution. Have a great day !!!