-
1. Re: EJB Deployment
gtigti Jun 25, 2004 4:49 AM (in response to gtigti)No one have had problems with EJB deployment ?
Please, it's very urgent ...... -
2. Re: EJB Deployment
gtigti Jun 25, 2004 1:34 PM (in response to gtigti)I think I have to write this fragment for each session bean or entity bean I have :
<ejb-name></ejb-name>
<jndi-name></jndi-name>
<local-jndi-name></local-jndi-name>
but I don't know what values I have to put in these tags, suppose I have an entity bean with name OPCAISSE in com.gti.iagence.ejb.opcaisse.entity package
So the fragment will look like this ?
<ejb-name>OPCAISSE</ejb-name>
<jndi-name>com/gti/iagence/ejb/opcaisse/entity/OPCAISSE</jndi-name>
<local-jndi-name>OPCAISSELocal</local-jndi-name>
please help .... -
3. Re: EJB Deployment
jamesstrachan Jun 27, 2004 6:35 AM (in response to gtigti)I don't know whether you are trying to deploy a session bean or entitry bean, but here is an example of both xml descriptors that works.
Fragment from ejb-jar.xml <session> <display-name>Menu Option Use Case Session Bean</display-name> <ejb-name>milton/appmenu/optionmaint</ejb-name> <home>org.milton.services.applicationmenu.OptionMaintHome</home> <remote>org.milton.services.applicationmenu.OptionMaintRemote</remote> <ejb-class>org.milton.services.applicationmenu.OptionMaintBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <ejb-ref> <ejb-ref-name>ejb/milton/appmenu/menuoption</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>org.milton.services.applicationmenu.MenuOptionHome</home> <remote>org.milton.services.applicationmenu.MenuOptionRemote</remote> <ejb-link>milton/appmenu/menuoption</ejb-link> </ejb-ref> </session> <entity> <description>Menu Option Entity Bean</description> <display-name>Menu Option EJB</display-name> <ejb-name>milton/appmenu/menuoption</ejb-name> <home>org.milton.services.applicationmenu.MenuOptionHome</home> <remote>org.milton.services.applicationmenu.MenuOptionRemote</remote> <ejb-class>org.milton.services.applicationmenu.MenuOptionBean</ejb-class> <persistence-type>Bean</persistence-type> <prim-key-class>java.lang.String</prim-key-class> <reentrant>False</reentrant> <primkey-field>shortCode</primkey-field> <resource-ref> <res-ref-name>jdbc/MiltonDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </entity> Entire jboss.xml <?xml version="1.0" encoding="Cp1252"?> <!DOCTYPE jboss PUBLIC "-/JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd"> <!-- Define security domain for the Milton application. --> <jboss> <security-domain>java:/jaas/Milton</security-domain> <unauthenticated-principal>guest</unauthenticated-principal> <enforce-ejb-restrictions>false</enforce-ejb-restrictions> <resource-managers> <resource-manager> <res-name>jdbc/MiltonDS</res-name> <res-jndi-name>java:/DefaultDS</res-jndi-name> </resource-manager> </resource-managers> </jboss>
This gives a full definition of a session bean, which references an entity bean.
The entity bean in turn references a datasource defined in jboss.xml.
You can use a reference in jboss.xml of form :-<entity> <ejb-name>milton/appmenu/menuoption</ejb-name> <jndi-name>another/jndi/name</jndi-name> </entity>
but you only need this if you can't map your EJB names one-to-one with the JNDI names.
James -
4. Re: EJB Deployment
gtigti Jun 28, 2004 10:17 AM (in response to gtigti)I'm trying to deploy session beans and entity beans, but I dunno if I will need to reference them all in a jboss.xml file, my DS is working fine without that file.
So ca, I deploy without using jboss.xml ?
my ejb-jar.xml file looks like this :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="EJBJar_1084196237578">
<display-name>EJBJARArchive</display-name>
<enterprise-beans>
<ejb-name>OPCAISSESB</ejb-name>
com.gti.iagence.ejb.opcaisse.session.OPCAISSESBHome
com.gti.iagence.ejb.opcaisse.session.OPCAISSESB
<ejb-class>com.gti.iagence.ejb.opcaisse.session.OPCAISSESBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-local-ref id="EJBLocalRef_1084197960188">
<ejb-ref-name>ejb/EXTRAIT1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.utilmetier.entity.EXTRAITHome</local-home>
com.gti.iagence.ejb.utilmetier.entity.EXTRAIT
<ejb-link>EXTRAIT</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1084197960172">
<ejb-ref-name>ejb/COMPTE1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.utilmetier.entity.COMPTEHome</local-home>
com.gti.iagence.ejb.utilmetier.entity.COMPTE
<ejb-link>COMPTE</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1084197960203">
<ejb-ref-name>ejb/CAISSE1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.opcaisse.entity.CAISSEHome</local-home>
com.gti.iagence.ejb.opcaisse.entity.CAISSE
<ejb-link>CAISSE</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1084197960219">
<ejb-ref-name>ejb/OPCAISSE1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.opcaisse.entity.OPCAISSEHome</local-home>
com.gti.iagence.ejb.opcaisse.entity.OPCAISSE
<ejb-link>OPCAISSE</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1084360137141">
<ejb-ref-name>ejb/INSTANCE1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.utilmetier.entity.INSTANCEHome</local-home>
com.gti.iagence.ejb.utilmetier.entity.INSTANCE
<ejb-link>INSTANCE</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1084464058000">
<ejb-ref-name>ejb/VERS_DEPL_CENTRAL1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.opcaisse.entity.VERS_DEPL_CENTRALHome</local-home>
com.gti.iagence.ejb.opcaisse.entity.VERS_DEPL_CENTRAL
<ejb-link>VERS_DEPL_CENTRAL</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1084469748797">
<ejb-ref-name>ejb/VERS_RET_DEPL1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.opcaisse.entity.VERS_RET_DEPLHome</local-home>
com.gti.iagence.ejb.opcaisse.entity.VERS_RET_DEPL
<ejb-link>VERS_RET_DEPL</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1084528627031">
<ejb-ref-name>ejb/CHQDELIV1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.gti.iagence.ejb.utilspecial.entity.CHQDELIVHome</local-home>
com.gti.iagence.ejb.utilspecial.entity.CHQDELIV
<ejb-link>CHQDELIV</ejb-link>
</ejb-local-ref>
...... -
5. Re: EJB Deployment
peterb Jul 9, 2004 10:08 AM (in response to gtigti)You need to add all your beans to a jboss.xml file that maps EJB names to JNDI names. This is explained in the previous messages.
Furthermore I think you are looking up "ejb" instead of the actual bean you want, which would be something like "OPCAISSESB".