Help:ERROR: Error from ejbc: The names of cmr and cmp fields must be unique - WebLogic Server - EJB

Hi,
We are in the process of migrating our application (containing EJB and CMP/CMR relations between them) to WebLogic 10/SP1.
The migration wizard has updated the EJB files with the Java5 style annotations.
During the compilation of the component that contains EJBs, we are getting an error, that says.
java weblogic.utils.compiler.ToolFailureException: ERROR: Error from ejbc: In relation ServiceOrderBean-SpecialServiceBean, a cmr-field and a cmp-field on the bean are using the same name. The names of cmr and cmp fields must be unique.
The two entity beans ServiceOrderBean.java and SpecialServiceBean.java refer to two database tables. Both these tables have a likenamed column service_order_id.
Further, the following EJB relation is defined as under:
SpecialServiceBean.java defines a relation like:
#Relation(roleName = "SpecialServiceBeans-have-ServiceOrderBean",
fkColumn = "SERVICE_ORDER_ID",
cmrField = "serviceOrderId",
targetEjb = "ServiceOrderBean",
multiplicity = Relation.Multiplicity.MANY,
name = "ServiceOrderBean-SpecialServiceBean")
ServiceOrderBean.java defines a relation like:
#Relation(roleName = "ServiceOrderBean-has-SpecialServiceBeans",
cmrField = "specialService",
targetEjb = "SpecialServiceBean",
multiplicity = Relation.Multiplicity.ONE,
name = "ServiceOrderBean-SpecialServiceBean"
Further, the schemas for the tables related to these entity beans are as follows:
ServiceOrderBean --> TXN_SERVICE_ORDER table
SERVICE_ORDER_ID NOT NULL NUMBER
SERVICE_ID NUMBER
EVENT_ID NUMBER(10)
SERVICE_TYPE VARCHAR2(20)
BES_REF_NO VARCHAR2(20)
PART_ID NUMBER(10)
BACKENDSYSTEM_NAME VARCHAR2(20)
COLLECT_ID NUMBER(10)
DELIVERY_ID NUMBER(10)
COMMENT_ID NUMBER(10)
REPAIR_LINE VARCHAR2(300
SUPPLIER VARCHAR2(50)
EXCHANGEPRODUCT_NO VARCHAR2(20)
PRICE NUMBER(10,2)
STATUS_ID NUMBER(10)
PO_NUMBER VARCHAR2(25)
SHIPPED_FROM_RLDATE DATE
RECEIVE_DATE DATE
HUB_REASON VARCHAR2(300
HUB_SITE VARCHAR2(100
INITIAL_DELIVERY_DATE DATE
FAILURECODE NUMBER(10)
DOA_ID NUMBER(10)
RECEIVED_AT_RLDATE DATE
BEP_SERVICEORDER_ID VARCHAR2(12)
HPQUEUENAME VARCHAR2(20)
LOCALDEPOT VARCHAR2(64)
SERVICE_PRIORITY VARCHAR2(20)
ADDITIONAL_DATA VARCHAR2(100
SERVICEPRODUCT_DESC VARCHAR2(100
SERVICEPRODUCT_NO VARCHAR2(20)
REF_SERVICEORDER_ID NUMBER
PICK_DATE DATE
LASTUPDATE DATE
STATUS_HISTORY_ID NUMBER
COLLECT_SERIAL_NO VARCHAR2(100
DELIVERED_SERIAL_NO VARCHAR2(100
CHANNEL VARCHAR2(10)
DISPATCH_REASON VARCHAR2(100
ESCALATE_FLAG CHAR(1)
PART_NUMBER VARCHAR2(48)
PART_DESCRIPTION VARCHAR2(256
PART_SERIALNO VARCHAR2(16)
PARTSERVICE_FLAG VARCHAR2(1)
DRIVER_VERSION VARCHAR2(32)
DRIVER_LANGUAGE VARCHAR2(16)
DRIVER_OS VARCHAR2(48)
DRIVER_MEDIA_TYPE VARCHAR2(16)
QUALITY_ID NUMBER(10)
CALLER_MOBILE_PHONE VARCHAR2(15)
CALLER_PHONE VARCHAR2(20)
SpecialServiceBean --> TXN_SPECIAL_SERVICE table
SP_ID NOT NULL NUMBER
SERVICE_ORDER_ID NUMBER
SP_SERVICE_NAME VARCHAR2(64)
SP_SERVICE_STATUS VARCHAR2(64)
SP_CUSTOMER_COMMENT VARCHAR2(100)
SP_RP_COMMENT VARCHAR2(100)
We are currently facing this roadblock without fixing which we will be unable to proceed with the migration.
Hence, appreciate help if you have encountered and fixed this issues earlier.
If any additional information is needed to look into this issue, please let me know.
Thanks in advance,
Deepak A. 

This is now resolved.
The reason for the issue was a method in a bean (SpecialServiceBean) that had two annotations
#CmrField()
#CmpField(column = "SERVICE_ORDER_ID")
#LocalMethod()
public abstract java.lang.Integer getServiceOrderId();
This was causing the issue.
This was resolved by creating a new getXXX method with a new name (takes care of CMR field) and the current name as is for the CMP field.
With this, the CMP field name got changed to a name separate from the CMR field, and the compilation proceeded.

Related

loading nodes & link tables

I am learning oracle spatial and got stuck at the creating network stage. I am using navteq sample data. I have created the node,link and path tables. what I am looking for is what table should be used to populate the node and link tables from the navteq data ( I am thinking intersection and road tables). If anyone can please post the load script that was used to load these tables (node & link). This could aid me understanding what was done or needs to be done.
Thanks 
Have a look at the following thread, it lists a script/workflow for adding Tele Atlas data into the Network Model. Maybe it can give you an idea how to do it for your Navteq data.
Re: Massive Routing analysis
Luc 
I looked at the thread but my problem is with the tables. in the navteq data there are 3 tables
SQL> desc gc_intersection_us
Name Null? Type
----------------------------------------- -------- ----------------------------
ROAD_ID_1 NUMBER(10)
ROAD_SEGMENT_ID_1 NUMBER(10)
ROAD_ID_2 NUMBER(10)
ROAD_SEGMENT_ID_2 NUMBER(10)
INTS_LONG NUMBER
INTS_LAT NUMBER
HOUSE_NUMBER NUMBER(6)
HOUSE_NUMBER_2 NUMBER(6)
SIDE VARCHAR2(1)
COUNTRY_CODE_2 VARCHAR2(2)
PARTITION_ID NUMBER(2)
SQL> desc gc_road_us
Name Null? Type
----------------------------------------- -------- ----------------------------
ROAD_ID NUMBER(10)
SETTLEMENT_ID NUMBER(10)
MUNICIPALITY_ID NUMBER(10)
PARENT_AREA_ID NUMBER(10)
LANG_CODE VARCHAR2(3)
NAME VARCHAR2(80)
BASE_NAME VARCHAR2(64)
PREFIX VARCHAR2(32)
SUFFIX VARCHAR2(32)
STYPE_BEFORE VARCHAR2(32)
STYPE_AFTER VARCHAR2(32)
STYPE_ATTACHED VARCHAR2(1)
START_HN NUMBER(6)
CENTER_HN NUMBER(6)
END_HN NUMBER(6)
START_HN_SIDE VARCHAR2(1)
CENTER_HN_SIDE VARCHAR2(1)
END_HN_SIDE VARCHAR2(1)
START_LONG NUMBER
START_LAT NUMBER
CENTER_LONG NUMBER
CENTER_LAT NUMBER
END_LONG NUMBER
END_LAT NUMBER
START_ROAD_SEG_ID NUMBER(10)
CENTER_ROAD_SEG_ID NUMBER(10)
END_ROAD_SEG_ID NUMBER(10)
POSTAL_CODE VARCHAR2(16)
COUNTRY_CODE_2 VARCHAR2(2)
PARTITION_ID NUMBER(2)
CENTER_HN2 NUMBER(6)
SQL> desc gc_road_segment_us
Name Null? Type
----------------------------------------- -------- ----------------------------
ROAD_SEGMENT_ID NUMBER(10)
ROAD_ID NUMBER(10)
L_ADDR_FORMAT VARCHAR2(1)
R_ADDR_FORMAT VARCHAR2(1)
L_ADDR_SCHEME VARCHAR2(1)
R_ADDR_SCHEME VARCHAR2(1)
START_HN NUMBER(6)
END_HN NUMBER(6)
L_START_HN NUMBER(6)
L_END_HN NUMBER(6)
R_START_HN NUMBER(6)
R_END_HN NUMBER(6)
POSTAL_CODE VARCHAR2(16)
GEOMETRY MDSYS.SDO_GEOMETRY
COUNTRY_CODE_2 VARCHAR2(2)
PARTITION_ID NUMBER(2)
L_START_HN2 NUMBER(6)
L_END_HN2 NUMBER(6)
R_START_HN2 NUMBER(6)
R_END_HN2 NUMBER(6)
i would like to populate the following tables
SQL> desc dc_intersections <-------node table
Name Null? Type
----------------------------------------- -------- ----------------------------
NODE_ID NOT NULL NUMBER
NODE_NAME VARCHAR2(200)
NODE_TYPE VARCHAR2(200)
ACTIVE VARCHAR2(1)
PARTITION_ID NUMBER
LOCATION MDSYS.SDO_GEOMETRY
SQL> desc dc_streets <---------link table
Name Null? Type
----------------------------------------- -------- ----------------------------
LINK_ID NOT NULL NUMBER
LINK_NAME VARCHAR2(200)
START_NODE_ID NOT NULL NUMBER
END_NODE_ID NOT NULL NUMBER
LINK_TYPE VARCHAR2(200)
ACTIVE VARCHAR2(1)
LINK_LEVEL NUMBER
STREET_GEOM MDSYS.SDO_GEOMETRY
STREET_LENGHT NUMBER
BIDIRECTED VARCHAR2(1)
based on this table could any one come up with an insert statement for the node and link table. My main problem is that am not sure what most the columns from the navteq data mean. I downloaded the data (district of columbia) from acdi which did not have any description for the tables or columns. i am hoping that someone used the navteq data and was able to populate the link & nodes, if so please post.
thanks for all ur help 
When looking at the table descriptions only, it is difficult to say how the intersection table should be used to fit it in the NODE table.
The Link table should be filled using the streetsegment table or combination of the road table with the roadsegment table. This all depends on what info you would like to use in your network analysis. Also attributes like cost or length, you probably have to derive from the geometry => calculate length of the geometry.
This can be done explicitly during the load of the tables using sdo_geom.sdo_length(geometry), or by refering to a function which will give you the cost of a link (new in 10gR2 read: Cost Computation by a PL/SQL Function http://download.oracle.com/docs/html/B14256_01/sdo_topo_newfeat.htm#sthref32).
My best guess it to ask some support or pre-sales assistance from the website you've downloaded this testdata or search for some integrators that can assist you with this like 1Spatial for example (http://www.1spatial.com/products/radius_topology/index.php).
Regards
Luc

PLS-00049: bad bind variable

Hi, Am getting band bind variable when an trying to compile a trigger. Appeciate if someone could helpme. Below is a simple trigger i have created and corresponding table for it. Thanks desc objective Name Null? Type ----------------------------------------- -------- -------------- OBJECTIVE_ID NUMBER(10) QUESTION_ID NOT NULL NUMBER(10) NAME VARCHAR2(200) CREATEDBY NOT NULL NUMBER(10) CREATEDATE NOT NULL TIMESTAMP(6) MODIFIEDBY NOT NULL NUMBER(10) SQL> desc at_objective Name Null? Type ----------------------------------------- -------- ------------- ATID NUMBER(10) ACTION CHAR(1) ACTIONTIME TIMESTAMP(6) OBJECTIVE_ID NUMBER(10) QUESTION_ID NUMBER(10) NAME VARCHAR2(200) CREATEDBY NUMBER(10) CREATEDATE TIMESTAMP(6) MODIFIEDBY NUMBER(10) create or replace trigger objective after update on objective FOR EACH ROW begin INSERT INTO AT_Objective (:NEW.ACTION,:NEW.actiontime, :NEW.objective_id, :NEW.question_id, :NEW.NAME, :NEW.createdby, :NEW.createdate, :NEW.modifiedby, :NEW.modifydate ) VALUES ( 'U', SYSDATE,:NEW.:OLD.objective_id, :NEW.:OLD.question_id, :NEW.:OLD.NAME, :NEW.:OLD.createdby, :NEW.:OLD.createdate, :NEW.:OLD.modifiedby, :NEW.:OLD.modifydate ); end objective;
Try this:
CREATE OR REPLACE TRIGGER objective
AFTER UPDATE
ON objective
FOR EACH ROW
BEGIN
INSERT INTO at_objective
(action, actiontime, objective_id, question_id,
NAME, createdby, createdate, modifiedby,
modifydate
)
VALUES ('U', SYSDATE, :OLD.objective_id, :OLD.question_id,
:OLD.NAME, :OLD.createdby, :OLD.createdate, :OLD.modifiedby,
:OLD.modifydate
);
END; 
Thanks Steve,
I have done the changes suggested and it worked.

Display the date witch is not exist in my table

Dear Sir
I want to get the date which is not exist in this field C_DATE, when I compare between tow date, that is I let user enter from_date and to_date ,to get the date which is not exist in the CHEMICAL_CONSUMPTION table ,
And my table structure as the flowing:
SQL> DESC CHEMICAL_CONSUMPTION
Name Null? Type
------------------------------- -------- ----
C_DATE DATE
C_JOB_NO NUMBER(8)
C_BLOCK_TYPE VARCHAR2(10)
C_COLOR_TYPE VARCHAR2(10)
C_RUN_TIME NUMBER(6,2)
C_OPER_CODE VARCHAR2(10)
REMARKS VARCHAR2(450)
C_YEAR NUMBER(4)
C_DAY_REMARKS VARCHAR2(2000)
ORDER_CODE NUMBER(12)
RRQ_DOC_CODE NUMBER(12)
Can I compare this table with the dual table to display the date witch is not in CHEMICAL_CONSUMPTION .
Waiting for your valuable answer with example
Best regards
Jamil Alshaibani

Add default Column as Boolean while creating table

Hi,
I am trying to create a table with default value for boolean data as shown below:
CREATE TABLE test_users (
user_id number(11) NOT NULL PRIMARY KEY,
first_name varchar2(50),
last_name varchar2(50),
email varchar2(100),
user_password varchar2(100),
zip_code varchar2(50),
title varchar2(100),
description varchar2(2000),
picture_path varchar2(2000),
one_time_activation number(1) default null check(one_time_activation in(0,1)),
one_time_activation_code varchar2(100),
is_active number(1) default null check(is_active in(0,1)),
security_question_id number(11),
security_answer varchar2(100),
inserted_date datetime,
modified_date datetime,
is_deleted number(1) default 0 check(is_deleted in(0,1)),
last_login_date datetime,
no_of_views number(20) DEFAULT 0,
is_redirect_to_edit_profile number(1) default 1 check(is_redirect_to_edit_profile in(0,1)),
present_login_date datetime,
is_interested_ab_membership number(1) default 0 check(is_interested_ab_membership in(0,1)),
joined_date datetime,
removed_date datetime,
is_admin_deleted number(1) DEFAULT 0 check(is_admin_deleted in(0,1)),
moderated_by number(11),
is_subscribe_newsletter number(1) DEFAULT 0 check(is_subscribe_newsletter in(0,1)),
user_pagination number(3) DEFAULT 15
);
but i am getting
Error at line 1
ORA-00902: invalid datatype
thanks 
Boolean's not an available data type in Oracle.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6263249199595 
What does your question have to do with sql developer?
You don't even say what database you are trying to use.
Oracle doesn't support a 'datetime' datatype so your create table statement won't work in Oracle.
If you change 'datetime' to 'date' the table creates just fine.

developing spatial queries

Hi i have two tables :
SQL> desc nw1911
Name Null? Type
------------------------------- -------- ----
AREA NUMBER(18,3)
PERIMETER NUMBER(18,3)
PAR_ID NUMBER(13)
PARISH VARCHAR2(150)
DB_NAME VARCHAR2(40)
COUNTY VARCHAR2(20)
NOTES VARCHAR2(200)
CEN_AREA NUMBER
FAM1901 NUMBER
FAM1911 NUMBER
POP1901 NUMBER
POP1911 NUMBER
MALE1911 NUMBER
FEMALE1911 NUMBER
INST_NO NUMBER
INST_POP NUMBER
SUB_DIST VARCHAR2(40)
POPDENSITY NUMBER
MI_PRINX NUMBER(11)
GEOLOC MDSYS.SDO_GEOMETRY
SQL> desc postcode_1
Name Null? Type
------------------------------- -------- ----
POSTCODE VARCHAR2(7)
COUNTY NUMBER(11)
LADUA VARCHAR2(2)
SPC VARCHAR2(1)
EASTING NUMBER(11)
NORTHING NUMBER(11)
GRSTAT NUMBER(11)
POBOX NUMBER(11)
MI_PRINX NUMBER(11)
i want to query the postcode and parish column
Is it possible to do a join on these two tables based on them having MI_ PRINX
Pleass correct me if i am completely correct. 
You are probably not completely correct.
The mi_prinx key from one table may not
have any relationship to the mi_prinx key from another
table, so joining based on that value would not be
helpful.
If you want to do a spatial query between the two tables
then you will need to join them using a spatial query.
This requires that you create a spatial index.
Dan

Categories

Resources