Creating Entity EJB's in loop

I have a servlet in my EAR that inserts default fields into a table based on one of my CMP Entity EJB's (v2.x).
The servlet operates as such:
public void init(ServletConfig config) throws ServletException {
     super.init(config);
     ServletContext application = getServletContext();
     Context ctx = null;
     AccountType act = null;
     AccountTypeHome acth = null;
     try{
          ctx = new InitialContext();
          Object obj = ctx.lookup(JNDI_USERPRIVELAGES);
          application.log("Creating system privelage groups...");
          UserPrivelages usp = null;
          UserPrivelagesHome usph = null;
          usph = (UserPrivelagesHome) PortableRemoteObject.narrow(obj,UserPrivelagesHome.class);
          usp = usph.create(new Integer(1),baseUserPrivelages[0][0],baseUserPrivelages[0][1],baseUserPrivelages[0][2]);
          UserPrivelages uspStandard = usph.create(new Integer(2),
               baseUserPrivelages[0][0],baseUserPrivelages[0][1],
                              baseUserPrivelages[0][2]);
          application.log("Created system privelage groups...");
          application.log("Creating system users...");
          Context ctx2 = new InitialContext();
          SysUserHome sysh = null;
          application.log("Looking up: "+JNDI_SYSUSER);
          Object o = ctx2.lookup(JNDI_SYSUSER);
          application.log("Narrowing object...");
          sysh = (SysUserHome) PortableRemoteObject.narrow(o,SysUserHome.class);
          for(int i=0;i<1;i++){
               String[] users = baseSysUsers;
               application.log("Creating: "+users[1]);
               Integer id =new Integer(users[0]);
               String login = users[1];
               String pword = users[2];
               String forename = users[3];
               String surname = users[4];
               String empNo = users[5];
               String priv = users[6];
               String group = users[7];
               String lastUpdatedBy = users[8];
               SysUser sys = null;
               application.log("Creating sysuser...");
               sys = sysh.create(id,login,pword,forename,surname,empNo,priv,group,new java.sql.Timestamp(System.currentTimeMillis()),lastUpdatedBy);
               application.log("Created "+users[1]);
          application.log("Created system users...");
     } catch(NamingException ne){
          application.log("Error initialising startup!",ne);
     } catch(RemoteException re){
          application.log("Error creating startup db entries.",re);
     } catch(CreateException ce){
          application.log("Error creating Sysuser",ce);
When the servlet starts, the first 2 ejbs are created without a problem. When it gets to the loop to create the SysUsers, it seems to create the first then throws the following exception:
Error creating startup db entries.
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
     java.rmi.RemoteException: Transaction aborted (possibly due to transaction time out).; nested exception is: javax.transaction.RollbackException; nested exception is:
     javax.transaction.RollbackException
java.rmi.RemoteException: Transaction aborted (possibly due to transaction time out).; nested exception is: javax.transaction.RollbackException; nested exception is:
     javax.transaction.RollbackException
javax.transaction.RollbackException
     <<no stack trace available>>The ejbCreate method for the SysUserBean interface is as follows:
     public Integer ejbCreate(Integer id,
     String login,
     String pword,
     String forename,
     String surname,
     String empNo,
     String privelage,
     String group,
     java.sql.Timestamp lastUpdated, String lastUpdatedBy) throws CreateException {
          System.out.println("Constructing new SystemUser with login: "+login);
          this.setSysu_id(id);
          this.setSysu_login_name(login);
          this.setSysu_password(pword);
          this.setSysu_forename(forename);
          this.setSysu_surname(surname);
          this.setSysu_forename(empNo);
          this.setSysu_user_privelage(privelage);
          this.setSysu_user_privelage(group);
          this.setSysu_last_updated(lastUpdated);
          this.setSysu_last_updated_by(lastUpdatedBy);
          System.out.println("Created new SystemUser: "+login);
          return null;
     }When I run the code, the servlet runs up until it calls sysh.create(...) where it throws the exception.
Inside the ejbCreateMethod, the whole method is run (as I have the "System.out.println('Created new SystemUser: '+login);" statement having been executed.
The "return null" statement at the end of the method doesn't seem to be the problem (it is a CMP) besides, I've tested it with returning the primary key (return this.getSysu_id()) but this makes no difference and I have the same implementation for the UserPrivelages interface.
The ejbCreate method in the UserPrivelagesBean class also has the same format without the error occurring.
I'm currently testing with the J2EE Application deployment tool 1.3.
Do I need to "close" (if such an option exists) the SysUser interface before I create a new one?
Cheers,
Anthony

Found the problem. Too much late night programming. I double declared a couple of methods in the Create method on the SysUserBean class.
All working fine now.
Anthony

Similar Messages

  • What does this error means "Could not create Entity EJB"

    This error occurs when i tried to run my entitybean example, so may i know what does this error means? How can i resolve it?
    I am connecting to an Oracle8 DB, but it seems tat i have problem connecting to it and retrieving record from the database. Can anyone help me how to establish a connection to my Oracle DB??
    Need help urgently. thanx.!

    have you tried simple jdbc connection?
    Driver drv = Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection(oracle:jdbc:thin:@myhost:1521:instance, "usrname", "password");
    If this works you're able to connect! so check that your oracel datasource is well specified in your deploiement descriptor and that your bean references this datasource.
    hope it helps

  • How to use the same Entity EJB to access the same table in 2 syb databases

    We are trying to convert an application to J2EE. We have the following
    concern. The application requires the use of 10 sybase databases with
    identical tables. One database per branch. We would like to be able to use the same set of entity EJBs to access all databases.
    One solution we can think of is to use bmp entity beans and have a dispatcher session bean pass the database that the entity bean has to connect to.
    Would it work?
    Is there a more elegant way to do this?

    I don't know if there is a more elegant way to do it, but that will work. I have a similar scenario, one database per customer. You'll have to use BMP and get your connections based on the branch.
    Each one of my DAO methods requires that a customer ID be passed in for each method. The customer ID is part of the primary key for each entity bean; therefore, if I need to find a deposit (entity) for a customer, I pass the customer ID and deposit ID to my session facade, create the PK using these, do a findByPrimaryKey, etc. In the ejbLoad, I use the customer ID and the deposit ID to pass into the DAO. There, another class (ConnectionFactory) returns a proper connection based on the customer ID passed, which I use to do my queries.
    Paul

  • Creating entity beans with auto numbered primary key

    I have two entity bean with a CMR between them. I am successfully creating the first one but when I try and create the child entity bean I get a NullPointerException.
    Now I think this is because the gernerated code tries to get the primary key of the created entity bean and this is not set as it is set using a auto number in the database (An oracle sequence and trigger).
    Is there anyway i can get round this problem?
    Thanks in advance,
    Adrian

    This is the auto generated code:
         public dmd.sync.ejbs.entity.AppliancePackInfoLocal create_Local(dmd.sync.dataobjects.dto.AppliancePackInfoDTO appliancePackInfoDTO, dmd.sync.ejbs.entity.AmppLocal amppLocal) throws javax.ejb.CreateException, java.rmi.RemoteException {
              BeanO beanO = null;
              dmd.sync.ejbs.entity.AppliancePackInfoLocal result = null;
              boolean createFailed = false;
              boolean preCreateFlag = false;
              try {
                   beanO = super.createBeanO();
                   dmd.sync.ejbs.entity.AppliancePackInfoBean bean = (dmd.sync.ejbs.entity.AppliancePackInfoBean) beanO.getEnterpriseBean();
                   preCreateFlag = super.preEjbCreate(beanO);
                   bean.ejbCreate(appliancePackInfoDTO, amppLocal);
                   Object ejsKey = keyFromBean(bean);
                   result = (dmd.sync.ejbs.entity.AppliancePackInfoLocal) super.postCreate_Local(beanO, ejsKey, true);
                   bean.ejbPostCreate(appliancePackInfoDTO, amppLocal);
                   super.afterPostCreate(beanO, ejsKey);
    It must be falling over on the last line as it calls the ejbPostCreate fine.

  • Oracle Dabase Schema with OC4J CMP Entity EJB

    I have tables in a schema called vsxlib. My Entity EJBs that map to SQL SERVER tables (no schema) work perfectly. My Entity CMP EJBs that connect need to connect to the vsxlib schema only partially work.
    The findAll method works. When I add a where clause, I get no results back.
    When I try a findByPrimaryKey, I get a ObjectNotFoundException.
    Does OC4J version 9.0.3 support database schemas? There were examples posted at http://otn.oracle.com/sample_code/tech/java/j2ee/javacookbook/transactionsample/readme.html#descfiles say that they have an Entity bean working within a db schema.
    Could it be permission related????
    I even tried creating a synonym pointing to the table within the vsxlib schema.. No Luck.
    I had this same problem with JBoss3.2 and found out that they did not support db schemas. That is why I was wanting to switch to OC4J because I thought for sure, being an oracle product that it would support db schemas.
    Any help is greatly appreciated.

    Hi Alex,
    I think you may be misunderstanding the meaning of 'database schemas'. For your information, in the Oracle database, a schema is the same as a database user. For example all the database tables belonging to user SCOTT (TIGER) are said to be in the SCOTT schema.
    OC4J uses the term 'database schema' differently. Here it refers to the mapping of database datatypes to java classes. Look at the "j2ee/home/config/database-schemas" subdirectoryof the OC4J installation for more details. The "data-sources.xml" file has a 'schema' tag (not sure if that's the correct name) which points OC4J to the datatype mapping XML file -- usually one of those that come with the distribution. However, I use OC4J stand-alone version and I don't need to worry about the mappings at all -- OC4J already knows the mappings for an Oracle database (I assume).
    In order to access a particular Oracle schema, I merely have to log in to the database as the appropriate user. So, using the previous example, if I configure the "data-sources.xml" file to use 'scott' as the database login, then OC4J can access the SCOTT schema. You can find more details about Oracle's use of the term 'schema' in the Oracle documentation, which is available from:
    http://tahiti.oracle.com
    Hope this has answered your question.
    Good Luck,
    Avi.

  • How to inherit one enity method and to create entity manager factory

    Hi All,
    i have totally 5 databases where one database has the connection details of all other 4 databases.i am using EJB 3.0 and using MVC architecture.is there any possibility to get the details in that datbase and create entity manager factory based on that detail.i defined all the database connection in persistence.xml.

    Hi,
    is there any oher possibility to create entity manager factory dynamically?

  • Database Views with Entity EJBs

    Is it possible to use Weblogic Workshop to create a CMP entity EJB on an Oracle database view for a Weblogic 8.1 server?
    Is there special configuration I need to do for either the Oracle or Weblogic side to accomplish this?
    Thanks.
    Tania

    I can manually create the EJB, an it builds just
    fine, but when I go to deploy it, I get the following
    error:
    [EJB:011076]Unable to deploy the EJB
    'AssortmentMerchandise' because the databas
    e table 'K_BA01.BAV_ASRT_CLUSTR_DAT' is not
    accessible. Please ensure that this
    table exists and is accessible.
    The view is on the same datasource that I have
    successfully created all of my other entity EJBs
    (from tables).
    I can select data from the view using JDBC and the
    same datasource that I am trying to associate the EJB
    to.
    Any ideas what might be wrong with my view?Are you using synonyms or aliases? I would double check those...
    Log in using same username and password as weblogic and try a simple query:
    select * from K_BA01.BAV_ASRT_CLUSTR_DAT

  • How to set the isolation level on Entity EJBs

    I am using 10.1.3.3 of the OC4J app server.
    I am creating an application that uses EJB 2.1.
    I am trying to set the isolation levels on the EJBs to either serializable or repeatable read.
    When i deploy the EAR file from the OC4J admin console, i can set the isolation level property on the EJB's however when i inspect the orion-ejb-jar.xml file I do not see the isolation level being set. Furthermore, i tried to manually change the isolation setting by editing the orion-ejb-jar.xml and adding the isolation="serialiable" attribute on the entity bean descriptor. I then stopped and restarted the server. I noticed that my change was no longer in the file.
    Can someone please let me know how to solve this problem and set the isolation level on Entity EJBs . Thanks

    I find it at ejb.pdf from BEA.
              The transaction-isolation stanza can contain the elements shown here:
              <transaction-isolation>
              <isolation-level>Serializable</isolation-level>
              <method>
              <description>...</description>
              <ejb-name>...</ejb-name>
              <method-intf>...</method-intf>
              <method-name>...</method-name>
              <method-params>...</method-params>
              </method>
              </transaction-isolation>
              "Hyun Min" <[email protected]> wrote in message
              news:3c4e7a83$[email protected]..
              > Hi!
              >
              > I have a question.
              > How to set the transaction isolation level using CMT in descriptor?
              >
              > The Isolation level not supported in CMT?
              >
              > Thanks.
              > Hyun Min
              >
              >
              

  • Bmp entity ejb transactions, using DAO objects

    hi all,
    i'm new to entity ejb's... i'm using the j2ee reference implementation (1.3.1) with the cloudscape db to test my code.
    i can't seem to get my ejbCreate method to work. i'm using a DAO object to encapsulate all my database code, and simply call dao.insert(...) in my ejbCreate method.
    i tested the dao object, and it works fine when it's invoked straight. but when i try to invoke under the ejb container i run into problems:
    i deploy the bean with container managed transactions:
    (1) with the 'required' attribute:
    I get a javax.transaction.RollbackException nested inside another RollbackException, nested inside a RemoteException, nested inside another RemoteException. The final RollbackException says <<no stack trace available>>...
    So I've got no clue what's causing it...
    (2) with the 'never' attribute:
    I get a NullPointerException nested inside another NullPointerException, nested inside a RemoteException, nested inside another RemoteException. The final NullPointerException says <<no stack trace available>>...
    So I've got no clue what's causing it...
    I'm assuming something messed up with my deployment -- but I've checked it against all the examples I can find -- seems to be correct. Would the encapsulated Data Access code cause a problem? Some other config problem?
    Thanks in advance for any help!!

    i'm using the cloudscape db that's already configured with the server. i believe the datasource is correctly configured, as i am able to successfully invoke the dao methods straight -- the problem occurs when I try to do it via the entity bean that uses the dao object.
    here's my server startup messages:
    Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:CloudscapeDB;create=
    true
    Binding DataSource, name = jdbc/DB1, url = jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/EstoreDB, url = jdbc:cloudscape:rmi:CloudscapeDB;create=tr
    ue
    Binding DataSource, name = jdbc/InventoryDB, url = jdbc:cloudscape:rmi:CloudscapeDB;create
    =true
    Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
    Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.core.RemoteX

  • Deployment error: The Entity EJB requires the table:  to be accessible

    Hello
    When I deploy my EJBs, WEBLogic throws an exception:
    Unable to deploy EJB: OrderBean from ejb-jar-ic.jar:
    The Entity EJB requires the table: Order to be accessible. Please ensure that th
    is table exists and is accessible.
    I use built in Cloudscape database.
    And I have those lines in descriptor:
    <weblogic-rdbms-bean>
    <ejb-name>OrderBean</ejb-name>
    <data-source-name>ejbDS</data-source-name>
    <table-name>Order</table-name>
    <field-map>
    <cmp-field>totalAmount</cmp-field>
    <dbms-column>totalAmount</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>time</cmp-field>
    <dbms-column>ordertime</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>orderID</cmp-field>
    <dbms-column>orderID</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>True</create-default-dbms-tables>
    thanx in advance
    Maris

    Hi Maris,
    I see that you have create-default-dbms-tables set to true so WLS should be creating
    the database table for your EJB. If you can give me some more information, I'll be
    able to help you further. What version of WLS + service pack are you using? Also,
    is this a 1.1 bean or 2.0? Lastly, what are the types of the CMP fields in your
    bean?
    As a work-around, you can try creating the database table yourself before deploying
    the bean. This should resolve the deployment problem.
    - Matt
    Maris wrote:
    Hello
    When I deploy my EJBs, WEBLogic throws an exception:
    Unable to deploy EJB: OrderBean from ejb-jar-ic.jar:
    The Entity EJB requires the table: Order to be accessible. Please ensure that th
    is table exists and is accessible.
    I use built in Cloudscape database.
    And I have those lines in descriptor:
    <weblogic-rdbms-bean>
    <ejb-name>OrderBean</ejb-name>
    <data-source-name>ejbDS</data-source-name>
    <table-name>Order</table-name>
    <field-map>
    <cmp-field>totalAmount</cmp-field>
    <dbms-column>totalAmount</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>time</cmp-field>
    <dbms-column>ordertime</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>orderID</cmp-field>
    <dbms-column>orderID</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>True</create-default-dbms-tables>
    thanx in advance
    Maris

  • Remove methods in Entity EJBs

    Hi,
    I have a entity EJB with following methods:
    findByPrimaryKey(PK)
    create(PK)
    get and set methods
    I wanna add a remove method which will take the PK and delete the record for
    me.
    Please tell me the changes I have to incorporate. and How do i do it. I am using VA 3.5 and WAS 3.5
    Thanx & Regards
    Ravi Mittal

    hi,
    after adding access bean & generating deployed code you have to add remove method in Access Bean by yourself. remove(object) is in EJBhome interface.
    you have to pass object of key class. so add empty remove() in acees bean. instantiate ur key class there & call remove(keclassobject) method. I think it will help you.
    -priya

  • Entity EJBs

    Hello!!
    My application works with tables in a Oracle database but I have several Entity EJB too .. is it absolutely necessary to create the tables that are used by the Entity EJBs in a data dictionary project?
    I hope anybody help me.
    Thanks

    Hi,
    no, using Data Dictionary is necessary only if you want to use OpenSQL to access the database. In your case you can use EJBs with Vendor of Native SQL DB access. For more info on the persistency layers that are available on the Web AS Java, see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm">this page</a>.

  • HELP - ERROR INVOKING ENTITY EJB METHOD

    Hi,
    I keep getting a java.rmi.NoSuchObject exception when using my entity ejb, but cannot see why, as I already have the ejb in a collection... code & stack trace below: Any one know what is causing this ??
    java.rmi.NoSuchObjectException: com.syntegra.cec.insurance.entity.AATreportPK@7a6c34
    java.rmi.NoSuchObjectException: com.syntegra.cec.insurance.entity.AATreportPK@7a6c34 at AATreport_EntityBeanWrapper14.getPayment_reference(AATreport_EntityBeanWrapper14.java:1881) at com.syntegra.cec.insurance.dtofactory.RecordsDTOFactoryBean.fetchAAT(RecordsDTOFactoryBean.java:151) at com.syntegra.cec.insurance.dtofactory.RecordsDTOFactoryBean.fetchRecords(RecordsDTOFactoryBean.java:62) at RecordsDTOFactory_StatelessSessionBeanWrapper49.fetchRecords(RecordsDTOFactory_StatelessSessionBeanWrapper49.java:108)
    HashMap records = new HashMap();
    Collection theEJBs = null;
    int counter = 0;
    //Find the beans
    AATreportHome home = (AATreportHome)lookUpHome
    (com.syntegra.cec.insurance.entity.AATreportHome.class,
    "AATreport");
    theEJBs = home.findByStatus(type);
    //Populate the DTO's
    if(theEJBs != null)
    Iterator it = theEJBs.iterator();
    while(it.hasNext())
    AATreport theEJB = (AATreport)it.next();
    AATreportDTO theDTO = new AATreportDTO
    ----- This is where the error comes from --
    ---Line 151 ---(theEJB.getPayment_reference(),
    theEJB.getTenant_ref_no(),
    theEJB.getInsurance_no(),
    theEJB.getName(),
    theEJB.getAddress_line_1(),
    theEJB.getPremium(),
    getDateAsString(theEJB.getAction_date()));
    records.put(new Integer(counter), theDTO);
    counter++;

    Greetings,
    Hi,
    I am trying to access a bean from a JSP and have the
    foll. code piece:
    <%
    String op="";
    try {
    // Contact the AccountBean container (the "AccountHome") through JNDI.
    Context ctx = getInitialContext();
    out.println("initial context got !!");
    DemoHome home = (DemoHome) ctx.lookup("demo.DemoHome");
    out.println("home got !!");Though it doesn't seem to be the problem in this case, good EJB coding practices dictate that your code should be narrowing the home reference before calling any of it's methods (i.e. create(...) )... WebLogic may allow handling of its protocol objects in their native state, but other vendors do not... your application is not portable without narrowing.
    It gives an error on trying to access the method "demoSelect".
    e.printStackTrace gives the output:
    java.lang.RuntimeException: javax.ejb.EJBContext.getEnvironment is deprecated inThe error is not in your JSP, but in the bean... it seems your bean is attempting to acquire its "environment properties" in the pre-1.1 style, when...
    EJB 1.1. EJB 1.1 compliant containers are not required to implement this
    method. Use java:comp/env instead. ...instead, it should be looking them up in its JNDI namespace.
    What is wrong???
    pls help! Regards,
    Tony "Vee Schade" Cook

  • Entity EJB Relationships Architectural Question

    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I define
    the relationships (EJB 2.0)? If it is not, how would you build it?
    Thanks for helping me out,
    Thomas A. Valletta

    Thanks Slava,
    You deserve more than a free trip to a conference for the time and effort
    that you put into this board. I think you should be able to write this off
    as a charitable contribution on your taxes. If you need someone to sign the
    receipt, just let me know.
    Anyway, back to my hierarchy issue(s). I found some information that
    weblogic will set-up this kind of many-to-many relationship for you if you
    set it up correctly in the weblogic-cmp-rdbms-jar.xml and the ejb-jar.xml.
    So I went through the DTDs, but despite the examples the help is extremely
    vague. Has anyone done this? Could anyone recommend where I could find
    something more on the topic (books, magazine articles, online documentation,
    code, etc)?
    Thanks again,
    Thomas A. Valletta
    "Slava Imeshev" <[email protected]> wrote in message
    news:3ec552f9$[email protected]..
    Hi Thomas,
    "Thomas A. Valletta" <[email protected]> wrote in message
    news:[email protected]..
    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I
    define
    the relationships (EJB 2.0)? If it is not, how would you build it?The best approach is the one that works for you. If the
    combination of two beans works, leave it as is and
    go ahead with next tasks.
    Regards,
    Slava Imeshev

  • Errors when deploy a simple entity ejb module to oc4j 10g?

    I work as following steps:
    1. new project
    2. new Digram-->EJB Diagram
    3. Drag a Entity bean ico to Diagram and name it with Student, then add a id&name column to it.
    4 set the entity-ejb Student's Resource Reference's property: name(MysqlPool),ResourceType(com.mysql.jdbc.Driver),Authentification(Container)
    (in oc4j, I have set the pool connection--MysqlPool)
    5 use command to start oc4j 10.1.3 in jdev10.1.3
    6 In Jdeveloper IDE, select ejb-jar.xml and use right mouse button to call out the menu and then select "Cretae ejb or jar deploy profile", set the deploy platform to my oc4j connection.
    7 select the deploy profile and deploy to my oc4j connection, then errors were reported as following:
    Target platform is Standalone OC4J 10.1.3 (AppServerConnection1).
    Wrote EJB JAR file to D:\jdevj2ee1013\jdev\mywork\Application1\Project1\deploy\ejb1.jar
    Wrote EAR file to D:\jdevj2ee1013\jdev\mywork\Application1\Project1\deploy\ejb1.ear
    Uploading file ...
    Application Deployer for ejb1 STARTS.
    Do not undeploy previous deployment
    Copy the archive to D:\jdevj2ee1013\j2ee\home\applications\ejb1.ear
    Initialize D:\jdevj2ee1013\j2ee\home\applications\ejb1.ear begins...
    Unpacking ejb1.ear
    Done unpacking ejb1.ear
    Initialize D:\jdevj2ee1013\j2ee\home\applications\ejb1.ear ends...
    Starting application : ejb1
    Initializing ClassLoader(s)
    Initializing EJB container
    Loading connector(s)
    Starting up resource adapters
    Processing EJB module: ejb1.jar
    Compiling EJB generated code
    Error while compiling EJB component: D:\jdevj2ee1013\j2ee\home\applications\ejb1\ejb1.jar
    com.evermind.compiler.CompilationException: Error finding a suitable DataSource: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
         at com.evermind.server.ejb.compilation.EntityBeanCompilation.createTable(EntityBeanCompilation.java:257)
         at com.evermind.server.ejb.compilation.EntityBeanCompilation.preCompile(EntityBeanCompilation.java:318)
         at com.evermind.server.ejb.compilation.Compilation.generateAnyOldStyle(Compilation.java:1728)
         at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:162)
         at com.evermind.server.ejb.compilation.Compilation.doGenerateCode(Compilation.java:216)
         at com.evermind.server.ejb.EJBContainer.postInitBatch(EJBContainer.java:1197)
         at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:1118)
         at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:200)
         at com.evermind.server.Application.setConfig(Application.java:299)
         at com.evermind.server.Application.setConfig(Application.java:226)
         at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1740)
         at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:403)
         at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:144)
         at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:95)
         at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:53)
         at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:68)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:299)
         at java.lang.Thread.run(Thread.java:534)
    application : ejb1 is in failed state
    java.lang.InstantiationException: Error initializing ejb-module; Exception
    Error compiling D:\jdevj2ee1013\j2ee\home\applications\ejb1\ejb1.jar: Error finding a suitable DataSource: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
         at com.evermind.server.ejb.EJBContainer.throwInstantiationException(EJBContainer.java:2285)
         at com.evermind.server.ejb.EJBContainer.postInitBatch(EJBContainer.java:1422)
         at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:1118)
         at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:200)
         at com.evermind.server.Application.setConfig(Application.java:299)
         at com.evermind.server.Application.setConfig(Application.java:226)
         at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1740)
         at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:403)
         at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:144)
         at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:95)
         at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:53)
         at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:68)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:299)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.InstantiationException:
    Error compiling D:\jdevj2ee1013\j2ee\home\applications\ejb1\ejb1.jar: Error finding a suitable DataSource: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
         at com.evermind.server.ejb.EJBContainer.postInitBatch(EJBContainer.java:1226)
         ... 12 more
    Operation failed with error:
    java.lang.InstantiationException: Error initializing ejb-module; Exception
    Error compiling D:\jdevj2ee1013\j2ee\home\applications\ejb1\ejb1.jar: Error finding a suitable DataSource: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
    Deployment failed
    Elapsed time for deployment: 41 seconds
    #### Deployment incomplete. #### 2005-2-15 10:46:02
    what's the meaning about Error finding a suitable DataSource: Error looking up cmt-datasource at jdbc/OracleDS (name not found)?
    I didn't use jdbc/OracleDS Datasource, and I deleted it from config\data-source.xml.
    Is it cause those errors or my operation rong?
    Who can tell me the entity ejb's deploy method&step?

    Yes, now I added a connection pool and a datasource in oc4j, and set the datasource's jndi name to "jdbc/OracleDS".For The connection pool,I use the mysql database.
    Followed the above operation, I repeat the deployment and it deployed successfully.
    Viewed by web-control-for-oc4j, I found jdeveloper automaticly created a datasource and pool for the ejb module.However, the datasource's parameter(connection-factory factory-class="oracle.jdbc.pool.OracleDataSource") is wrong.
    So I open Tools Menu->Preferences menu and setted the Deploy property to "unbundle datasource...".Then I Created a file named data-sources.xml in project and filled out the correct properties.
    After I deploied the ejb-module, I openned the deploied .ear file with winrar to view its contents.I found the factory-class property's value is still wrong which included in data-sources.xml file in Mata-Inf directory,but the property of the data-sources.xml file in .jar file is correct.So, the class factory value of the deploied ejb-application's connection pool still is "oracle.jdbc.pool.OracleDataSource".It couldn't work surely.
    Of course, I can modity the data-sources.xml in .ear file.
    But has some more better method to settle this problem while not manuelly?

Maybe you are looking for

  • Site map of Communities and Categories

    Site map of Communities and Categories As part of the migration of Apple Discussions to Apple Support Communities many previous forums have become categories of the new communities. This list may help you locate the content of any specific category y

  • Cost component split in copa

    Hi, I am looking cost component split in copa document , Price for FERT(FG) materil valuation will at manufactured plant level is Standard price(S) and Depo level Moving avg price(V) i am doing standard cost estimate for that i have done ..setting. 1

  • Problem in Automatic mail generation after shipment creation in vt01

    Hi All, In VT01 Automatic mail generation to  customer  whenver a new shipment is created & in from address user mail adderess is mentioned but in my requirements i have  to mention different mail id in user mail address. how can i do this? please gi

  • Where can I buy a new 5D mark ii ?

    I want another new 5D Mark ii but am leary to buy from just any store. Can someone suggest a dealer, store, or website that they know is trustworthy?

  • Black bar below email instead of menu bar

    After installing the software update, I have a solid black bar below my email boxes. I can't reply, forward, delete or move mail without it. Is there a solution for this?