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.  [ 6 posts ] 
Author Message
 Post subject: capture the command executed by Eclipse
PostPosted: Sun Jul 20, 2008 12:16 am 
Beginner
Beginner

Joined: Tue Jun 17, 2008 12:14 am
Posts: 21
I have a Hibernate appps. It runs on Eclipse IDE (in class files format), it works fine. But when I packages it to jar file, and run it using command prompt, it hit error.

Quote:
java.lang.NoClassDefFoundError: org/hibernate/Session
at com.flextronics.fftester.Client.main(Client.java:103)
Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
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)
... 1 more


My question is, how to capture the command executed by Eclipse, so that I cna re-use it on command prompt?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 21, 2008 6:04 am 
Beginner
Beginner

Joined: Tue Jun 17, 2008 12:14 am
Posts: 21
I even used all the classpath in the build options, but still fails. anyone knows?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 1:38 pm 
Beginner
Beginner

Joined: Fri Aug 05, 2005 3:36 am
Posts: 28
Gary, I posted this reply to your earlier topic, but i think you missed it. It describes how to get the command line you're looking for.


Run your application from Eclipse, in debug mode, and set a breakpoint. When the app hits the breakpoint, go to the Debug Perspective. (Eclipse has probably taken you there anyway.)

From there, find the Debug View. Each top-level node in this tree-based view represents a launch that Eclipse managed - either one that is still running, or one that has recently terminated. Find the node in this view that corresponds to the one you're concerned with. Presumably it is suspended (on your breakpoint), and you can see its immediate child, a single Process node, and several children of that node, representing Threads.

Select the process node, and view its properties, either by typing Alt-Enter, or by right-clicking it and selecting "Properties" from the menu that pops up. A dialog will pop up, and in the right pane, you will see the command line that Eclipse used to launch the process.

There you go!

-larry


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 8:38 pm 
Beginner
Beginner

Joined: Tue Jun 17, 2008 12:14 am
Posts: 21
great! it's there, thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 2:59 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Obviously, all of your jar files need to be on your classpath. The JVM doesn't always behave from the command line like you think it might should. :(

You might find this tutorial helpful. It gets Hibernate running from the command line, and it uses MySQL as the database, although as we know, the system iteself is db agnostic:

Running Hibernate Applications from the Command Link - Setting Up Hibernate3 with JPA

And of course, check your jar files!

Image

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 3:33 am 
Beginner
Beginner

Joined: Tue Jun 17, 2008 12:14 am
Posts: 21
Quote:
The JVM doesn't always behave from the command line like you think it might should.


why? where ?

Wow, you have your book published? Congrats! Are you one of the developer in Hibernate (or JBoss)? If not, why I never see any developer in this forum, like in MSDN? Why people said Hibernate (and JBoss) is so popular, yet so many pending unanswered post in both forums? Are the beginner level and expert level differ so huge?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.