hariharakarthi Subramanian

Greenhorn
+ Follow
since Aug 11, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by hariharakarthi Subramanian

Hi,
I have written an ant script to build an EAR file. It runs on WAS 7 project. Till now we export EAR and deploy it in WAS 7 server.
In Java 5 EE, we don't have to specify application.xml file.


1. When ran ant script it runs and builds EAR in windows and when deploy the EAR we got deployment excpetion.
2. As Java 5 EE, does not require application.xml, we do not have it. But, while using ant script, we tried the below, it is not builing the EAR, it says Deployment descriptor not found.

<target name="build_ear" depends="junit">
<ear destfile="${destination}/${name}EAR.ear" update="true" appxml=" "> <!-- appxml=space -->
<fileset dir="${build}" includes="*.jar,*.war, version.txt"/>
<manifest>
<attribute name="Class-Path" value="" />
</manifest>
</ear>
</target>
3. When we use update="false" and appxml="", it builds an EAR, but it fails during deployment with Websphere deployment exception.

In both case 2 and 3, either Ant looks for appxml or Websphere looks for application.xml. I don't want to specify application.xml and build an ear.

how to fix this?
12 years ago
Hi,

I trying to join two tables.

The table and its details are as follows,
TANNUAL_STMT_LINE --- A
TRESERVE_FACTOR -- B

Trying to add table B (TRESERVE_FACTOR) as collection in table A (TANNUAL_STMT_LINE)

The mapping file is given below,




Below is the code snippet used to execute the above query.





The sysout is as follows,

Code:
021
ALLIED LINES
Hibernate: select treservefa0_.ANNUAL_STMT_LN_ID as ANNUAL1_0_, treservefa0_.MEASURE_ID as MEASURE2_0_, treservefa0_.YEAR_NO as YEAR3_0_, treservefa0_.QUARTER_NO as QUARTER4_0_, treservefa0_.POOL_CD as POOL5_0_, treservefa0_.COMPANY_NO as COMPANY6_0_, treservefa0_.CRNT_RESRV_FCTR_PC as CRNT7_0_, treservefa0_.MIN1_RESRV_FCTR_PC as MIN8_0_, treservefa0_.MIN2_RESRV_FCTR_PC as MIN9_0_, treservefa0_.MIN3_RESRV_FCTR_PC as MIN10_0_, treservefa0_.MIN4_RESRV_FCTR_PC as MIN11_0_, treservefa0_.UPDATE_TS as UPDATE12_0_, treservefa0_.UPD_USER_ID as UPD13_0_, treservefa0_.MIN5_RESRV_FCTR_PC as MIN14_0_ from REPORTER.TRESERVE_FACTOR treservefa0_ where treservefa0_.ANNUAL_STMT_LN_ID=?
null
0742



I could not get the ANNUAL_STMT_LN_ID column in the set, which is key column. The mapping may look very complex. But, the mappings are mandatory for the project requirement.


I have two pojo classes for the table TRESERVE_FACTOR, class TreserveFactor and TreserveFactorPK. The class TreserveFactorPK contains properties for primary keys of TRESERVE_FACTOR table. Hence, I have to use the nested-composite-element to do the mapping.

Now, the quetion is I could not map the key of the set. The key ANNUAL_STMT_LN_ID is a primary key. Hence, it needs to be reference inside the nested-composite-element. But, when I tried it, hibernate throws error saying that duplicate mapping. I can't get rid of key from the set.

I need to refer the key ANNUAL_STMT_LN_ID to TreserveFactorPK inside the nested-composite-element. Is it possible? is there any other option ? Help is appericated
Thanks for your replay.

Given below is my mapping file class,

<class name="icp.entity.TannualStmtLine" table="TANNUAL_STMT_LINE">
<id column="ANNUAL_STMT_LN_ID" name="annualStmtLnId" type="string">
<generator class="assigned"/>
</id>
<property name="annualStmtLnNm" type="string">
<column length="30" name="ANNUAL_STMT_LN_NM" not-null="true"/>
</property>
<property name="updateTs" type="timestamp">
<column length="45" name="UPDATE_TS" not-null="true"/>
</property>
<property name="updUserId" type="string">
<column length="8" name="UPD_USER_ID" not-null="true"/>
</property>
<property name="exceptionIn" type="char">
<column length="1" name="EXCEPTION_IN" not-null="true"/>
</property>
<property name="ovAnnlStmtLnId" type="string">
<column length="3" name="OV_ANNL_STMT_LN_ID" not-null="true"/>
</property>
<set name="treserveFactors" table="TRESERVE_FACTOR">
<key column="ANNUAL_STMT_LN_ID"/>
<composite-element class="icp.entity.TreserveFactor">
<parent name="icp.entity.TannualStmtLine"/>
<property name ="treserveFactorPK" column="MEASURE_ID"/>
<property name ="treserveFactorPK" column="YEAR_NO"/>
<property name ="treserveFactorPK" column="QUARTER_NO"/>
<property name ="treserveFactorPK" column="POOL_CD"/>
<property name ="treserveFactorPK" column="COMPANY_NO"/>
<property name ="crntResrvFctrPc" column="CRNT_RESRV_FCTR_PC"/>
<property name ="min1ResrvFctrPc" column="MIN1_RESRV_FCTR_PC"/>
<property name ="min2ResrvFctrPc" column="MIN2_RESRV_FCTR_PC"/>
<property name ="min3ResrvFctrPc" column="MIN3_RESRV_FCTR_PC"/>
<property name ="min4ResrvFctrPc" column="MIN4_RESRV_FCTR_PC"/>
<property name ="updateTs" column="UPDATE_TS"/>
<property name ="updUserId" column="UPD_USER_ID"/>
<property name ="min5ResrvFctrPc" column="MIN5_RESRV_FCTR_PC"/>
</composite-element>
</set>
</class>

I am trying to add a collection of TRESERVE_FACTOR table in the TannualStmtLine java class.

I use the below query to get the data from the database,

<sql-query name="findReserveFactors"><![CDATA[
SELECT TannualStmtLine.*,TreserveFactor.*
FROM REPORTER.TANNUAL_STMT_LINE TannualStmtLine
right outer join REPORTER.TRESERVE_FACTOR TreserveFactor
on TannualStmtLine.ANNUAL_STMT_LN_ID = TreserveFactor.ANNUAL_STMT_LN_ID
AND TreserveFactor.YEAR_NO=:year
AND TreserveFactor.QUARTER_NO=:quarter
AND TreserveFactor.MEASURE_ID=:measureid
AND TreserveFactor.COMPANY_NO=:comp
where
TannualStmtLine.ANNUAL_STMT_LN_ID ><> '310'
order by TannualStmtLine.ANNUAL_STMT_LN_ID]]>
<return alias ="TannualStmtLine" class="icp.entity.TannualStmtLine"/>

</sql-query>

I am completely missing something here. But, I don't what is it.

Below is the set,

<set name="treserveFactors" table="TRESERVE_FACTOR">
<key column="ANNUAL_STMT_LN_ID"/>
<composite-element class="icp.entity.TreserveFactor">
<parent name="icp.entity.TannualStmtLine"/>
<property name ="treserveFactorPK" column="MEASURE_ID"/>
<property name ="treserveFactorPK" column="YEAR_NO"/>
<property name ="treserveFactorPK" column="QUARTER_NO"/>
<property name ="treserveFactorPK" column="POOL_CD"/>
<property name ="treserveFactorPK" column="COMPANY_NO"/>
<property name ="crntResrvFctrPc" column="CRNT_RESRV_FCTR_PC"/>
<property name ="min1ResrvFctrPc" column="MIN1_RESRV_FCTR_PC"/>
<property name ="min2ResrvFctrPc" column="MIN2_RESRV_FCTR_PC"/>
<property name ="min3ResrvFctrPc" column="MIN3_RESRV_FCTR_PC"/>
<property name ="min4ResrvFctrPc" column="MIN4_RESRV_FCTR_PC"/>
<property name ="updateTs" column="UPDATE_TS"/>
<property name ="updUserId" column="UPD_USER_ID"/>
<property name ="min5ResrvFctrPc" column="MIN5_RESRV_FCTR_PC"/>
</composite-element>
</set>

I have given the parent tag in the set because ANNUAL_STMT_LN_ID column is a primary key on the table TANNUAL_STMT_LINE. I am trying to do the mapping for the remaining columns of the table TRESERVE_FACTOR.

TRESERVE_FACTOR table has the following primay keys,
<property name ="treserveFactorPK" column="MEASURE_ID"/>
<property name ="treserveFactorPK" column="YEAR_NO"/>
<property name ="treserveFactorPK" column="QUARTER_NO"/>
<property name ="treserveFactorPK" column="POOL_CD"/>
<property name ="treserveFactorPK" column="COMPANY_NO"/>

I have given the name of the property as treserveFactorPK. The reason is when I created a entitiy POJO for TRESERVE_FACTOR, it created two java classes.
TreserveFactorPK - Contains only all the primay keys of table TRESERVE_FACTOR.
TreserveFactor - Contains TreserveFactorPK as one of the element and all non-primay keys of TRESERVE_FACTOR.

My problem is how to define the property element within Composite-element. Say for example how to define the MEASURE_ID field, I have tried the below options, all are failed,

<property name ="measureId" column="MEASURE_ID"/>
<property name ="treserveFactorPK" column="MEASURE_ID"/>
<property name ="treserveFactorPK.measureId" column="MEASURE_ID"/>

error:
MeasureId not defined in class TreserveFactor

Can anyone tell me how to define this? Sorry, I know it may be insane to you.. But, I struck on this by more than two weeks now..........help is appericated..






I have table which has the below definition,

CREATE TABLE REPORTER.TRESERVE_FACTOR
(
MEASURE_ID NUMBER NOT NULL,
YEAR_NO NUMBER NOT NULL,
QUARTER_NO NUMBER(1,0) NOT NULL,
POOL_CD CHAR(8) NOT NULL,
COMPANY_NO CHAR(4) NOT NULL,
ANNUAL_STMT_LN_ID CHAR(3) NOT NULL,
CRNT_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN1_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN2_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN3_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN4_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
UPDATE_TS DATE NOT NULL,
UPD_USER_ID CHAR(8) NOT NULL,
MIN5_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL
)

PRIMARY KEY (MEASURE_ID,YEAR_NO,QUARTER_NO,POOL_CD,COMPANY_NO,ANNUAL_STMT_LN_ID)

I have created the entity class for the table TRESERVE_FACTOR using Netbeans. It created two POJOS,
TreserveFactor -- POJO for Table it has TreserveFactorPK as one of the type
TreserveFactorPK --- POJO class for Primarykeys of TRESERVE_FACTOR table

Now, I have problem in referring the primay keys in the mapping document.
Say, for example, I have a set created for this table.
Then, I can't define the property for primary key columns.
For, non primary key columns, I can define the proerty as follows,

<set name="treserveFactors" table="TRESERVE_FACTOR">
.
.
.
<property name ="crntResrvFctrPc" column="CRNT_RESRV_FCTR_PC"/>
</set>

But, for primary key columns I could not do it.

<set name="treserveFactors" table="TRESERVE_FACTOR">
<property name ="measureId" column="CRNT_RESRV_FCTR_PC"/>
.
.
</set>

If I define it like above, it is not working. I have tried other options like,

<property name ="treserveFactorPK " column="CRNT_RESRV_FCTR_PC"/>

Please advise.


Here, the property measureId is in TreserveFactorPK POJO Class..

Hi,

Thanks for your input. How to configure the property inside a composite-element as a composite-property.
Moreover, the TreserverFactorPK is a class generated for primary keys of the table TRESERVER_FACTOR, how to it is going to affect when I configure the TreserveFactorPK in a separate hbm file and if it is possible, then how to refer it in this above hbm file.

Thanks,
Hi,

I am getting the below error in Hibernate...

Initial SessionFactory creation failed.org.hibernate.PropertyNotFoundException: field [treserveFactorPK.yearNo] not found on icp.entity.TreserveFactor

My mapping doc is as follows,

<class name="icp.entity.TannualStmtLine" table="TANNUAL_STMT_LINE">
<id column="ANNUAL_STMT_LN_ID" name="annualStmtLnId" type="string">
<generator class="assigned"/>
</id>
<property name="annualStmtLnNm" type="string">
<column length="30" name="ANNUAL_STMT_LN_NM" not-null="true"/>
</property>
<property name="updateTs" type="timestamp">
<column length="45" name="UPDATE_TS" not-null="true"/>
</property>
<property name="updUserId" type="string">
<column length="8" name="UPD_USER_ID" not-null="true"/>
</property>
<property name="exceptionIn" type="char">
<column length="1" name="EXCEPTION_IN" not-null="true"/>
</property>
<property name="ovAnnlStmtLnId" type="string">
<column length="3" name="OV_ANNL_STMT_LN_ID" not-null="true"/>
</property>
<set name="treserveFactors" table="TRESERVE_FACTOR">
<key column="ANNUAL_STMT_LN_ID"/>
<composite-element class="icp.entity.TreserveFactor">
<parent name="icp.entity.TannualStmtLine"/>
<many-to-one name="measureId" class="icp.entity.Tmeasure" column="MEASURE_ID"/>
<property name ="treserveFactorPK.yearNo" column="YEAR_NO"/>
<property name ="treserveFactorPK.yearNo" column="QUARTER_NO"/>
<many-to-one name="poolCd" class="icp.entity.TpoolCompanyPK" column="POOL_CD"/>
<many-to-one name="companyNo" class="icp.entity.TpoolCompanyPK" column="COMPANY_NO"/>
<property name ="crntResrvFctrPc" column="CRNT_RESRV_FCTR_PC"/>
<property name ="min1ResrvFctrPc" column="MIN1_RESRV_FCTR_PC"/>
<property name ="min2ResrvFctrPc" column="MIN2_RESRV_FCTR_PC"/>
<property name ="min3ResrvFctrPc" column="MIN3_RESRV_FCTR_PC"/>
<property name ="min4ResrvFctrPc" column="MIN4_RESRV_FCTR_PC"/>
<property name ="updateTs" column="UPDATE_TS"/>
<property name ="updUserId" column="UPD_USER_ID"/>
<property name ="min5ResrvFctrPc" column="MIN5_RESRV_FCTR_PC"/>
</composite-element>
</set>
</class>

The table TRESERVE_FACTOR structure is as follows,

CREATE TABLE REPORTER.TRESERVE_FACTOR
(
MEASURE_ID NUMBER NOT NULL,
YEAR_NO NUMBER NOT NULL,
QUARTER_NO NUMBER(1,0) NOT NULL,
POOL_CD CHAR(8) NOT NULL,
COMPANY_NO CHAR(4) NOT NULL,
ANNUAL_STMT_LN_ID CHAR(3) NOT NULL,
CRNT_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN1_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN2_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN3_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN4_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
UPDATE_TS DATE NOT NULL,
UPD_USER_ID CHAR(8) NOT NULL,
MIN5_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL
)

PRIMARY KEY (MEASURE_ID,YEAR_NO,QUARTER_NO,POOL_CD,COMPANY_NO,ANNUAL_STMT_LN_ID)


I have created the entity class for the table TRESERVE_FACTOR using Netbeans. It created two POJOS,
TreserveFactor -- POJO for Table it has TreserveFactorPK as one of the type
TreserveFactorPK --- POJO class for Primarykeys of TRESERVE_FACTOR table

[treserveFactorPK.yearNo] not found on icp.entity.TreserveFactor --- I have given the value as "yearNo" then also it says the same problem.

Please advise..


Hi,

We are migrating from WSAD 5.1.2 to RAD 7.0. Our prjoect imports
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection and com.ibm.ws.rsadapter.jdbc.WSJdbcUtil classes from rsadapeterspi.jar file.

In WSAD 5.1.2, we configured our build path of the project to include rsadapeterspi.jar from WSAD 5.1.2 runtime lib directory.


In RAD 7.0, we configured our build path of the project to include rsadapeterspi.jar from RAD 7.0 runtime lib (runtimes\base_v6\stub\lib) directory.

Now the project throws the error,
"The type com.ibm.websphere.rsadapter.WSConnection cannot be resolved. It is indirectly referenced from required .class files". It says can't find the class com.ibm.websphere.rsadapter.WSConnection in the build path. More importantly, the com.ibm.websphere.rsadapter.WSConnection is not used by our source code.

Please help us to resolve this.
15 years ago
The class path is as follows, Somehow it is not dipslayed in my previous postt..

<?xml version="1.0" encoding="UTF-8"?>
< !--
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry exported="true" kind="lib" path="C:/Workspace/workspace_App_mig/COGSecWeb/WebContent/WEB-INF/lib/classes12.zip"/>
<classpathentry exported="true" kind="lib" path="C:/Program Files/IBM/SDP70/runtimes/base_v6_stub/lib/rsadapterspi.jar"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_ConTAINER"/>
<classpathentry exported="true" kind="lib" path="C:/Program Files/IBM/SDP70/runtimes/base_v61/lib/j2ee.jar"/>
<classpathentry exported="true" kind="lib" path="C:/Workspace/workspace_App_mig/COGSecWeb/WebContent/WEB-INF/lib/cafe.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/COGSecServices"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/COGSecWeb"/>
<classpathentry kind="output" path=""/>
</classpath>
-->

[edited to escape HTML]
[ August 14, 2008: Message edited by: Jeanne Boyarsky ]
15 years ago
Hi Srini,

Thanks for your quick response.

It is added in the class path. Classpath of the project is as follows,

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry exported="true" kind="lib" path="C:/Workspace/workspace_App_mig/COGSecWeb/WebContent/WEB-INF/lib/classes12.zip"/>
<classpathentry exported="true" kind="lib" path="C:/Program Files/IBM/SDP70/runtimes/base_v6_stub/lib/rsadapterspi.jar"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="C:/Program Files/IBM/SDP70/runtimes/base_v61/lib/j2ee.jar"/>
<classpathentry exported="true" kind="lib" path="C:/Workspace/workspace_App_mig/COGSecWeb/WebContent/WEB-INF/lib/cafe.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/COGSecServices"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/COGSecWeb"/>
<classpathentry kind="output" path=""/>
</classpath>

The rsadapterspi.jar is added in the class path.
You have mentioned that to add it in JVM path, I assume that you are talking about the classpath of the project. If not can you clarify what is JVM path?

Thanks,
Karthi S
15 years ago
Hi,

I have verified the Builder in Project Properties. It is already congifured as javabuilder and migration builder. Both are checked.

Our project has reference to Websphere's rsadapterspi.jar file. Hence, the build path it is been added from the runtimes\base_v6_stub\lib directory.
But, we are getting an error "The type com.ibm.websphere.rsadapter.WSConnection cannot be resolved. It is indirectly referenced from required .class files"
But, jar files are added in the class path correctly. The same project compiles fine in WSAD 5.1.2. In RAD 7.0, the code thorws the above error.

Help us to resolve this issue.
15 years ago
Hi,
Currenlty My Applicatio running on WSAD 5.1.2. We are planned to Migrate to RAD 7.0. So, I created a new workspace in RAD 7.0. I have loaded the project files and build the Workspace from scratch. But, in RAD 7.0 the files are not compiling and it is not throwing any error/warning also. If do build and see the build driectory, there is no class files generated. I am using the JDK proivided in RAD. I have changed the JDK to JDK 1.4 also. But the result is same.

In RAD.7.0 I have built a new Hello World Project. That is working fine.

Please advise.
15 years ago