Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Amith Bhavikatti

Greenhorn
+ Follow
since Oct 27, 2006
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 Amith Bhavikatti

Hi Carol,

Thanks for replying.i want to include jars in build-service target.
If you suggest in any of the targets also,its ok finally i need all jars to be packed in war file which build.xml generates.
This is the latest build.xml file.check this.
14 years ago
Hi All,
I am building some webservices using weblogic server,I have some jar files which i added to my classpath ,but the resulting output war files does not have the jar files.
Please guide me in this matter.
please find the attached build.xml and suggest me .

14 years ago
Hi All,
I am building some webservices using weblogic server,I have some jar files which i added to my classpath ,but the resulting output war files does not have the jar files.
Please guide me in this matter.
please find the attached build.xml and suggest me .

Hi All,
I am building some webservices using weblogic server,I have some jar files which i added to my classpath ,but the resulting output war files does not have the jar files.
Please guide me in this matter.
please find the attached build.xml and suggest me .

14 years ago
Hi Javid,

I am using singleton on sessionFactory.
I am getting this error for a single user login.
no only delete and insert.
This is the mapping file code


And this is the code written to delete and insert into database.
Hi Javid,

Thanks for your reply.
I have modified my code but still that exception comes randomly any time.
Please suggest me.
Here is my code:
<code>
public void insDelAssignmentByLetters(ArrayList delAssignmentByLetterList,ArrayList addingtoAssignmentByLetterList,String remoteUsername)
{
if(log.isDebugEnabled()) log.debug("entering addAssignmentByLetters()....");
Session session = HibernateUtil.getCurrentUtil().getCurrentSession();
Transaction tx = session.beginTransaction();
try
{
for ( int i=0; i< delAssignmentByLetterList.size(); i++)
{
AssignmentByLetter delAssignList = (AssignmentByLetter) delAssignmentByLetterList.get(i);
deleteAsgLetter(delAssignList,remoteUsername,session);
}

for ( int i=0; i< addingtoAssignmentByLetterList.size(); i++)
{
AssignmentByLetter addingAssignmentByLettersList = (AssignmentByLetter) addingtoAssignmentByLetterList.get(i);
insertToAsgLetter(addingAssignmentByLettersList,remoteUsername,session);
}
}
catch(HibernateException ex)
{
log.error("Caught a hibernate exception while adding AssignmentByLetter.",ex);
throw new DataAccessException("addAssignmentByLetters","AssignmentByLetter");
}

finally
{
tx.commit();
session.close();
}

}

private void deleteAsgLetter(AssignmentByLetter deleteAssignObj,String remoteUsername,Session session){

try
{
if(log.isDebugEnabled()) log.debug("Remote UserName : "+remoteUsername);
if(log.isDebugEnabled()) log.debug("Deleting From AssignmentByLetter Table..."+ "AssignmentID --> " + deleteAssignObj.getAssignmentID());
session.getNamedQuery("deleteAssignmentByLetter").setInteger("assignmentIDD",deleteAssignObj.getAssignmentID()).executeUpdate();
}
catch(HibernateException ex)
{
log.error("Caught a hibernate exception in deleteAsgLetter(): ",ex);
throw new DataAccessException("deleteAsgLetter","AssignmentByLetter");
}
}

private void insertToAsgLetter(AssignmentByLetter insertObj,String remoteUsername,Session session)
{

try{
if(log.isDebugEnabled()) log.debug("entering insertToAsgLetter()....");
if(log.isDebugEnabled()) log.debug("Remote UserName : "+remoteUsername);
if(log.isDebugEnabled()) log.debug("Inserting into AssignmentByLetter Table..."+ "StartValue --> " + insertObj.getStartValue());
if(log.isDebugEnabled()) log.debug("Inserting into AssignmentByLetter Table..."+ "EndValue --> " + insertObj.getEndValue());
if(log.isDebugEnabled()) log.debug("Inserting into AssignmentByLetter Table..."+ "CollectorId --> " + insertObj.getCollector().getCollectorID());
if(log.isDebugEnabled()) log.debug("Inserting into AssignmentByLetter Table..."+ "GroupId --> " + insertObj.getGroup().getGroupID());
insertObj.setCreated(new Date());
session.saveOrUpdate(insertObj);
}
catch(HibernateException ex)
{
log.error("Caught a hibernate exception in insertToAsgLetter(): ",ex);
throw new DataAccessException("insertToAsgLetter","AssignmentByLetter");
}

}
</code>
Hi All,

I am trying to insert many rows to database and delete many rows from database using hibernate sessions.but if i enter some 4 rows it will work fine,but if i enter many rows(say 10) it is giving this exception.
Please help me...
Thanks in Advance.....
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.bvn.finance.services.treatment.collectors.Collector#12]
at org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:556)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:258)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)
at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:213)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:157)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:108)
at org.hibernate.engine.Cascade.cascade(Cascade.java:248)
at org.hibernate.engine.Cascade.cascade(Cascade.java:223)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.cascadeOnUpdate(DefaultSaveOrUpdateEventListener.java:331)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:303)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)
at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:213)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:157)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:108)
at org.hibernate.engine.Cascade.cascade(Cascade.java:248)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:385)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:242)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)


Hi All,
I want to generate unique random number from(0 to n number) such that if i run the program everytime it should give me a unique random number all the time.numbers should not repeated at any cost.

Please help me...

Thanks in Advance..
15 years ago
Hi All,

i am tring to run a java program from commandline .
i included all classpaths while compiling the java file.
i included all environment variables.

i compiled it and i got the generated class file.
but still i cannot run the program.

This is the command and the error which i am getting:

E:\ECost>java MyProgram
Exception in thread "main" java.lang.NoClassDefFoundError: MyProgram (wrong name
: ECost/MyProgram)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)


Please help me.
Thanks in Advance
15 years ago
Yes i have added cgilib.jar file .
but still showing that error ..
please suggest me......
Hi This is the Error i am getting from hibernates but i checked there was no exception in catch block but still the error is coming..

java.lang.NoClassDefFoundError: org/hibernate/proxy/CGLIBLazyInitializer : net/sf/cglib/proxy/MethodInterceptor
at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain Ljava.lang.Class;(Unknown Source)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:367)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:182)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:61)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source)
at java.lang.ClassLoader.loadClass(Ljava.lang.String Ljava.lang.Class;(Unknown Source)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:41)
at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String Ljava.lang.Class;(Unknown Source)
at org.hibernate.proxy.SerializableProxy.readResolve(SerializableProxy.java:55)
at java.lang.LangAccessImpl.readResolve(Ljava.lang.Class;Ljava.lang.Object Ljava.lang.Object;(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Ljava.lang.Object Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Ljava.lang.Object;Ljava.io.ObjectStreamClass V(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Ljava.io.ObjectStreamClass V(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
at java.util.ArrayList.readObject(ArrayList.java:554)
at java.lang.LangAccessImpl.readObject(Ljava.lang.Class;Ljava.lang.Object;Ljava.io.ObjectInputStream V(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Ljava.lang.Object;Ljava.io.ObjectInputStream V(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Ljava.io.ObjectStreamClass V(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
at weblogic.rmi.internal.CBVInputStream.readObjectInternal(CBVInputStream.java:67)
at weblogic.rmi.internal.CBVInputStream.readObject(CBVInputStream.java:61)
at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:97)


Please suggest me...
Thanks in Advance.
database value for that column will come like @com.bvn.finance.services.treatment.collectors.Collector object..

So please tell me how to convert it to my class Collector and assign collector name using collector id from the above object..

Thanks in Advance.....
HI Angel,
Thanks for the reply..
I have to diplay Collector names in JSF page using collectorsID from the Table.
If i query the table the collector id will come as a object not as a value..
so please suggest me how to convert that object value returned in to noraml values and add to arraylist..

Thanks in Advance