XDoclet  and ejb-jar.xml - No Entity tags?

build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="XDoclet" default="ejbdoclet">
     <property file="build.properties"/>
     <target name="init">
          <property name="dir" value="G:\JAVA Tools"/>
          <property name="lib.dir" value="lib"/>
<!-- library/jar path -->
          <property name="xdoclet.jar.path" value="${dir}\XDoclet\lib\xdoclet.jar"/>
          <property name="log4j.jar.path" value="${dir}\XDoclet\samples\lib\log4j.jar"/>
          <property name="ant.jar.path" value="${dir}\ANT\lib\ant.jar"/>
          <property name="src.dir" value="src"/>
          <property name="generated.src.dir" value="XDoclet/gen-src-code"/>
          <property name="web.dir" value="${src.dir}/web"/>
     <property name="generated.java.dir" value="${generated.src.dir}/java"/>
          <property name="config.dir" value="config"/>
          <property name="build.dir" value="XDoclet/build"/>
          <property name="dist.dir" value="XDoclet/dist"/>
          <property name="build.compiler" value="modern"/>
          <path id="project.class.path">
               <fileset dir="${lib.dir}">
                    <include name="**/*.jar"/>
               </fileset>
               <!-- append the external classpath lastly -->
               <pathelement path="${java.class.path};${log4j.jar.path}"/>
          </path>
     </target>
     <!-- Prepare -->
     <target name="prepare" depends="init">
          <mkdir dir="${build.dir}"/>
          <mkdir dir="${build.dir}/ejb"/>
          <mkdir dir="${build.dir}/ejb/META-INF"/>
          <mkdir dir="${build.dir}/web"/>
          <mkdir dir="${build.dir}/web/WEB-INF"/>
          <mkdir dir="${build.dir}/web/WEB-INF/tlds"/>
          <mkdir dir="${build.dir}/web/WEB-INF/classes"/>
          <mkdir dir="${build.dir}/j2ee"/>
          <mkdir dir="${build.dir}/j2ee/META-INF"/>
          <mkdir dir="${build.dir}/jmx"/>
          <mkdir dir="${dist.dir}"/>
          <mkdir dir="${generated.src.dir}"/>
          <mkdir dir="${generated.java.dir}"/>
          <echo message="XDoclet Path = ${xdoclet.jar.path}"/>
          <echo message="Log4J Path = ${log4j.jar.path}"/>
          <echo message="Ant Path = ${ant.jar.path}"/>
          <echo message="ClassPath = ${java.class.path}"/>
          <property name="cp" refid="project.class.path"/>
          <echo message="CLASSPATH/REF ID:${cp}"/>
          <echo message="base dir = ${basedir}/${src.dir}"/>
     </target>
     <target name="delete" >
     <echo message = "Deleting directories"/>
          <delete dir="${build.dir}"/>
          <delete dir="${build.dir}/ejb"/>
          <delete dir="${build.dir}/ejb/META-INF"/>
          <delete dir="${build.dir}/web"/>
          <delete dir="${build.dir}/web/WEB-INF"/>
          <delete dir="${build.dir}/web/WEB-INF/tlds"/>
          <delete dir="${build.dir}/web/WEB-INF/classes"/>
          <delete dir="${build.dir}/j2ee"/>
          <delete dir="${build.dir}/j2ee/META-INF"/>
          <delete dir="${build.dir}/jmx"/>
          <delete dir="${dist.dir}"/>
          <delete dir="${generated.src.dir}"/>
          <delete dir="${generated.java.dir}"/>
     </target>
     <!-- Run EJBDoclet -->
     <target name="ejbdoclet" depends="prepare">
          <taskdef name="ejbdoclet"
               classname="xdoclet.ejb.EjbDocletTask"
               classpath="${java.class.path};${log4j.jar.path};${ant.jar.path};${xdoclet.jar.path} "/>
          <ejbdoclet sourcepath="${src.dir}"
destdir="${generated.java.dir}"
               classpathref="project.class.path"
               excludedtags="@version,@author"
               ejbspec="2.0"
               >
               <fileset dir="${src.dir}">
                    <include name="**/*EJB.java"/>
               </fileset>
               <dataobject/>
<!-- <localinterface/>
<localhomeinterface/> -->
               <remoteinterface/>
               <homeinterface/>
               <entitypk/>
<!--               <entitycmp/> -->
               <deploymentdescriptor destdir="${build.dir}/ejb/META-INF" validatexml="true"/>
               <jboss version="2.4" xmlencoding="UTF-8" validatexml="true" typemapping="Hypersonic
               SQL" datasource="java:/DefaultDS" destdir="${build.dir}/ejb/META-INF"/>
               <!--
               <weblogic xmlencoding="UTF-8" destdir="${build.dir}/ejb/META-INF" validatexml="true"/>
     <webSphere destdir="${build.dir}/ejb/META-INF" />
     <orion/>
               <apachesoap destdir="${build.dir}/web"/>
     -->
               <!--
Have struts form objects generated based on entity beans'
data objects. Will require struts.jar to compile.
<strutsform />
-->
          </ejbdoclet>
     </target>
</project>
My Session Bean:
package com.uniserv.comn.controller.ejb.session.terminalfacade;
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
import javax.ejb.*;
import java.util.*;
import com.uniserv.comn.util.*;
import com.uniserv.comn.model.*;
import com.uniserv.comn.controller.ejb.entity.tenderconfig.*;
public class TerminalSessionFacadeEJB implements SessionBean {
private SessionContext ctx = null;
private ServiceLocator serviceLocator = null;
public TerminalSessionFacadeEJB() throws ServiceLocatorException {
try {
serviceLocator = ServiceLocator.getInstance();
} catch (Exception e) {
System.out.println("TerminalSessionFacade Exception : " + e.getMessage());
* Adds an tenderConfig record
* @param tenderConfigVO TenderConfig's Value Object
* @return boolean true if successful, false if not
public boolean addTenderConfig(TenderConfigVO tenderConfigVO) {
          System.out.println("TerminalSessionFacadeEJB.addTenderConfig - START");
boolean blnRet = false;
try {
LocalTenderConfigHome home = (LocalTenderConfigHome)
serviceLocator.getLocalHome(ServiceLocator.Services.TENDERCONFIG);
LocalTenderConfig local = null;
try {
TenderConfigPK pk
= new TenderConfigPK(tenderConfigVO.getTndrID(), tenderConfigVO.getTndrCfgName());
local = home.findByPrimaryKey(pk);
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
if (local == null) {
home.create(tenderConfigVO);
blnRet = true;
} else {
blnRet = false;
} catch (Exception e) {
System.out.println("Error in TerminalSessionFacadeEJB.addTenderConfig "
+ "method (Exception) : "
+ e.getMessage());
} finally {
System.out.println("Returned value : " + blnRet);
          System.out.println("TerminalSessionFacadeEJB.addTenderConfig - END");
return blnRet;
public void setSessionContext(SessionContext parm1) throws javax.ejb.EJBException, java.rmi.RemoteException {
this.ctx = parm1;
public void ejbRemove() throws javax.ejb.EJBException, java.rmi.RemoteException
public void ejbActivate() throws javax.ejb.EJBException, java.rmi.RemoteException
public void ejbPassivate() throws javax.ejb.EJBException, java.rmi.RemoteException
public void ejbCreate() throws javax.ejb.EJBException
My Entity Bean:
package com.uniserv.comn.controller.ejb.entity.tenderconfig;
* @ejb.bean
* type="CMP"
* cmp-version="2.x"
* name="TenderConfigEJB"
* schema="TenderConfig"
* view-type="local"
import javax.ejb.*;
import com.uniserv.comn.model.*;
public abstract class TenderConfigEJB implements EntityBean{
private EntityContext ctx = null;
* @ejb.pk
public abstract int getTndrID();
public abstract void setTndrID(int iTndrID);
* @ejb.pk
public abstract String getTndrCfgName();
public abstract void setTndrCfgName(String strTndrCfgName);
public abstract int getTndrType();
public abstract void setTndrType(int iTndrType);
public abstract String getTndrCfgValue();
public abstract void setTndrCfgValue(String strTndrCfgValue);
public abstract String getTndrCfgDataType();
public abstract void setTndrCfgDataType(String strTndrCfgDataType);
public abstract String getTndrCfgDesc();
public abstract void setTndrCfgDesc(String strTndrCfgDesc);
public TenderConfigVO getTenderConfigVO() {
TenderConfigVO tenderConfigVO = new TenderConfigVO();
tenderConfigVO.setTndrID(this.getTndrID());
tenderConfigVO.setTndrCfgName(this.getTndrCfgName());
tenderConfigVO.setTndrType(this.getTndrType());
tenderConfigVO.setTndrCfgValue(this.getTndrCfgValue());
tenderConfigVO.setTndrCfgDataType(this.getTndrCfgDataType());
tenderConfigVO.setTndrCfgDesc(this.getTndrCfgDesc());
return tenderConfigVO;
public void setTenderConfigVO(TenderConfigVO tenderConfigVO) {
this.setTndrID(tenderConfigVO.getTndrID());
this.setTndrCfgName(tenderConfigVO.getTndrCfgName());
this.setTndrType(tenderConfigVO.getTndrType());
this.setTndrCfgValue(tenderConfigVO.getTndrCfgValue());
this.setTndrCfgDataType(tenderConfigVO.getTndrCfgDataType());
this.setTndrCfgDesc(tenderConfigVO.getTndrCfgDesc());
* Constructor
public TenderConfigEJB() {
* ejbCreate callback method
* @return int
public TenderConfigPK ejbCreate(TenderConfigVO tenderConfigVO)
throws CreateException {
this.setTenderConfigVO(tenderConfigVO);
return null;
* ejbPostCreate
* @param TerminalConfigTypeVO
public void ejbPostCreate(TenderConfigVO tenderConfigVO) {
* setEntityContext callback method
public void setEntityContext(EntityContext ctx) {
this.ctx = ctx;
* unsetEntityContext callback method
public void unsetEntityContext() {
this.ctx = null;
* ejbActivate callback method
public void ejbActivate() {
* ejbPassivate callback method
public void ejbPassivate() {
* ejbLoad callback method
public void ejbLoad() {
* ejbRemove callback method
public void ejbRemove() {
* ejbStore callback method
public void ejbStore() {
But the generated ejb-jar.xml only contains
<?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>
     <description>No Description.</description>
     <display-name>Generated by XDoclet</display-name>
     <enterprise-beans>
          <!-- Session Beans -->
          <session>
               <description><![CDATA[No Description.]]></description>
               <ejb-name>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</ejb-name>
               <home>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeHome</home>
               <remote>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</remote>
               <ejb-class>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeEJB</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Container</transaction-type>
          </session>
          <!--
To add session beans that you have deployment descriptor info for, add
a file to your merge directory called session-beans.xml that contains
the <session></session> markup for those beans.
-->
          <!-- Entity Beans -->
          <!--
To add entity beans that you have deployment descriptor info for, add
a file to your merge directory called entity-beans.xml that contains
the <entity></entity> markup for those beans.
-->
          <!-- Message Driven Beans -->
          <!--
To add message driven beans that you have deployment descriptor info for, add
a file to your merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
     </enterprise-beans>
     <!-- Relationships -->
     <!-- Assembly Descriptor -->
     <assembly-descriptor>
          <!-- finder permissions -->
          <!-- transactions -->
          <!-- finder transactions -->
     </assembly-descriptor>
</ejb-jar>
this ejb-jar.xml only contains entries for session beans? where did the entries for entity beans went?Ive written XDoclet tags for the Entity Bean as what ive posted above....help!!!

you comment the generation of CMP entity beans out :
build.xml:
replace
<!-- <entitycmp/> -->
with
<entitycmp/>i've already removed the comments of the tag <entitycmp> and yet the resulting ejb-jar.xml contains no <entity> tags....i'm just wondering how can i include the generation of entity tags (not only session tags) in the resulting ejb-jar.xml
<ejb-jar>
<description>No Description.</description>
     <display-name>Generated by XDoclet</display-name>
     <enterprise-beans>
          <!-- Session Beans -->
          <session>
               <description><![CDATA[No Description.]]></description>
               <ejb-name>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</ejb-name>
               <home>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeHome</home>
               <remote>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</remote>
               <ejb-class>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeEJB</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Container</transaction-type>
          </session>
          <!--
To add session beans that you have deployment descriptor info for, add
a file to your merge directory called session-beans.xml that contains
the <session></session> markup for those beans.
-->
          <!-- Entity Beans -->
          <!--
To add entity beans that you have deployment descriptor info for, add
a file to your merge directory called entity-beans.xml that contains
the <entity></entity> markup for those beans.
-->
          <!-- Message Driven Beans -->
          <!--
To add message driven beans that you have deployment descriptor info for, add
a file to your merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
     </enterprise-beans>
     <!-- Relationships -->
     <!-- Assembly Descriptor -->
     <assembly-descriptor>
          <!-- finder permissions -->
          <!-- transactions -->
          <!-- finder transactions -->
     </assembly-descriptor>
</ejb-jar>

Similar Messages

  • Using JMX to read ejb manifest jar and ejb-jar.xml in ejb jar inside ear

    Hello,
    I have an ear deployed on weblogic console. I need to check contents of manifest file and ejb-jar.xml of a jar that is present in the deployed ear.
    Currently I am using below code to access jar inside ear deployed :
    Hashtable env = new Hashtable(5);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    url);
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    mBeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    String type = "EJBComponentRuntime";
    Set beans = mBeanHome.getMBeansByType(type);
    try{
    for(Iterator it=beans.iterator();it.hasNext();)
    EJBComponentRuntimeMBean rt = (EJBComponentRuntimeMBean)it.next();
    if(rt.getParent().getName().equals("xxx")){
    System.out.println(rt.getName());
    l.add(rt.getName());
    Here xxx is the ear. Now I need to get inside the jar (represented) by variable rt and access its manifest file,ejb-jar.xml
    Does anyone have an idea how to do this?
    regards
    Sameer

    Isn't it possible to put them there manually? :)

  • Can't create EJB from existing .java AND ejb-jar.xml entries

    I've noticed that I can create the source files for an EJB outside of JDeveloper, then I can do the "Create Entity Bean" thing, and specify the path to the source files, and it will use those source files, instead of forcing me to create them again.
    However, I've noticed that if I manually add the information to the "ejb-jar.xml" file, and then try to add the bean, it won't let me. I've found I have to delete the entry from the ejb-jar.xml file and let JDeveloper control the creation of the fields, even if I know exactly what needs to be set.

    If you are adding/modifying ejb-jar.xml outside JDeveloper and trying to see the changes.
    Save the ejb-jar.xml file which is being modified externally
    Select ejb-jar.xml in JDeveloper
    and do View | Refresh
    This will load in the changes (providing the source path has been set properly)
    raghu
    JDev Team

  • Stateless session Bean - xml and ejb-jar.xml file ???

    Dear Experts,
    Stateless-session bean
    For Creating an ear file
    we need ejb-jar.xml and weblogic-ejb-jar.xml files
    Is these files are already available
    or we have to type these files ??
    Advance Thanks
    Rengaraj.R

    My best advice: surrender to use an IDE.
    You wonder sometimes at how much productivity (read as 'time') could be wasted by doing something that could be done automatically. For a learning experience or a once only exercise is fine but as a routine thing, not worth it.
    Cheers

  • Many EJB's and ejb-jar.xml

    I will have about 20 EJB's who have relationships with each other.
    Now all those EJB's come in the same deployment descriptor, causing it to grow to over 2000 lines.
    Is it possible to split the ejb-jar.xml in several ejb-jar.xml's? One for every EJB or one for every EJB group as a business object pattern.
    Or is there another solution?

    No - this is a case of "what you sow, you reap." In other words, if you have that many relations, you have a large ejb-jar.xml, since all the Entities involved in the relations must be in the same .jar file. What I would try to do is break down the relations into logical groupings and, ideally, those groups would not have relations with each other. Then split those groups out into separate deployments. Or if the relation between two groups is "light" (maybe only one), you can manually handle the relation through remote calls, instead of using CMR.

  • How will be the weblogic-ejb-jar and ejb-jar xml for EJB Local Interface?

    Hi,
    I have one ear application which is using Stateless Session Beans. I don't have any Bean to Bean communication . At present, the client is invoking remote methods thro Home/Remote interfaces. My doubt is , shall I implement EJBLocal home/ local interface to obtain this same functionality cos, in this app, both client and EJb bean have been deployed in same JVM. Can Local interfaces only be applicable to Bean - Bean relation ship?If LocalHome/Local interfaces can be implemented in my scenario, then may I know how will be the ejb-jar.xml and weblogic-ejb-jar.xml?
    thanks and regards,
    Venkat.

    Local interfaces are for communication between ejbs and their clients when both are in the same JVM. The clients can be normal clients, jsps, servlets, and other ejbs. If the client is not in the same JVM you cannot use local interfaces even though your client is another ejb.
    Advantage of using local interface is it reduces the network overhead.
    For more information you can download Mastering Enterprise Java Beans Third Edition by Ed Roman. You can go through 45
    You can download pdf version from.
    http://www.theserverside.com/books/wiley/masteringEJB/index.tss.
    Let me know the URL of the ejb doc that you referred.
    Thanks..

  • Will weblogic-ejb-jar.xml dtd 6.0 working fine on server 8.1?

    Hi guys,
    I have problem when use weblogic-ejb-jar.xml on server 8.1. JNDI compalain can not find local-home.
    Thanks!

    The interfaces and ejb-jar.xml, weblogic-ejb-jar.xml were generated by Xdoclet. I just copy the .ear file to the deployment directory. Is there anything more I need to do? Thanks!
    Here is the error message:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: remaining name: java:app/ejb/sims_hta.jar#HierarchyAdminSession/local-home
         at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
         at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:39)
         at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:57)
         at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:62)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at weblogic.jndi.internal.WLNamingManager.getObjectInstance(WLNamingManager.java:96)
         at weblogic.jndi.internal.ServerNamingNode.resolveObject(ServerNamingNode.java:265)
         at weblogic.jndi.internal.BasicNamingNode.resolveObject(BasicNamingNode.java:732)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:191)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:237)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:336)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.hta.servlet.HTAUtil.getHierarchyAdminSessionLocal(HTAUtil.java:622)
         at com.hta.servlet.HTAUtil.getPropertyDictionaryValues(HTAUtil.java:745)
         at com.hta.servlet.jsp.bean.Admin.getPropertyDictinaryValues(Admin.java:870)
         at com.hta.servlet.jsp.bean.Admin.getRunLevelDisplayParameters(Admin.java:819)
         at jsp_servlet._sims_jsp._app._hta.__incell_import._jspService(__incell_import.java:463)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

  • Orion-ejb-jar.xml for oc4j and xdoclet

    Does anybody try to use xdoclet to generate orion-ejb-jar.xml with ejb relation?
    Could somebody show me any example of definition relation for xdoclet and orion-ejb-jar.xml? (@orion:persistence...)
    thanks for any advice... :-)
    Zajo

    Hello,
    The warning message looks to be unrelated to the java.lang.IllegalArgumentException error. The warning states that optimistic locking cannot be migrated to the toplink-ejb-jar.xml file; this is stated in chapter 7 of the TopLink developer's guide at
    http://download-west.oracle.com/otn_hosted_doc/toplink/1013/MAIN/_pdf/b13593_v1_01.pdf
    The exception though seems to indicate that your orion-ejb-jar.xml contains EJBs mapped to the same table that are not related through EJB inheritance. I do it all the time with POJOs so this will work in TopLink, but you will need a support case to help get your project migrated if this is the case.
    Best Regards,
    Chris Delahunt

  • Weblogic-ejb-jar.xml : Are following extra tags harmless?

    I am using xdoclets to generate descriptor file weblogic-ejb-jar.xml
    for a BMP entity bean. Xdoclet is generating the descriptor file
    alright, but is putting the following extra tags. This happens even
    for samples which come with the download, so my tags in java file are
    not wrong.
    My question is, are the extra tags below harmless, or should I
    manually go to each desciptor file and remove them?
    Thanks.
    ----------- EXTRA TAGS GENERATED START ---------
    persistence> <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    ----------- EXTRA TAGS GENERATED END ---------
    ----------- TAGS I PUT IN JAVA CLASS START --------
    * @ejb:bean name="com.ejb.entity.Customer"
    * jndi-name="com.ejb.entity.CustomerHome"
    * view-type="remote"
    * type="BMP"
    * primkey-field="com.ejb.entity.CustomerPK"
    * reentrant="false"
    * @weblogic:cache
    * max-beans-in-cache="1000"
    * read-timeout-seconds="900"
    * concurrency-strategy="ReadOnly"
    ----------- TAGS I PUT IN JAVA CLASS END --------

    Those tags just declare that you are using our CMP provider and that
    your descriptor is in META-INF/weblogic-cmp-rdbms-jar.xml.
    FWIW, you might also want to check out EJBGen. It tends to keep more up
    to date with WLS than xdoclet.
    -- Rob
    Gen wrote:
    I am using xdoclets to generate descriptor file weblogic-ejb-jar.xml
    for a BMP entity bean. Xdoclet is generating the descriptor file
    alright, but is putting the following extra tags. This happens even
    for samples which come with the download, so my tags in java file are
    not wrong.
    My question is, are the extra tags below harmless, or should I
    manually go to each desciptor file and remove them?
    Thanks.
    ----------- EXTRA TAGS GENERATED START ---------
    persistence> <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    ----------- EXTRA TAGS GENERATED END ---------
    ----------- TAGS I PUT IN JAVA CLASS START --------
    * @ejb:bean name="com.ejb.entity.Customer"
    * jndi-name="com.ejb.entity.CustomerHome"
    * view-type="remote"
    * type="BMP"
    * primkey-field="com.ejb.entity.CustomerPK"
    * reentrant="false"
    * @weblogic:cache
    * max-beans-in-cache="1000"
    * read-timeout-seconds="900"
    * concurrency-strategy="ReadOnly"
    ----------- TAGS I PUT IN JAVA CLASS END --------

  • Query about reentrant in ejb-jar.xml file(in case of entity Bean)

    Hi all friends,
    I am new to EJB I couldn't understand in ejb-jar.xml file in case Entity Bean[<reentrant>False</reentrant>
    &<reentrant>true</reentrant>]what is the function of this tag and what is the effect of value true and false of this tag.Can any one please explain it.
    Regards
    Bikash

    Hi,
    Re-entrant tag is used in the ejb-jar.xml to notify the container if you would want your bean to call itself through another bean.
    Most of the time you would want it to be set to FALSE because you would have to consider the multi-threading issues if you set it TRUE.
    Regards
    Meka Toka

  • Weblogic-ejb-jar.xml tags

    can anybody tell me if the jndi name tag can come before the ejbtype-descriptor tag
    like instead of the usual
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>MyTestSessionBean</ejb-name>
    <stateless-session-descriptor>
    <pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <jndi-name>MyTestSessionBean</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    can it be like
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>MyTestSessionBean</ejb-name>
    <jndi-name>MyTestSessionBean</jndi-name>
    <stateless-session-descriptor>
    <pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <jndi-name>MyTestSessionBean</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    i think it should not be a problem as long as its within the <weblogic-enterprise-bean>: i am generating DDs for weblogic and ejbs and its a big applictaion i dont know if it will work or not. thanks in advance
    Message was edited by sarmahdi at Sep 3, 2004 7:45 AM

    it seems that unfortunately i cannot but i really appreciate your answer:
    ejbname should follow descriptor then jndi name i gues as i am having errors
    <!ELEMENT weblogic-enterprise-bean (
    ejb-name,
    (entity-descriptor|
    stateless-session-descriptor|
    stateful-session-descriptor|
    message-driven-descriptor
    transaction-descriptor?,
    iiop-security-descriptor?,
    reference-descriptor?,
    enable-call-by-reference?,
    clients-on-same-server?,
    (run-as-identity-principal|
    run-as-principal-name
    create-as-principal-name?,
    remove-as-principal-name?,
    passivate-as-principal-name?,
    jndi-name?,
    local-jndi-name?,
    dispatch-policy?)
    >
    i am having this error: Module: core_ejb_sb.jar Error: [EJB:011024]The XML parser encountered an error in your deployment descriptor.
    Please ensure that your deployment descriptor corresponds to the format in the DTD. The error was:
    Error parsing file 'META-INF/weblogic-ejb-jar.xml' at line: 9 column: 29. The content of element
    type "weblogic-enterprise-bean" must match "
    (ejb-name,
    (entity-descriptor|stateless-session-descriptor|stateful-session-descriptor|message-driven-descriptor)?,
    transaction-descriptor?,iiop-security-descriptor?,reference-descriptor?,enable-call-by-reference?,clients-on-same-server?,(run-as-identity-principal|
    run-as-principal-name)?,create-as-principal-name?,remove-as-principal-name?,passivate-as-principal-name?,jndi-name?,local-jndi-name?,dispatch-policy?)"
    i guess i have to change the format now.

  • External Entity Problem w/ ejb-jar.xml

    I cannot figure out nor find how to have the ejb-jar.xml refer to external entities
    so that it doesn't get overly large and unmanageable. Note: our "shared-ejb-jar.xml"
    gets converted into "ejb-jar.xml" inside of a deployed shared.jar file.
    The shared-ejb-jar.xml file contains:
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'
    <!ENTITY SatelliteExt SYSTEM "satellite-ext.xml">
    ]>
    ........XML code.........
    &SatelliteExt;
    ........XML code.........
    The satellite-ext.xml file is in the same directory and contains the XML to describe
    a single <entity>...</entity>.
    I use ant to compile and receive this error:
    C:\jist\bin\build.xml:74: SAXException while parsing 'shared-ejb-jar.xml'. This
    probably indicates badly-formed XML. Details: Relative URI "satellite-ext.xml";
    can not be resolved without a document URI.
    Any help will be most appreciated.
    -- Guy

    Problem is resolved. Thanks for looking over this thread.
    Regards
    Karthik

  • ejb-local-ref where to put this tag in ejb-jar.xml ??

    I have an ejb-jar.xml that looks like this. I have had no problem with remote interfaces. Now I want the bean to have a local interface too.
    Just let me know where the tag I have mentioned for the <ejb-local-ref> has to be put into.
    When I compile this file it throws me an error which i have shown below the output of the ejb-jar.xml file
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>IDMaster</ejb-name>
    <home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
    <remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    <ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
    <persistence-type>Container</persistence-type>
    <ejb-local-ref>
    <ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    </ejb-local-ref>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>IDMaster</abstract-schema-name>
    <cmp-field>
    <field-name>idPrefix</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>idValue</field-name>
    </cmp-field>
    <primkey-field>idPrefix</primkey-field>
    <query>
         <query-method>
              <method-name>findAllIDMasters</method-name>
              <method-params/>
         </query-method>
         <ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>IDMaster</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    I have also added the following tag in the weblogic-jar.xml
    <local-jndi-name>IDMasterEJB.IDMasterLocalHome</local-jndi-name>
    Just let me know whether I am correct
    On compilation (using ant utility) the error thrown is like this :
    ejbc:
    [java] ERROR: Error parsing 'ejb-jar.xml' line 47: The content of element type "entity" must ma
    tch "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,e
    jb-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-schema-name?,cmp-field*,pri
    mkey-field?,env-entry*,ejb-ref*,ejb-local-ref*,security-role-ref*,security-identity?,resource-ref*,r
    esource-env-ref*,query*)".
    [java] ERROR: ejbc found errors
    [java] Java Result: 1
    Kindly Help !!!
    Thanks n regards
    Sajiv

    This should take care of it
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>IDMaster</ejb-name>
    <home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
    <remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    <ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
    <persistence-type>Container</persistence-type>
    <ejb-local-ref>
    <ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    </ejb-local-ref>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>IDMaster</abstract-schema-name>
    <cmp-field>
    <field-name>idPrefix</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>idValue</field-name>
    </cmp-field>
    <primkey-field>idPrefix</primkey-field>
    <ejb-local-ref>
    <ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    </ejb-local-ref>
    <query>
    <query-method>
    <method-name>findAllIDMasters</method-name>
    <method-params/>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>IDMaster</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>

  • Deploytool not deleting fields in ejb-jar.xml and sun-cmp-mappings.xml

    Java(TM) 2 Platform, Enterprise Edition 1.4 SDK Developer Release deploytool
    This situation was found on a simple, but original application using CMP EJB's. The database is MySQL using numeric id's and foreign keys.
    I changed some fields in the database and went through the usual 14 attempts at getting deploytool to recognize a new schema without success. The one thing that is noticed is that when I tried to open the CMP display in the Entity selection the tool would not show any data, also it appears to lockup; however, if you select EJB in the choice box of the upper left you can get the view to close.
    In desperation (mind you decoding machine generated XML is NOT my favorite activity) I looked at the descriptor viewer and notice fields existed in the descriptor that were deleted in the database. The tool had read the schema because the new fields were also present.
    In sun-cmp-mappings.xml the old <cmp-field-mapping> definitions were still present. and in ejb-jar.xml the <query> and <cmp-field> were still present.
    After deleting them out -- happy, happy, happy, joy, joy, joy. Deploytool accepted the new schema (keeping all the proper old stuff correctly. yea!!!) and a simple create mapping process brought the beans and database into sync.
    I didn't want to report a bug, since I am actually new to EJB's so if anybody wishes to comment please do. I just wanted to provide a heads up in case this was something not noticed.
    BTW I'm a recent expert at EJB's anybody got a job? :-)

    Have you tried to unmap your fields and relationships?
    Go through all your enterprise beans in the CMP Database window and click Unmap All until the Persistent Field Mappings table is empty of mappings. Then click Create Database Mappings, select the new schema, and verify the fields and relationships were mapped. This should clear out any old field mappings.
    -Ian Evans

  • Unable to deploy ejb jar consisting CMP and Stateful in single ejb-jar.xml

    Hi
    I was able to deploy entity bean and stateless bean saperately but when i am trying to deploy a jar consisting of CMP entity and Stateless within single ejb-jar.xml it shows following errors.
    Auto-deploying ejb_SDCurrency.jar (No previous deployment found)... ISDCMCurrencyHome_EntityHomeWrapper4.java:830: 'finally'
    wi
    finally
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:835: 'try' without 'catch' or 'finally'.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:838: 'catch' without 'try'.
    catch(java.sql.SQLException e)
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:889: '}' expected.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:893: 'try' without 'catch' or 'finally'.
    public com.satyam.icalm.staticdata.currency.ISDCMCurrency findByCode(int argument0, java.lang.String argument1) throws
    javax.ej
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:893: Statement expected.
    public com.satyam.icalm.staticdata.currency.ISDCMCurrency findByCode(int argument0, java.lang.String argument1) throws
    javax.ej
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:961: 'finally' without 'try'.
    finally
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:966: 'try' without 'catch' or 'finally'.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:968: 'catch' without 'try'.
    catch(java.sql.SQLException e)
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1017: '}' expected.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1021: 'try' without 'catch' or 'finally'.
    public com.satyam.icalm.staticdata.currency.ISDCMCurrency findAllByCode(int argument0, java.lang.String argument1) throws
    javax
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1021: Statement expected.
    public com.satyam.icalm.staticdata.currency.ISDCMCurrency findAllByCode(int argument0, java.lang.String argument1) throws
    javax
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1371: 'finally' without 'try'.
    finally
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1376: 'try' without 'catch' or 'finally'.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1378: 'catch' without 'try'.
    catch(java.sql.SQLException e)
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1427: '}' expected.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1431: 'try' without 'catch' or 'finally'.
    public java.util.Enumeration findAuthorizedRecords(int argument0) throws javax.ejb.FinderException, java.rmi.RemoteException
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1431: Statement expected.
    public java.util.Enumeration findAuthorizedRecords(int argument0) throws javax.ejb.FinderException, java.rmi.RemoteException
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1496: 'finally' without 'try'.
    finally
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1501: 'try' without 'catch' or 'finally'.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1504: 'catch' without 'try'.
    catch(java.sql.SQLException e)
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1555: '}' expected.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1559: 'try' without 'catch' or 'finally'.
    public java.util.Enumeration findAllRecords(int argument0) throws javax.ejb.FinderException, java.rmi.RemoteException
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1559: Statement expected.
    public java.util.Enumeration findAllRecords(int argument0) throws javax.ejb.FinderException, java.rmi.RemoteException
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1624: 'finally' without 'try'.
    finally
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1629: 'try' without 'catch' or 'finally'.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1632: 'catch' without 'try'.
    catch(java.sql.SQLException e)
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1683: '}' expected.
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1685: 'try' without 'catch' or 'finally'.
    public ISDCMCurrencyHome_EntityHomeWrapper4() throws java.rmi.RemoteException
    ^
    ISDCMCurrencyHome_EntityHomeWrapper4.java:1685: Statement expected.
    public ISDCMCurrencyHome_EntityHomeWrapper4() throws java.rmi.RemoteException
    ^
    30 errors
    Error compiling C:\oc4jext\j2ee\home\applications\calm6/ejb_SDCurrency.jar: Syntax error in source
    com.evermind.compiler.CompilationException: Syntax error in source
    at com.evermind.compiler.FileLinkedCompilation.run(FileLinkedCompilation.java:90)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.evermind.compiler.FileLinkedCompiler.compile(FileLinkedCompiler.java:19)
    at com.evermind.compiler.Javac.compile(Javac.java:37)
    at com.evermind.server.ejb.compilation.Compilation.compileClasses(Compilation.java:335)
    at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:256)
    at com.evermind.server.administration.ServerApplicationInstallation.finish(ServerApplication
    Installation.java:439)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62)
    Note:The same jar is deployed into Weblogic 5.1 and was working fine .....
    so please if any solutions .....
    regards,
    Sap

    Hi sapthapathi,
    From the information u have provided, i can only guess, that
    the problem is in ur code...Not in ejb-jar.xml....
    'coz there is no problem in combining stateless session bean and CMP entity bean information in a single ejb-jar.xml file...i myself have deployed bunch of CMPs with stateless session beans..
    So please check ur code once again....
    --Venky                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for