Russell Ray

Ranch Hand
+ Follow
since Apr 25, 2005
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 Russell Ray

Let me explain what I am trying to accomplish.

First I have a store procedure running on Oracle 10g. When I run the store procedure in SQL Developer, I have no problems. The store procedure compiles correctly and runs without error. Next I move the call out to a Java class and use a jdbc connection. When I make the call, I get a foriegn constraint error and the data is not loaded properly. The input is the same. The execute operation is not in a loop.

Your suggestions would be greatly appreciated. I have been told the CallableStatment could be getting called twice, but I don't see how.

Thanks for your suggestions.

Russ
The problem was a Hibernate Proxy object was being passed in and that's what caused the equals method to fail. Once I force the proxy object to be populated with the implementation data.......all worked as designed.
12 years ago
Thank you for your reply.

I have confirmed the process is falling into the if clause and the print statement is being printed out...... This means false is returned from the equals method and no other action is taking place inside the equals method.
12 years ago
Okay I have tried to solved this issue but I am not successful. What I have done is over write the equals method in a domain object. The comparison fails when the two objects are compared in this segment of code:



I have proven the *obj* is not null. I have proven the objects are in fact the same class by printing out the class info. I have verified the hashcode for the objects are the same I have verified the classloaders are the same for the two objects.

I just don't see why the statement fails to evaluate true.

Any suggestions would be welcome now..........
12 years ago
The web server is telling me it can not find it.....HTTP 404
13 years ago
I am getting the destinct impression that the ActionServlet is not loading. I do not see it in the Tomcat logs or within the console stating the ActionServlet init() has been called. I have used the blank Struts war file that comes with the distribution. I can get this project to work. I have compared the libraries and the two projects are the same. I have read the JavaRanch forum for suggestions and FAQ. I can not see where this error is coming from.....
13 years ago
Okay after some testing the blank struts project........ It appears the ActionServlet for my project is not loading......

Any suggestions?
13 years ago
First, thank you for offering some suggestions on where to look for this fault. I tried your recommendation and I still received an error. This time it's a little more descriptive. I started with just the action attribute and walked it through each attribute. The errors are the same.



This is the code for the JSP translation of the jsp on line 191





When the tomcat server lanuches I am seeing this:




Any suggestions would be greatly appreciated..........
13 years ago
Forgive me for posting a topic that seems to be answered already in this forum. I am not able to correct this fault using the information provided in this form and FAQ sections.

This is a basic tutorial example of a struts project I have created. It consist of one jsp, one Form and Action class. However, typing in the URL http://localhost:8080/strutsproject/addPerson.jsp I recieve the following fault:



What I have done to correct this problem myself:

1. Verify all the dependent jar files are in the lib directory within the war file.
2. I reviewed the struts-config.xml file.


Here is my struts 1.3.8 config file.



This is my JSP




This is my web.xml file.





Thank you in advance for taking the time in reading my post. Any comments would be greatly appreciated.


Russ
13 years ago
I am hoping someone can guide me through this issue. I have solved this problem earlier using JPA, but I now must use Hibernate only.

This is the annotation I used in JPA.




The goal is a document may belong to many groups. A group may have many documents. How I handled this using JPA was create a Document_Collection table. I have done the same in Hibernate by creating a table called document_collection_groupXref.

I've tried to follow the "Java Persistence with Hibernate" book in creating my solution. Here are the hibernate files


jtdiDocument.hbm.xml




CollectionGroup.hbm.xml





Lastly, DocumentCollectionGroupXref.hbm.xml





I've thoroughly confused myself on how to proceed. In JPA I never had to touch the xref table. All I had to do was add the collection group to the Document class and add the document to the CollectecionGroup Class and JPA would do all the mapping to the cross-reference table.

What the Hibernate book tells me to maintain a Set of DocumentCollectionGroupXref classes in the Document class and in the CollectionGroup Class. However, this approach assumes a Group already exist.

Any counsel would be greatly appreciated.


Russ
I fixed my problem by increating the heal size from the standard to



Thanks Mark!
Mark,

I took you question as a suggestion and I tried something. The only thing different is a I placed the find operation within a transaction per your question.



I am still getting the same error. My method for adding metadata documents is identifical with regards to wrapping the actions within a transaction.

Russ
I have been working with Hibernate only a short period of time. I have gotten my database model up and running and I have generated all the classes using the tools from MyEclipse. I have been successful in storing and retrieving data to the main object/table. I have written a Junit test to accomplish this action. Now I have moved on to the second table. In this table I have one attribute as a LONGTEXT datatype (XML Doucment). I have mapped this attribute as described in the Hibernate documentation:



What I see in the log files is the data is being pumped into the database as it should. Next, Hibernate fetches the data to test the SELECT statement works. However, something is going wrong because I see:



From what I can tell something is happening in the database Connection pool.


My setting are as follows for the database Connection pool:



Thank you for taking the time to read my post and for any suggestions you can offer.

Russ
Mark,

This is just the information I need.......

The tool I am using (MyEclipse) generates all the code for the DAOs. The DocumentDAO extends the HibernateSupportDAO. It handles most of the required method generation.

From your comment I can tell you are using the JDBC Template. I changed my code to use something very similar. The SQL generated call for UPDATE of the table. It return zero because no record was in the database with the id of 1. Actually the table is empty. When I tried the save function the SQL generated was an INSERT statement. In both cases no data was stored in the database.

The lock method obtains the specific lock level upon the given object, implicitly checking whether the corresponding database entry still exist. In my case, the lock mode is none. The database is empty so there is no corresponding database entry.

As far as JPA is concerned......It's a hard locked into Spring and Hibernate.

Russ
Mark,

Thank you so much for reading my post..........

Here is my mapping file:





Here the method that calls the Hibernate framework:



As you can see most of this was generated for me. I have made very little changes.