Chris Spierings

Greenhorn
+ Follow
since Mar 29, 2001
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 Chris Spierings

I am working in WSAD which limits us to the 1.4 JVM and use of JAXB 1.0.

We interact with a service through the classes generated in WebSphere and are successfully getting back a response from the service.

I have been asked if there is a way that we can capture part of the actual XML message and put it into a string rather than use the objects to get at response data. I could use the objects to rebuild part of the xml response but I am wondering if anyone knows of an easy way to get the actual xml response given that we are using an early version of JAXB.

If need be I can part through the reponse for the piece I want assuming I can get my hands on the XML within the code.

I have been trying to locate the JAXB 1.0 javadoc but having little luck.

Thanks in advance for any help.

Chris
14 years ago
turns out that the references to the hbm files in the cfg file had an extra slash in front of them. This meant we were looking for the hbm files in c:..../then the normal package strucutre.

Thanks for all the help.

Chris
we've set up a project in WSAD (locally) we're just trying to get it working locally first.

In the build path for this project we include a reference to a jar file which contains all the classes which interact with the tables using hibernate. One class the hibernateUtlity references the .cfg file for hibernate. That config file references the .hbm files also within that jar.
The more we look at this I think its coming down to classpath issues.

We seem to be having issues with the .hbm files being found. We've even gone so far to move the hbm files on to the class path outside a jar and continue to have issues.

Here is the message we get in the WSAD console when we attempt to run in a batch mode that is to say running the code from a main method.



WSCL0100E: Exception received: java.lang.reflect.InvocationTargetException
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.initialize(Class.java:356)
at com.amfam.isagent.codebase.persistence.IASIRDAO.getData(IASIRDAO.java:39)
at com.amfam.isagent.codebase.persistence.RegionDAO.getRegionList(RegionDAO.java:67)
at com.amfam.isagent.codebase.facade.AgentCodeBaseFacade.getAllRegions(AgentCodeBaseFacade.java:101)
at com.amfam.isagent.codebase.facade.AgentCodeBaseFacade.getAllRegionsFromXml(AgentCodeBaseFacade.java:56)
at com.amfam.isagent.agtplnacr.batchproc.builders.ReportDataBuilder.createReportTree(ReportDataBuilder.java:148)
at com.amfam.isagent.agtplnacr.batchproc.builders.ReportDataBuilder.createReportData(ReportDataBuilder.java:70)
at com.amfam.isagent.agtplnacr.batchproc.builders.ReportDataBuilder.createReport(ReportDataBuilder.java:55)
at com.amfam.isagent.agtplnacr.batch.runner.ReportDataBuilderRunner.main(ReportDataBuilderRunner.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:644)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:426)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.ibm.ws.bootstrap.WSLauncher.run(WSLauncher.java:222)
at java.lang.Thread.run(Thread.java:813)
Caused by: com.amfam.isagent.codebase.persistence.HibernateUtilityException: Configuration problem: Resource: /com/amfam/isagent/codebase/entities/SALE_REGN.hbm.xml not found
at com.amfam.isagent.codebase.persistence.HibernateUtility.<clinit>(HibernateUtility.java:59)
at java.lang.Class.initializeImpl(Native Method)
at java.lang.Class.initialize(Class.java:350)
at com.amfam.isagent.codebase.persistence.IASIRDAO.getData(IASIRDAO.java:39)
at com.amfam.isagent.codebase.persistence.RegionDAO.getRegionList(RegionDAO.java:67)
at com.amfam.isagent.codebase.facade.AgentCodeBaseFacade.getAllRegions(AgentCodeBaseFacade.java:101)
at com.amfam.isagent.codebase.facade.AgentCodeBaseFacade.getAllRegionsFromXml(AgentCodeBaseFacade.java:56)
at com.amfam.isagent.agtplnacr.batchproc.builders.ReportDataBuilder.createReportTree(ReportDataBuilder.java:148)
at com.amfam.isagent.agtplnacr.batchproc.builders.ReportDataBuilder.createReportData(ReportDataBuilder.java:70)
at com.amfam.isagent.agtplnacr.batchproc.builders.ReportDataBuilder.createReport(ReportDataBuilder.java:55)
at com.amfam.isagent.agtplnacr.batch.runner.ReportDataBuilderRunner.main(ReportDataBuilderRunner.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:644)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:426)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.ibm.ws.bootstrap.WSLauncher.run(WSLauncher.java:222)
at java.lang.Thread.run(Thread.java:813)
We've finally gotten to the point of trying to run Hibernate outside the servlet and we are experiencing issues with the hbm files being found.

When running a web app using hibernate you end up having a bunch of initialization occur when hibernate is used. I'm wondering if that is the issue we are running into trying to run this via a main method.

Has anyone else run into this sort of issue? Were you able to work through it? If so can you share how?

Thanks

Chris
We are thinking about creating a java app which will run at night and not be running behind struts or any sort of servlet. The idea being that once a month the app would run at about 1AM in the morning.

Has anyone had any experience with this? Where there issues with the session with regard to hibernate?

Thanks,

Chris
I've done a couple of projects with hibernate but I can't seem to get this sort of thing to work. I have to classes IncentiveObj and IncentiveOwnerObj I want to return an IncentiveObj for those rows on the IncentiveOwnerObj (related table actually) where the other parts of the where clause are specified that is the first_Name and last_Name match the string's passed. Both share a field called incentive_id which I am joining on.

I have tried different things the last being to create a contructor on the object I want which accepts a paramter but then I get a list of objects with only that field filled. If I add the other columms to the constructor it doesn't work.

Here is the select string I'm passing to the query currently.

private String INCENTIVE_BY_OWNER = "SELECT new com.amfam.isagent.asit.dataObjects.IncentiveObj(i.incentive_Name)" + "from IncentiveObj i," + " IncentiveOwnerObj io " +
"where i.incentive_Id = io.incentive_Id " + " and io.first_Name = 'Kristie'" + " and io.last_Name = 'Sands'";

Can this sort of thing be done without reading the tables independent of each other and iterating through one of the resulting lists and reading the other table?

Thanks,

Chris
Here is what worked for me:

<logic:iterate id="testName" name="testForm" property="testList" >
<tr>
<td>
<bean:write name="testName"/>
</td>
</tr>
</logic:iterate>
18 years ago
I have a list of Strings being returned in a form. These Strings reside in an arrayList passed back in the form from the action. Below is what I'm thinking of doing in the JSP to display the Strings in the list. However I can't come up with the property to reference in the bean:write line below where I've placed the ?

<logic:iterate name="form" property="arrayList" type ="java.lang.String">
<tr>
<td>
<bean:write property="?"/>
</td>
</tr>
</logic:iterate>

Any help appreciated.

Thanks
18 years ago
Eric,

Thanks for the help. Sure is a lot cleaner than what I put together. So did you mean for xElemen to really be the data passed into the function.

Chris
I've got a field on a jsp which takes a text date in mm/dd/yyyy format. I need to make sure that the date entered into that field is not greater than the current system date. Here is what I've come up with so far:

function isFutureDate(inputDate) {

var now = new Date();
now = now.getTime();

var day = inputDate.value.substring(3,5);
var month = inputDate.value.substring(0,2);
var year = inputDate.value.substring(6);

//take the parse date values and create a Date object
var dateToCheck = new Date();
dateToCheck.setYear(year);
dateToCheck.setMonth(month);
dateToCheck.setDate(day);
alert("dateToCheck = " + dateToCheck);

var checkDate = dateToCheck.getTime();

alert("checkDate = " + checkDate);
alert("day = " + day + " month = " + month + " year = " + year);

if (checkDate > now)
{
alert("The date entered may not be in the future");
return false;
}
return true;
}

My alert("checkDate = " + checkDate); shows checkdate as undefined.

Can someone point out what I'm doing incorrectly?

Thanks,

Chris
I have defined an hbm file where I have a key handled like this:

<id name="id">
<generator class="sequence">
<param name="sequence">id_seq</param> </generator>
</id>

Right after I do the insert I need that if back for future use and since its the unique key for the table I don't have the means to read it and ensure that I get the correct row.

Any ideas if this can be done without taking control of the creation of the key values?

Thanks,

Chris
Here are the associated HBM files

<hibernate-mapping package="com.amfam.isagent.agtpipeln.containers.meta">
<class name="SecurityMeta" table="TASK_JOB_ROLE"
schema = "agentpipe" lazy="false">

<id name="taskId" type="java.lang.Long" column="META_TASK_ID">
<generator class="native" />
</id>

<property name="jobId" column="JOB_ID" not-null="false" type="java.lang.Long" />
<property name="roleId" column="ROLE_ID" not-null="false" type="java.lang.Long" />

<bag name="roles" table="ROLE">
<key column="ROLE_ID"></key>
<one-to-many class="com.amfam.isagent.agtpipeln.containers.meta.RoleMeta" />
</bag>

<bag name="jobs" table="JOB">
<key column="JOB_ID"></key>
<one-to-many class="com.amfam.isagent.agtpipeln.containers.meta.JobMeta"/>
</bag>




</class>

</hibernate-mapping>


The table task_job_role has 3 columns:

meta_task_id
job_id (fk)
role_id(fk)

Job table

Job_Id (pk)
Job_Desc

Role Table

Role_Id (fk)
Role_Desc


Role Meta Class

public class RoleMeta {
private long roleId = 0;
private String roleDescription ="";

Job Meta

public class JobMeta {
private long jobId = 0;
private String jobDescription ="";


Again getters and setters omitted

Thanks,

Chris
I'm struggling with the following

Here are my classes (getter and setters omitted to save space)
public class SecurityMeta {

private long taskId = 0;
private ArrayList roles = new ArrayList();
private ArrayList jobs = new ArrayList();

public class RoleMeta {
private long roleId = 0;
private String roleDescription ="";

the roles list will consist of RoleMeta objects

public class JobMeta {
private long jobId = 0;
private String jobDescription ="";

the jobs list will consist of JobMeta objects

The tables look like this:

TJR
meta_task_id
job_id
role_id

Job
job_id
job_desc

Role
role_id
role_desc

what I'm trying to do is configure an hbm file which will permit me to get a SecurityMeta object which is populated with lists of roles and jobs.

I've created simple hbm files to deal with tables individually and classes to read the tables but I'm struggling to do something like I've outlined above giving me an object which draws from multiple tables.

I've spent a fair amount of time looking at the hibernate doc and playing around with the code trying to make something work but I'm struggling with this. Any help is appreciated.

Thanks,

Chris