Location of weblogic700-ejb-jar.dtd ???

The DTD is not located at
http://www.bea.com/servers/wls700/dtd/weblogic700-ejb-jar.dtd where it
should be.
I cannot validate the documents without the DTD.
Where is it?

It should be somewhere inside the weblogic.jar file.
Open it with WinZip or unjar it and search for the filename.
Dejan
Hans Schwäbli wrote:
The DTD is not located at
http://www.bea.com/servers/wls700/dtd/weblogic700-ejb-jar.dtd where it
should be.
I cannot validate the documents without the DTD.
Where is it?

Similar Messages

  • Broken orion-ejb-jar.dtd?

    I use the Ant task <xmlvalidate> in an EJB project to check the EJB XML deployment descriptors against their DTDs. Checking the (Sun-specified) "ejb-jar.xml" is fine. JDeveloper creates the OC4J specific deployment descriptor "orion-ejb-jar.xml" with a reference to the DTD located at "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd". Now this DTD seems to be broken.
    Firstly, the DTD seems to have an invalid syntax. I'm not a DTD expert but Ant complains about lines 279-281 of that DTD :
    279: isolation (commited | serializable | uncommited | repeatable_reads)
    280: CDATA #IMPLIED
    281: locking-mode (pessimistic | optimistic | read-only | old_pessimistic)
    286: max-tx-retries CDATA #IMPLIED
    287: update-changed-fields-only (true | false) "true"
    There seems to be an attribut missing altogether at line 280 (see line 286) so I deleted that line. Then for lines 279 and 281, Ant complained about missing quotes - apparently, such an "enum" needs to have a "default value" (as in line 287), so I manually added such a value for each line.
    The final error was in the "orion-ejb-jar.xml" (created by JDeveloper itself). Here is a piece of that:
    <orion-ejb-jar>
    <enterprise-beans>
    <session-deployment max-instances="-1" name="DiscountCalculator"/>
    I assume that the "max-instances" attribute sets the number of EJB instances in the OC4J pool to "unlimited". However, according to the DTD, session beans don't have such a "max-instances" attribute (lines 10-21):
    <!-- Deployment info for a session bean. -->
    ELEMENT session-deployment (env-entry-mapping*, ejb-ref-mapping*, resource-ref-mapping*)
    ATTLIST session-deployment call-timeout CDATA #IMPLIED
    copy-by-value CDATA #IMPLIED
    location CDATA #IMPLIED
    max-tx-retries CDATA #IMPLIED
    name CDATA #IMPLIED
    persistence-filename CDATA #IMPLIED
    timeout CDATA #IMPLIED
    wrapper CDATA #IMPLIED
    replication CDATA #IMPLIED
    >
    So I copied and pasted the instances attribute from the entity bean section.
    How come the DTD is broken? Even the 9.0.3 OC4J docs (http://download-east.oracle.com/docs/cd/A97688_08/generic.903/a97677/dtdxml.htm#620714) talk about all sorts of features (such as the "max-instances" attribute for session beans) and still points to the DTD "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd" that doesn't have these features at all.

    Karsten,
    In case you are still on it, I stumbled upon this some time ago, too. My best guess is that they miss entire phrase, which I put in bold:
    ....mmited | repeatable_reads ) "commited"
    disable-wrapper-cache CDATA #IMPLIED
    locking-mode ( pesim...
    (There is a line break between '"commited"' and 'disable-wrapper-cache'. 'commited', 'uncommited' must be MISSPELLED exactly as above.)
    Btw, max-instances and min-instances are in the DTD that ships with 9.0.3 (jarred in oc4j.jar). This DTD, however, is still broken in the way that you found (it won't even XML-validate). How do they go around this? go figure! Oracle documentation? we all know ...
    Best regards,
    bjk

  • Download locally weblogic-ejb-jar.dtd

    Hi,
    Can we download weblogic-ejb-jar.dtd, weblogic-rdbms-persistence.dtd, weblogic-web-jar.dtd
    locally and refer to those dtds instead of http://www.bea.com/...
    and ship with our products? Because we don't want the end user to have internet
    connection while deploying.
    Is this legally allowed?
    Sambath.

    I have no idea, but ... all the WLS tools will resolve the weblogic
    DTDs locally. They won't open a socket to bea.com. (If they do, it's a
    bug.)
    -- Rob
    sambath wrote:
    Hi,
    Can we download weblogic-ejb-jar.dtd, weblogic-rdbms-persistence.dtd, weblogic-web-jar.dtd
    locally and refer to those dtds instead of http://www.bea.com/...
    and ship with our products? Because we don't want the end user to have internet
    connection while deploying.
    Is this legally allowed?
    Sambath.

  • Deploy ejb on wls7.0 weblogic.ejb.jar.xml ! help

    Morning !
    i'm try to deploy a EJB on wls7.0
    my descriptor is like this and i don't really undestand what's go wrong.
    thanks you to help
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 7.0.0
    EJB//EN" "http://www.bea.com/servers/wls700/dtd/weblogic700-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <entity>
    <ejb-name>Compte</ejb-name>
    <bean-home-name>Compte</bean-home-name>
    <resource-ref>
    <res-ref-name>jdbc/DataSource</res-ref-name>
    <jndi-name>DataSource</jndi-name>
    </resource-ref>
    <cmp-info>
    <database-map>
    <table>"Compte"</table>
    <column-map>
    <field-name>id</field-name>
    <column-name>"id"</column-name>
    </column-map>
    <column-map>
    <field-name>nomSte</field-name>
    <column-name>"nomSte"</column-name>
    </column-map>
    <column-map>
    <field-name>dateCreation</field-name>
    <column-name>"dateCreation"</column-name>
    </column-map>
    <column-map>
    <field-name>nbEmployes</field-name>
    <column-name>"nbEmployes"</column-name>
    </column-map>
    <column-map>
    <field-name>caSte</field-name>
    <column-name>"caSte"</column-name>
    </column-map>
    <column-map>
    <field-name>descSte</field-name>
    <column-name>"descSte"</column-name>
    </column-map>
    <column-map>
    <field-name>logo</field-name>
    <column-name>"logo"</column-name>
    </column-map>
    <column-map>
    <field-name>id_commercial</field-name>
    <column-name>"id_commercial"</column-name>
    </column-map>
    </database-map>
    <finder>
    <method-signature>findAll()</method-signature>
    <where-clause />
    <load-state>True</load-state>
    </finder>
    </cmp-info>
    </entity>
    <datasource-definitions>
    <datasource>
    <jndi-name>DataSource</jndi-name>
    <url>jdbc:odbc:dev_java</url>
    <username>sa</username>
    <password>lnx.sully</password>
    <driver-class-name>sun.jdbc.odbc.JdbcOdbcDriver</driver-class-name>
    </datasource>
    </datasource-definitions>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    the EXception is !
    Exception
    weblogic.management.ApplicationException: No deployment found at
    E:\bea70\weblogic700\server\bin\GRPEJB.jar.
    at
    weblogic.j2ee.J2EEApplicationContainerFactory.initializeDeployment(J2EEAppli
    cationContainerFactory.java:350)
    at
    weblogic.management.deploy.DeployerRuntime.unprotectedActivate(DeployerRunti
    me.java:350)
    at
    weblogic.management.deploy.DeployerRuntime.access$0(DeployerRuntime.java:282
    at
    weblogic.management.deploy.DeployerRuntime$1.run(DeployerRuntime.java:947)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.management.deploy.DeployerRuntime.checkAndPerformDeployerActions(De
    ployerRuntime.java:941)
    at
    weblogic.management.deploy.DeployerRuntime.activate(DeployerRuntime.java:279
    at java.lang.reflect.Method.invoke(Native Method)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl
    .java:717)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:6
    99)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerI
    mpl.java:921)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:470)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:198)
    at $Proxy48.activate(Unknown Source)
    at
    weblogic.management.console.actions.mbean.ConfigureAppWizardAction.commit(Co
    nfigureAppWizardAction.java:248)
    at
    weblogic.management.console.actions.mbean.ConfigureAppWizardAction.perform(C
    onfigureAppWizardAction.java:100)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:171)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5360)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2468)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    tahnks you !
    Unimon Thierry
    CGBI- CET-E-services
    69, Blvd Galliéni
    91 Issy les Mlx
    tele :01/55/95/54/22 Poste:5422
    Port :06/61/81/78/59
    Prof : mailto:[email protected]
    Pers : mailto:[email protected]

    oops! Pls ignore my previous mail. It was for a different problem.
    FOr the original problem of "couldn ot locate the bean with the ejb-name XZY in weblogic-ejb-jar.xml":
    This happens if you don't have the below files defined
    for a JAR/EAR file:
    weblogic-ejb-jar.xml and weblogic-cmp-rdbms-jar.xml (needed if you have any Datasource mapped)
    These two are basic files required for any JAR/EAR file.
    If you dont' have it already you can generate them using
    $WLS_HOME/bin/startWLBuilder.sh GUI tool bundled along
    with WLS (I used 8.1 SP4) to generate these files ! This tool is really helpful.
    - Mouli

  • Webllogic8to10migration-SAXValidationExc Couldnot locate bean ejb-jar.xml

    Please help me out here..
    Failed to parse descriptor at 'META-INF/weblogic-ejb-jar.xml' for module 'PAMaintenanceBean.jar': javax.xml.stream.XMLStreamException: weblogic.xml.process.SAXValidationException: Could not locate bean with ejb-name "PAMaintenance" in ejb-jar.xml
    ejb-jar.xml
    ==========
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
         <ejb-name>PAMaintenance</ejb-name>
         <home>com.bear.coreapps.pa.ejb.maintenance.PAMaintenanceHome</home>
         <remote>com.bear.coreapps.pa.ejb.maintenance.PAMaintenance</remote>
         <ejb-class>com.bear.coreapps.pa.ejb.maintenance.PAMaintenanceBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
         <method>
         <ejb-name>PAMaintenance</ejb-name>
         <method-intf>Remote</method-intf>
         <method-name>*</method-name>
         </method>
         <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
         <ejb-name>PAFeatures</ejb-name>
         <home>com.bear.coreapps.pa.ejb.features.PAFeaturesHome</home>
         <remote>com.bear.coreapps.pa.ejb.features.PAFeatures</remote>
         <ejb-class>com.bear.coreapps.pa.ejb.features.PAFeaturesBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
         <env-entry>
         <env-entry-name>myString</env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>anything at all</env-entry-value>
         </env-entry>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
         <method>
         <ejb-name>PAFeatures</ejb-name>
         <method-intf>Remote</method-intf>
         <method-name>*</method-name>
         </method>
         <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    weblogic-ejb-jar.xml
    ===============
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>PAMaintenance</ejb-name>
    <caching-descriptor>
         <max-beans-in-free-pool>100</max-beans-in-free-pool>
    </caching-descriptor>
    <enable-call-by-reference>false</enable-call-by-reference>
    <jndi-name>com.bear.coreapps.pa.ejb.maintenance.PAMaintenance</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>PAFeatures</ejb-name>
    <caching-descriptor>
         <max-beans-in-free-pool>100</max-beans-in-free-pool>
    </caching-descriptor>
    <jndi-name>statelessSession.PAFeaturesHome</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    my web.xml
    ========
    <ejb-ref>
    <ejb-ref-name>PAFeatures</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.bear.coreapps.pa.ejb.features.PAFeaturesHome</home>
    <remote>com.bear.coreapps.pa.ejb.features.PAFeatures</remote>
    <ejb-link>../PAFeaturesBean.jar#PAFeatures</ejb-link>
    </ejb-ref>
    <ejb-ref>
    <ejb-ref-name>PAMaintenance</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.bear.coreapps.pa.ejb.maintenance.PAMaintenanceHome</home>
    <remote>com.bear.coreapps.pa.ejb.maintenance.PAMaintenance</remote>
    <ejb-link>../PAMaintenanceBean.jar#PAMaintenance</ejb-link>
    </ejb-ref>
    Application.xml
    ===========
    <module>
    <ejb>PAFeaturesBean.jar</ejb>
    </module>
    <module>
    <ejb>PAMaintenanceBean.jar</ejb>
    </module>
    config.xml
    ===========
    <app-deployment>
    <name>emsApp</name>
    <target>mngCTK_dbctkapp01</target>
    <module-type>ear</module-type>
    <source-path>applications/emsApp</source-path>
    <sub-deployment>
    <name>/</name>
    <target>mngCTK_dbctkapp01</target>
    </sub-deployment>
    <sub-deployment>
    <name>PAMaintenanceBean.jar</name>
    <target>mngCTK_dbctkapp01</target>
    </sub-deployment>
    <sub-deployment>
    <name>PAFeaturesBean.jar</name>
    <target>mngCTK_dbctkapp01</target>
    </sub-deployment>
    <security-dd-model>DDOnly</security-dd-model>
    <staging-mode>nostage</staging-mode>
    </app-deployment>

    Hi,
    Nothing stands out as being configured incorrectly. I copy and pasted the descriptors below, put them in a jar file and ran weblogic.appc on it. The descriptors loaded properly and appc only complained that the EJB classes couldn't be found (as expected). Are you sure the weblogic-ejb-jar.xml containing the 'PAMaintenance' reference is in the same ejb-jar file as the ejb-jar.xml containing the 'PAMaintenance' definition? That's the only thing I can think of.
    - Matt

  • DTD Doctype for weblogic-ejb-jar.xml

    Hi,
    I have a small question about XML DOCTYPE DEFINITION used with XML descriptors.
    What should be the DOCTYPE HEADER for weblogic 6.0 sp2 & EJB 1.1?
    Currently, i'm using :
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems,
    Inc.//DTD WebLogic 5.1.0 EJB//EN''http://www.bea.com/servers/wls510/ dtd/weblogic-ejb-jar.dtd'>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    These are working fine. But my question is, why should we use DTDs of WLS5.1 even
    if we are using WL6.0?
    Note that we intend to use EJB1.1 specification.
    Regards,
    Amit

    There is a new 6.0 DTD for CMP 1.1 entity beans to take advantage of new
    features (such as 2pc). Search the CMP EJB newsgroup for a post from me
    about 1 or 2 months ago summarizing the topic.
    Otherwise the old DTDs seem to work just fine.
    Peace,
    Cameron Purdy
    Tangosol Inc.
    << Tangosol Server: How Weblogic applications are customized >>
    << Download now from http://www.tangosol.com/download.jsp >>
    "Amit Vaidya" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    I have a small question about XML DOCTYPE DEFINITION used with XMLdescriptors.
    >
    What should be the DOCTYPE HEADER for weblogic 6.0 sp2 & EJB 1.1?
    Currently, i'm using :
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems,
    Inc.//DTD WebLogic 5.1.0 EJB//EN''http://www.bea.com/servers/wls510/
    dtd/weblogic-ejb-jar.dtd'>
    >
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD EnterpriseJavaBeans
    1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    These are working fine. But my question is, why should we use DTDs ofWLS5.1 even
    if we are using WL6.0?
    Note that we intend to use EJB1.1 specification.
    Regards,
    Amit

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

  • Please check this ejb-jar.xml, weblogic-ejb-jar.xml,weblogic-cmp-rdbms.xml

    i am getting a classcast exception.My Stateless and stateful session bean works
    fine .. problem only with Entity bean. Please check these xml files and let me
    know if i have missed anything.
    ejb-jar.xml
    <?xml version="1.0"?>
    <!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>
    <entity>
    <ejb-name>stores</ejb-name>
    <home>Ejb.Stores.storesHome</home>
    <remote>Ejb.Stores.storesRemote</remote>
    <ejb-class>Ejb.Stores.storesBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>storesBean</abstract-schema-name>
    <cmp-field>
    <field-name>productId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>descrip</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>price</field-name>
    </cmp-field>
    <primkey-field>productId</primkey-field>
    <query>
    <query-method>
    <method-name>findPriceGreaterThan</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE a.price > ?1]]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>stores</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- end of ejb-ar.xml---------------------
    weblogic-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>stores</ejb-name>
    <entity-descriptor>
    <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>
    <jndi-name>storesEntity</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ------------- end of weblogic-jar.xml----------
    weblogic-cmp-rdbms-jar.xml
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0
    EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>stores</ejb-name>
    <data-source-name>sqlTX</data-source-name>
    <table-name>ProductEJBTable</table-name>
    <field-map>
    <cmp-field>productId</cmp-field>
    <dbms-column>productId</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>descrip</cmp-field>
    <dbms-column>descrip</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>price</cmp-field>
    <dbms-column>price</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>false</create-default-dbms-tables>
    </weblogic-rdbms-jar>
    ---------------- end of weblogic-cmp-rdbms-jar.xml----------
    Do i have to mention the connection Pool name anywhere .. My connection Pool name
    is sql7Pool and my datasource name which i have mentioned is sqlTx. I am using
    Sql server 7. I am deploying a jar file(not a war file) and accessng the EJB through
    a Servlet. Please any help would definitely be appreciated.
    Cheers
    Ashish.

    I thought you were getting a class cast exception but the stack trace shows
    a NullPointerException on line 38 of your servlet code. I am not sure if the
    code that you have attached is the complete code or just snippets of your
    complete code. Anyways, counting 38 lines in the code you attached points to
    the line "mr =
    mh.create(request.getParameter("login"),request.getParameter("name"));"
    which could be because "mh" is null. Can you verify "mh" is not null and
    also "objRef" is not null.
    Attaching the stack trace for ClassCastException would be useful.
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hey Anand,
    Thanks for your reply. I have attached the StackTrace,Servlet code andmy
    location and settings of my servlet .
    This is the StackTrace which i get :
    pl.java:265)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    before create
    java.lang.NullPointerException
    at trialweblogic.webServlet.doGet(webServlet.java:38)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    -------------- end of StackTrace---------------------
    My Servlet Code is
    package trialweblogic;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import javax.ejb.ObjectNotFoundException;
    import javax.ejb.DuplicateKeyException;
    import javax.ejb.EJBException;
    import java.rmi.RemoteException;
    import java.rmi.Remote;
    import trialweblogic.*;
    public class webServlet extends HttpServlet {
    masterHome mh;
    masterRemote mr;
    OutputStream out;
    private static final String CONTENT_TYPE = "text/html";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponseresponse)
    throws ServletException, IOException {
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    // out = response.getOutputStream();
    try{
    InitialContext ic = new InitialContext();
    Object objRef = ic.lookup("masterBeanJNDI");
    mh =(masterHome)PortableRemoteObject.narrow(objRef,masterHome.class);
    >
    mr =mh.create(request.getParameter("login"),request.getParameter("name"));
    out.println("after create");
    }catch(Exception ex){
    ex.printStackTrace();
    public void destroy() {
    --------- end of servlet--------------
    I am using Weblogic 6.1. I have included the following in my web.xml filewhich
    is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF
    >
    >
    <servlet>
    <servlet-name>webServlet</servlet-name>
    <servlet-class>trialweblogic.webServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>webServlet</servlet-name>
    <url-pattern>/webServlet/*</url-pattern>
    </servlet-mapping>
    My Servlet is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF\class
    es\trialweblogic\
    folder. In this folder i also have the supporting files (home,remote &bean tooo).
    >
    >
    I call this servlet when te user submits the info from a JSP page.
    Hope this info helps in solving my problem. Do i have to mention theconnection
    Pool name anywhere in the xml descriptor or am i missing anything here. iguess
    Connection Pool name is not required since we are mentioning the JNDI namein
    the xml descriptor. Bye for now.Awaiting your reply.
    Cheers
    Ashish.
    "Anand Byrappagari" <[email protected]> wrote:
    It is unlikely that your xml descriptors can cause class cast exceptions.
    How did you install the servlet? Can you attach the servlet code that
    might
    help. Also complete stack trace of the exceptions would be helpful.
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    Hi Anand,
    Thanks for quic reply.Hey i am using weblogic6.1. I am Not usinga WAR
    and
    ear file.I have created a jar file and deployed it.now i have createda
    servlet
    to access entity bean.Is a war file neccessary for accesing an entitybean
    through
    Servlet or JSP ???I am using sql server 7. The error that it givesis -----
    java.lang.ClassCastException: Cannot narrow remote object<br>
    "inside lookup method aaaaaaa" java.lang.NullPointerException. <br>
    Hope to get ur reply soon. in another entity bean i am getting thiserror ---
    java.lang.ClassCastException:
    weblogic.jdbc.common.internal.RmiDataSource
    .. I
    can't understand wots this error. I feel i am missing something inmy xml
    descriptor.
    Bye for now.
    Cheers
    Ashish.
    "Anand Byrappagari" <[email protected]> wrote:
    Can you attach the stack trace for the exception? Also please describe
    you
    environment - are the war and jar files installed separately? Are
    they
    composed into a ear? Also when are you getting a classcast exception?
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    i am getting a classcast exception.My Stateless and stateful sessionbean
    works
    fine .. problem only with Entity bean. Please check these xml filesand
    let me
    know if i have missed anything.
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD EnterpriseJavaBeans
    2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>stores</ejb-name>
    <home>Ejb.Stores.storesHome</home>
    <remote>Ejb.Stores.storesRemote</remote>
    <ejb-class>Ejb.Stores.storesBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>storesBean</abstract-schema-name>
    <cmp-field>
    <field-name>productId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>descrip</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>price</field-name>
    </cmp-field>
    <primkey-field>productId</primkey-field>
    <query>
    <query-method>
    <method-name>findPriceGreaterThan</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE
    a.price> >> >>> >> >?1]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>stores</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- end of ejb-ar.xml---------------------
    weblogic-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD
    WebLogic
    6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>stores</ejb-name>
    <entity-descriptor>
    <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>
    <jndi-name>storesEntity</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ------------- end of weblogic-jar.xml----------
    weblogic-cmp-rdbms-jar.xml
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD
    WebLogic
    6.0.0
    EJB RDBMS Persistence//EN'
    'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dt
    d
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>stores</ejb-name>
    <data-source-name>sqlTX</data-source-name>
    <table-name>ProductEJBTable</table-name>
    <field-map>
    <cmp-field>productId</cmp-field>
    <dbms-column>productId</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>descrip</cmp-field>
    <dbms-column>descrip</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>price</cmp-field>
    <dbms-column>price</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>false</create-default-dbms-tables>
    </weblogic-rdbms-jar>
    ---------------- end of weblogic-cmp-rdbms-jar.xml----------
    Do i have to mention the connection Pool name anywhere .. My
    connection
    Pool name
    is sql7Pool and my datasource name which i have mentioned is sqlTx.I am
    using
    Sql server 7. I am deploying a jar file(not a war file) and accessngthe
    EJB through
    a Servlet. Please any help would definitely be appreciated.
    Cheers
    Ashish.

  • Orion-ejb-jar.xml is not valid

    I am trying to parse orion-ejb-jar.xml as follows:
    package test;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.apache.xml.serialize.*;
    import org.xml.sax.*;
    import java.io.*;
    public class GetFieldSize {
    String filePath = null;
    Document document = null;
    public GetFieldSize(String filePath) {
    this.filePath = filePath;
    public void constructDocument() {
    try {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    builder.parse(new InputSource(new FileReader(filePath)));
    } catch (FactoryConfigurationError fce) {
    fce.printStackTrace();
    } catch (ParserConfigurationException pce) {
    pce.printStackTrace();
    } catch (SAXException se) {
    se.printStackTrace();
    } catch (IOException ie) {
    ie.printStackTrace();
    public static void main(String[] args) {
    GetFieldSize getFieldSize = new GetFieldSize("Z:\\nosqms\\ProcessTools\\qTools\\qTools\\qTools\\src\\META-INF\\orion-ejb-jar.xml");
    getFieldSize.constructDocument();
    I got the following parse error.
    oracle.xml.parser.v2.XMLParseException: Expected '>'.
    void oracle.xml.parser.v2.XMLError.flushErrors()
    void oracle.xml.parser.v2.NonValidatingParser.parseMarkupDecl()
    void oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl()
    void oracle.xml.parser.v2.NonValidatingParser.parseProlog()
    void oracle.xml.parser.v2.NonValidatingParser.parseDocument()
    void oracle.xml.parser.v2.XMLParser.parse(org.xml.sax.InputSource)
    org.w3c.dom.Document oracle.xml.jaxp.JXDocumentBuilder.parse(org.xml.sax.InputSource)
    void test.GetFieldSize.constructDocument()
    void test.GetFieldSize.main(java.lang.String[])
    When I opened the orion-ejb-jar.xml in IE, I got the following error:
    A string literal was expected, but no opening quote character was found. Line 87, Position 1
    CDATA #IMPLIED
    Seems like problem with http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd.
    How to rectify it?

    1: Replace
    isolation (committed | serializable | uncommitted | repeatable_reads)
    CDATA #IMPLIED
    locking-mode (pessimistic | optimistic | read-only | old_pessimistic)
    by
    isolation (committed | serializable | uncommitted | repeatable_reads) #IMPLIED
    locking-mode (pessimistic | optimistic | read-only | old_pessimistic) #IMPLIED
    2: in
    <!ELEMENT ior-security-config (transport-config?, as-context?
    sas-context?) >
    add the final comma:
    <!ELEMENT ior-security-config (transport-config?, as-context?, sas-context?) >

  • Use of externally-defined/ in weblogic-ejb-jar.xml

    I am trying to use Global Roles defined via the Weblogic console to control access to EJB methods.
    I am using the <externally-defined/> tag in security role assignments, however when I deploy to Weblogic I get the following error :
    <8/09/2004 04:21:42 PM GMT+10:00> <Error> <Deployer> <BEA-149205> <Failed to initialize the application appsdirmars-marketdata_ear due to error weblogic.manag
    ement.ApplicationException: Prepare failed. Task Id = null
    Module Name: ejb-marketdata.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: 51 column: 26. Element type "externally-defined" must be declared..
    at weblogic.j2ee.J2EEApplicationContainer.checkForErrors(J2EEApplication
    Container.java:1612)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:1207)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:1051)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:823)
    at weblogic.management.deploy.slave.SlaveDeployer$Application.prepare(Sl
    aveDeployer.java:2925)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareAllApplications
    (SlaveDeployer.java:967)
    at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
    ava:349)
    at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
    e(DeploymentManagerServerLifeCycleImpl.java:229)
    at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
    at weblogic.Server.main(Server.java:32)
    I am running Weblogic 8.1 SP3 on Windows XP Pro.
    The XML is valid for the specified DTD according to my XML editor.
    The relevevant fragment from weblogic-ejb-jar.xml is included below.
    Any help much appreciated.
    Gavin.
    <?xml version="1.0" encoding="UTF-8"?>
    <!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>
    <security-role-assignment>
    <role-name>MarsAdmin</role-name>
    <externally-defined/>
    </security-role-assignment>
    <security-role-assignment>
    <role-name>MarsViewer</role-name>
    <externally-defined/>
    </security-role-assignment>
    </weblogic-ejb-jar>

    I tried using the <global-role/> tag instead - this does deploy without any errors - but when I call the secure EJB method I get the Security Violation error below.
    The DTD says using the <global-role/> tag is fine, albeit deprecated, but the Weblogic 8.1 manual says this has been replaced by <externally-defined/>, so I'm not sure if this should work or not.
    [EJB:010160]Security Violation: User: 'ghughes' has insufficient permission to access EJB: type=<ejb>, application=_appsdir_mars-marketdata_ear, module=ejb-marketdata.jar, ejb=marketdata.MarketDataManager, method=getEnergyOverview, methodInterface=Remote, signature={java.util.Date}.
    So on the whole I'd prefer to work out why Weblogic isn't recognising <externally-defined/> - I've included the full deployment descriptor below - I'm generating it using the latest snapshot of XDoclet - is the DTD specified correct for Weblogic 8.1 SP3 ? (It matches the one specified in http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html - but I can't think of anything else that could be wrong).
    Any tips much appreciated as I need to enable an administrator to customise these roles at runtime rather than hard-coding the role - group mappings into the deployment descriptors.
    Thanks,
    Gavin.
    <?xml version="1.0" encoding="UTF-8"?>
    <!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>
    <description><![CDATA[Generated by XDoclet]]></description>
    <weblogic-enterprise-bean>
    <ejb-name>marketdata.MarketDataManager</ejb-name>
    <stateless-session-descriptor>
    </stateless-session-descriptor>
    <reference-descriptor>
    </reference-descriptor>
    <jndi-name>marketdata.MarketDataManager</jndi-name>
    <local-jndi-name>marketdata.MarketDataManagerLocal</local-jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>marketdata.MessageManager</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>5</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>FileTopic</destination-jndi-name>
    <connection-factory-jndi-name>JMSConnectionFactory</connection-factory-jndi-name>
    <jms-polling-interval-seconds>10</jms-polling-interval-seconds>
    <jms-client-id>1</jms-client-id>
    </message-driven-descriptor>
    <transaction-descriptor>
    <trans-timeout-seconds>10</trans-timeout-seconds>
    </transaction-descriptor>
    <reference-descriptor>
    </reference-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    </weblogic-enterprise-bean>
    <!--
    To add enterprise beans that you have deployment descriptor info for, add
    a file to your XDoclet merge directory called weblogic-enterprise-beans.xml that contains
    the <weblogic-enterprise-bean></weblogic-enterprise-bean> markup for those beans.
    -->
    <!-- xdoclet merge file -> weblogic-ejb-jar.xml -->
    <security-role-assignment>
    <role-name>MarsAdmin</role-name>
    <externally-defined/>
    </security-role-assignment>
    <security-role-assignment>
    <role-name>MarsViewer</role-name>
    <externally-defined/>
    </security-role-assignment>
    <idempotent-methods>
    </idempotent-methods>
    </weblogic-ejb-jar>
    Message was edited by [email protected] at Sep 8, 2004 8:45 PM

  • Error compiling ejb-jar.xml. Help!!

    I do not know why this xml file is giving me the errors displayed below.
    Thank you in advance.
    Here is my xml file:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
    JavaBeans 2.0//EN' 'http://www.java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>ObjectConnectorBean</ejb-name>
    <display-name>ObjectConnector</display-name>
    <home>com.harris.netboss.shared.posting.ObjectConnectorHome</home>
    <remote>com.harris.netboss.shared.posting.ObjectConnector</remote>
    <ejb-class>com.harris.netboss.shared.posting.ObjectConnectorBean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>com.harris.netboss.shared.posting.ObjectConnectorPK</prim-ke
    y-class>
    <reentrant>False</reentrant>
    </entity>
    </enterprise-beans>
    </ejb-jar>
    Here is the error message:
    org.xml.sax.SAXParseException: The content of element type "entity" must
    match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Exception.java:42)
    at org.xml.sax.SAXException.<init>(SAXException.java:45)
    at org.xml.sax.SAXParseException.<init>(SAXParseException.java:56)
    at
    weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1008)
    at
    weblogic.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLEr
    ror(XMLValidator.java:1280)
    at
    weblogic.apache.xerces.validators.common.XMLValidator.callEndElement(Compile
    d Code)
    at
    weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
    ch(Compiled Code)
    at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
    Code)
    at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
    at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:128)
    at
    weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
    at weblogic.ejbc20.runBody(Compiled Code)
    at weblogic.utils.compiler.Tool.run(Tool.java:81)
    at weblogic.ejbc.main(ejbc.java:20)
    --------------- nested within: ------------------
    weblogic.xml.process.XMLParsingException: The content of element type
    "entity" must match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    . - with nested exception:
    [org.xml.sax.SAXParseException: The content of element type "entity" must
    match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    .] Line: 16 Column: 16
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at weblogic.utils.NestedException.<init>(NestedException.java:18)
    at
    weblogic.xml.process.XMLParsingException.<init>(XMLParsingException.java:17)
    at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:132)
    at
    weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
    at weblogic.ejbc20.runBody(Compiled Code)
    at weblogic.utils.compiler.Tool.run(Tool.java:81)
    at weblogic.ejbc.main(ejbc.java:20)
    ERROR: weblogic.xml.process.XMLParsingException: The content of element type
    "entity" must match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    . - with nested exception:
    [org.xml.sax.SAXParseException: The content of element type "entity" must
    match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    .] Line: 16 Column: 16

    looks like your xml file(ejb-jar.xml) is missing some required tag element or
    the elements are out of
    order. the format is specified in a dtd, you should take a look at the dtd for
    ejb-jar.xml. for wl5.1, try looking under c:\weblogic for ejb-jar.dtd
    Richard Ong wrote:
    I do not know why this xml file is giving me the errors displayed below.
    Thank you in advance.
    Here is my xml file:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
    JavaBeans 2.0//EN' 'http://www.java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>ObjectConnectorBean</ejb-name>
    <display-name>ObjectConnector</display-name>
    <home>com.harris.netboss.shared.posting.ObjectConnectorHome</home>
    <remote>com.harris.netboss.shared.posting.ObjectConnector</remote>
    <ejb-class>com.harris.netboss.shared.posting.ObjectConnectorBean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>com.harris.netboss.shared.posting.ObjectConnectorPK</prim-ke
    y-class>
    <reentrant>False</reentrant>
    </entity>
    </enterprise-beans>
    </ejb-jar>
    Here is the error message:
    org.xml.sax.SAXParseException: The content of element type "entity" must
    match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Exception.java:42)
    at org.xml.sax.SAXException.<init>(SAXException.java:45)
    at org.xml.sax.SAXParseException.<init>(SAXParseException.java:56)
    at
    weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1008)
    at
    weblogic.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLEr
    ror(XMLValidator.java:1280)
    at
    weblogic.apache.xerces.validators.common.XMLValidator.callEndElement(Compile
    d Code)
    at
    weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
    ch(Compiled Code)
    at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
    Code)
    at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
    at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:128)
    at
    weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
    at weblogic.ejbc20.runBody(Compiled Code)
    at weblogic.utils.compiler.Tool.run(Tool.java:81)
    at weblogic.ejbc.main(ejbc.java:20)
    --------------- nested within: ------------------
    weblogic.xml.process.XMLParsingException: The content of element type
    "entity" must match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    . - with nested exception:
    [org.xml.sax.SAXParseException: The content of element type "entity" must
    match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    .] Line: 16 Column: 16
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at weblogic.utils.NestedException.<init>(NestedException.java:18)
    at
    weblogic.xml.process.XMLParsingException.<init>(XMLParsingException.java:17)
    at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:132)
    at
    weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
    at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
    at weblogic.ejbc20.runBody(Compiled Code)
    at weblogic.utils.compiler.Tool.run(Tool.java:81)
    at weblogic.ejbc.main(ejbc.java:20)
    ERROR: weblogic.xml.process.XMLParsingException: The content of element type
    "entity" must match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    . - with nested exception:
    [org.xml.sax.SAXParseException: The content of element type "entity" must
    match
    "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
    b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
    ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
    curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
    .] Line: 16 Column: 16

  • Finder-method in orion-ejb-jar.xml

    Hi,
    Is there a way to let jdeveloper 9.0.3 preview to automatically generate finder-method descriptors for us? When I was developing a cmp-based entity bean, although I defined the ejb-ql in ejb-jar.xml, JDeveloper still just generated the first orion-ejb-jar.xml shown below. In the first orion-ejb-jar.xml, there is no definition for any finder-method. I have to manually add my own definition to it, which is shown in the second orion-ejb-jar.xml. I know that the oc4j container will generate the finder-method after deployment, but in some situation it generated incorrect finder-method descriptors. One of such situation is the between query like "between ?1 and ?2". Anyway, if JDeveloper can generate the finder-method during development, then we can know whether the descriptor is correct or not before deployment, and we can make modifications before deploying it to oc4j server.
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" " " target="_new">http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd"> <orion-ejb-jar>
    <enterprise-beans>
    <entity-deployment name="BooksBean" data-source="jdbc/bookDS" table="BOOKS">
    <primkey-mapping>
    <cmp-field-mapping>
    <fields>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    </fields>
    </cmp-field-mapping>
    </primkey-mapping>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    <cmp-field-mapping name="title" persistence-name="TITLE" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="author" persistence-name="AUTHOR" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="price" persistence-name="PRICE" persistence-type="NUMBER(6,2)"/>
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping name="&lt;default-ejb-caller-role>" impliesAll="true"/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" " " target="_new">http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd"> <orion-ejb-jar>
    <enterprise-beans>
    <entity-deployment name="BooksBean" data-source="jdbc/bookDS" table="BOOKS">
    <primkey-mapping>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    </primkey-mapping>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    <cmp-field-mapping name="title" persistence-name="TITLE" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="author" persistence-name="AUTHOR" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="price" persistence-name="PRICE" persistence-type="NUMBER(6,2)"/>
    <finder-method query="select * from books where $author like $1">
    <method>
    <ejb-name>BooksBean</ejb-name>
    <method-name>findByAuthor</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>
    <finder-method query="select * from books where $title like $1">
    <method>
    <ejb-name>BooksBean</ejb-name>
    <method-name>findByTitle</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>
    <finder-method query="$price between $1 and $2">
    <method>
    <ejb-name>BooksBean</ejb-name>
    <method-name>findByPriceRange</method-name>
    <method-params>
    <method-param>double</method-param>
    <method-param>double</method-param>
    </method-params>
    </method>
    </finder-method>
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping impliesAll="true" name="&lt;default-ejb-caller-role>"/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    Any one has any idea?
    Thanks,
    Jingzhi

    Jingzhi -- If you define the correct EJB-QL you should get the correct SQL generated for the finder. If that's not happening can you verify it against the OC4J v903 production release and see if it is still happening. I don't know if this helps with the JDeveloper problem specifically but if you don't need to create your own finders then that I hope should help.
    Thanks -- Jeff

  • Having trouble with ejb jar...

    Hi experts,
    I've created a simple Java Enterprise Application project. Which contain, a web client and a ejb. The ejb package (ejb jar) contain one session interface and a session object. The web package (war) contain a index.jps which call a serlet (controller). This servlet invoke an object located into the ejb jar project. I don't want to create a .ear.
    I deployed both files into a glassfish server. So, i'm getting a .war file and ejb .jar file. Now, my question is why am i having a ClassNotFound exception when the servlet invoke the ClientSessionRemote interface of the ejb? Currently, the only way i've found to remove this exception is to include the ejb jar file into the classpath of the war... but it doesn't make sens!
    any help would be appreciate.
    I joined some code....
    ClientSessionRemote.java
    package com.imagem;
    import javax.ejb.Remote;
    @Remote
    public interface ClientSessionRemote {
       public java.lang.String SayHello();
    }ClientSession.java
    package com.imagem;
    import javax.ejb.Stateful;
    @Stateful
    public class ClientSession implements ClientSessionRemote  {
       public String SayHello(){
             String msg="Hello! I am Session Bean";
             System.out.println(msg);
             return msg;
    } Controller.java (servlet)
    public class Controller extends HttpServlet {
       @EJB
       private ClientSessionRemote m_testClientSessionBean;
       ...some code...
       public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          PrintWriter out;
          response.setContentType("text/html");
          String title = "EJB Example";
          out = response.getWriter();
          out.println("<html>");
          out.println("<head>");
          out.println("<title>Hello World Servlet!</title>");
          out.println("</head>");
          out.println("<body>");
          out.println("<p align=\"center\"><font size=\"4\" color=\"#000080\">Servlet Calling Session Bean</font></p>");
          try{
                //ClientSessionRemote client = (ClientSessionRemote) new InitialContext().lookup("java:comp/env/StatefulClientSession");
             //ClientSessionRemote client = (ClientSessionRemote) new InitialContext().lookup(ClientSessionRemote.class.getName());
             //out.println("<p align=\"center\"> Message from Session Bean is: <b>" + client.SayHello() + "</b></p>");
             //System.out.println("Message = " + client.SayHello());
             out.println("<p align=\"center\"> Message from Session Bean is: <b>" + m_testClientSessionBean.SayHello() + "</b></p>");
          catch(Exception CreateException){
             CreateException.printStackTrace();
          out.println("<p align=\"center\"><a href=\"javascript:history.back()\">Go to Home</a></p>");
          out.println("</body>");
          out.println("</html>");
          out.close();
       ...some code...
    }thks
    Mart.

    yorkroad wrote:
    If you just have the .war and .jar file deployed separatley then how is the Servlet going to know about the EJB classes? It doesn't, hence the ClassNotFoundException. You should at least include the EJB interfaces in the war file. Is there a particular reason for notwanting an .ear file? Just asking as it could simply things :)
    mI think you're seriously wrong on this one. Isn't the whole point of placing your logic in EJBs in not having to include anything in separate projects that are going to share it?
    @pm.renaud
    It could be the @EJB annotation. It doesn't work properly on some app servers (though I believe it should work just fine on Glassfish). Try getting to the EJB manually, through a JNDI call.

  • JDeveloper Unilateral relationship ejb-jar.xml verifying error

    I am huge difficulty with tables that have relationships mapping in one direction (unilateral).
    If I give you a really basic scenario of table Emp which has Employee information and a Dept_no foreign key. I also have a table Dept which has department info and includes it's primary key of Dept_no.
    When dragging and dropping tables from the Oracle Database onto the UML Diagram (OC4J container), the relationships automatically configure as bilateral. The ejb-jar.xml builds and the verifying Enterprise Beans verifies OK. If I select the relationship on the diagram and change it to be unilateral from Employee -> Department, it will still compile the EJB related source, but the ejb-jar.xml file will no longer verify the Enterprise Beans.
    Now there have been a million ways that I have tried to get this simple example to work.
    Here's my ejb-jar.xml and the orion-ejb-jar.xml:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!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>
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>Dept</display-name>
    <ejb-name>Dept</ejb-name>
    <local-home>nz.co.fal.DeptLocalHome</local-home>
    <local>nz.co.fal.DeptLocal</local>
    <ejb-class>nz.co.fal.impl.DeptBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Long</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Dept</abstract-schema-name>
    <cmp-field>
    <field-name>deptno</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>dname</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>loc</field-name>
    </cmp-field>
    <primkey-field>deptno</primkey-field>
    </entity>
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>Emp</display-name>
    <ejb-name>Emp</ejb-name>
    <local-home>nz.co.fal.EmpLocalHome</local-home>
    <local>nz.co.fal.EmpLocal</local>
    <ejb-class>nz.co.fal.impl.EmpBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Long</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Emp</abstract-schema-name>
    <cmp-field>
    <field-name>empno</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>ename</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>job</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>mgr</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>hiredate</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>sal</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>comm</field-name>
    </cmp-field>
    <primkey-field>empno</primkey-field>
    </entity>
    </enterprise-beans>
    <relationships>
    <ejb-relation>
    <ejb-relation-name>Emp - Dept</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Dept may have one Emp</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Dept</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Emp may have one Dept</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Emp</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>dept_deptno</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    </ejb-jar>
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
    <enterprise-beans>
    <entity-deployment name="Dept" data-source="jdbc/Connection1DS" table="DEPT">
    <primkey-mapping>
    <cmp-field-mapping name="deptno" persistence-name="DEPTNO" persistence-type="NUMBER(2)"/>
    </primkey-mapping>
    <cmp-field-mapping name="deptno" persistence-name="DEPTNO" persistence-type="NUMBER(2)"/>
    <cmp-field-mapping name="dname" persistence-name="DNAME" persistence-type="VARCHAR2(14)"/>
    <cmp-field-mapping name="loc" persistence-name="LOC" persistence-type="VARCHAR2(13)"/>
    </entity-deployment>
    <entity-deployment name="Emp" data-source="jdbc/Connection1DS" table="EMP">
    <primkey-mapping>
    <cmp-field-mapping name="empno" persistence-name="EMPNO" persistence-type="NUMBER(4)"/>
    </primkey-mapping>
    <cmp-field-mapping name="empno" persistence-name="EMPNO" persistence-type="NUMBER(4)"/>
    <cmp-field-mapping name="ename" persistence-name="ENAME" persistence-type="VARCHAR2(10)"/>
    <cmp-field-mapping name="job" persistence-name="JOB" persistence-type="VARCHAR2(9)"/>
    <cmp-field-mapping name="mgr" persistence-name="MGR" persistence-type="NUMBER(4)"/>
    <cmp-field-mapping name="hiredate" persistence-name="HIREDATE" persistence-type="DATE"/>
    <cmp-field-mapping name="sal" persistence-name="SAL" persistence-type="NUMBER(7,2)"/>
    <cmp-field-mapping name="comm" persistence-name="COMM" persistence-type="NUMBER(7,2)"/>
    <cmp-field-mapping name="dept_deptno">
    <entity-ref home="Dept">
    <cmp-field-mapping persistence-name="DEPTNO" persistence-type="NUMBER(2)"/>
    </entity-ref>
    </cmp-field-mapping>
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping impliesAll="true" name="<default-ejb-caller-role>"/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    DeptBean.java (Department ejb Bean class)
    package nz.co.fal.impl;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import java.util.Collection;
    import nz.co.fal.EmpLocal;
    public abstract class DeptBean implements EntityBean {
    private EntityContext context;
    public Long ejbCreate() {
    return null;
    public void ejbPostCreate() {
    public Long ejbCreate(Long deptno) {
    setDeptno(deptno);
    return deptno;
    public void ejbPostCreate(Long deptno) {
    public void ejbActivate() {
    public void ejbLoad() {
    public void ejbPassivate() {
    public void ejbRemove() {
    public void ejbStore() {
    public void setEntityContext(EntityContext ctx) {
    this.context = ctx;
    public void unsetEntityContext() {
    this.context = null;
    public abstract Long getDeptno();
    public abstract void setDeptno(Long newDeptno);
    public abstract String getDname();
    public abstract void setDname(String newDname);
    public abstract String getLoc();
    public abstract void setLoc(String newLoc);
    DeptLocal.java
    package nz.co.fal;
    import javax.ejb.EJBLocalObject;
    import java.util.Collection;
    public interface DeptLocal extends EJBLocalObject {
    Long getDeptno();
    void setDeptno(Long newDeptno);
    String getDname();
    void setDname(String newDname);
    String getLoc();
    void setLoc(String newLoc);
    DeptLocalHome.java
    package nz.co.fal;
    import javax.ejb.EJBLocalHome;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import java.util.Collection;
    public interface DeptLocalHome extends EJBLocalHome {
    DeptLocal create() throws CreateException;
    DeptLocal findByPrimaryKey(Long primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    DeptLocal create(Long deptno) throws CreateException;
    EmpBean.java (ejb Bean class for Emp)
    public abstract class EmpBean implements EntityBean {
    private EntityContext context;
    public Long ejbCreate() {
    return null;
    public void ejbPostCreate() {
    public Long ejbCreate(Long empno) {
    setEmpno(empno);
    return empno;
    public void ejbPostCreate(Long empno) {
    public void ejbActivate() {
    public void ejbLoad() {
    public void ejbPassivate() {
    public void ejbRemove() {
    public void ejbStore() {
    public void setEntityContext(EntityContext ctx) {
    this.context = ctx;
    public void unsetEntityContext() {
    this.context = null;
    public abstract Long getEmpno();
    public abstract void setEmpno(Long newEmpno);
    public abstract String getEname();
    public abstract void setEname(String newEname);
    public abstract String getJob();
    public abstract void setJob(String newJob);
    public abstract Long getMgr();
    public abstract void setMgr(Long newMgr);
    public abstract Timestamp getHiredate();
    public abstract void setHiredate(Timestamp newHiredate);
    public abstract Long getSal();
    public abstract void setSal(Long newSal);
    public abstract Long getComm();
    public abstract void setComm(Long newComm);
    public abstract DeptLocal getDept_deptno();
    public abstract void setDept_deptno(DeptLocal newDept_deptno);
    EmpLocal.java (ejb local interface for Emp)
    package nz.co.fal;
    import javax.ejb.EJBLocalObject;
    import java.sql.Timestamp;
    public interface EmpLocal extends EJBLocalObject {
    Long getEmpno();
    void setEmpno(Long newEmpno);
    String getEname();
    void setEname(String newEname);
    String getJob();
    void setJob(String newJob);
    Long getMgr();
    void setMgr(Long newMgr);
    Timestamp getHiredate();
    void setHiredate(Timestamp newHiredate);
    Long getSal();
    void setSal(Long newSal);
    Long getComm();
    void setComm(Long newComm);
    DeptLocal getDept_deptno();
    void setDept_deptno(DeptLocal newDept_deptno);
    EmpLocalHome.java (ejb local home for Emp)
    package nz.co.fal;
    import javax.ejb.EJBLocalHome;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import java.util.Collection;
    public interface EmpLocalHome extends EJBLocalHome {
    EmpLocal create() throws CreateException;
    EmpLocal findByPrimaryKey(Long primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    EmpLocal create(Long empno) throws CreateException;
    that's probably all the relevant information.
    As I said if I can't map relationships unilaterally from Oracle tables, then that is a huge issue for our project.
    Any Help, would be fantastic - THANKYOU.
    Geoff

    Geoff,
    please repost your question in the JDeveloper forum
    JDeveloper and ADF
    the JDeveloper product management team monitors their forum and you will receive a faster response.
    thanks - OTN

  • Error defining transaction-isolation at weblogic-ejb-jar.xml

    Hi,
    .. from WebLogic 5.1 reference:
    (...) the top level elements in weblogic-ejb-jar.xml are as follows:
    . description
    . weblogic-version
    . weblogic-enterprise-bean
    . ejb-name
    . caching-descriptor
    . presistence-descriptor
    . clustering-descriptor
    . transaction-descriptor
    . reference-descriptor
    . enable-call-by-reference
    . jndi-name
    . TRANSACTION-ISOLATION
    . security-role-assignment
    this way i've appended a transaction isolation section immediatly after the jndi-name section
    from my weblogic-ejb-jar.xml file to specify that all methods of my container-managed ejb
    should use read-committed accesses to the database. But i've gotten the error message:
    org.xml.sax.SAXParseException: Element "weblogic-enterprise-bean" allows no further input; "transaction-isolation" is not allowed.
    during compilation time at parsing. Nowhere else in the weblogic-ejb-jar.xml i can put the
    isolation transaction section without receiving some related parsing error. The same happens
    trying to include such transaction section at ejb-jar.xml. I'm attaching both xml files. Should
    anybody help me saying where that section should be described? And if it should be placed in
    another file, why the documentation states for describing it at the weblogic-ejb-jar.xml?
    [weblogic-ejb-jar.xml]

    That means that you do not have the SP6 in the service pack and it is using
    the old DTD.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    +1.617.623.5782
    WebLogic Consulting Available
    "Ana Benites" <[email protected]> wrote in message
    news:[email protected]...
    >
    Cameron,
    hello.
    When you say "<enterprise-bean>" block, you mean"<weblogic-enterprise-bean>"block, isn't it?
    >
    Because you recommend in your response exactly what i was doing in myweblogic-ejb-jar.xml,
    >
    that i had attached to my message when openning this discussion. I copyit again here:
    >
    My weblogic-ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
    >
    >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>cluster.ejb.TellerHome</ejb-name>
    <caching-descriptor>
    </caching-descriptor>
    <enable-call-by-reference>False</enable-call-by-reference>
    <jndi-name>cluster.ejb.TellerHome</jndi-name>
    <transaction-isolation>
    <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
    >
    <method>
    <ejb-name>cluster.ejb.TellerHome</ejb-name>
    <method-name>*</method-name>
    </method>
    </transaction-isolation>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ...and this is resulting in the following parsing error during compiletime:
    >
    >
    org.xml.sax.SAXParseException: Element "weblogic-enterprise-bean" allowsno further input; "transaction-isolation" is not allowed.
    at com.sun.xml.parser.Parser.error(Parser.java:2775)
    atcom.sun.xml.parser.ValidatingParser$ChildrenValidator.consume(ValidatingPars
    er.java:306)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1280)
    at com.sun.xml.parser.Parser.content(Parser.java:1498)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
    at com.sun.xml.parser.Parser.content(Parser.java:1498)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:491)
    at com.sun.xml.parser.Parser.parse(Parser.java:283)
    at weblogic.xml.dom.SunDOMParser.getDocument(SunDOMParser.java:69)
    at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:102)
    atweblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.java:157
    at weblogic.ejbc.runBody(ejbc.java, Compiled Code)
    at weblogic.utils.compiler.Tool.run(Tool.java:80)
    at weblogic.ejbc.main(ejbc.java:353)
    Am i forgetting anything?
    Thanks for your help
    Ana.
    "Cameron Purdy" <[email protected]> wrote:
    Hi Ana,
    Add to weblogic-ejb-jar.xml:
    Inside each <enterprise-bean> block, add the following immediately before
    the block closes:
    <transaction-isolation>
    <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
    <method>
    <ejb-name></ejb-name>
    <method-name>*</method-name>
    </method>
    </transaction-isolation>
    The <ejb-name> value of the <method> block of the <transaction-isolation>
    block must match the <ejb-name> value of the <enterprise-bean> block.
    Please note the case sensitive nature of the values.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    +1.617.623.5782
    WebLogic Consulting Available
    "Ana Benites" <[email protected]> wrote in message
    news:[email protected]...
    Thanks for your attention Cameron,
    from my WebLogic Console one can read
    "WebLogic Build 5.1.0 Service Pack 6 09/20/2000 21:03:19#84511"
    ...because i was suspecting the problem was due to a lack of
    applying
    the service pack 6. But even
    after that upgrade the parsing errors remain.
    regards
    Ana
    "Cameron Purdy" <[email protected]> wrote:
    Ana,
    The 5.1 release did NOT support transaction isolation in the
    weblogic-ejb-jar.xml file.
    That feature was introduced in a service pack. What SP are you using?
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    +1.617.623.5782
    WebLogic Consulting Available
    "Ana Benites" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    .. from WebLogic 5.1 reference:
    (...) the top level elements in weblogic-ejb-jar.xml are as follows:
    description
    weblogic-version
    weblogic-enterprise-bean
    . ejb-name
    . caching-descriptor
    . presistence-descriptor
    . clustering-descriptor
    . transaction-descriptor
    . reference-descriptor
    . enable-call-by-reference
    . jndi-name
    . TRANSACTION-ISOLATION
    security-role-assignment
    this way i've appended a transaction isolation section immediatly
    after
    the jndi-name section
    from my weblogic-ejb-jar.xml file to specify that all methods of mycontainer-managed ejb
    should use read-committed accesses to the database. But i've gotten
    the
    error message:
    org.xml.sax.SAXParseException: Element "weblogic-enterprise-bean"
    allows
    no further input; "transaction-isolation" is not allowed.
    during compilation time at parsing. Nowhere else in theweblogic-ejb-jar.xml i can put the
    isolation transaction section without receiving some related parsingerror. The same happens
    trying to include such transaction section at ejb-jar.xml. I'm
    attaching
    both xml files. Should
    anybody help me saying where that section should be described? And
    if
    it
    should be placed in
    another file, why the documentation states for describing it at theweblogic-ejb-jar.xml?

Maybe you are looking for

  • NOKIA Lumia 710: Touch screen focus no longer work...

    Hello. I've only had my Lumia 710 for two weeks.  Up until 4 days ago, the touch screen focus attribute was working perfectly.  I was taking pictures and it simply stopped working. I've since tried resetting the camera options back to defaults with n

  • Need alternatives for my code...

    Hello experts, I am currently modifying a code where it seems it doesnt pass the data to be fetched into the variables v_usnam and v_ppnam. I checked BSAK table and there is a data on it. Anyway, when I tries to remove the AT NEW statement, it worked

  • Table Control in LSMW

    Hi All, I have used XK01 tcode to upload vendor details as well bank details.Bank details are in Table Control. Here in this table control the number of visible rows are 5. And I did LSMW, recording for one vendor with 5 bank details. I have taken al

  • Recon for Vendor Master

    HI Guru's, How to system identify the Recon account for vendor master.. what is the link between vendor master and GL.. regards Dhana

  • Whats the difference between Cost  and (%CPU)

    whats the difference between Cost (%CPU) in the newest version of the explain plan and just Cost in the Older versions?