Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

log4j classes not found in custom RoleMapper (sometimes)

6 views
Skip to first unread message

Miles Krivoshia

unread,
Mar 19, 2004, 3:44:09 PM3/19/04
to
WLS8.1 sp2, using wlserver ant task to start the server. Not sure if this is
the best group, but...

I have a custom RolerMapper provider that I can successfully add to a
running server through the admin console, but when I try to start the server
via ant (essentially a coldstart with a saved config.xml file,
boot.properties and ldift files), the server throws a NoClassDefFoundError:

[wlserver] <Mar 19, 2004 2:57:08 PM EST> <Info> <Security> <BEA-090075>
<The RoleMapper provider has had its LDIF information loaded from:
C:\bea\user_projects\domains\combinenet\.\DefaultRoleMapperInit.ldift>
[wlserver]
***************************************************************************
[wlserver] The WebLogic Server did not start up properly.
[wlserver] java.lang.NoClassDefFoundError: org/apache/log4j/Logger
[wlserver] at com.combinenet.util.Logger.<init>(Logger.java:113)
[wlserver] at com.combinenet.util.Logger.getLogger(Logger.java:125)
[wlserver] at com.combinenet.util.Logger.getLogger(Logger.java:136)
[wlserver] at
com.combinenet.security.CNRoleMapperProvider.<clinit>(CNRoleMapperProvider.j
ava:65)

I tried adding "Class-Path: log4j.jar" to the manifest of the provider jar
file, and I even stuffed the log4j.jar in there too, but neither worked.
log4j.jar is in the server's common/lib directory, and other parts of our
app use log4j without a problem.

I worked around this by unjarring log4j.jar and updating my provider jar
with all of the classes, but obviously isn't a solution.

Any idea why log4j.jar isn't being loaded by the server's bootstrap
classloader at startup (from common/lib)?

How can I add log4j.jar to the classpath in the wlserver task? (it doesn't
support the classpath attribute).

I've had more problems getting log4j to work properly with WLS...

Thanks for any help,
Miles


Craig

unread,
Mar 19, 2004, 5:28:19 PM3/19/04
to

I believe you will need to place the jar in the system classpath. You can ask about
provider jars and using the class path from the manifest file in the weblogic.developer.interest.management
newsgroup.

Miles Krivoshia

unread,
Mar 20, 2004, 10:06:56 AM3/20/04
to
Thanks for the reply. I have tried placing the jar in the system classpath
(that's how our ejbs access log4j, just fine), but that didn't work either.
Seems to be something special about provider jars. I'll follow up on the
mgmt newsgroup.

-Miles

"Craig" <c...@thefrogpad.net> wrote in message
news:405b7403$1...@newsgroups.bea.com...

Miles Krivoshia

unread,
Mar 22, 2004, 4:27:24 PM3/22/04
to
FYI, if anyone is interested, putting the log4j.jar in the mbeantypes
directory and using the Class-Path: log4j.jar entry in the provider's
manifest file got around this problem. It seems that jars in the system
classpath is not available to security provider jars for some reason. I
don't recall seeing that documented anywhere.

"Miles Krivoshia" <mkrivoshia{{remove}}@combinenet.{{rem}}com> wrote in
message news:405c5e16$1...@newsgroups.bea.com...

seyvet

unread,
Mar 23, 2004, 11:22:27 AM3/23/04
to

I ran in the same problem... I tried to autogenerate the Manifest file from the
weblogicMbeanMaker with no success. So instead of hacking the Manifest file (I
could not do it from ANT)., I conceded the game to weblogic and put the log4j.jar
in the Classpath in startWebLogic.cmd/startWebLogic.sh.

It worked.

How do you change the manifest? After generating the .jar or did u find a work
around for the webLogicMbeanMaker class?

Miles Krivoshia

unread,
Mar 23, 2004, 4:01:46 PM3/23/04
to

"seyvet" <Nicolas...@ericsson.ca> wrote in message
news:40606443$1...@newsgroups.bea.com...

>
> I ran in the same problem... I tried to autogenerate the Manifest file
from the
> weblogicMbeanMaker with no success. So instead of hacking the Manifest
file (I
> could not do it from ANT)., I conceded the game to weblogic and put the
log4j.jar
> in the Classpath in startWebLogic.cmd/startWebLogic.sh.
>
> It worked.

Having log4j on the sys classpath did not work for me, but I was using
<wlserver> to start the server. I was able to get wlserver to use a
classpath that I specified, but still no luck.

> How do you change the manifest? After generating the .jar or did u find a
work
> around for the webLogicMbeanMaker class?

I was able to use ant's jar task to update the manifest of the jar that
WebLogicMBeanMaker created:

<jar update="true" basedir="${build}"
destfile="${provider.jar}"
manifest="${src}/com/combinenet/security/MANIFEST.MF"
includes="com/combinenet/util/**/*"/>

I checked in a MANIFEST.MF file in my src tree that contains only:

Class-Path: log4j.jar

The resulting manifest is the merge of that plus what WebLogicMBeanMaker
produced.

-Miles

0 new messages