Skip to Content.
Sympa Menu

grouper-dev - Re: [grouper-dev] Strange grouper error on 1.3.0 rc1

Subject: Grouper Developers Forum

List archive

Re: [grouper-dev] Strange grouper error on 1.3.0 rc1


Chronological Thread 
  • From: "GW Brown, Information Systems and Computing" <>
  • To: "Cramton, James" <>,
  • Subject: Re: [grouper-dev] Strange grouper error on 1.3.0 rc1
  • Date: Thu, 01 May 2008 08:43:51 +0100

Could it be a permission problem reading a file? Are you adding WEB-INF/classes to the classpath or getting config from elsewhere?

You can add

-Xrunjdwp:transport=dt_socket,server=y,address=4001,suspend=y
to the command line java invocation and the process will pause until you connect with a debugger which would let you catch the error in situ.

Gary



--On 30 April 2008 16:46 -0400 "Cramton, James" <> wrote:



I'm sure this is not a problem with Grouper, but with our provisioning
scripts that call the Grouper API. But I've beat my head against this for
a bit, and my brain cells are probably in mourning for Abby Hoffman, and
therefore refuse to operate above par. Any suggestions for resolving
this would be welcome, and I'll keep this as short as possible.



We provision our grouper from a separate Java process called from a perl
script that sets up a reasonable classpath, along with other environment
variables. The classpath includes the grouper.jar in our tomcat webapps
directory, so we know it's in sync with the webapp, which works fine.
When we create a GrouperSession, we get the following error, which has a
null message.







Apr 30, 2008 4:44:15 PM edu.internet2.middleware.grouper.ErrorLog fatal

SEVERE: [edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO]
unable to initialize hibernate: null

Exception in thread "main" java.lang.ExceptionInInitializerError

at
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO.<clinit>(Hib3D
AO.java:71)

at
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAOFactory.getGrou
p(Hib3DAOFactory.java:57)

at
edu.internet2.middleware.grouper.GrouperSourceAdapter.getSubject(GrouperS
ourceAdapter.java:97)

at
edu.internet2.middleware.grouper.subj.SourcesXmlResolver.find(SourcesXmlR
esolver.java:87)

at
edu.internet2.middleware.grouper.subj.CachingResolver.find(CachingResolve
r.java:67)

at
edu.internet2.middleware.grouper.subj.ValidatingResolver.find(ValidatingR
esolver.java:61)

at
edu.internet2.middleware.grouper.SubjectFinder.findById(SubjectFinder.jav
a:67)

at edu.brown.grouper.GrouperUtils.newSession(Unknown Source)

at StemInfo.main(Unknown Source)

Caused by: java.lang.NoClassDefFoundError

at org.apache.log4j.Logger.getLogger(Logger.java:94)

at
com.mchange.v2.log.log4j.Log4jMLog.getMLogger(Log4jMLog.java:51)

at com.mchange.v2.log.MLog.getLogger(MLog.java:145)

at com.mchange.v2.log.MLog.<clinit>(MLog.java:72)

at com.mchange.v2.c3p0.DataSources.<clinit>(DataSources.java:59)

at
org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionP
rovider.java:154)

at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(
ConnectionProviderFactory.java:124)

at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(
ConnectionProviderFactory.java:56)

at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactor
y.java:414)

at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)

at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)

at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:12
98)

at
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO.<clinit>(Hib3D
AO.java:66)

... 8 more





Which I trace to the following lines of code in lines 46 -- 57 of
Hib3DAO.java:



abstract class Hib3DAO {



// PRIVATE CLASS CONSTANTS //

private static final Configuration CFG;

private static final SessionFactory FACTORY;



// STATIC //

static {

try {

// Find the custom configuration file

if (Hib3DAO.class.getResource(GrouperConfig.HIBERNATE_CF) == null)
{

throw new RuntimeException("Cant find resource " +
GrouperConfig.HIBERNATE_CF + ", make sure it is on the classpath.");

}

// JFC: OK to here

InputStream in =
Hib3DAO.class.getResourceAsStream(GrouperConfig.HIBERNATE_CF);

Properties p = new Properties();

p.load(in);

// And now load all configuration information

CFG = new Configuration()

.addProperties(p)

.addClass(Hib3AttributeDAO.class)

.addClass(Hib3CompositeDAO.class)

.addClass(Hib3FieldDAO.class)

.addClass(Hib3GroupDAO.class)

.addClass(Hib3GroupTypeDAO.class)

.addClass(Hib3GroupTypeTupleDAO.class)

.addClass(Hib3GrouperSessionDAO.class)

.addClass(Hib3MemberDAO.class)

.addClass(Hib3MembershipDAO.class)

.addClass(Hib3RegistrySubjectDAO.class)

.addClass(Hib3RegistrySubjectAttributeDAO.class)

.addClass(Hib3StemDAO.class)

;

// And finally create our session factory

FACTORY = CFG.buildSessionFactory();

// JFC: Throws an exception with a null message by here

}

catch (Throwable t) {

String msg = "unable to initialize hibernate: " + t.getMessage();

ErrorLog.fatal(Hib3DAO.class, msg);

throw new ExceptionInInitializerError(t);

}

} // static



I've verified that all of the classed added in the Configuration
constructor are present, as are their xml files. And again, the web
interface does not have this problem, so it's clearly something
environmental about our provisioning script.



Thoughts on where to look next?



Thanks!



James Cramton

Lead Programmer/Analyst



401 345 9795





----------------------
GW Brown, Information Systems and Computing




Archive powered by MHonArc 2.6.16.

Top of Page