Hi, I think I'm getting pretty close to getting this working.  I followed the 
example in

ejb\org\apache\ojb\ejb\ODMGSessoinBean.java

I set the env-entry to point at my respository.xml file (via the xdoclet tag).  
Then I tried a bunch of different formats (file:// url style, etc).  Then I 
compared it to putting in a bogus path.  Then I put repository.xml in 
jboss/bin directory and just used "repository.xml" in my env-entry.  All 
result in the (same) following error.  FWIW, I verified that the env-entry is 
getting trasferred into ejb-jar.xml correctly.


I get the database in my bean code like so:

initialContext = new InitialContext();
String ojbRepository = (String) 
initialContext.lookup("java:comp/env/ojb.repository");
System.out.println("ojbRepos->" + ojbRepository);
db = this.getOJBInstance().newDatabase();
db.open(ojbRepository, Database.OPEN_READ_WRITE);


which results in this error in the jboss window:


2002-10-04 08:54:21,939 INFO  [STDOUT] ojbRepos-
>c:/data/devprojects/ojbtest/repository.xml
2002-10-04 08:54:21,939 INFO  [STDOUT] [BOOT] ERROR: 
2002-10-04 08:54:21,939 INFO  [STDOUT] could not instantiate null
2002-10-04 08:54:21,939 INFO  [STDOUT] null
2002-10-04 08:54:21,939 ERROR [STDERR] java.lang.NoClassDefFoundError
2002-10-04 08:54:21,939 ERROR [STDERR]  at 
org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown Source)
2002-10-04 08:54:21,939 ERROR [STDERR]  at 
org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown Source)
2002-10-04 08:54:21,970 ERROR [STDERR]  at 
org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown Source)
2002-10-04 08:54:21,970 ERROR [STDERR]  at 
org.apache.ojb.odmg.OJB.<init>(Unknown Source)
...
2002-10-04 08:54:22,070 INFO  [STDOUT] [BOOT] ERROR: 
2002-10-04 08:54:22,070 INFO  [STDOUT] could not instantiate null
2002-10-04 08:54:22,070 INFO  [STDOUT] null
2002-10-04 08:54:22,070 ERROR [STDERR] java.lang.NoClassDefFoundError
2002-10-04 08:54:22,070 ERROR [STDERR]  at 
org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown Source)
2002-10-04 08:54:22,070 ERROR [STDERR]  at 
org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown Source)
2002-10-04 08:54:22,070 ERROR [STDERR]  at 
org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown Source)
2002-10-04 08:54:22,080 ERROR [STDERR]  at 
org.apache.ojb.odmg.OJBJ2EE_2.<init>(Unknown Source)
...
java.lang.NoClassDefFoundError
        at 
org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown Source)
        at org.apache.ojb.odmg.OJBJ2EE_2.getInstance(Unknown Source)
        at org.jboss.ojb.odmg.ODMGFactory.getInstance(Unknown Source)
        at ojb.OJBWrapperBean.getOJBInstance(Unknown Source)



Btw OJB works great when I use it outside of the appserver (normal usage). 

So to summarize, it does this whether or not I provide a correct path to 
repository.xml.  I tried setting everything to DEBUG in OJB.props which had no 
effect (after an appserver restart too).  My latest theory is that it's not 
picking up my OJB.props, in spite of the fact that I'm doing a

System.setProperty("OJB.properties","c:/data/devporjects/ojbtest/OJB-
SERVER.properties");

in my bean's constructor (don't ask why, it's just a hack).  I had tried 
putting OJB.props in jboss/bin as well.  Is there a way to verify that 
OJB.props is getting found correctly by ojb, before doing a db.open?

Anyone seen this before?  Any ideas are appreciated.

Thanks,
Steve



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to