Problem in creating CMP Entity Bean - Pls Help

I am trying to build one simple project having jsps to get connected to CMP Entity Bean.
But while deploying I am getting the following error...
Nov 15, 2004 10:59:09... Info: End of log messages of the target system.
Nov 15, 2004 10:59:09... Info: ***** End of SAP J2EE Engine Deployment (J2EE Application) *****
Nov 15, 2004 10:59:09... Error: Execution of deployment action for "EntityCMPAppln" aborted:
Caught exception during application deployment from SAP J2EE Engine's deploy service:
java.rmi.RemoteException: Error occurred while starting application bcone.com/EntityCMPAppln and wait.
Reason: Complex error : server ID 6155350:Application bcone.com/EntityCMPAppln cannot be started, because it has hard reference to resource CONFIG_DB with type javax.sql.DataSource, but it is not active on the server.
(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
Nov 15, 2004 10:59:09... Error: Deployment NOT successful for EntityCMPAppln
Nov 15, 2004 10:59:09... Info: SDM configuration: Do not automatically start/stop J2EE Engine. Do not restore state of J2EE Engine now.
Nov 15, 2004 10:59:09... Error: -
At least one of the Deployments failed -
Nov 15, 2004 11:05:16... Info: Request for Logon as admin accepted
===========================================
Nov 15, 2004 11:05:08... Info: =   Starting to execute command 'remotegui'   =
Nov 15, 2004 11:05:08... Info: ===============================================
Nov 15, 2004 11:05:10... Info: SDM started successfully.
Please tell me how to activate the CONFIG_DB reference in database. Or what Extra I have to do to run this example.
Regards,
Vivek Ojha

Dear Benny,
The code of the required files is pasted below....
Application.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
                             "http://java.sun.com/dtd/application_1_3.dtd">
<application>
    <display-name>EntityCMPAppln</display-name>
    <description>EAR description</description>
    <module>
        <ejb>EntityCMPEjb.jar</ejb>
    </module>
    <module>
        <web>
            <web-uri>EntityCMPWeb.war</web-uri>
            <context-root>/student</context-root>
        </web>
    </module>
</application>
Application-j2ee-engine.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
<application-j2ee-engine>
     <provider-name>bcone.com</provider-name>
     <fail-over-enable
          mode="disable"/>
</application-j2ee-engine>
data-source-aliases.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data-source-aliases SYSTEM "data-source-aliases.dtd">
<data-source-aliases>
     <aliases>
          <data-source-name>${com.sap.datasource.default}</data-source-name>
          <alias>STUDENTDB</alias>
     </aliases>
</data-source-aliases>
ejb-j2ee-engine.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
<ejb-j2ee-engine>
     <enterprise-beans>
          <enterprise-bean>
               <ejb-name>StudentBean</ejb-name>
               <resource-ref>
                    <res-ref-name>jdbc/STUDENTDB</res-ref-name>
                    <res-link>STUDENTDB</res-link>
               </resource-ref>
               <entity-props/>
          </enterprise-bean>
     </enterprise-beans>
</ejb-j2ee-engine>
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
     <description>EJB JAR description</description>
     <display-name>EJB JAR</display-name>
     <enterprise-beans>
          <entity>
               <ejb-name>StudentBean</ejb-name>
               <home>com.bcone.ejb.StudentHome</home>
               <remote>com.bcone.ejb.Student</remote>
               <ejb-class>com.bcone.ejb.StudentBean</ejb-class>
               <persistence-type>Container</persistence-type>
               <prim-key-class>java.lang.String</prim-key-class>
               <reentrant>False</reentrant>
               <cmp-version>2.x</cmp-version>
               <abstract-schema-name>StudentBean</abstract-schema-name>
               <cmp-field>
                    <field-name>studentId</field-name>
               </cmp-field>
               <cmp-field>
                    <field-name>lname</field-name>
               </cmp-field>
               <cmp-field>
                    <field-name>standard</field-name>
               </cmp-field>
               <cmp-field>
                    <field-name>fyear</field-name>
               </cmp-field>
               <cmp-field>
                    <field-name>fname</field-name>
               </cmp-field>
               <primkey-field>studentId</primkey-field>
               <resource-ref>
                    <res-ref-name>jdbc/STUDENTDB</res-ref-name>
                    <res-type>javax.sql.DataSource</res-type>
                    <res-auth>Container</res-auth>
               </resource-ref>
          </entity>
     </enterprise-beans>
</ejb-jar>
persistent.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE persistent-ejb-map SYSTEM "persistent.dtd">
<persistent-ejb-map>
     <locking
          type="Table"/>
     <db-properties>
          <data-source-name>CONFIG_DB</data-source-name>
          <database-vendor
               name="SAPDB"/>
     </db-properties>
     <entity-beans>
          <entity-bean>
               <ejb-name>StudentBean</ejb-name>
               <table-name>TMP_STUDENTNEW</table-name>
               <field-map
                    key-type="PrimaryKey">
                    <field-name>studentId</field-name>
                    <column>
                         <column-name>STUDENTID</column-name>
                    </column>
               </field-map>
               <field-map
                    key-type="NoKey">
                    <field-name>lname</field-name>
                    <column>
                         <column-name>LNAME</column-name>
                    </column>
               </field-map>
               <field-map
                    key-type="NoKey">
                    <field-name>standard</field-name>
                    <column>
                         <column-name>STANDARD</column-name>
                    </column>
               </field-map>
               <field-map
                    key-type="NoKey">
                    <field-name>fyear</field-name>
                    <column>
                         <column-name>FYEAR</column-name>
                    </column>
               </field-map>
               <field-map
                    key-type="NoKey">
                    <field-name>fname</field-name>
                    <column>
                         <column-name>FNAME</column-name>
                    </column>
               </field-map>
          </entity-bean>
     </entity-beans>
     <relationships/>
</persistent-ejb-map>
StudentBean.java
package com.bcone.ejb;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
import javax.ejb.CreateException;
@abstractSchemaName StudentBean
@cmpVersion 2.x
@ejbHome <{com.bcone.ejb.StudentHome}>
@ejbPrimaryKey <{java.lang.String}>
@ejbRemote <{com.bcone.ejb.Student}>
@hasSimplePK true
public abstract class StudentBean implements EntityBean {
     public void ejbLoad() {
     public void ejbStore() {
     public void ejbRemove() throws RemoveException {
     public void ejbActivate() {
     public void ejbPassivate() {
     public void setEntityContext(EntityContext context) {
          myContext = context;
     public void unsetEntityContext() {
          myContext = null;
     private EntityContext myContext;
@primKeyField
     public abstract String getStudentId();
     public abstract void setStudentId(String studentId);
     public abstract String getLname();
     public abstract void setLname(String lname);
     public abstract String getFname();
     public abstract void setFname(String fname);
     public abstract String getStandard();
     public abstract void setStandard(String standard);
     public abstract String getFyear();
     public abstract void setFyear(String fyear);
Create Method.
     public String ejbCreate(
          String studentId,
          String fname,
          String lname,
          String standard,
          String fyear)
          throws CreateException {
          setStudentId(studentId);
          setFname(fname);
          setLname(lname);
          setStandard(standard);
          setFyear(fyear);
          return null;
Post Create Method.
     public void ejbPostCreate(
          String studentId,
          String fname,
          String lname,
          String standard,
          String fyear) {
          // TODO : Implement
StudentData.java
Created on Nov 14, 2004
To change the template for this generated file go to
Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
package com.bcone.data;
@author Administrator
To change the template for this generated type comment go to
Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
public class StudentData {
     private String studentId;
     private String fname;
     private String lname;
     private String standard;
     private String fyear;
@return
     public String getFname() {
          return fname;
@return
     public String getFyear() {
          return fyear;
@return
     public String getLname() {
          return lname;
@return
     public String getStandard() {
          return standard;
@return
     public String getStudentId() {
          return studentId;
@param string
     public void setFname(String string) {
          fname = string;
@param string
     public void setFyear(String string) {
          fyear = string;
@param string
     public void setLname(String string) {
          lname = string;
@param string
     public void setStandard(String string) {
          standard = string;
@param string
     public void setStudentId(String string) {
          studentId = string;
student.jsp
<%@ page language="java" %>
<html>
     <head>
          <title>
               Title
          </title>
     </head>
     <body>
          <form method="POST" action="WEBBOT-SELF" name="Student" onSubmit="">
  <!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
  S-Format="TEXT/CSV" S-Label-Fields="TRUE" ><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!webbot
  bot="SaveResults" endspan -->
  <br>
  <a href="/student/manageStudent.jsp?action=add" method="post"> Create </a>   
  <a href="/student/manageStudent.jsp?action=modify" method="post"> Modify </a>   
  <a href="/student/manageStudent.jsp?action=delete" method="post"> Delete </a>
  <br><br>
  <table border="1" width="32%">
    <tr>
      <td width="39%">Student ID </td>
      <td width="61%"><input type="text" name="studentId" size="20"></td>
    </tr>
    <tr>
      <td width="39%">First Name</td>
      <td width="61%"><input type="text" name="fname" size="20"></td>
    </tr>
    <tr>
      <td width="39%">Last Name</td>
      <td width="61%"><input type="text" name="lname" size="20"></td>
    </tr>
    <tr>
      <td width="39%">Standard</td>
      <td width="61%"><input type="text" name="standard" size="20"></td>
    </tr>
    <tr>
      <td width="39%">Fiscal Year</td>
      <td width="61%"><input type="text" name="fyear" size="20"></td>
    </tr>
    <tr>
      <td width="39%" align="center"><input type="submit" value="Submit" name="submit"></td>
      <td width="61%" align="center"><input type="reset" value="Reset" name="reset"></td>
    </tr>
  </table>
</form>
     </body>
</html>
mamageStudent.jsp
<%@ page language="java"
import="javax.naming.,java.sql.,javax.sql,com.bcone.ejb."
%>
<html>
     <head>
          <title>
               Manage Student
          </title>
     </head>
     <body>
          <h1>
          </h1>
<jsp:useBean id="stu" class="com.bcone.data.StudentData" ></jsp:useBean>
<jsp:setProperty name="stu" property="*" />
<%
try {
     InitialContext ctx = new InitialContext();
     StudentHome home = (StudentHome) ctx.lookup("java:comp/env/StudentBean");
     String str = request.getParameter("action");
     if("action".equals(str)) {
          Student rem = home.create(remote.setFname(stu.getStudentId(),stu.getFname(),stu.getLname(),stu.getStandard(),stu.getFyear());
          out.println(stu.getStudentId() + "Student Created");
     } else if ("modify".equals(str)) {
          Student remote  = home.findByPrimaryKey(stu.getStudentId());
          remote.setFname(stu.getFname());
          remote.setFname(stu.getLname());
          remote.setFname(stu.getStandard());
          remote.setFname(stu.getFyear());
          out.println(stu.getStudentId() + "Student modified");
     } else if ("delete".equals(str)) {
          Student stu1  = home.findByPrimaryKey(stu.getStudentId());
          stu1.remove();
          out.println(stu.getStudentId() + "Student deleted");
} catch (Exception e) {
     out.println("Exception e"+e.toString());
%>
     </body>
</html>
Regards,
Vivek Ojha

Similar Messages

  • Create CMP Entity Beans from Tables Wizard - Can't see any tables with DB2

    Hi,
    I'm trying to use the "Create CMP Entity Beans from Tables Wizard" to create an entity from a table in a DB2 database. The problem is, on page 2, I can't see any available tables. I have verified that the connection works (I can open the connection in the Navigator frame and I can see that table).
    Note that if I try this wizard on an Oracle database, I can see tables.
    WTF? Can someone please help?

    I second the motion. I too work in an environment with centralized data management (DBA's) that create and maintain all tables under a generic schema. This has prevented me from using the Create Entity Beans from Table feature of Jdev r3 preview.
    At least I can see that I'm not alone.
    Thanks
    When I select the "Create CMP Entity Beans from Tables Wizard," no tables or views are available to select. The JDev database connection is using an ID assigned to me.
    The tables that I am looking for were created by the DBA under his ID and are therefore in that schema. He did create Public Synonyms for them, but the tables still do not show up in the wizard.
    Is there a configuration step that I need to do to have those tables show up?
    Tables created by a DBA and then accessed by developers using a public synonym is a very common scenario and should be supported by JDeveloper (IMO).
    Thanks.
    I'm using JDev 9.0.2.8.2.

  • Problem in deploying CMP entity bean 2.0 in J2EE 1.4

    i am trying to deploy a cmp entity bean 2.0 using j2ee1.4 deployment tool. the bean uses sql server as the database. i have successfully created a coonection pool for sql server using j2ee admin console. the entity bean class files are successfully compiled. but while deploying the entity bean i am not able to set the database settings and jndi name for the bean. can one please guide me in the deployment steps in j2ee1.4.
    mohit

    Mohit,
    We are discussing this topic in the fourm below. I'm having the same problem so feel free to join our conversation.
    ~Howard
    http://forum.java.sun.com/thread.jsp?forum=13&thread=478054

  • CMP Entity Bean's problem with MS-SQL Server 2000

    Hi everyone!
    I have a problem regarding CMP Entity Bean on OC4J.
    I made one CMP Entity Bean and deployed it to OC4J.
    It was successful.
    I used MS-SQL Server 2000 as Datasource.
    So, I installed MS-SQL Server's JDBC Driver and add some jar files to classpath.
    And I updated 'data-sources.xml' in OC4J's config directory.
    Then, I updated also 'orion-ejb-jar.xml' in my application's directory.
    I changed data-source's name to my data-source's name which use MS-SQL Server 2000.
    Finally, I started OC4J and EJB Client program which called Enitiy Bean's create method.
    But, The error occured which was 'Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence'.
    What's wrong? I need any helps.
    Here is stack overflow message. Thank you. Best regards.
    com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence.
         at UserHome_EntityHomeWrapper2.create(UserHome_EntityHomeWrapper2.java:1114)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    at connection to localhost/127.0.0.1 as admin
         at com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1530)
         at com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1453)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:53)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
         at __Proxy0.create(Unknown Source)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.create(UserBeanTestClient1.java:73)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.<init>(UserBeanTestClient1.java:49)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.main(UserBeanTestClient1.java:1077)

    Hi Young,
    From the information you have supplied, my guess is that the SQL
    string that OC4J is sending to SQL-Server is incorrect. So it may
    help if you could see the exact SQL string. In order to see the
    SQL string, I suggest you either run OC4J in "debug" mode, or try
    using "P6 Spy".
    The following web page has details on running OC4J in "debug" mode:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    And here is the web page for "P6 Spy"
    http://www.provision6.com/
    And these other web sites may also be of help (in general):
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

  • RE: Consuming and Creating a CMP Entity Bean

    Hi There,
    I have been trying to find an answer for 1 day. I don't know ehre to look next.
    I am creating a CMP entity bean. I have created all the set and get mehtods as abstract functions. I have added a ejbCreate and a matching ejbPostCreate. The class code looks like this.
    public abstract class COrderBean implements EntityBean {
         protected EntityContext entctx;
         //abstract declarations of property accessors
         public abstract int getId();
         public abstract void setId(int intid);
         public abstract String getCustomerID();
         public abstract void setCustomerID(String strcustomerid);
         public abstract Date getDate();
         public abstract void setDate(Date datorder);
         public abstract String getNotes();
         public abstract void setNotes(String strnotes);
         public void ejbActivate() {}
         public void ejbPassivate() {}
         public void ejbRemove() {}
         public void ejbLoad() {}
         public void ejbStore() {}
         public void setEntityContext(EntityContext context)
              entctx = context;
         public void unsetEntityContext()
              entctx = null;
         public COrderPK ejbCreate()
              return null;
         public COrderPK ejbCreate(int new_id, String new_customerid, Date new_order_date, String new_notes) throws CreateException
              setId(new_id);
              setCustomerID(new_customerid);
              setDate(new_order_date);
              setNotes(new_notes);
              return new COrderPK(getId());
         public void ejbPostCreate(int id, String customerid, Date order_date, String notes) {}
    My client code works with both BMP entity beans and session beans. It is shown below. I am working with Sun's Application Server 8.0 and I created the database schema with the capture-schema.exe command.
    Properties prps = new Properties();
              props.put("javax.rmi.CORBA.UtilClass","com.sun.corba.ee.impl.javax.rmi.CORBA.Util");
              props.put("org.omg.CORBA.ORBClass","com.sun.corba.ee.impl.orb.ORBImpl");
              props.put("org.omg.CORBA.ORBSingletonClass","com.sun.corba.ee.impl.orb.ORBSingleton");
              Context context = new InitialContext(props);
              Object obj = context.lookup("corbaname:iiop:localhost:3700#COrderBean");
              //Object obj = context.lookup("entitybean.OrderItem");
                   IOrderHome home = (IOrderHome)PortableRemoteObject.narrow(obj,Class.forName("ctaejb.entitybean.order.IOrderHome"));
                   //use create
                   IOrderRemote remote = home.findByPrimaryKey(new COrderPK(1));
                   System.out.println(remote.getDate().toString());
    I am getting the follwing error. Can someone please help. Thanks in advance.
    WARNING: "IOP00810257: (MARSHAL) Could not find class"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:7987)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1989)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2213)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1221)
         at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:255)
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:30)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)
    Caused by: java.lang.ClassNotFoundException
         ... 27 more
    org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:34)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)

    Forget it. All the code works. I didn't know that the Sun App Server required a Persistence Manager to work with CMP entity beans. Once I added the persistence manager, all was OK. Have a good day.

  • Problems accessing fields in a CMP entity bean from a session bean

    Hello everybody,
    I'm getting the next problem: when I try to access a field in a CMP entity bean that I have instantiated from a session bean (trhoug entitybean.getNameOfField), I get the error "the entity bean does not exist in the database".
    This entity bean is accessing a table in an external database (not the DB of the WAS), but I know that it's getting the correct data from the table, since  I check the entitybean.size() and the entitybean.findByPrimaryKey(), and I get the right information. For some reason, the only thing that it doesn't work in the entity bean are the getter/setter methods (I created them automatically after having created the entity fields).
    I access the entity bean through its local interface...
    I know it's really difficult to give an answer with so few details, but... does anybody think I forgot something important to configure??
    Thank very much in advance!!
    Isidro

    getter and setter methods for cmp-fields are abstract.
    getter and setter methods for cmr-fields are abstract.
    "John Lee" <[email protected]> wrote:
    >
    Hi:
    Which method in a CMP Entity bean should be abstract? just only SetXXX
    and
    GetXXX?
    Thanks!
    John Lee

  • Problem when trying to delete CMP entity bean

    Hi,
    When I try to remove a CMP entity bean, I have this error :
    re09.projet_ejb.syndic.AdminException: Exception thrown from bean; nested exception is: javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUnsupportedOptionException: JDO76207: Update of a primary key field is not allowed.It's only happening when I try to remove a bean which has a relation with another bean. The relation type is One to Many. I tried to search on this forum to find an answer but I found nothing that could help me.
    Message was edited by:
    Starship
    Sry I just found the mistake, the cascade delete was not on the right place :s
    Message was edited by:
    Starship

    Got it sorted so I thought I would share the solution here:  The problem wasnt related to LR 5.2 but was to do with Mac OS X 10.8.5 AKA Mountain Lion.  I had also noticed that I was having an issue around deleting anything on my MAC.  When I tried to delete a file from anywhere I was asked to submit my password.  The message I got was finder wants to make a change please submit password.  I checked through the mountain Lion forums and found a solution here; https://discussions.apple.com/message/20499360#20499360%2320499360
    I implemented it and the problem has dissappeared.

  • Help about Date and Time by CMP entity bean

    I should have two fields in my cmp .one stores current date ,another one stores current time while ejbcreate();
    I should be able to get findmethod findobjectBetween ?! and ?2
    or that sorts of find method.what type of the method should I use.
    java.util.Date or Simply String?
    if I use java.tuil.Date as the type.
    How shoud my ejbcreate method look like?
    public abstract void setDate(Date mydate);
    public abstract Date getDate();
    ejbCreate(String name,String password,Date mydate,Date mytime)
    setDate()
    I suppose I use write a business method getCurrentDate() which uses
    java.util.Date().toLocale,But I think it just returns String
    help pls.

    I am using oc4j(Oracle9iAS (9.0.3.0.0))
    I am getting the following error using Timestamp while deploying cmp entity bean ejb1.1. Thanks...
    Auto-deploying TimestampTestEntity.jar (No previous deployment found)... TimestampTest_EntityBeanWrapper0.java:1558: Missing term.
    if (if(thread.contextContainer != null)
    ^
    TimestampTest_EntityBeanWrapper0.java:1558: ')' expected.
    if (if(thread.contextContainer != null)
    ^
    TimestampTest_EntityBeanWrapper0.java:1559: Invalid expression statement.
    response != null) {if(thread.contextContainer != null)
             ^
    TimestampTest_EntityBeanWrapper0.java:1559: ';' expected.
    response != null) {if(thread.contextContainer != null)
                    ^
    TimestampTest_EntityBeanWrapper0.java:1560: Missing term.
    response.setNanos(if(thread.contextContainer != null)
                      ^
    TimestampTest_EntityBeanWrapper0.java:1560: ')' expected.
    response.setNanos(if(thread.contextContainer != null)
                      ^
    TimestampTest_EntityBeanWrapper0.java:1561: ';' expected.
    response.getNanos());} // generated from BeanMethodCompilation
    ^
    7 errors
    Error compiling F:\oc4j\j2ee\home\applications\TimestampAppl/TimestampTestEntity.jar: Syntax error in source
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized

  • Help:How to manage relationships in CMP Entity beans

    Hi everybody;
    I am using Oracle JDeveloper 9i release 2 and Oracle 9i database.
    How can I manage one-to-many and many-to-many relationships in a CMP Entity Bean, I tried to managed the relationships in code, calling the beans, searching for records, making loops and joining.
    Is there a better way to manage the relationships with out doing this in code?
    Because I think it is not good for performance.
    Regards Francisco

    public void selectCurriculum(ValueChangeEvent event){
    logger.info(event.getNewValue().getClass());
    Integer id = (Integer) event.getNewValue();
    Collection curriculums = curriculums().getCurriculums();
    ObjectCurriculum curriculum = null;
    for (Iterator iterator = curriculums.iterator(); iterator.hasNext();) {
    ObjectCurriculum objectCurriculum = (ObjectCurriculum) iterator.next();
    if(objectCurriculum.getId().equals(id)){
    curriculum = objectCurriculum;
    break;
    curriculum().setWholeObject(curriculum);
    logger.info("setting current curriculum");
    no message is logged

  • Composite Primary Key in M:N CMP Entity Bean Relationship

    Dear Sir/Madam,
         We are creating an Enterprise Application for our institute using EJB 2.0 specifiactions. In the course of developement, we are facing a problem in writing the CMP Entity Beans with EJB Relationships.
         We are having many to many relationship between two beans such that the primary key of one Entity Bean (let's call it A), serves as the foreign key of another Entity Bean (let's call it B). Further, this primary key of A as foreign key in B, participates in the composite key of B.
         The EJB Specifications require that the primary key field(s) of any bean (B, in our case) declared in the Primary Key class should be the subset of the 'cmp-field' declared in the deployment descriptor for that bean. As I said earlier, we have many to many relationship at play. Hence, we require to keep the foerign key in the 'cmr-field' in lieu of 'cmp-field'. In short, the component of primary key is in 'cmr-field' while, it is needed in both 'cmp-field' and 'cmr-field'. That's perfect from Database point of view but illogical from CMP Entity Bean's view.
         How can we write the deployment descriptor for such a CMP (BMP is working fine for above scenario) Entity Bean? Also, how can we write the Primary Key class? The problem is not just to find the solution, but find under the hood of EJB 2.0 specifications.
         Please help.

    I think you should realise that it would not be convenient to use CMP for everything. It is difficult to define complex relations using CMP. Mostly BMP os preferd since it gives the flexibility for the bean developer.
    Regards
    xH4x0r

  • RE: Accessing a CMP Entity Bean

    Hi There,
    I have written a couple of CMP entity beans. When I run the client application, I am getting a ORB minor code 257. The error message follows. My code works with both BMP entity beans and session beans. Can anyone help? Thanks in advance.
    Aug 21, 2005 10:24:57 PM com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
    WARNING: "IOP00810257: (MARSHAL) Could not find class"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:7987)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1989)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2213)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1221)
         at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:255)
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:30)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)
    Caused by: java.lang.ClassNotFoundException
         ... 27 more
    org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:34)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)

    This is probably not the best forum to get an answer. Try this one instead:
    http://forum.java.sun.com/forum.jspa?forumID=13
    Its difficult to know exactly the source of your problem. If your code works for session beans and Entity beans using BMP then I can only think of the following:
    In a CMP Bean, the ejbLoad and ejbStore methods do nothing. The container performs the load and store for you. I don't know whether leaving code in these methods will cause any problems though.
    You will need to make a few changes to your ejbCreate method though. Suppose your ejbCreate method looks like this:
    public PersonKey ejbCreate(String aFirstName, String aLastName) You still need to initialise the firstName and lastName fields in the bean.
    firstName = aFirstName;
    lastName = aLastName;Normally, the ejbCreate method returns the key value for the created object. Using CMP, you must return null. The container generates the new key value and returns it to the client.
    Not sure if that will help. Post on the link above if not.
    Simon

  • CMP entity bean with compound primary key

    I'm trying to use a compound primary key in a CMP entity bean. I've created the custom primary key class okay, and I have the prim-key-class set in ejb-jar.xml. My client app gets the home reference okay, but when it tries to find an entity, I get the exception "SQLException: Incorrect syntax near '/'."
    I think I'm having trouble deploying this in OC4J. Is there a sample orion-ejb-jar.xml deployment for a custom, compound primary key somewhere?
    Many thanks for any help.
    Ernie

    Never mind. I solved my problem. Thanks.

  • Use direct JDBC with CMP entity bean in one transaction

    I am trying to use direct JDBC call with CMP entity bean within a session
    bean method that requires transaction. The problem is that it appears these
    are not in the same transaction. When I use the JDBC call, the CMP entity
    bean update to the DB has not been committed yet.
    We are using Weblogic 5.1 SP6. The DB is Oracle.
    What I do for the JDBC is get a new connection from the pool using weblogic
    jdbc pool driver.
    Any help would be appreciated.
    Patrick

    Hi. You can do JDBC and invoke CMP EJBs and have this all treated
    as one transaction, if your hand-written code explicitly starts
    a JTS transaction, then uses the jts driver or a TxDataSource to
    get the JDBC connection. Then your code can call transactional
    EJBs and their work will be included in the transaction you started.
    Assuming the bean work went OK, and your manual JDBC went OK, you
    can manually commit the UserTransaction at that time. This is 5.1
    talk. For 6.0, with @PC, this may be even easier...
    Joe
    Patrick Shen wrote:
    >
    But if I do that, then they would not be in the same transaction anymore.
    Is there any way to use JDBC with CMP Entity bean in the same transaction?
    Patrick
    "L'artiste" <[email protected]> wrote in message
    news:[email protected]...
    Are you calling all the CMP create in the session Bean ? If so, beforeyou
    make the JDBC call from the session bean, the CMP in 2. should commit. Try
    to set its attribute to TX_REQUIRES_NEW. This way, the calling client will
    block until this transaction is done (committed) before the execution
    continues. There might be some overhead involved in doing so if you are
    anticipating a lot of users.
    "Patrick Shen" <[email protected]> wrote in message
    news:[email protected]...
    What I am trying to do is:
    In a Session bean method -
    1. create a new CMP entity bean (a new row in DB table)
    2. create another new CMP entity bean that uses previous bean as foreignkey
    3. use JDBC to update the row just created
    And all these 3 calls have to be in one transaction.
    Thanks,
    Patrick
    "L'artiste" <[email protected]> wrote in message
    news:[email protected]...
    Can you give a little bit more information?
    Do you have methods in your session bean that creates this CMP entitybeans?
    It looks like
    you might wanna try to change the isolation level to
    TRANSACTION_READ_COMITTED
    to preven dirty_read.
    "Patrick Shen" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to use direct JDBC call with CMP entity bean within a
    session
    bean method that requires transaction. The problem is that it
    appears
    these
    are not in the same transaction. When I use the JDBC call, the CMP
    entity
    bean update to the DB has not been committed yet.
    We are using Weblogic 5.1 SP6. The DB is Oracle.
    What I do for the JDBC is get a new connection from the pool usingweblogic
    jdbc pool driver.
    Any help would be appreciated.
    Patrick
    PS: Folks: BEA WebLogic is expanding rapidly, with both entry and advanced positions
    for people who want to work with Java, XML, SOAP and E-Commerce infrastructure products.
    We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and San Jose CA.
    Send resumes to [email protected]

  • How to load the existing data from the databse in the CMP entity bean?

    hello
    my problem is as follows--
    i am creating a CMP entity bean.in these beans client create the data instances using create() function.
    now a entity bean will be created for the newly created data and it's EJBObject will also be formed.
    now we will be able to perform finder methods over them.
    remember these data has been newly created in the database.
    but now if i want to perform the finder methods on the
    existing data in the database( i don't need to use create() fn as i am not "creating" the data.). how will i perform the query over the existing data.
    basically i have to make a CMP bean to extract the data corresponding to a particular condition , from the database table. i don't want to create the data in the database but just find out what data satisfies my condition.
    thanking you
    Prashant

    you have to use findByXXX methods. depending on your appserver you may have to declare them (and eventually the query you want to be used) in the vendor specific deploiement descriptor.
    (e.g. using jboss i don't remember having explicitly declare the findBySomeField method - where someField is a persistent field - in the dd, whereas with bas all finder methods have to be explicitly declared)
    [note that obviously these methods have to be present in your home interface]

  • Error while using sybase trigger with the CMP entity bean,ejb version 2.1

    Hi All,
    I am using ejb version 2.1 and using entity bean (Transaction required) ,i am trying to update data in sybase(ver 12.3) database table
    I am using session bean(Transaction required) to update the multiple entity beans in a while loop.It is working fine .But when i am trying to run it with the trigger which updates multiple tables in different sybase databases on update of each entity.Then it throws NoSuchEntityException and it rollback the whole transaction.
    My trigger has only few simple update statements and the trigger runs fine without my CMP entity bean.is the CMP does not support the update triggers in sybase or is it the problem with the transaction.
    Please help
    Thanks
    Anshu

    If you can have a look at a cmp example in the samples that ship with the server. My guess is that the weblogic-ejb-jar.xml file is missing the <persistence-use> element which for 810 would look like:
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    I seem to recall that the elements might be slightly different in structure for the wls700 version of the DTD, so please check that (I cannot, I'm at home and don't have everything here).
    Give that a try and see if it doesn't solve your compilation failure.
    Also, the compilation should not be throwing a null pointer exception in a case like that, I consider that to be a bug.
    -thorick

Maybe you are looking for

  • Firefox will not start up at all due to installing add on {e4a8a97b-f2ed-450b-b12d-ee082ba24781}

    I think it may be due to me stupidly downloading XAMPP as well as MAMP and now Firefox won't open. It tries to restore all tabs at start up but goes straight to Mozilla crash report. I can't start it in safe mode because it won't even open. Tried dow

  • How to delete album artwork for new u2 album

    Thank you Apple for letting me delete artwork for every single album EXCEPT that for the new U2 album. I would like to set the artwork to a generic icon and can't...no matter what I do. Why?

  • Cannot load model on E&A

    Hello SAP team, I am having a problem while i am loading the model on E&A screen. Problem occurs both in test and live servers. We have tested our LinkID's and we have a problem with a LinkID SSM_CB_EA. Please see the detailed log below. Our system e

  • Creating a Product Comparison Chart

    Hello, I was wondering if anyone had any suggestions about where I could find resourses/tutorials on how to create product comparison charts for a website?  I have some very basic knowledge of php and MySQL so is this something I could learn on my ow

  • Getting a mac pro???

    im getting a new computer for sure but im a gamer and i was wondering if the mac pro can handle more serious games...the video card is weak from my view but does anyone hav eany experience with it....also is it possible to add more cores into the mac