• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. Leveraging J2EE > Working with EJBs

Working with EJBs

To ColdFusion MX, Enterprise Java Beans are just another Java object, but there are several very specific things you must do to get ColdFusion to work with EJBs. You first need to make sure you have registered the EJB JAR file in the Administrator.

To communicate with the EJB, you need to use CFOBJECT to get the Java Naming and Directory Interface (JNDI) naming-context class. You will use fields from this class to define the information you use to locate the EJB. Because you only use fields, you do not initialize the object. Next you will need to load the Java Hashtable class to contain the context object properties via CFOBJECT. Initialize the Hashtable object using the ColdFusion init method. You will need to set your Hashtable to contain the properties required to create an initial JNDI naming context. These properties include INITIAL_CONTEXT_FACTORY and PROVIDER_URL. You might need to provide the SECURITY_PRINCIPAL and SECURITY_CREDENTIALS values as well; they might be required for secure access to the naming context.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint