First, you must insure that you put all of your jars in WEB-INF/lib. This is important because of the way that classloaders work. Once a classloader has found something in its effective classpath, that is where it stops looking. Don't be tempted to put your jars in some Oracle lib path. Next insure that a class can be loaded from classes. You can do this by creating a class that has no package and calling it from a server. Examine the application deployment directory structure (the expansion that happens after the war or ear is dropped into the applications subdirectory of j2ee/server-instance. If an ear, you should find a appname/warname file. Below this, you should find a directory of appname that contains the webapp. The webapp must contain a WEB-INF. The WEB-INF should contain web.xml (you created this for your web app). It may also contain some tlds, a classes directory and a lib directory. The lib directory is where all of your jars (including ojb jars as needed) will be. The classes directory should contain all of your ojb configuration files (for me it also contains all of my struts configuration files) and related dtds. There should also be a directory mil in your case (the root of your package names if mil.af.xxx is your package naming convention). Because of the test indicated above, it should also contain your package-less .class file. If Oracle is not deploying the stuff here, that is why you are getting the result you are getting. That is, if the files are there, and the classloader finds the package-less class, this problem is out of my league. Otherwise, deployment is not happening as it is expected to occur. In the past, I have found that problems like this come from deployed files not arriving in the expected directory. Please let me know what you find.

Wayne

Durham David Contr 805 CSPTS/SCBE wrote:

Hi Wayne,

I have tried a couple more things and want to ask for a bit of further
information.




The place to understand is in the CVS for the following 2 classes

org.apache.ojb.broker.util.configuration.impl.ConfigurationAb
stractImpl

and

org.apache.ojb.broker.util.configuration.impl.OjbConfiguration

They actually do this stuff.

You will get an error message if that file is not found

catch (Exception ignore)
{
LoggerFactory.getBootLogger().error("Cannot get
OJB properties file, use default settings!");
properties.put("valid", "false");
}
}



Yeah, I tracked down what was happening in the source. Specifically OJB.properties is loaded with the following line:

        
Thread.currentThread().getContextClassLoader().getResource(getFilename()
);

The following line is being logged:

Cannot get OJB properties file, use default settings!


So, my question is still how to make Oracle 9ias load the OJB.properties file. I tried adding the following:

System.setProperty("OJB.properties","/OJB.properties");

based on your previous suggestion for using "/repository.xml" instead of
"repository.xml"

I realize that this really is an Oracle classloader issue, and I am
talking with Oracle support regarding this issue.  However, they have so
far been unhelpful and are hinting that I should use Toplink.  Blah, I
don't like it.  I'd rather not, I like having access to source code,
also am having no problems with OJB itself.

So, can you give me more info about what you had to do to get Oracle
9ias to load OJB.properties.  Otherwise, I'm thinking I'll have to make
some kind of change to OJB itself (e.g., instead of
Thread.currentThread... use
org.apache.log4j.helpers.Loader.getResource())   Not something I want to
do because of dependency, and required patching when the OJB final
release comes out.

Anyway, would appreciate any info about exactly how you got oracle to
find this properties file.

Thanks,

Dave





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


Reply via email to