Win a copy of Terraform in Action this week in the Cloud forum!

Anupam Dee

Ranch Hand
+ Follow
since Oct 18, 2010
Anupam likes ...
Firefox Browser Tomcat Server Windows XP
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anupam Dee

Yes of course.

This is creating a big problem for me. I ve to use a lot of jars. I can't write them individually.
8 years ago
Yes I know.

But what is the solution then?
Actually I tried both. with MANIFEST and without MANIFEST.

Is there no way for adding multiple jars from a different directory in classpath and running the jar file?
8 years ago

This is the Stacktrace

Exception in thread "main" java.lang.NoClassDefFoundError: abc/employee/Employee
at abc.printemployee.PrintEmployee.main(
Caused by: java.lang.ClassNotFoundException: abc.employee.Employee
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
... 1 more
8 years ago
I solved the problem by adding the classpath in the MANIFEST itself because the classpath is invalid when we run the jar file from command line.

But the real problem is:
If there are 25 jars in my project that i need to load, How I am going to load them all?
I tried using

Class-Path: jars/* it does not work

But when i use
Class-Path: jars/employee.jar
it works fine.
8 years ago
Hi all,

In Eclipse
I created a simple Employee class.
It consists of String name; and getters and setters
Simply converted it to jar.

Created another project that references the Employee jar.
It consists of main where I am simply setting a name and displaying it.

I converted this project to an executable jar.

Now I took both the jars
PrintEmployee.jar (executable)

put in a simple directory EMP
and when i used the command

java -classpath employee.jar PrintEmployee.jar
from the EMP directory

It threw the java.lang.NoClassDefFoundError

Please help.

Where am I wrong?
8 years ago
I am getting a inputstream using
InputStream is = response.getEntity().getContent();
now i want to save it in UTF-8 file that preserves the language codes.
The input stream contains data in a different languages e.g chinese, japanese, hindi.

I tried using IOUtils, OutputStreamWriter but failed. The file is saved but it is something like ऩ Ӓ i want these codes to be actually saved in its equivalent symbol

How can I do this?

Please help.
8 years ago
I want to store parent child, a tree like structure in mongodb.
I followed this link.

But there is no way of how to save the tree in mongodb. Only retrieving is there.

How to do that?
Any help would be appreciable.

9 years ago
I have two classes
Class A
Class B
class B extends A

i m storing it in mongodb as follows

A a=new B();;

the data is being stored with _class : B

But i want to store it as A,
Is it possible?
Can i store the object with _class as its superclass?
9 years ago
Hi guys,
I am new to hibernate and having a lot of confusions.

I created 3 classes.

I have User and Category properties in

Now when i am trying to persist only the expense object after setting the User and Category properties, i am getting TransientObjectException because i am not persisting the User and Category objects to the database.

But when I persist them before persisting the Expense object using, it works fine.

I have <many-to-one> association in Expense.hbm.xml for both User and Category, because multiple expenses can have single or many users with single or many categories.

So what is the case when we have to explicitly save these objects first and then the final object, and when is not the case.
What is the actual concept behind this? I want the User and the Category objects to automatically get persisted when i call;

I am confused. Please help me.
I have a Customer Class and an Address class as follows

Now I want to have two customers with the same address

//Now when i try to retrieve the Customer Object and iterate over the list i am not getting the address for the second customer. I am getting null there.

These are my HBM files



I am new to hibernate mapping.. please help me...

And i am a bit confused about the mapping strategies in hibernate..please suggest a good link too.
I have two fields in Person Class

I want to validate that both the names should be given by the user at the same time

ValidationUtils only gives the method to check on a particular field, how can I validate this?
9 years ago
I want to create a Validator class e.g PersonValidator that implements Validator interface. I want to get the error messages stored in the .properties file (for Internalization).
I am trying to autowire MessageResource to do the same.

this is the xml content

and this is main

and the output is
[Field error in object 'person' on field 'name': rejected value [null]; codes [,,,name.required]; arguments []; default message [null]]

the first null is messageSource getting printed and it is null !
I think i am not able to autowire the messagesource to the .properties file. How should i do it?
Any help would be appreciated.

Thanks in advance.
9 years ago
How can we debug Spring Application or Spring MVC Application?
I have commons-logging.jar. But don't know how to use it?
Or is there any other alternative to step through to debug my application by setting breakpoints.

I am using Spring Tool Suite.
Please help.
9 years ago
Thank you so much.
If you don't mind I really don't know how to set breakpoints and I really need to know. So if you can suggest any links about setting the breakpoints.
Thanks in advance
9 years ago