Discussions

EJB programming & troubleshooting: integer primary key for entity beans

  1. integer primary key for entity beans (4 messages)

    Hi
    I'm working on an EJB project, where in my primary key of an entity bean is and integer field. So in .xml, I'm writing <prim-key-class> as "java.lang.Integer" and also mentioning the <primkey-field>. After succesful ejbCompilation (i.e. ejbc), I'm getting an error while starting the WLserver. (We r using Weblogic6.0). I'm giving the error below:

    **************************************************************
    <Feb 19, 2001 5:10:29 PM GMT+05:30> <Error> <J2EE> <Error de
    ploying EJB Component : cust2
    weblogic.ejb20.EJBDeploymentException: Error Deploying CMP E
    JB:; nested exception is:
            weblogic.ejb20.cmp.rdbms.RDBMSException: Could not a
    ccess table 'ssc'.
    weblogic.ejb20.cmp.rdbms.RDBMSException: Could not access ta
    ble 'ssc'.
            at weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl
    .verifyTableExists(PersistenceManagerImpl.java:129)
            at weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl
    .verifyTablesExist(PersistenceManagerImpl.java:138)
            at weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl
    .setup(PersistenceManagerImpl.java:90)
            at weblogic.ejb20.internal.EntityEJBHome.setBeanInfo
    (EntityEJBHome.java:144)
            at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.
    deploy(ClientDrivenBeanInfoImpl.java:474)
            at weblogic.ejb20.deployer.Deployer.deployDescriptor
    (Deployer.java:968)
            at weblogic.ejb20.deployer.Deployer.deploy(Deployer.
    java:792)
            at weblogic.j2ee.EJBComponent.deploy(EJBComponent.ja
    va:31)
            at weblogic.j2ee.Application.addComponent(Applicatio
    n.java:116)
            at weblogic.j2ee.J2EEService.addDeployment(J2EEServi
    ce.java:115)
            at weblogic.management.mbeans.custom.DeploymentTarge
    t.addDeployment(DeploymentTarget.java:283)
            at weblogic.management.mbeans.custom.DeploymentTarge
    t.addDeployment(DeploymentTarget.java:109)
            at java.lang.reflect.Method.invoke(Native Method)
            at weblogic.management.internal.DynamicMBeanImpl.inv
    okeLocally(DynamicMBeanImpl.java:559)
            at weblogic.management.internal.DynamicMBeanImpl.inv
    oke(DynamicMBeanImpl.java:545)
            at weblogic.management.internal.ConfigurationMBeanIm
    pl.invoke(ConfigurationMBeanImpl.java:285)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1555)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1523)
            at weblogic.management.internal.ConfigurationMBeanIm
    pl.updateConfigMBeans(ConfigurationMBeanImpl.java:405)
            at weblogic.management.internal.ConfigurationMBeanIm
    pl.invoke(ConfigurationMBeanImpl.java:287)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1555)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1523)
            at weblogic.management.internal.DynamicMBeanImpl.add
    Deployment(DynamicMBeanImpl.java:859)
            at weblogic.management.internal.DynamicMBeanImpl.add
    Deployment(DynamicMBeanImpl.java:846)
            at weblogic.management.internal.DynamicMBeanImpl.add
    (DynamicMBeanImpl.java:831)
            at weblogic.management.internal.DynamicMBeanImpl.inv
    okeLocally(DynamicMBeanImpl.java:563)
            at weblogic.management.internal.DynamicMBeanImpl.inv
    oke(DynamicMBeanImpl.java:545)
            at weblogic.management.internal.ConfigurationMBeanIm
    pl.invoke(ConfigurationMBeanImpl.java:285)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1555)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1523)
            at weblogic.management.internal.MBeanProxy.invoke(MB
    eanProxy.java:431)
            at weblogic.management.internal.MBeanProxy.invoke(MB
    eanProxy.java:172)
            at $Proxy45.addTarget(Unknown Source)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.autoDeploy(ApplicationManager.java:485)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.addApplication(ApplicationManager.java:556)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.addApplication(ApplicationManager.java:503)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.poll(ApplicationManager.java:427)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.poll(ApplicationManager.java:379)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.update(ApplicationManager.java:151)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.startAdminManager(ApplicationManager.java:204)
            at weblogic.management.mbeans.custom.ApplicationMana
    ger.start(ApplicationManager.java:119)
            at java.lang.reflect.Method.invoke(Native Method)
            at weblogic.management.internal.DynamicMBeanImpl.inv
    okeLocally(DynamicMBeanImpl.java:559)
            at weblogic.management.internal.DynamicMBeanImpl.inv
    oke(DynamicMBeanImpl.java:545)
            at weblogic.management.internal.ConfigurationMBeanIm
    pl.invoke(ConfigurationMBeanImpl.java:285)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1555)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBe
    anServerImpl.java:1523)
            at weblogic.management.internal.MBeanProxy.invoke(MB
    eanProxy.java:431)
            at weblogic.management.internal.MBeanProxy.invoke(MB
    eanProxy.java:172)
            at $Proxy5.start(Unknown Source)
            at weblogic.management.Admin.startApplicationManager
    (Admin.java:963)
            at weblogic.management.Admin.finish(Admin.java:459)
            at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:429)
            at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:170)
            at weblogic.Server.main(Server.java:35)
    >
    <Feb 19, 2001 5:10:29 PM GMT+05:30> <Error> <J2EE> <Error de
    ploying application cust2: Could not deploy: 'cust2.jar'
    Possible reasons include:
    1. The bean or an interface class has been modified but
       the deployment descriptor has not been updated
    2. The database mappings in the deployment descriptor do not

       match the database definition
    3. The jar file is not a valid jar file
    4. The jar file does not contain a valid bean>
    <Feb 19, 2001 5:10:35 PM GMT+05:30> <Notice> <WebLogicServer
    > <WebLogic Server started>
    <Feb 19, 2001 5:10:35 PM GMT+05:30> <Notice> <WebLogicServer
    > <SSLListenThread listening on port 7002>
    <Feb 19, 2001 5:10:35 PM GMT+05:30> <Notice> <WebLogicServer
    > <ListenThread listening on port 7001>

    *************************************************
    Kindly help me asap. Promt response will be appreciated.
    Regards,
    Ram Mohan





  2. Ram,

    Make it as "java.math.BigDecimal" and change all your beans accordingly. It is working in my case.

    I think your error is also saying "could not access table". Juct check the connection pool name in the XMl file and entry in the weblogic.properties file.

    Thanks
    Srinivas
  3. Dear Srinivas,
      Thanx alot. I tried it but no result.
    I couldn't even run a single entity bean CMP in WL6.0. Even the example given with WL as it is. I could run every thing with WL5.1. I do't know what's the problem with WL6.0. The same bean, which succeeded in 5.1 is giving error (The same given previously). Could anybody kindly help me?
    --Ram
  4. Dear Srinivas,
      Thanx alot. I tried it but no result.
    I couldn't even run a single entity bean CMP in WL6.0. Even the example given with WL as it is. I could run every thing with WL5.1. I do't know what's the problem with WL6.0. The same bean, which succeeded in 5.1 is giving error (The same given previously). Could anybody kindly help me?
    --Ram
  5. Dear Srinivas,
      Thanx alot. I tried it but no result.
    I couldn't even run a single entity bean CMP in WL6.0. Even the example given with WL as it is. I could run every thing with WL5.1. I do't know what's the problem with WL6.0. The same bean, which succeeded in 5.1 is giving error (The same given previously). Could anybody kindly help me?
    --Ram