Waswani Naresh

Ranch Hand
+ Follow
since May 01, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Waswani Naresh

Please provide your DB configuration file.

Regards,
Naresh
While setting the value also make sure that the cusid in Database is string or integer.

Regards,
Naresh Waswani
Just by replacing it with cusid wil not help.

As I mentioned before, you need to set the value of cusid before you call the list() method on it. If you have ever used parameter place holder (?) used with PreparedStatement of JDBC, named parameter are exactly the same.

Please take a look at PreparedStatement usage with paremeter place holders using "?".

Regards,
Naresh Waswani
Post the original query code where you are using parameter name.

Regards,
Naresh Waswani
Probably I got the error.

In the method getAll_bill_by_cid(String cusid), you are receiving the value in the cusid and I believe your named parameter is set to cusid.

The only thing you are missing is setting the value for the named parameter. Just call below method on the query object

setString("cusid",value);

and then call list() on it.


Regards,
Naresh Waswani
Please let us know how did you configure name parameter and how are you passing value to it ?

Regards,
Naresh Waswani
Hi Snehal,

Could you please show the code for inserting these POJOs into the Database ?

Regards,
Naresh Waswani
Good to hear that. Please mark this thread as resolved.
If you are running your JBoss server via eclipse, please do the following and let me know the result.

1) Go to the Server view Tab
2) Double click on the Jboss server entry, it will open a window.
3) Click on "Open Launch Configuration" and go to Classpath TAB.
4) Select Bootstrap Entries and browse to the hibernate jar which is in your lib folder. (It can be done via Add Jars OR Add External Jars).
5) Restart the server


Regards,
Naresh Waswani
JBoss 6 comes with its own set of hibernate 3 jars in the common/lib folder. Are you using the ones provided by the JBoss env OR you have your own set of hibernate jars and included them as part of your application's lib folder.

If both the sets are present, you might encounter Class version related issues.

Try removing one of the set and let me know how it goes.

Also, what is the exact version of hibernate you are using and which version do you see in JBoss 6 ?

Regards,
Naresh Waswani
Hi,

It looks like there is some class version conflicts. Do you have by any chance two different versions of hibernate jars being referred directly or indirectly from your dependencies ?

In eclipse, do Ctrl+Shift+T, and type Dialect; how many occurrences do you see there ?

Regards,
Naresh Waswani
Please go through this post. You will understand the reason.

https://coderanch.com/t/540481/ORM/java/Weird-Exception

Regards,
Naresh Waswani
Hello,

It looks like some jars are missing in your application. Wrap your code in a try/catch block and catch the Throwable object some thing like below.

try
{
/// code
/// code
}
catch(Throwable t)
{
t.printStackTrace();
}

You should get some exception on which class is missing.

Regards,
Naresh Waswani
Have you included/mentioned the hbm mapping file in the hibernate config file (hibernate.cfg.xml).

Something like this :

<mapping resource="com/pnd/data/Market.hbm.xml" />

Regards,
Naresh Waswani
Hi Hemanth,

Add external jars (probably you are using eclipse) would allow you to compile your application but because this is a JEE application, you need to add your jars in the lib folder and then deploy the package into the Tomcat.

Just adding jars in the environment classpath variable would not help.

Please check the JEE web application folder structure for more details.

Regards,
Naresh Waswani