Error while migrating orion-ejb-jar.xml from OC4J 9.0.4.1

I am trying to use Toplink migration tool to take our existing orion-ejb-jar.xml file and toplink-ejb-jar.xml file to new 10.1.3 deployment. While running the migration tool I get the following error
WARNING: Oc4j native CMP setting optimistic-locking on
entity(TransactionTypeEntityBean) is not migrated and supported.
java.lang.IllegalArgumentException: MWDatabaseField[9BE2B5]
(TAX_RULE.TAX_RULE_ID)
at
oracle.toplink.workbench.mappingsmodel.desc.relational.MWRelationalPrima
ryKeyPolicy.addPrimaryKey(MWRelationalPrimaryKeyPolicy.java:99)
at
oracle.toplink.tools.migration.RuntimeCMPProjectToMWProjectConverter.con
vertDescriptor(RuntimeCMPProjectToMWProjectConverter.java:297)
at
oracle.toplink.tools.migration.RuntimeCMPProjectToMWProjectConverter.con
vertDescriptors(RuntimeCMPProjectToMWProjectConverter.java:265)
at
oracle.toplink.tools.migration.RuntimeCMPProjectToMWProjectConverter.con
vertProject(RuntimeCMPProjectToMWProjectConverter.java:144)
at
oracle.toplink.tools.migration.MigrationManagerBase.convertAndWriteoutMW
Project(MigrationManagerBase.java:369)
at
oracle.toplink.tools.migration.MigrationManagerBase.migrate(MigrationMan
agerBase.java:358)
at
oracle.toplink.tools.migration.io.MigrationIOManager.buildMigratedJarFil
e(MigrationIOManager.java:243)
at
oracle.toplink.tools.migration.io.MigrationIOManager.operateEarEntry(Mig
rationIOManager.java:181)
at
oracle.toplink.tools.migration.io.MigrationIOManager.operateEar(Migratio
nIOManager.java:145)
at
oracle.toplink.tools.migration.io.MigrationIOManager.operateIO(Migration
IOManager.java:88)
at
oracle.toplink.tools.migration.MigrationManagerBase.startMigration(Migra
tionManagerBase.java:280)
at
oracle.toplink.tools.migration.MigrationManagerBase.run(MigrationManager
Base.java:121)
at
oracle.toplink.tools.migration.MigrationManagerBase.run(MigrationManager
Base.java:97)
at
oracle.toplink.tools.migration.TopLinkCMPMigrator.main(TopLinkCMPMigrato
r.java:59)

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

Similar Messages

  • Weblogic Migration /  orion-ejb-jar.xml

    What is the best way to create the orion-ejb-jar.xml when migrating from Weblogic? This could be a utility that converts the weblogic deployment descriptors or a tool that helps me quickly create a new orion-ejb-jar.xml.
    I have quite a few so a manual process is less desirable.
    Thanks!

    Hi,
    Im not aware of any tool, but here's a whitepaper on switching from WL to 9iAS,
    http://otn.oracle.com/tech/migration/content.html
    http://otn.oracle.com/products/ias/pdf/weblogic_migration.pdf
    Hope this helps,
    Neelesh Shastry
    OTN Team @ IDC

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

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

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

  • Orion-ejb-jar.xml is overwritten every deployment and not using from .jar

    My application is an ear file containing a single jar and a war.
    My configuration looks like:
    /applications/<appname>/myejbs.jar
    within myejbs.jar, exists meta-inf\orion-ejb-jar.xml
    Every time I redeploy (copy .ear into /applications and restart server) a version of orion-ejb-jar.xml is copied into /application-deployments/myejbs/orion-ejb-jar.xml but it is not the version that I bundle within my jar. It appears this is the auto-generated version.
    Why is this file being overwritten? I thought it should detect if a version of orion-ejb-jar already exists and leave it intact if so. Is there a config setting I've missed somewhere?

    Well, we had the some problem.
    We solved it when we wrote in the orion-ejb-jar.xml deployment version for actual oc4j.
    example orion-ejb-jar.xml for oc4j 904:
    <orion-ejb-jar deployment-version="9.0.4.0.0">
    or
    <orion-ejb-jar deployment-version="1.5.0">
    example orion-ejb-jar.xml for oc4j 903:
    <orion-ejb-jar deployment-version="9.0.3.0.0">
    Zajo

  • Generated orion-ejb-jar.xml

    I have app. which run under oc4j(version 020725.1695). If I try new
    oc4j(version 020927.1699), app doesn't run.
    If I compare generated orion-ejb-jar.xml by oc4j(version 020725.1695)
    with generated orion-ejb-jar.xml by oc4j(version 020927.1699) there
    is a differnce.
    What I'm doing wrong?
    thanks for any idea.
    Jan
    Differnce:
    Relationship
    my orion-ejb-jar.xml in project:
    <cmp-field-mapping name="samaCase">
         <entity-ref home="CaseBean">
    <cmp-field-mapping name="samaCase">
    <fields>
    <cmp-field-mapping name="oid" persistence-name="CASE_ID"/>
    </fields>
    </cmp-field-mapping>
    </entity-ref>
    </cmp-field-mapping>
    oc4j(version 020725.1695):
    <cmp-field-mapping name="samaCase">
    <entity-ref home="CaseBean">
    <cmp-field-mapping name="samaCase">
    <fields>
    ? <cmp-field-mapping name="oid" persistence-name="CASE_ID" />
    </fields>
    </cmp-field-mapping>
    </entity-ref>
    </cmp-field-mapping>
    oc4j(version 020927.1699):
    <cmp-field-mapping name="samaCase">
    <entity-ref home="CaseBean">
    <cmp-field-mapping name="samaCase">
    <fields>
    ? <cmp-field-mapping name="oid" persistence-name="OID" />
    </fields>
    </cmp-field-mapping>
    </entity-ref>
    </cmp-field-mapping>
    finders:
    my orion-ejb-jar.xml in project:
    - none
    oc4j(version 020725.1695):
    ? <finder-method query="SELECT oid FROM SM_RATE" partial="false">
    ? <!-- Generated SQL: "SELECT oid FROM SM_RATE" -->
    <method>
    <ejb-name>RateBean</ejb-name>
    <method-name>findAll</method-name>
    <method-params>
    </method-params>
    </method>
    </finder-method>
    oc4j(version 020927.1699):
    ? <finder-method>
    ? <!-- Generated SQL: "select SM_RATE.OID from SM_RATE -->
    <method>
    <ejb-name>RateBean</ejb-name>
    <method-name>findAll</method-name>
    <method-params>
    </method-params>
    </method>
    </finder-method>

    well, actually we delete the previously deployed application always. (we had to do it in old one, and also we try it in new oc4j. It didn't help.). New oc4j always rewrite our persistence-name CASE_ID on OID.
    You are right, we have mapping on old orion-ejb-jar.xml too. The purpose is that we have a variable samaCase and the colum in the table is CASE_ID.
    The question is, what we are doing wrong? Our app is running in old oc4j(version 020725.1695), and not in new oc4j(version 020725.1695). The problem is in the EJB relatinship.
    EJB-QL - ok.
    There is missing : " on the end. (behind the table name SN_RATE) Is it ok?
    <!-- Generated SQL: "select SM_RATE.OID from SM_RATE -->
    Jan

  • OC4J9.0.4 generates orion-ejb-jar.xml instead of using mine !!!

    META-INF directory of my EJB module of the EAR archive contains two descriptors: ejb-jar.xml and orion-ejb-jar.xml. But when I deploy the application OC4J generates its own orion-ejb-jar.xml and replaces mine with it. How it could be ?

    Hi Avi,
    I assume you are talking about your development
    environment (as opposed to your production
    environment). You do know that if you edit the
    deployed "orion-ejb-jar.xml" file, OC4J will pick
    that up and automatically re-deploy, don't you? Or
    simply copy your new "orion-ejb-jar.xml" file to the
    same directory as the deployed one (thus overwriting
    it) -- same effect.This is exactly what I end up doing. Are you saying that
    (a) the production environment will not suffer from this problem? (if so, how?)
    (b) I will have to edit the deployed orion-ejb-jar.xml file every time I deploy to production (admittedly, not too frequently)?
    regards
    George

  • Orion-ejb-jar.xml being ignored

    In oc4j 903 my orion-ejb-jar.xml file is being ignored at deployment time. It is in the META-INF directory of the ejb jar. Any ideas?

    changes to this file only get reflected if the tags exist initially. You can;t add new tags and hope to see them miraculously appear - which would be nice! Delete the orion-ejb-jar.xml from the application-deployments directory of your app, and redeploy, a new deployment version of the file will be generated.

  • Oc4j generated finders in orion-ejb-jar.xml file causing errors

    Any information or assistance would be greatly appreciated.
    I have encountered a problem with the generated orion-ejb-jar.xml file.
    It looks like the additional finder methods that are generated when the application
    is deployed are incorrect from the 9.0.3 version to the new 10.1.2.0.2 version.
    The original content of orion-ejb-jar.xml before additional finder syntax is added:
    <finder-method query=
    "NO_SYS_USER_OBJECT_HISTORY.USER_ID=UPPER($1) and
      NO_SYS_USER_OBJECT_HISTORY.AUTOID NOT IN(
      SELECT H1.AUTOID                             
      FROM   NO_SYS_USER_OBJECT_HISTORY H1,                                
             (SELECT AUTOID                                     
              FROM   NO_SYS_USER_OBJECT_HISTORY                                    
              WHERE  USER_ID=UPPER($1)                                    
              ORDER BY DATE_TIME DESC) H2                            
      WHERE  ROWNUM &lt;= $2
        AND  H1.AUTOID = H2.AUTOID)">
    <method>
      <ejb-name>NoUserHistoryEntry</ejb-name>
      <method-name>findOldest</method-name>
      <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Integer</method-param>
      </method-params>
    </method>
    </finder-method>
    After deploying in 9.0.3 the following information is added to the orion-ejb-jar.xml file:
    <finder-method query=
    "NO_SYS_USER_OBJECT_HISTORY.USER_ID=UPPER($1) and
      NO_SYS_USER_OBJECT_HISTORY.AUTOID NOT IN(
      SELECT H1.AUTOID
      FROM   NO_SYS_USER_OBJECT_HISTORY H1,
             (SELECT AUTOID                                     
              FROM   NO_SYS_USER_OBJECT_HISTORY
              WHERE  USER_ID=$1   
              ORDER BY DATE_TIME DESC) H2
      WHERE  ROWNUM &lt;= $2
        AND  H1.AUTOID = H2.AUTOID)">
    <!-- Generated SQL:
      "select NO_SYS_USER_OBJECT_HISTORY.autoid
       from   NO_SYS_USER_OBJECT_HISTORY
       where  NO_SYS_USER_OBJECT_HISTORY.USER_ID=UPPER(?)
         and  NO_SYS_USER_OBJECT_HISTORY.AUTOID NOT IN(
              SELECT H1.AUTOID                             
              FROM   NO_SYS_USER_OBJECT_HISTORY H1,
                     (SELECT AUTOID
                      FROM   NO_SYS_USER_OBJECT_HISTORY
                      WHERE  USER_ID=?
                      ORDER BY DATE_TIME DESC) H2
              WHERE ROWNUM <= ?
                AND H1.AUTOID = H2.AUTOID) -->
    <method>
      <ejb-name>NoUserHistoryEntry</ejb-name>
      <method-name>findOldest</method-name>
      <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Integer</method-param>
      </method-params>
    </method>
    </finder-method>
    After deploying in 10.1.2.0.2 the following information is added to the
    orion-ejb-jar.xml file:
    <finder-method query=
    "NO_SYS_USER_OBJECT_HISTORY.USER_ID=UPPER($1) and
      NO_SYS_USER_OBJECT_HISTORY.AUTOID NOT IN(
      SELECT H1.AUTOID
      FROM   NO_SYS_USER_OBJECT_HISTORY H1,
             (SELECT AUTOID
              FROM   NO_SYS_USER_OBJECT_HISTORY
              WHERE  USER_ID=UPPER($1)
              ORDER BY DATE_TIME DESC) H2
      WHERE  ROWNUM &lt;= $2
        AND  H1.AUTOID = H2.AUTOID)">
    <!-- Generated SQL (pk only):
      "select H1.autoid
       from   NO_SYS_USER_OBJECT_HISTORY
       where  NO_SYS_USER_OBJECT_HISTORY.USER_ID=UPPER(?)
         and  NO_SYS_USER_OBJECT_HISTORY.AUTOID NOT IN(
              SELECT H1.AUTOID
              FROM   NO_SYS_USER_OBJECT_HISTORY H1,
                     (SELECT AUTOID
                      FROM   NO_SYS_USER_OBJECT_HISTORY
                      WHERE  USER_ID=UPPER(?)
                      ORDER BY DATE_TIME DESC) H2
              WHERE  ROWNUM <= ?
                AND  H1.AUTOID = H2.AUTOID) -->
    <!-- Generated SQL (all columns):
      "select H1.autoid, H1.USER_ID, H1.OBJECT_CLASS_ID,
                 H1.DATE_TIME, H1.COMMENT_TEXT, H1.ACTION,
                 H1.ACTION_DATA, H1.SITE_DESCRIPTION
       from   NO_SYS_USER_OBJECT_HISTORY
       where  NO_SYS_USER_OBJECT_HISTORY.USER_ID=UPPER(?)
         and  NO_SYS_USER_OBJECT_HISTORY.AUTOID NOT IN(
              SELECT H1.AUTOID
              FROM   NO_SYS_USER_OBJECT_HISTORY H1,
                     (SELECT AUTOID
                      FROM   NO_SYS_USER_OBJECT_HISTORY
                      WHERE  USER_ID=UPPER(?)
                      ORDER BY DATE_TIME DESC) H2
              WHERE  ROWNUM <= ?
                AND  H1.AUTOID = H2.AUTOID) -->
    <method>
      <ejb-name>NoUserHistoryEntry</ejb-name>
      <method-name>findOldest</method-name>
      <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Integer</method-param>
      </method-params>
    </method>
    </finder-method>
    The problem with the 10.1.2.0.2 generated finders is that it is prepending H1 when
    it should be NO_SYS_USER_OBJECT_HISTORY which results in the following error:
    Exception in thread "main" com.cdtelecom.vygroe.configuration.ConfigurationException:
    com.evermind.server.rmi.OrionRemoteException:
    Transaction was rolled back: Database error: java.sql.SQLException:
    ORA-00904: "H1"."SITE_DESCRIPTION": invalid identifier
    ; nested exception is:
            java.sql.SQLException: ORA-00904: "H1"."SITE_DESCRIPTION": invalid identifier
            at com.cdtelecom.vygroe.configuration.ConfigurationSession.internalRecordAction(ConfigurationSession.java:869)
            at com.cdtelecom.vygroe.configuration.ConfigurationSession.recordAction(ConfigurationSession.java:401)
            at com.cdtelecom.vygroe.configuration.Configuration.recordActionSaveOrder(Configuration.java:886)
            at com.cdtelecom.vygroe.configuration.Configuration.getOrder(Configuration.java:239)
            at test10g.main(test10g.java:47)
    I tried to manually edit the file but when I shutdown and restart oc4j it regenerates the file again.

    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

  • How to prevent OC4J generating DD file orion-ejb-jar.xml?

    I am doing a migration from JBoss to OC4J. I already have the ejb-jar.xml file which is working under JBoss. The xDoclet generate all the parts except the CMR parts so I deployed the ear file without orion-ejb-jar.xml and I got generated version from OC4J. I merge the xDoclet version with the OC4J generated version by adding the CMR parts into my xDoclet version and modify the table name and persistance fields name generated by OC4J. I don't want to mapping all the relationships so I use:
    <ejb-relation >
    <ejb-relation-name>AppReport-User</ejb-relation-name>
    <ejb-relationship-role >
    <ejb-relationship-role-name>the-User-of</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source >
    <ejb-name>AppReports</ejb-name>
    </relationship-role-source>
    <cmr-field >
    <cmr-field-name>user</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role >
    <ejb-relationship-role-name>the-appreports-of</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source >
    <ejb-name>Users</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    Here I just want unidirectional EJB AppReports refewrence to Users but I don't want Users EJB reference back to AppReports. The OC4j will generate DD file orion-ejb-jar.xml again with all the missing parts combined with my merged version orion-ejb-jar.xml and put it under my deploment directory. It seems it voilate the ejb-jar.xml since I don't have <cmr-field-name> defined for AppReports. My question is how I can control this way and let OC4J not generate orion-ejb-jar.xml again.

    You need to have the orion-ejb-jar.xml in your app before you initially deploy it, otherwise OC4J will automatically create it for you. I would take to copy of the orion-ejb-jar.xml that is a result of the combination of OC4J and XDoclet generated and add this to my code base as the de-facto orion deployment descriptor to be included in all app deployments. On deploying the app, OC4J will see that a orion-ejb-jar file already exists and will not auto create one. Hope this makes sense!

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

  • Orion-ejb-jar works in oc4j, but seemingly ignored while running in jdev

    I'm using OC4J 9.0.2.0 and JDeveloper 9.0.2.
    I have a set of entity classes. I'm trying to map the entity name to a different table name, and map the field names to different column names.
    I have an ejb-jar.xml that sets the ejb-name, and I have an orion-ejb-jar.xml that uses the ejb-name, specifies a "table-name", and uses "cmp-field-mapping" elements. The "table-name" and "cmp-field-mapping" elements do what I said, using a table name different from the ejb name, and db column names different from the field names.
    When I build and deploy this in standalone OC4J, it works fine. It creates the exact table and column names that I specified.
    Now, how the heck do I get this to work in JDeveloper 9.0.2? Is this impossible as of this version? I need to know this.
    In JDeveloper, I can edit the orion-ejb-jar.xml file, and I can do the "Edit Settings" option, and that all looks correct, but when I finally run the embedded OC4J, it creates the wrong tables with the wrong attributes.

    I tried a simple test case and it seems to work fine
    I create a entity bean by name "foo" with 2 fields "col1" (CMP PK) and "col2" (CMP field)
    Select orion-ejb-jar.xml in project and right-click on it and choose settings
    Select foo in the upper left hand items
    Added table name on the right hand side "deployfoo"
    Select CMP Field Mappings on the lower left hand side
    Select col1 and in the persistence name add "firstcolumn"
    Seelct col2 and in the persistence namd add "secondcolumn"
    When I run the bean the table is created with the above name and columns
    Message in log window
    <<
    Auto-creating table: create table deployfoo (firstcolumn VARCHAR2(255) not null primary key, secondcolumn VARCHAR2(255) null)
    >>>
    raghu
    JDev Team

  • 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

  • JDeveloper / OC4J rewriting my orion-ejb-jar.xml

    Hi All.
    Im having a play around with OC4J and CMP entity beans and struts at the moment learning some stuff for a new job, so ive started to write a little test app to get used to things.
    Ive created a CMP entity - CustomerEntityEJB, manually defined the tables etc wrote and built it using JDeveloper 10.
    Ive created all the necessary classes and descriptors in JDeveloper and the bean compiles and deploys fine, however no matter what i do, the table attribute of the <entity-deployment> elemnt is ALWAYS removed from the orion-ejb-jar.xml file before its deployed and i have no idea why.
    Here are some snippets form the xml config files im using....
    ejb-jar.xml :
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>CustomerEntityEJB</display-name>
    <ejb-name>CustomerEntityEJB</ejb-name>
    <local-home>com.gb.ejb.entity.customer.CustomerEntityEJBLocalHome</local-home>
    <local>com.gb.ejb.entity.customer.CustomerEntityEJBLocal</local>
    <ejb-class>com.gb.ejb.entity.customer.CustomerEntityEJBBean</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>CustomerEntityEJB</abstract-schema-name>
    <cmp-field>
    <field-name>id</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>title</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>forename</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>surname</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>email</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>password</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>active</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params/>
    </query-method>
    <ejb-ql>SELECT OBJECT(c) FROM CustomerEntityEJB c</ejb-ql>
    </query>
    </entity>
    orion-ejb-jar.xml as in JDeveloper:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <orion-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-ejb-jar-10_0.xsd" schema-major-version="10" schema-minor-version="0">
    <enterprise-beans>
    <persistence-manager name="toplink"/>
    <session-deployment name="CustomerSessionEJB" local-location="CustomerSessionEJB" />
    <entity-deployment name="CustomerEntityEJB" data-source="jdbc/PostgresDS" table="Customer" local-location="CustomerEntityEJB">
    <primkey-mapping>
    <cmp-field-mapping name="id"/>
    </primkey-mapping>
    <cmp-field-mapping name="active"/>
    <cmp-field-mapping name="email"/>
    <cmp-field-mapping name="forename"/>
    <cmp-field-mapping name="id"/>
    <cmp-field-mapping name="password"/>
    <cmp-field-mapping name="surname"/>
    <cmp-field-mapping name="title"/>
    </entity-deployment>
    </enterprise-beans>
    </orion-ejb-jar>
    orion-ejb-jar.xml as viewed in the OC4J enterprise manager.     
    <?xml version="1.0" encoding="utf-8"?>
    <orion-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-ejb-jar-10_0.xsd" deployment-version="10.1.3.3.0" deployment-time="1151415a0e3" schema-major-version="10" schema-minor-version="0" >
    <enterprise-beans>
    <persistence-manager name="toplink" class="oracle.toplink.internal.ejb.cmp.oc4j.Oc4jPersistenceManager" descriptor="toplink-ejb-jar.xml">
    </persistence-manager>
    <session-deployment name="CustomerSessionEJB" location="CustomerSessionEJB" local-location="CustomerSessionEJB" persistence-filename="CustomerSessionEJB">
    <ejb-ref-mapping name="ejb/local/CustomerEntityEJB" location="TWA-EJB_CustomerEntityEJBLocal" />
    </session-deployment>
    <entity-deployment name="CustomerEntityEJB" location="CustomerEntityEJB" local-location="CustomerEntityEJB" concrete-bean-class="CustomerEntityEJB_ConcreteSubClass3" data-source="jdbc/PostgresDS" local-wrapper="CustomerEntityEJBLocalHome_LocalEntityHomeWrapper5">
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping name="<default-ejb-caller-role>" impliesAll="true" />
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    As you can see, the orion-ejb-jar.xml that been deployed on the server has had extra attributes defined in it (like concrete-bean-class) which makessense - its adding in the bits i didnt to get th bean to deploy - however the table attribue is just removed, meaning my bean cant find the table - hence my app not working.
    i just dont know how to stop this and would be extremely grateful if someone could give me a clue how to get my bean up and working properly as this is driving me insane.
    Thanks in advance..
    Gareth.

    sorted - the <persistence-manager name="toplink"/> element was automatically generated by JDeveloper and put in my orion-ejb-jar.xml appears to be un necessary and seemed to be breaking eveything - as soon as i removed it, the bean seemed to deploy ok and pick up the table name =]
    as a bit of an aside does anyone know why it was automatically put there in the first place if it breaks things?

  • Ejb-jar.xml and orion-ejb-jar.xml configuration issue

    Chris,
    We have an application that uses the Oracle 10g Application Server and WebSphere MQ v5.3 w/ fixpack 9.
    Our application is a J2EE messaging system which essentially consists of Message Driven Beans, the EJB
    realization of the J2EE Java Message Service (JMS) API. Our application has Message Driven Beans which
    listen to queues and send messages to queues -- a simple messaging system. Currently we can listen to queues, but
    cannot send messages to queues in the Oracle 10g Application Server environment.
    Any J2EE application server has its own implementation of Java Naming Directory Interface (JNDI) API that
    deployed J2EE applications utilize to lookup resources such as Data Sources, JMS Destinations (i.e. MQ Queue),
    JMS QueueConnectionFactories (i.e. MQ QManagers).
    Our application uses the 3rd party JMS Provider, WebSphere MQ.
    MQ ships with a JMSAdmin tool which allows one to create JMS administered objects (i.e. objects a java
    application searches for in some JNDI directory) that reside in some JNDI context. We create a JNDI context for
    MQ resources, queues and QManagers. We configure the MQ provided
    JMSAdmin tool with two property name/value pairs:
    PROVIDER_URL=file:/opt/mqm/JNDI-Directory
    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    A resultant .bindings file is created in /opt/mqm/JNDI-Directory which represents our JDNI context
    containing our JMS administered objects. A standalone java application that needs to directly access this
    JNDI context can simply conduct a JNDI lookup on the following context: "java:comp/resource/MQSeries/". An
    example of how a standalone application would lookup a JMS administered object named "qNumber1" would be to
    lookup "java:comp/resource/MQSeries/qNumber1". This lookup would result in the standalone java application
    having a JMS reference to an MQ Queue.
    There is a major difference in how an enterprise EJB application deployed into a J2EE Container (Oracle 10g App Server)
    conducts a JNDI lookup on a 3rd party resource such as MQ as a JMS Provider. A typical EJB application deployed
    into a J2EE container as an .ear (enterprise archive) file has implicit access to the application server's own
    JNDI context. This JNDI context is usually "java:comp/env/". Looking up the Application Server's own Data Source or
    it's own JMS Resources is easy. An application that needs references to these Application Server provided resources
    simply conducts a lookup for "java:comp/env/jms/someQ" or "java:comp/env/jdbc/myDataSource".
    The problem we face is mapping our MQ JNDI context to the Oracle App Server's own JNDI context. We believe this is
    accomplished through mappings defined in both the ejb-jar.xml (EJB Descriptor) and the application server specific
    counterpart, orion-ejb-jar.xml. Note that Oracle 10g Application Server uses the popular orion J2EE container for
    hosting J2EE enterpise applications.
    Our Message Driven Beans (MDBs)currently listen to the Queue at the JNDI location "prodQ". Our problem is that we cannot
    get our MDB to send messages to any queues. Note that the MQ implementation of the queues and Queue Managers work
    flawlessly with standalone java applications. It's safe to say that the MQ objects are working.
    We are looking for a solid example of how the ejb-jar.xml and the orion-ejb-jar.xml map 3rd party JMS provider
    JNDI locations to the App Server's JNDI context.
    Below is how we have attempted to configure our own ejb-jar.xml and orion-ejb-jar.xml:
    ejb-jar.xml begin >>>>>>>>>>>>>>><?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>
    <display-name>Production Message Driven Bean</display-name>
    <enterprise-beans>
    <message-driven>
    <display-name>prodMdb</display-name>
    <ejb-name>prodMdb</ejb-name>
    <ejb-class>message.handler.AIDMSMessageConsumerBean</ejb-class>
    <transaction-type>Bean</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
         <resource-ref>
    <res-ref-name>prodQCF</res-ref-name>
    <res-type>javax.jms.QueueConnectionFactory</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
         <resource-ref>
    <res-ref-name>prodQ</res-ref-name>
    <res-type>javax.jms.Queue</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
                   <resource-ref>
    <res-ref-name>prodR</res-ref-name>
    <res-type>javax.jms.Queue</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>
    <<<<<<<< ejb-jar.xml end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    begin orion-ejb-jar.xml >>>>>>>>>>>>>>>>>>>>>>>>>>><orion-ejb-jar>
    <enterprise-beans>
    <message-driven-deployment name="prodMdb" connection-factory-location="java:comp/resource/MQSeries/prodQCF" destination-location="java:comp/resource/MQSeries/prodR">
              <resource-ref-mapping location="prodQ" name="prodQ">     
                   <lookup-context location="java:comp/resource/MQSeries/" >
                        <!-- <context-attribute name="java.naming.factory.initial"
                             value="com.sun.jndi.fscontext.RefFSContextFactory" /> -->
                   </lookup-context>
              </resource-ref-mapping>
              <resource-ref-mapping location="prodR" name="prodR">     
                   <lookup-context location="java:comp/resource/MQSeries/" >
                        <!-- <context-attribute name="java.naming.factory.initial"
                             value="com.sun.jndi.fscontext.RefFSContextFactory" /> -->
                   </lookup-context>
              </resource-ref-mapping>
         </message-driven-deployment>
    </enterprise-beans>
    </orion-ejb-jar>
    <<<<<<<<< end orion-ejb-jar.xml <<<<<<<<<<<<<<<<<<<<<<<<

    If you look at the contents of a deployment plan (Plan.xml) when you have it generated
    <deployment-plan ...>
      <module-override>
        <module-name>ejb.jar</module-name>
        <module-type>ejb</module-type>
        <module-descriptor external="true">
          <root-element>weblogic-ejb-jar</root-element>
          <uri>META-INF/weblogic-ejb-jar.xml</uri>
        </module-descriptor>
        <module-descriptor external="false">
          <root-element>ejb-jar</root-element>
          <uri>META-INF/ejb-jar.xml</uri>
        </module-descriptor>
        <module-descriptor external="true">
          <root-element>persistence-configuration</root-element>
          <uri>META-INF/persistence-configuration.xml</uri>
        </module-descriptor>
        <module-descriptor external="false">
          <root-element>persistence</root-element>
          <uri>META-INF/persistence.xml</uri>
        </module-descriptor>
      </module-override>
    </deployment-plan>You can see which files can be external and which can be not. The weblogic-ejb-jar.xml can be external
    but in this case you need a deployment plan to point weblogic to the file. The ejb-jar.xml cannot be
    external (see external=false)
    The benefit of storing the weblogic-ejb-jar.xml is that your administrator can fine tune certain
    configurations by using a deployment plan, instead of having to extract the contents from the jar file
    and then repackage it again.
    No need to worry about a clustered environment, you can place the jar and the deployment plan
    on the server where the admin server is located, when you deploy an application you deploy it to
    the cluster and everything is taken care off.
    More information on deployment plans can be found here: http://download.oracle.com/docs/cd/E11035_01/wls100/deployment/config.html

  • Null Pointer Exception in orion-ejb-jar.xml GUI editor

    Hi,
    I am getting a NPE when attempting to configure CMR mappings orion-ejb-jar.xml with the GUI/Properties Editor.
    Using 9.0.5.2 on Windows XP professional SP2
    Have defined the necessary <relationships> descriptors for this relation.
    1:M unidirectional from entity X to Entity Y
    1)Over orion-ejb-jar.xml right click and select 'Properties...'
    2) Highlight Entity X in properties gui and open the tree. Select 'CMP Field Mappings'.
    3)On the right pane there are two tabs 'CMP Field Mappings' and 'Relationship Mappings'. Select Relationship Mappings.
    4) Relationship Mappings tab now displayed with the above relationship displayed in drop down 'Relationship' tab.
    5) Regardless of whether I select any extra properties on the CMP Mapping, If I hit ok button I get the NPE shown below (n.b. All details filled in except the FK field on the many side of the relation - this is the only field I can enter on this window in this case.).
    java.lang.NullPointerException
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.saveCollectionMapping(RelationshipsPanel.java:1195)
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.saveOneToManyRelationship(RelationshipsPanel.java:748)
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.saveRelationship(RelationshipsPanel.java:528)
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.onExit(RelationshipsPanel.java:394)
         at oracle.ide.panels.TabbedPanel.exitCurrentTraversable(TabbedPanel.java:219)
         at oracle.ide.panels.TabbedPanel.onExit(TabbedPanel.java:106)
         at oracle.jdevimpl.deploy.ejb.oc4j.CmpFieldMappingsPanel.onExit(CmpFieldMappingsPanel.java:134)
         at oracle.ide.panels.MDDPanel.exitTraversable(MDDPanel.java:850)
         at oracle.ide.panels.MDDPanel.onExit(MDDPanel.java:290)
         at oracle.ide.panels.TDialog$L.vetoableChange(TDialog.java:72)
         at java.beans.VetoableChangeSupport.fireVetoableChange(VetoableChangeSupport.java:300)
         at java.beans.VetoableChangeSupport.fireVetoableChange(VetoableChangeSupport.java:217)
         at oracle.bali.ewt.dialog.JEWTDialog.fireVetoableChange(Unknown Source)
         at oracle.bali.ewt.dialog.JEWTDialog.dismissDialog(Unknown Source)
         at oracle.bali.ewt.dialog.JEWTDialog$UIListener.actionPerformed(Unknown Source)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
    <snip ....>
    Very good chance I am doing something wrong ! However, would be interested in getting a reason (or any lead for that matter) why JDev is throwing NPE in this case.
    Cheers
    Ben

    Hi,
    I am getting a NPE when attempting to configure CMR mappings orion-ejb-jar.xml with the GUI/Properties Editor.
    Using 9.0.5.2 on Windows XP professional SP2
    Have defined the necessary <relationships> descriptors for this relation.
    1:M unidirectional from entity X to Entity Y
    1)Over orion-ejb-jar.xml right click and select 'Properties...'
    2) Highlight Entity X in properties gui and open the tree. Select 'CMP Field Mappings'.
    3)On the right pane there are two tabs 'CMP Field Mappings' and 'Relationship Mappings'. Select Relationship Mappings.
    4) Relationship Mappings tab now displayed with the above relationship displayed in drop down 'Relationship' tab.
    5) Regardless of whether I select any extra properties on the CMP Mapping, If I hit ok button I get the NPE shown below (n.b. All details filled in except the FK field on the many side of the relation - this is the only field I can enter on this window in this case.).
    java.lang.NullPointerException
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.saveCollectionMapping(RelationshipsPanel.java:1195)
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.saveOneToManyRelationship(RelationshipsPanel.java:748)
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.saveRelationship(RelationshipsPanel.java:528)
         at oracle.jdevimpl.ejb.mapper.RelationshipsPanel.onExit(RelationshipsPanel.java:394)
         at oracle.ide.panels.TabbedPanel.exitCurrentTraversable(TabbedPanel.java:219)
         at oracle.ide.panels.TabbedPanel.onExit(TabbedPanel.java:106)
         at oracle.jdevimpl.deploy.ejb.oc4j.CmpFieldMappingsPanel.onExit(CmpFieldMappingsPanel.java:134)
         at oracle.ide.panels.MDDPanel.exitTraversable(MDDPanel.java:850)
         at oracle.ide.panels.MDDPanel.onExit(MDDPanel.java:290)
         at oracle.ide.panels.TDialog$L.vetoableChange(TDialog.java:72)
         at java.beans.VetoableChangeSupport.fireVetoableChange(VetoableChangeSupport.java:300)
         at java.beans.VetoableChangeSupport.fireVetoableChange(VetoableChangeSupport.java:217)
         at oracle.bali.ewt.dialog.JEWTDialog.fireVetoableChange(Unknown Source)
         at oracle.bali.ewt.dialog.JEWTDialog.dismissDialog(Unknown Source)
         at oracle.bali.ewt.dialog.JEWTDialog$UIListener.actionPerformed(Unknown Source)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
    <snip ....>
    Very good chance I am doing something wrong ! However, would be interested in getting a reason (or any lead for that matter) why JDev is throwing NPE in this case.
    Cheers
    Ben

Maybe you are looking for