David E Jones wrote:
On Jun 29, 2008, at 6:56 PM, Adam Heath wrote:
On Jun 29, 2008, at 5:23 PM, David E Jones wrote:
It looks like in the last few hours, something following SVN rev
672652, has broken the trunk.
Now when trying to start I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Priority
at
org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:51)
at org.ofbiz.base.start.Start.initStartLoaders(Start.java:250)
at org.ofbiz.base.start.Start.init(Start.java:89)
at org.ofbiz.base.start.Start.main(Start.java:398)
Somehow, the classpath used to compiled ofbiz-base.jar had 2 versions
of log4j in it, the local one in framework/base/lib, and one that
appears to be in ant's global classpath.
Hadn't noticed it myself yet, I've got some other things in progress;
I assumed that everything compiled fine, seeing as how the other libs
were found.
Sorry about it(and the fix is in).
I looked into this a little more, and it's a weird one. It looks like
all of the classes from src/base are also be put into the the
build/classes/start directory, and added to the eventual jar file, which
means there will be lots of classes in that jar file that depend on
other classes (in jar files) that are not on the classpath (since only
the contents of ofbiz.jar are on the initial classpath).
Anyway, I couldn't see what might cause this, so who knows what the
solution might be....
Ah, yes, now I understand.
macros.xml contains a presetdef for javac; it sets srcdir="${src.dir}".
For base, the source doesn't live directly in that dir, but in 2
subdirs, start/ and base/. When the javac15 macro was called in
build.xml, it used a nested <src> path element; instead of overriding
this, like I thought, it actually built upon the already set srcdir.
So, I fixed this by changing the srcdir value, instead of using a nested
<src> element.
If you want to use a nested <src> element(for specifying multiple paths,
etc), then you'll need to set the srcdir attribute to the empty value,
before adding any <src> elements.