J2EE Important notes

· First write the Session bean.: No need to write the session bean home and remote as they are provided by lead.

· Then prepare Meta-Inf folder in same folder as that of .java file.

· Prepare ejb-jar.xml in meat-inf:

PDMController

com.lti.lead.ejb.business.LFIControllerHome //This is lead provided remote and home interface

com.lti.lead.ejb.business.LFIControllerRemote

com.fso.business.pdm.CPDMController

Stateless

Container

PDMController

Remote

*

Required

· Then prepare weblogic-ejb-jar.xml file in meta-inf

PDMController //This is the name as mentioned in the ejb-jar.xml

10

com.fso.business.pdm.CPDMController //This is used in the ServerTaskManager

· Now from the current directory run

javac -d .*.java //This will create class file with full package structure with the .class file

jar -cvf0

jar –cvf0 pdmController.jar *.java META-INF

java weblogic.ejbc pdmController.jar pdmControllerBean.jar

Then deploy this bean using the console of the weblogic.

Put the class file of the controller in C:\Lead2.0\sampleapplication\LeadExample\WEB-INF\classes with complete folder structure as that of the package.

· Create the form handler servlet and put the clas file in C:\Lead2.0\sampleapplication\LeadExample\WEB-INF\classes with complete folder structure as that of the package.

· In web.xml of C:\Lead2.0\sampleapplication\LeadExample\WEB-INF put following for formhandler

CPDMFormHandler

com.fso.forms.pdm.CPDMFormHandler

CPDMFormHandler

/CPDMFormHandler

In Each request ID for that form handler must be here else parameter ot defined IPE0001 exception.

LFCRequestProcessor

com.lti.lead.server.util.LFCRequestProcessor

REQPDM0001

CPDMFormHandler //This is url pattern.

i.e.

· In the html invoking the request

· In response map

TEMPLATE="examplegui/leadtry.jsp" CHANGEABLE="N">

· In leadtry.jsp

examplegui/output.xsl" flgDOM="LF_CURRENT_DOM"/>

This out put XSL for the request.

· In TaskManager, this is for the form handler.

The request ID as given in input.html The response ID as mentioned in response map. The command ID is used in formhandler’s process() switch case, controller execute() switch case. And in task manager.

· In server task manager for Controller.

suhas

com.fso.business.pdm.CPDMController //This is the controller name as mentioned in weblogic-ejb-jar.xml

localhost

7001


· Entity bean:

3files + ejb-jar.xml, weblogic-cmp-rdbms-jar.xml, weblogic-ejb-jar.xml

· ejb-jar.xml

containerManaged

com.fso.data.pdm.IPDMHome

com.fso.data.pdm.IPDMRemote

com.fso.data.pdm.CPDMEntityBean

Container

com.fso.data.pdm.ProductPK

False

m_strProdId //This is the name of the variables used in entity bean.

m_strProdName

m_dPrice

m_strUOM

containerManaged

Remote

*

Required

· weblogic-cmp-rdbms-jar.xml

'-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN'

'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms-persistence.dtd'>

samplePool //This pool should be defined in the config.xml of weblogic.

Product_Master //Name of the table to be accessed.

m_strProdId //Name of variable in Entity bean

productID //Name of table field

m_strProdName

productName

m_dPrice

price

m_strUOM

UOM

findByProdName

java.lang.String

false

· weblogic-ejb-jar.xml

containerManaged

1000

isModified

WebLogic_CMP_RDBMS

5.1.0

META-INF/weblogic-cmp-rdbms-jar.xml

WebLogic_CMP_RDBMS

5.1.0

com.fso.data.pdm.IPDMHome //This name is used to find the home interface in the controller for lookup using context object.


Deploying EJB.

put the 3 xmls in Meta-inf.

Then run the three commands as that of session bean to create deplayable jar, and deplay it using weblogic console.

This will produce following entry in config.xml of weblogic

If the path is wrong correct the path yourself by modifying this file.

The pool entry for the database is:

Name="samplePool"

Properties="user=wf;password=wf;dll=ocijdbc8;protocol=thin"

Targets="myserver" TestTableName="Product_Master" URL="jdbc:oracle:thin:@172.25.5.97:1521:SAMPLE"/>

· For this the tnsname.ors of the oracle/network/admin should have the entry

SAMPLE.LNTINFOTECH.COM =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.5.97)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = sample.lntinfotech.com)

)

)

This can be created using the net8 config assistant.

· If this does not work :

The winnt/System/drivers/etc/Hosts should have the entry of

172.25.5.97 selva.lntinfotech.com //name of the pc and domain name

No comments: