HI Everyone,
    I am new to Websphere 5 Server. I am trying to deploy a simple app with two beans having relation on WAS 5.  How do I map my beans to existing tables?
Here is the structure of bean and its table,
 
1. Customer (Customer Table)
    - String id, (VARCHAR2) -    PK
    - String name (VARCHAR2)
    - address (cmr)
2. Address (Address Table)
    - Long addId, (NUMBER) -     PK
    - String houseNO (VARCHAR2)
    - String street (VARCHAR2)
    - String city (VARCHAR2)
                        (CUSTID     FK references Customer)
 
 
I tried changing the map.mapxmi files generated by "ejbDeploy" giving my mapping. It works only when there is no relation. As soons as I introduce relation between them, it starts giving problem.
 
Here are some problems which I faced.
 
1. I had a finder method in a bean which was using cmr field in the ejb-ql. "ejbdeploy" does not complain the first time. But when I make change in map.mapxmi file, it starts complaining that the schema has not any field named as this cmr field name. I checked the cmr name and it is very much valid.
 
2. I removed the finder method to nail down the problem. Now it complains for Invalid TypeMap for Long - VARCHAR for pk field of the target bean (target of relation). The PK field type is java.lang.Long and its data Type in the DB is NUMBER. I am unbale to find why it is complaining for Long-VARCHAR.
 
3. I changed my addId field to Integer , then it moves a little further and then throws up this exception
 
java.lang.NullPointerException
        at com.ibm.ObjectQuery.crud.queryplan.ReadQueryCreator.createInverseNavi
gationQuery(ReadQueryCreator.java:145)
        at com.ibm.etools.ejbdeploy.gen20.jdbc.QueryCache.initRelQueries(QueryCa
che.java:590)
        at com.ibm.etools.ejbdeploy.gen20.jdbc.QueryCache.initQueryCache(QueryCa
che.java:110)
        at com.ibm.etools.ejbdeploy.gen20.jdbc.QueryCacheHelper.<init>(QueryCach
eHelper.java:31)
        at com.ibm.etools.ejbdeploy.gen20.jdbc.QueryCacheCache.initQueries(Query
CacheCache.java:69)
        at com.ibm.etools.ejbdeploy.gen20.jdbc.QueryCacheCache.init(QueryCacheCa
che.java:154)
        at com.ibm.etools.ejbdeploy.plugin.EJBDeployOperation.runCMP(EJBDeployOp
eration.java:1489)
        at com.ibm.etools.ejbdeploy.plugin.EJBDeployOperation.run(EJBDeployOpera
tion.java:1352)
        at com.ibm.etools.ejbdeploy.plugin.EJBDeployOperation.doit(EJBDeployOper
ation.java:859)
        at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.invokeDeployment
Codegen(BatchExtension.java:1508)
        at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.internalJarProce
ss(BatchExtension.java:498)
        at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.runEarDeploy(Bat
chExtension.java:339)
        at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.access$000(Batch
Extension.java:103)
        at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension$RunDeploy.run(Ba
tchExtension.java:237)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1378
)
        at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension$RunDeploy.execut
e(BatchExtension.java:221)
        at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.run(BatchExtensi
on.java:184)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.ibm.etools.ejbdeploy.batch.impl.BootLoaderLoader.run(BootLoaderLo
ader.java:255)
        at com.ibm.etools.ejbdeploy.batch.impl.BatchDeploy.execute(BatchDeploy.j
ava:133)
        at com.ibm.etools.ejbdeploy.EJBDeploy.execute(EJBDeploy.java:82)
        at com.ibm.etools.ejbdeploy.EJBDeploy.main(EJBDeploy.java:309)
Will greatly appreciate any help regarding this.
 
Regards,
Rupesh.
 
p.s : I have already deployed this application on Pramati Server as well as weblogic 7.0 and it works without any problem.


 
 

Reply via email to