-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: IllegalMonitorState
PostPosted: Fri Feb 20, 2004 11:02 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
Hello-

I tried to run the quickstart example and got IllegalMonitorStateException during build. The database is MySQL. The example was run bypassing JNDI and using the jdbc:mysql:///quickstart
user name was root. This was placed in the src/hibernate.properties.
I use Win2000. jdk is 1.4

Could somebody provide pointers to the solution.

regards,
Amitabh.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2004 11:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Show the exception log.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2004 11:09 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
The exception came on the command prompt. Is it possible to redirect the output to a log file. I am not aware about that.

regards,
Amitabh.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2004 11:11 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
Hello-
Another information about the setup. I didnt use the servlet. I placed the mail in the HibernateUtils, made the changes in the build.xml and ran the build.bat


regards,
Amitabh.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2004 11:13 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Just read (and understand) the red notice on your screen before you post. Thanks :)

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2004 11:20 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
Hello-

Read the notice. I will send the information.

Thank you.

regards,
Amitabh.


Top
 Profile  
 
 Post subject: Error message at the command prompt
PostPosted: Sat Feb 21, 2004 3:29 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
Hello-

The following is the error code at the prompt. The version of the software used is given at the end alongwith the code snippet.

-------------------------------

C:\hibernate-2.1>java -cp "lib/ant-1.5.3.jar;lib/ant-optional-1.5.3.jar;lib/juni
t-3.8.1.jar;lib/xerces-2.4.0.jar;C:\bea\jdk131/lib/tools.jar" org.apache.tools.a
nt.Main -Ddriver.jar=lib\mysql.jar empdet
Buildfile: build.xml
A nonfatal internal JIT (3.00.078(x)) error 'chgTarg: Conditional' has occurred
in :
'org/apache/tools/ant/Project.fireMessageLoggedEvent (Lorg/apache/tools/ant/Bu
ildEvent;Ljava/lang/String;I)V': Interpreting method.
Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
i

A nonfatal internal JIT (3.00.078(x)) error 'chgTarg: Conditional' has occurred
in :
'org/apache/tools/ant/Project.addCreatedTask (Ljava/lang/String;Lorg/apache/to
ols/ant/Task;)V': Interpreting method.
Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
i

[taskdef] Could not load definitions from resource clovertasks. It could not b
e found.

empdet:
[echo] remember to place your JDBC driver in the lib directory
java.lang.IllegalMonitorStateException: current thread not owner
at org.apache.tools.ant.taskdefs.StreamPumper.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
java.lang.IllegalMonitorStateException: current thread not owner
at org.apache.tools.ant.taskdefs.StreamPumper.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)

BUILD FAILED
file:C:/hibernate-2.1/build.xml:554: Java returned: 1

Total time: 3 seconds

--------------------

version information
---------------

mysql version:2.5
tomcat version:4
hibernate version: 2.1
------------------
java code
-----------------
package net.sf.hibernate.examples.quickstart;
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;
import net.sf.hibernate.examples.quickstart.Cat

public class HibernateUtil {

private static final SessionFactory sessionFactory;

static {
try {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (HibernateException ex) {
throw new RuntimeException("Exception building SessionFactory: " + ex.getMessage());
}
}

public static final ThreadLocal session = new ThreadLocal();

public static Session currentSession() throws HibernateException {
Session s = (Session) session.get();
// Open a new Session, if this Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}

public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
session.set(null);
if (s != null)
s.close();
}
public static void main(String args[])throws HibernateException {
Session session1 = HibernateUtil.currentSession();

Transaction tx1= session1.beginTransaction();

Cat princess = new Cat();
princess.setName("Princess");
princess.setSex('F');
princess.setWeight(7.4f);

session1.save(princess);
tx1.commit();

HibernateUtil.closeSession();
}
}
---------------------


Please provide pointers to the solutions.



regards,
Amitabh.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 21, 2004 5:33 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Looks like it is bug in JVM, you need to change/upgrade JVM or ant (Ant fails before to execute any hibernate code).
Try to find answers in Ant README file too.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 21, 2004 6:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Yes, that really looks like some VM hickup. Are you using an up-to-date VM? If not, try with an upgraded one ...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 21, 2004 10:41 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
gloeglm wrote:
Yes, that really looks like some VM hickup. Are you using an up-to-date VM? If not, try with an upgraded one ...


I am using JDK1.4.1. The program runs well in my machine but in the office machine it fails.

Guess that could be the issue. If there are any other pointers please do inform.

Thanks.

regards,
Amitabh.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.