Skip to main content

Posts

Showing posts from March, 2012

ADF: debugging taskflows

I was having huge hassles with my task flow rerouting to themselves. I am using routers and pageflow scope varibles across bounded task flows. Mainly failed on task flow return items that went by default to a router. This post saved my bacon : http://biemond.blogspot.com/2008/10/debugging-task-flow-in-jdeveloper-11g.html Before and after listeners in your task-flow-call are also helpful for debugging: <before-listener>#{viewScope.chargeOutsEditBean.afterListener}</before-listener> <after-listener>#{viewScope.chargeOutsEditBean.afterListener}</after-listener>   public String beforeListener() {     System.out.println("beforeListener() {");     System.out.println("--------------------------->route Before:" + ADFContext.getCurrent().getPageFlowScope().get("route"));     return "blist";   }   public String afterListener() {     System.out.println("afterListener() {");   ...

ADF odd error : ADFC-10001: cannot instantiate class

Running one of my adf pages with some code in the construtor O got the following error: JspServlet error: Servlet unable to dispatch to the following requested page: The following exception occurred:javax.faces.FacesException: javax.faces.FacesException: oracle.adf.controller.ControllerException: ADFC-10001: cannot instantiate class 'za.co.test.adf.ops.view.common.form.TestBean' I was adding a partial target to my page in the constructor which is a no no - remove the line AdfFacesContext.getCurrentInstance().addPartialTarget(getResultTable()); and all was well again. Note: this can also be caused by any error in the bean constructor.

Java basic encryption decrypt util

Because I always need to do this for passwords in files and various utilities I thought I would post the code. Note: it is more secure to encrypt one way (cryptographic hashing) this is for simple no hassle cases. package za.co.test.common.util; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.Key; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; public class EncryptionUtil { private static final byte[] SECRET_KEY = "TESTKEY2013StormersRugby".getBytes();     public static byte[] encryptToByteArray(String input)         throws InvalidKeyException, BadPaddingException, IllegalBlockSizeException, NoS...

ADF: PS_TXN unique constraint violated passivation

Ok so I had this problem in a few applications and want to solve it the best way once and for all. java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SCHEMA.PS_TXN_PK) violated or oracle.jbo.PCollException: JBO-28030: Could not insert row into table PS_TXN, collection id . What a pain. So I have come across a couple of methods to solve this one: 1) Cleanup table regularly - this is a poor solution and is not guaranteed to work all the time. This involves creating a job to run (maybe twice a day) to sort the sequences out and clean up tables. Although it is the easiest to implement and requires no code changes. Can use this as a stop gap measure while your developers are fixing the real problem. 2) use a file store for passivation - better solution this one but I must test the performance impact and what to do if the filestore get corrupt. This involves setting the AM property  jbo.passivationstore = file on all Application Modules. Not...

Weblogic and ADF : migrateSecurityStore the hard way

I was struggeling to use WSLT to migrate my policy store for our production cluster there where classpath problems and naming problems and I just want to make the process easier for my self. So I wrote a little util to do the migration if nothing else this post will help me remeber the classes needed for the migration exercise. Script and classpath (I can post my linux script if anyone wants it) My jar file that you wont have but I will post the code: common.0.0.1.jar, ./migrator.jar Non adf etc 3rd party jars: ./lib/commons-cli-1.2.jar;./lib/commons-io-2.0.1.jar; SET WEBLOGIC_JAR=[your Middleware location]\wlserver_10.3\server\lib\weblogic.jar SET OLD_CLASSPATH=%CLASSPATH% SET CLASSPATH=%CLASSPATH%;%WEBLOGIC_JAR%;./lib/adf-controller-security.jar;./migrator.jar;./lib/adf-share-mbeans-wlst.jar;./lib/adfscripting.jar;./lib/commons-cli-1.2.jar;./lib/commons-io-2.0.1.jar;./lib/commons-logging-1.1.1.jar;./lib/common.0.0.1.jar;./lib/ldapjclnt11.jar;./lib/adf-share-base.jar;./lib/...

Weblogic and ADF: Unintended Consequences new session between weblogic apps and our project structure

Ok so a bit of background the following is our project stucture and all works well between applications that are deployed on one weblogic server they share sessions and user principals and roles. This setup allows us seperate jazn files across projects and to keep everything contained. Our base application is common which contains a set of projects for view, model, and common java code Common >     LoginModule (JAAS stuff)     Common (java code)     Model (company wide common model components)     View (company wide common model components) Shared Model     Model (All common lov, eo, vo files used across projects : NO Application Modules here) Various applications deployed as ears like finance, reports etc that contain Model and View projects   Home - this is the glue that binds all our applications together in a single menu etc it has NO dependacies on the other ear applications.   View...

ADF errors with template binding for templates within templates

I refactored my templates to contain templates within templates and all new screens I created stopped working. By not working my binding where not found using my utils methods to get the DCBindingContainer. For some reason when I created screens of my new templates it includes an extra form tag and binds my template to a page variable in the bindings <page path="za.co.test.pageDefs.defaultFormTemplatePageDef" id="ptb1" Refresh="ifNeeded"/>. If I remove the form tags and remove the page variable and its binding to my template all is good. Hopefully this saves you some time.

ADF : MDS-00013: no metadata found for metadata object

Weird error happend on one of my screens when I tried to call it, all my other screens worked perfectly. Removed the two MDS jars from my Model and View projects and like magic errors appeared in my build. Fixed up the errors (mainly related to refactoring and windows not recognising a difference in upper/ lowercase). Also had to do a clean before I built and remove the project directory in the o.j2ee folder. NOTE: Refactoring and changing case is dangerous. Also had this error where I had misspelt a task flow name.