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

Similar Messages

  • 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

  • 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

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

  • 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

  • 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

  • Configurable data-source in orion-ejb-jar.xml

    Hi,
    In my orion ejb-jar.xml file, I have hard coded data-source entries for all entity beans , i.e.
    <entity-deployment name="Customer" data-source="jdbc/slldev02DS" table="CUSTOMER">
    Is there any way, I can make this customizable, i.e. feed in or define a parameter?
    thanks in advance,
    Kevin

    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

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

  • No table name specified in ejb-jar.xml file

    Hi, I have an entity bean defined as follows:
    <enterprise-beans>
    <entity>
    <display-name>SponsorEJB</display-name>
    <ejb-name>SponsorEJB</ejb-name>
    <home>com.ultradns.j2ee.components.sponsor.ejb.SponsorHome</home>
    <remote>com.ultradns.j2ee.components.sponsor.ejb.Sponsor</remote>
    <ejb-class>com.ultradns.j2ee.components.sponsor.ejb.SponsorEJB</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
         <resource-ref>
              <res-ref-name>jdbc/jdbc/OracleDS</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
         </resource-ref>     
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>sponsor</abstract-schema-name>
    <cmp-field>
    <primkey-field>guid</primkey-field>
         <query>
              <query-method>
                   <method-name>findAll</method-name>
                   <method-params></method-params>
              </query-method>
              <ejb-ql>
                   <![CDATA[ SELECT OBJECT(a) FROM sponsor AS a]]>
              </ejb-ql>
         </query>
    </entity>
    </enterprise-beans>
    In the database, I want this entity bean refers to a table named "sponsor", but I could not specify the relation in the ejb-jar.xml file. So when I deployed this bean, it auto created a table called "SponsorEJB". Where is this name come from, from display-name or ejb-name field?
    Basically, how can I specify a bean "SponsorEJB" referes to a table "sponsor"?
    Thanks,

    First thing, to stop OC4J auto-creating tables, edit the file %J2EE_HOME%/config/application.xml. Change the first orion-application tag so that one attribute says autocreate-tables="false"
    The ejb-jar.xml file describes your EJB's to the container. It is not supposed to describe which table each entity bean maps too, as this is an implementation specific property, so would not be portable between databases. Therefore you have to configure the container to point an entity to a table. Sun uses the sun-j2ee-ri.xml file to do this, and this has to be included in the deployment.
    OC4J however uses the file 'orion-ejb-jar.xml', and will generate this for you. Since you have already deployed your application, this will have already been generated. Go to the directory %J2EE_HOME%/application-deployments. There will be a directory corresponding to your application name. In there is a directory corresponding to your ejb module name, and in there is the 'orion-ejb-jar.xml' file. If you open this file, you will see the entity deployment tags, an example of one is below. Edit the tag so that the table attribute points to the table in your database (note that there is a data-source attribute as well, so make sure that this points to the correct schema). The example below points the EJB Emp to the table EMP:
    <entity-deployment name="Emp" max-instances="10" location="Emp" wrapper="EmpHome_EntityHomeWrapper3" table="EMP" data-source="jdbc/rob9iDS" locking-mode="optimistic" update-changed-fields-only="true" min-instances-per-pk="0" max-instances-per-pk="50" disable-wrapper-cache="true">
    Hope this helps,
    Rob

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

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

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

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

  • 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

  • Missing listener-threads attribute in orion-ejb-jar.xml !!

    Hi All,
    I was trying to do some performance tuning as given in BPEL admin guide. For one of the BPEL property namely 'dspMaxThreads', guide says "Sum of dspMaxThreads of ALL domains should be <= the number of mdb listener threads on the workerbean". Now when i open <SOA_HOME>/j2ee/oc4j_soa/application-deployments/orabpel/orion-ejb-jar.xml and navigate to workerbean, i can not find any listener-threads attribute in message-driven-deployment tag.
    <message-driven-deployment name="WorkerBean" min-instances="100" resource-adapter="BPELjms">
    However there is a ReceiverThreads property set to 40.
    <message-driven-deployment name="WorkerBean" min-instances="100" resource-adapter="BPELjms">
    <config-property-name>ReceiverThreads</config-property-name>
    <config-property-value>40</config-property-value>
    </config-property>
    </message-driven-deployment>
    Now my question is that can i add listener-threads attribute to message-driven-deployment tag and then tune dspmaxthreads accordingly, Or
    i can make use of ReceiverThreads property to match with dspmaxthreads property. I am really confused b/w listener-threads and ReceiverThreads.
    Can anyone clarify the same ?
    I have ORACLE SOA Suite ver 10.1.3.1 (with 10.1.3.3 patch) installed.
    Thanks in advance.

    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

  • 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

  • Vendor-ejb-jar.xml to orion-ejb-jar.xml, finder methods

    Hello
    I want to convert a inprise based EJB 1.1 application from inprise to OC4J. The inprise based finder methods are quite different from the syntax of orion-ejb-jar.xml, regarding the finder methods. Does anyone know if this can be done more easily. Using JDev 903_pre does not help much. I dont have access to JBuilder either. It seems I have to write all the finder methods once more and it takes days.
    Any hints ?
    Ana Maria

    OC4J does not require all finder methods in the orion-ejb-jar.xml and it automatically generates all simple finder methods. The easiest thing to do is deploy the EJBs into OC4J and it will generate the finder methods in the $OC4J_HOME/j2ee/home/application-deployment/<application-name>/ejb-jar-name/ directory and then you can modify these per your requirement and package with your EJBs.
    hope this helps
    thanks
    Debu

Maybe you are looking for