Jruby/Hibernate/JPA

Hi,

I work on a large Java web project that uses Hibernate/JPA for the data
layer. We use the JPA and Hibernate annotations extensively. I’d love to
use
jirb to provide a Rails-like console to our business objects. Is anyone
doing something similar?

I’ve made some progress, but Hibernate is throwing a
NoClassDefFoundError
exception for commons logging’s LogFactory. LogFactory is imported and
available in jirb. I guess I’m looking for an indication that this is
doable
before I spend too much more time on it.

Thank you and thanks for all the hard work on Jruby.

Denny


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Tue, Dec 30, 2008 at 10:24 PM, Crall, Dennis P
[email protected] wrote:

available in jirb. I guess I’m looking for an indication that this is doable
before I spend too much more time on it.

There shouldn’t be anything particular you need to do. Does Hibernate
have some unusual classpath structuring expectations?

You should be able to just put the whole lot of jars in your
$CLASSPATH environment variable, start up jirb, and start loading up
classes and objects. Do you have any specific examples you can share
that exhibit the problem?

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Denny,
i also have console for my bussines objects but i use simple text
field for script and jsr223 to run the script. If You are interested
in details i can send You the code.
Still as Nick said You should be able to do it with jirb.

Best greetings,
Pawe³ Wielgus.

2008/12/31 Nick S. [email protected]:

On Wed, Dec 31, 2008 at 10:55 AM, Crall, Dennis P
[email protected] wrote:

I couldn’t get that to work. Is it possible to import .class files? Or do
you need a jar?

Directory entries on CLASSPATH should not include any package prefix.
This is a standard Java convention.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Weird. I’m not exactly sure what I changed, but I have it working now.
Thanks for the information.

Also, since you mentioned $CLASSPATH, originally I was trying to add my
.class files to the classpath. I was doing something like this:

export CLASSPATH=“/project/path/classes/packageroot”

I couldn’t get that to work. Is it possible to import .class files? Or
do you need a jar?

Thanks again,

Denny

On 12/30/08 11:01 PM, “Nick S.” [email protected] wrote:

On Tue, Dec 30, 2008 at 10:24 PM, Crall, Dennis P
[email protected] wrote:

available in jirb. I guess I’m looking for an indication that this is doable
before I spend too much more time on it.

There shouldn’t be anything particular you need to do. Does Hibernate
have some unusual classpath structuring expectations?

You should be able to just put the whole lot of jars in your
$CLASSPATH environment variable, start up jirb, and start loading up
classes and objects. Do you have any specific examples you can share
that exhibit the problem?

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Denny,

Once I got the classpath issues behind me I had no problems using
hibernate, etc from JRuby. So, this is the stanza I use to start my
scripts if it helps.

#!/usr/bin/env jruby

require ‘java’

[“#{File.dirname FILE}/…/build/”, “#{File.dirname
FILE}/…/lib/”].concat(Dir[“#{File.dirname
FILE}/…/lib/*.jar”]).each { |jar| $CLASSPATH << jar }

On Wed, Dec 31, 2008 at 9:17 AM, Nick S. [email protected]
wrote:

export CLASSPATH=“/project/path/classes/packageroot”


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email