JNDI and env. vars. in ejb-jar.xml

I have been trying for several days now to have my EJB session bean access
its env. vars. stored in the ejb-jar.xml document. I have been unsuccessful.
The only place I have been able to store my env. vars. is in the web.xml
document outside my .jar file. Although workable, it would be preferable to
store them in the ejb-jar.xml document in my .jar file.
I am hoping some one can help me. I am using the following code in my ejb:
Context init = new InitialContext();
Context env = (Context)init.lookup("java:comp/env");
m_bTruncCorporate =
((Boolean)env.lookup(MICRworks.MICR_ENV_TRUNCORP)).booleanValue();
m_strOptPath = (String)env.lookup(MICRworks.MICR_ENV_OPFLPATH);
m_strOptAccount = (String)env.lookup(MICRworks.MICR_ENV_OPFLACCT);
m_strOptRouting = (String)env.lookup(MICRworks.MICR_ENV_OPFLROUT);
My ejb-jar.xml follows:
<!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>
<enterprise-beans>
<session>
<ejb-name>MICRworksBean</ejb-name>
<home>USDataworks.MICRworks.MICRworksHome</home>
<remote>USDataworks.MICRworks.MICRworks</remote>
<ejb-class>USDataworks.MICRworks.MICRworksBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<description>Flag indicating whether to convert corporate
checks</description>
<env-entry-name>TruncateCorporate</env-entry-name>
<env-entry-type>java.lang.Boolean</env-entry-type>
<env-entry-value>true</env-entry-value>
</env-entry>
<env-entry>
<description>Location of the 1For1 exclusion files</description>
<env-entry-name>OptionFilePath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://localhost:7001/MICRworksLite/files/</env-entry-value
>
</env-entry>
<env-entry>
<description>Name of the 1For1 account exclusions file</description>
<env-entry-name>OptionFileAccount</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>account_file.txt</env-entry-value>
</env-entry>
<env-entry>
<description>Name of the 1For1 routing exclusion file</description>
<env-entry-name>OptionFileRouting</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>routing_file.txt</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MICRworksBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
and my weblogic-ejb-jar.xml:
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 7.0.0
EJB//EN' 'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>MICRworksBean</ejb-name>
<stateless-session-descriptor>
<pool>
</pool>
<stateless-clustering>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor>
</transaction-descriptor>
<jndi-name>MICRworksBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
My feeling is that I am missing some sort of reference in the
weblogic-ejb-jar.xml that points to the ejb-jar.xml but I have tried several
things without success.
I would appreciate any help I can get...especially if it contains specific
code I can use as I am rather new to writing and deploying ejbs!
Thanx in advance. Marek :-)

Thanks for the reference. I was using another book as a reference (Using
Java 2 Enterprise Edition by Mark Wutka) which had the same sort of example
and as you can see below, I coded my bean as they suggest...I'm still unable
to access the env. vars.!
I deployed by bean using WebLogic's Builder and but didn't create any sort
of application. I let WebLogic do what it would on its own. The WebLogic
documentation seemed to indicate for simple testing this would work
fine...is it wrong?
btw. MICRworks.MICR_ENV_TRUNCORP equates to "TruncateCorporate" as you
probably guessed.
The WebLogic Admin Console shows the environment variables in the EJB
Descriptors for my EJB but they do not show up when I view the JNDI tree for
my server. I have taken this to mean that the deployment tool is not
binding my env. vars. for some reason which would explain why my bean can't
find them.
I know it must be something stupid I am doing (or not doing) but I just
can't see it. Please help!
"Ryan LeCompte" <[email protected]> wrote in message
news:[email protected]...
>
Hello Marek,
I would suggest that you download the free book "Mastering EJB 2ndEdition" by
Ed Roman, Scott Ambler, and Tyler Jewell. The source code for the book isalso
freely available and is meant to be deployed specifically on WebLogic.Look for
a sample application called "Jasmine", which shows how to use environmententries.
You will see a concrete example of how they are defined and later accessedfrom
within EJBs. The book and source code are available at the followingaddress:
>
http://www.theserverside.com/books/masteringEJB/index.jsp
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
"Marek Kossak" <[email protected]> wrote:
I have been trying for several days now to have my EJB session bean
access
its env. vars. stored in the ejb-jar.xml document. I have beenunsuccessful.
The only place I have been able to store my env. vars. is in the web.xml
document outside my .jar file. Although workable, it would be preferable
to
store them in the ejb-jar.xml document in my .jar file.
I am hoping some one can help me. I am using the following code in my
ejb:
Context init = new InitialContext();
Context env = (Context)init.lookup("java:comp/env");
m_bTruncCorporate =
((Boolean)env.lookup(MICRworks.MICR_ENV_TRUNCORP)).booleanValue();
m_strOptPath = (String)env.lookup(MICRworks.MICR_ENV_OPFLPATH);
m_strOptAccount = (String)env.lookup(MICRworks.MICR_ENV_OPFLACCT);
m_strOptRouting = (String)env.lookup(MICRworks.MICR_ENV_OPFLROUT);
My ejb-jar.xml follows:
<!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>
<enterprise-beans>
<session>
<ejb-name>MICRworksBean</ejb-name>
<home>USDataworks.MICRworks.MICRworksHome</home>
<remote>USDataworks.MICRworks.MICRworks</remote>
<ejb-class>USDataworks.MICRworks.MICRworksBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<description>Flag indicating whether to convert corporate
checks</description>
<env-entry-name>TruncateCorporate</env-entry-name>
<env-entry-type>java.lang.Boolean</env-entry-type>
<env-entry-value>true</env-entry-value>
</env-entry>
<env-entry>
<description>Location of the 1For1 exclusion files</description>
<env-entry-name>OptionFilePath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://localhost:7001/MICRworksLite/files/</env-entry-valu
e
>>>
</env-entry>
<env-entry>
<description>Name of the 1For1 account exclusions file</description>
<env-entry-name>OptionFileAccount</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>account_file.txt</env-entry-value>
</env-entry>
<env-entry>
<description>Name of the 1For1 routing exclusion file</description>
<env-entry-name>OptionFileRouting</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>routing_file.txt</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MICRworksBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
and my weblogic-ejb-jar.xml:
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic
7.0.0
EJB//EN' 'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>MICRworksBean</ejb-name>
<stateless-session-descriptor>
<pool>
</pool>
<stateless-clustering>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor>
</transaction-descriptor>
<jndi-name>MICRworksBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
My feeling is that I am missing some sort of reference in the
weblogic-ejb-jar.xml that points to the ejb-jar.xml but I have tried
several
things without success.
I would appreciate any help I can get...especially if it containsspecific
code I can use as I am rather new to writing and deploying ejbs!
Thanx in advance. Marek :-)

Similar Messages

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Weblogic.ejb20.locks.LockTimedOutException and pb with weblogic-ejb-jar.xml

    Hello All,
    I get a strange problem when I try to log in to the J2EE application based on EJBs:
    weblogic.ejb20.locks.LockTimedOutException
    I see that I can add an option to the weblogic-ejb-jar.xml file, and I hope that can help for my previous problem:
    <weblogic-enterprise-bean><stateful-session-descriptor>
    <allow-concurrent-calls>true</allow-concurrent-calls>
    </stateful-session-descriptor></weblogic-enterprise-bean>
    But I can not edit the weblogic-ejb-jar.xml file under JBuilder ! the file is probably read-only, but I do not know how to change the property. I can not find this file directly under JBuilder directories.
    So I have tried to open the module.jar that contained this file. I have checked: the file is not read-only. I have modified directly manually the weblogic-ejb-jar.xml file, but now I get this error in Jbuilder when I open the weblogic-ejb-jar.xml file:
    URL: Transformation requires a XSL StyleSheetThe Node does not have a style sheet associated with itEither add a style sheet using the Add stylesheets button on the toolbar or add a valid XSL Processing instruction to the document directly
    In conclusion, what should I do to be able to modify the weblogic-ejb-jar.xml file properly ??

    Ok in a way I have solved my problem (even if I am not completely satisfied by the way on how to proceed...). So thanks to message "JBuilder7.0 and Weblogic6.1" on EJB sun forum :
    http://forum.java.sun.com/thread.jsp?thread=285735&forum=13&message=1255488
    I have tried the following actions (mentionned in the other forum messages):
    - To preserve changes to weblogic*.xml, the safest way is to change the ejb-borland.xml.
    (I am not sure that I have applied this advice correctly, because I suppose that syntax is not similar in weblogic file or borland file).
    And you can MANUALLY update the weblogic file in your JAR archive.
    1. Open the EJB JAR file in Winzip and extract the weblogic-ejb-jar.xml file, so that a copy exists in your
    project directory.
    2. Open this file (in Notepad), add the WebLogic specific information, and then save the file.
    3. Now, when you are finished with the build cycle and are ready to deploy, you may open the EJB jar file
    and swap in the weblogic-ejb-jar.xml file."
    Good Luck.

  • Global env-entry JNDI variables space for same ejb-jar.xml file

    [Software]
    jboss4.0.5
    jdk 1.5
    [Problem]
    Is there any global <env-entry> tag for a Single EJB Module. Is there any way by which the JNDI variable can be accessed by all the modules except by binding the variables in the JNDI explixity in the code
    Thanks in advance
    CSJakharia

    Unfortunately not. The EJB specification has always scoped the component environment
    (java:comp/env) as a private environment for each EJB. The advantage is you can
    assign entries within each bean easily without worrying about clashing with names selected
    for other beans in the ejb-jar. That eases the process of assembling beans developed
    separately into one ejb-jar since there is no possibility that their component environments
    will clash.
    However, the downside is just what you're pointing out, which is that in many cases
    developers prefer to define a single dependency that is shared among all the
    beans in the ejb module. That is the behavior of the component environment in a
    web application.
    We'll be looking into ways to simplify this for ejbs in a future revision of the specification.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Query Reg env-entry in ejb jar xml

    Hi,
    I have the following tag in the ejb-jar of my application:
    <env-entry>
    <env-entry-name>postingDate</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>Request</env-entry-value>
    </env-entry>
    When a JNDI LookUp is done for this variable in the application, it doesn't pick up the value of the variable which is "Request" but it picks up the Value of the Posting Date.
    I need to know how this works!
    Just an Fyi, Posting Date is a date entered from the UI.

    I feel it is like declaring global and local variables with the same name and trying to access that variable.

  • Application deployment order with weblogic-ejb-jar.xml and jndi-name

    I have two applicatation working on Weblogic server v. 10.3.6.
    First of them creating one ejb stateless bean and creates JNDI maping for it (in weblogic-ejb-jar.xml file):
    <weblogic-enterprise-bean>
         <ejb-name>ConfigMenegerBean</ejb-name>
         <stateless-session-descriptor>
         <stateless-session-descriptor>
              <business-interface-jndi-name-map>
              <business-remote>package.ConfigurationSessionRemote</business-remote>
              <jndi-name>ConfigMeneger</jndi-name>
              </business-interface-jndi-name-map>
         </stateless-session-descriptor>
         <enable-call-by-reference>true</enable-call-by-reference>
         <jndi-name>ConfigMeneger</jndi-name>
    </weblogic-enterprise-bean>
    Second appication have to refer for this bean by JNDI using spring been lookup :
    <jee:jndi-lookup id="configManager" jndi-name="ConfigMeneger"/>
    I changed deployment order parameter for both apllication(first=100 and second=500) in order to first app start first and share bean by jndi to another application. Unfortuantelly I got an error :
    javax.naming.NameNotFoundException: Unable to resolve 'ConfigMeneger'. Resolved ''; remaining name 'ConfigMeneger'
    How can I configure deployment order that first application make jndi mapping for bean, before the second application will use it ?

    Ok in a way I have solved my problem (even if I am not completely satisfied by the way on how to proceed...). So thanks to message "JBuilder7.0 and Weblogic6.1" on EJB sun forum :
    http://forum.java.sun.com/thread.jsp?thread=285735&forum=13&message=1255488
    I have tried the following actions (mentionned in the other forum messages):
    - To preserve changes to weblogic*.xml, the safest way is to change the ejb-borland.xml.
    (I am not sure that I have applied this advice correctly, because I suppose that syntax is not similar in weblogic file or borland file).
    And you can MANUALLY update the weblogic file in your JAR archive.
    1. Open the EJB JAR file in Winzip and extract the weblogic-ejb-jar.xml file, so that a copy exists in your
    project directory.
    2. Open this file (in Notepad), add the WebLogic specific information, and then save the file.
    3. Now, when you are finished with the build cycle and are ready to deploy, you may open the EJB jar file
    and swap in the weblogic-ejb-jar.xml file."
    Good Luck.

  • 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>

  • Ejb-jar.xml Error

    Hi,
    I like to write a wrapper of an existing J2EE bean.
    -     I make an new EJB Module
    -     Add my JAR-File in properties for my EJB module
    -     Then right click the “ejb-jar.xml” node to add my bean with the “Add EJBs…” entry.
    It works perfect, but when I close my Developers Studio and reopen it the ejb-jar-xml is corrupt and I can´ t compile it anymore!
    Can someone please help?
    Peter

    Here it is my new weblogic-ejb-jar.xml ( snippet):
    <weblogic-enterprise-bean>
    <ejb-name>RegistrationInfo</ejb-name>
    <entity-descriptor>
         <entity-cache><max-beans-in-cache>100</max-beans-in-cache></entity-cache>
    <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>
    </entity-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/auctiondb</res-ref-name>
    <jndi-name>auctiondb</jndi-name>
    </resource-description>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/PaymentInfo</ejb-ref-name>
                   <jndi-name>PaymentInfoLocalHome</jndi-name>
         </ejb-local-reference-description>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/AddressInfo</ejb-ref-name>
                   <jndi-name>AddressInfoLocalHome</jndi-name>
         </ejb-local-reference-description>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/BidInfo</ejb-ref-name>
                   <jndi-name>BidInfoLocalHome</jndi-name>
         </ejb-local-reference-description>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/SaleInfo</ejb-ref-name>
                   <jndi-name>SaleInfoLocalHome</jndi-name>
         </ejb-local-reference-description>
    </reference-descriptor>
    <jndi-name>RegistrationInfoLocalHome</jndi-name>
    <local-jndi-name>RegistrationInfoLocal</local-jndi-name>
    </weblogic-enterprise-bean>

  • Common lookup for datasource name in ejb-jar.xml for all EJB's??

    I used <env-entry>...</env-entry> in ejb-jar.xml ...but that does not allow me to look the same entry in another EJB ...what is the right place to keep and look for such a information ?
    EJBing recently !!
    Thanks
    Ajay

    I am sorry friend, that is not what i am looking for.
    I have datasource/connection pool and do not want to hardcode the name into all EJB's rather want to access it from xml file. If i use
    <env-entry> that is for a perticular session or entity bean. and i have to write that for all 35 beans. I believe there shoule be a tag to access globaly.
    thanks for considering me to reply.
    Ajay

  • Invalid weblogic-ejb-jar.xml ??

    I have a question about weblogic-ejb-jar.xml file entries.
    weblogic 9.1 server says it is invalid while deploying my file
    my file is as under,
    <?xml version="1.0"?><!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems,
    Inc.//DTD WebLogic 8.1.0 EJB//EN'
    'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/910"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/910
    http://www.bea.com/ns/weblogic/910/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
              <ejb-name>MessageAccess</ejb-name>
              <message-driven-descriptor>
    <resource-adapter-jndi-name>SystemModule-test</resource-adapter-jndi-name>
              </message-driven-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    can anybody help what is wrong with it?

    I used Korean language in comment.
    But the charset of XML was iso-8859-1.
    Sorry.
    "mariah" <[email protected]> wrote:
    >
    Hi, I am migrating to WebLogic Server 6.1 from 5.1.
    And for the weblogic-ejb-jar.xml,
    the following error occurs:
    ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml' line 14: An invalid
    XML character
    (Unicode: 0xb8) was found in the comment.
    ERROR: ejbc found errors
    The errorneous line is the following comment. (it's fine in 5.1)
    <!-- if false, ... -->
    Must I remove this comment?
    Thanks in advance.

  • The DOCTYPE declaration in the ejb-jar.xml deployment descriptor is missing

    Hello,
    I want to create web service from ejb but everytime I want to do it, I get the following error:
    I'm using NWDS 7.2 and JDK 1.6
    [004]Deployment aborted
    Settings
    SDM host : XXX
    SDM port : 50118
    URL to deploy : file:/C:/DOCUME1/XXXX/LOCALS1/Temp/temp3760382784932063822XXXWSProjectEar.ear
    Result
    => deployment aborted : file:/C:/DOCUME1/XXX/LOCALS1/Temp/temp3760382784932063822XXX/WSProjectEar.ear
    Aborted: development component 'XXXWSProjectEar'/'sap.com'/'localhost'/'2011.01.06.15.48.31'/'0':
    Caught exception during application deployment from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Cannot deploy application sap.com/XXXWSProjectEar.. Reason: The DOCTYPE declaration in the ejb-jar.xml deployment descriptor is missing. ; nested exception is:      com.sap.engine.services.ejb.exceptions.deployment.EJBXMLParserException: The DOCTYPE declaration in the ejb-jar.xml deployment descriptor is missing.
    (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
    Deployment exception : The deployment of at least one item aborted
    Can anyone tell me why am I getting this error.
    Thnx for your help.
    Best regards.

    Hello Decio Junior,
    Actually yes, I resolved my problem.
    I'm developing an EJB 3.0 project. I'm using NWDS 7.2 and JDK 1.6 as I said.
    The problem is that my server was using JDK 1.4 and that was the problem.
    EJB 1.1 and 2.1 need ejb-jar.xml but EJB 3.0 use the annotations instead.
    Check your server JDK Version. It should be JDK 1.5 or higher.
    Something else that you should check, in your project properties :
    In the Build PATH : Use JDK 1.5
    In the Java Compiler : Set the java compiler compliance level to 1.6 and check use default compliance settings
    Hope it would help.
    If you need more explanations, I'm here
    Good luck.

  • Can't I use the comment in weblogic-ejb-jar.xml?

    Hi, I am migrating to WebLogic Server 6.1 from 5.1.
    And for the weblogic-ejb-jar.xml,
    the following error occurs:
    ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml' line 14: An invalid XML character
    (Unicode: 0xb8) was found in the comment.
    ERROR: ejbc found errors
    The errorneous line is the following comment. (it's fine in 5.1)
    <!-- if false, ... -->
    Must I remove this comment?
    Thanks in advance.

    I used Korean language in comment.
    But the charset of XML was iso-8859-1.
    Sorry.
    "mariah" <[email protected]> wrote:
    >
    Hi, I am migrating to WebLogic Server 6.1 from 5.1.
    And for the weblogic-ejb-jar.xml,
    the following error occurs:
    ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml' line 14: An invalid
    XML character
    (Unicode: 0xb8) was found in the comment.
    ERROR: ejbc found errors
    The errorneous line is the following comment. (it's fine in 5.1)
    <!-- if false, ... -->
    Must I remove this comment?
    Thanks in advance.

  • How to write multiple ejb-jar.xml file in an ejb module

    i am developing an ejb project. I hav a number of entity beans and session beans and their mapping in ejb-jar.xml. As the number of beans increases the entry of beans and mapping is also increasing. So i want to ask u that is there any mechanism so that i can divide the ejb-jar.xml file so that it will be easy to maintain it.

    ejb-jar is the smallest composable unit for related EJB components. Your best bet is to create multiple ejb-jars and package them within the same enterprise application (.ear).

  • Sun-ejb-jar.xml  y ejb-jar.xml

    Hello
    I�m using SUn oNE Applciation Server and it request sun-ejb-jar.xml for this file when i deploy a ejb but i only have in the jar, generating by sun one studio , ejb-jar,xml , is it the same file?

    up

  • JBuilder plugin does not generate orion-ejb-jar.xml

    Hello,
    We are using JBuilder to code EJB's. I downloaded the OC4J plugins for JBuilder 5 and 6. Everything installed right but filling in the deployment descriptor does not automatically generate XML entries in the orion-ejb-jar.xml. I have to do this by hand.
    Deploying to OC4J 1.0.2.2.1 succeeds and also running OC4J 1.0.2.2.1 in the debugger of JBuilder succeeds.
    I would like to see an automatic process of filling in the right tags in the orion-ejb-jar.xml just as what happens in JDeveloper or in JBuilder for the ejb-inprise.xml.
    Who is responsible for making the plugins?
    The plugins are good but things must be better for working with JBuilder to Oracle 9iAS.
    Last big very big point is the lack of good documentation.
    Oracle, when you have good technology please tell me in good documentation how to use it otherwise how will I ever discover the good things. Maybe we are trowing things away because of not knowing.
    The plugins are only for working with OC4J 1.0.2.2.x.
    When will there be plugins voor OC4J version 2?
    With regards,
    Johan Borchers
    VDA informatiebegheersing.

    Here is the URL where you can download the JBuilder7 plugin for OC4J 903. It supports CMP and automatically generates orion-ejb-jar.xml, but the CMR mapping is supported from JBuilder8 and the corresponding plugin.
    http://codecentral.borland.com/codecentral/ccWeb.exe/listing?id=19237

Maybe you are looking for

  • SAPINST failed step "Install Oracle Database (post processing)"

    i will install ep6.0 with oracle database 9.2.0.4 on sun solaris. the SAPINST failed at the step "Install Oracle Database (post processing) with follow error. the oui - installer (runinstaller) finished sucessfully. ERROR 2004-08-31 16:05:17 CJS-0008

  • Re: iMac suddenly very slow only on start up

    OSX 10.9.5 on my imac takes over 2 minutes to boot!?!?!? What I notice in the below, is that flipvideo is no longer on my system and  skype has been uninstalled.  I have searched for com.skype.c2c_service.plist but it is not on my system.  How do I g

  • How to make use of class cl_gui_alv_grid

    Hi Expert, I have an ALV which has been developed using Object Oriented Programming. Now i need to enable the push button, that will enable the users to select any row they want. i have investigated and found the i need to update the field SEL_MODE w

  • IBook g4 (04) sudden death, plugged in

    My wife's iBook has begun to power down without notice on battery-only AND on power. When it shuts down, the line-in remains gree-or-orange lit, depending on the battery's charge state. I do not recall if the battery was subject to the recall and rep

  • Endeca Preview on ATG CRS

    I have ATG 10.1.2 and Endeca 3.1.1. I configured Stage and Prod instances of CRS, and I connected them to one Endeca App with 2 DGraphs. Stage CRS is connected to Authoring DGraph, while Prod CRS is connected to Live DGraph. Preview in Endeca App poi