Head First EJB - tips --------------------- Some readers have said that they are having trouble finding the J2EE 1.3 RI we use in the book (and that is the version they need for the exam). If people have trouble navigating to it (Sun has gone out of their way now to make it hard to find), they can go to the download page at: http://java.sun.com/j2ee/sdk_1.3/ And download the 1.3.1 FCS (and NOT the SunOne Application Server). They should *not* use any J2EE 1.4 version -- the exam is based on 1.3 only. ===================== In our client application in the book, we are using a csh unix shell (actually tsch, a variant under OSX), which has a particular syntax for environment variables that is not the same for other shells. Some folks are having trouble mapping that syntax to what their own system uses, so I thought we should compile a list here. Some examples of different shell syntax include: A) csh / tcsh: java -cp {$CLASSPATH}:AdviceAppClient.jar AdviceClient // note the curly braces, "$" sign, and ":" colon separators B) On Windows (From Mikalai Zaikin) java -cp %CLASSPATH%;AdviceAppClient.jar AdviceClient // note the "%" sign around CLASSPATH, and ";" semicolon separator C) On Red Hat Linux 9.0 default shell (from Unnsse Kahn) javac -classpath $CLASSPATH:AdviceAppClient.jar AdviceClient.java // note that that there are NO curly braces, just the $ sign and the ":" colon separator ==================== Environment variables you'll need for J2EE Reference Implementation: [note: the examples shown are for OSX, where the J2EE install was placed in a directory /Users/kathy/J2EEStuff/j2sdkee1.3.1 ] setenv PATH ${PATH}:/Users/kathy/J2EEStuff/j2sdkee1.3.1/bin setenv JAVA_HOME /usr setenv J2EE_HOME /Users/kathy/J2EEStuff/j2sdkee1.3.1 setenv CLASSPATH .:${J2EE_HOME}/lib/j2ee.jar A) J2EE_HOME -- must point to the J2EE top-level directory (the directory you see when you install it) Example: setenv J2EE_HOME /Users/kathy/J2EEStuff/j2sdkee1.3.1 B) JAVA_HOME -- must point to the location of the java directory Example: setenv JAVA_HOME /usr C) PATH -- must be modified to include the /bin directory in the J2EE directory Example: setenv PATH ${PATH}:/Users/kathy/J2EEStuff/j2sdkee1.3.1/bin D) CLASSPATH -- must point to the /lib/j2ee.jar file in the J2EE directory Example: setenv CLASSPATH .:${J2EE_HOME}/lib/j2ee.jar ========================================== When running the AdviceClient, if you get a CORBA NO_PERMISSION 0 error: You are probably using the older version (1.3.01) of the J2EE RI, rather than 1.3.1. The 1.3.01 version has a bug which makes the default security permission too strict; switching to 1.3.1 should fix it. However, if you cannot fix it or for some reason you are unable to switch to 1.3.1, you can do the following: Use the deploytool to build a deployment descriptor that does not require a strict security policy: 1) Under the Security screen of the EJB wizard or the Security tab of the EJB inspector in deploytool, click "Deployment Settings..". Under the box "Client Authentication", make sure "Support Client Choice" is checked instead of "Certificate" or "Password". 2. Now from Deplotool click on "Update & redeploy" 3. Run your AdviceClient again.