Posts

Showing posts from April, 2008

Invoking EJB deployed on a remote machine

Invoking EJB deployed on a remote machine In case we are calling remote ejb( ejb deployed on remote machines), The JNDI lookup might lookup like, Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.put(Context.PROVIDER_URL, "XX.XXX.XX.XX:1099"); env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); Context ctx = new InitialContext(env); If we are calling local ejb then we can simply create InitialContext without any parameters. Like, Context ctx = new InitialContext();

USE OF EJB-LINK

What is ejb-ref:: ejb-link?? The ejb-link element is used in the ejb-ref or ejb-local-ref elements to specify that an EJB reference is linked to an enterprise bean. The path name is relative to the war file containing the web application that is referencing the enterprise bean. This allows multiple enterprise beans with the same ejb-name to be uniquely identified. ejb-link is used so that servlets from the same application unit can refer ejb. If we specify then we don’t need to specify any thing in application server specific web.xml file(incase of jboss jboss-web.xml file)

Configuring JMS with JBOSS 4.0.2

The following documents illustrate steps to configure Jboss with JMS 1) Installing Jboss messaging with Jboss 4.0.2 a. Get the Jboss messaging software from http://www.jboss.org/jbossmessaging/downloads/ b. Set up JBOSS_HOME and ANT_HOME c. Unzip the messaging software to local directory d. Open Command Prompt e. Go to util directory( cd util) f. execute the command ant -f release-admin.xml, The installation script will create a $JBOSS_HOME/server/messaging configuration g. Create a new Jboss Server instance in Eclipse using this configuration h. Example, Name:EJB_Jboss_JMS i. Jboss Home::C:\DevWorld\SDE\jboss-4.0.2 j. Server Configuration: messaging k. Start the Server from Eclipse l. The default installation comes with the following pre configured destinations defined in (destination-service.xml) testTopic, securedTopic, testDurableTopic, testQueue, A,B,C etc. m. Test the instal