You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jason Dillon <ja...@planet57.com> on 2006/08/25 21:21:41 UTC

Endorsed dirs

Anyone know if the jars in the endorsed dir need to be added to the  
classpath... or will the jvm just suck up all *.jar files and load  
them anyways?

Was just wondering that if that is the case, and we add them to the  
classpath, does that just waste bytes for an unused classloader and/ 
or slow down the initial boot?

--jason

Re: Endorsed dirs

Posted by Jason Dillon <ja...@planet57.com>.
Okay.

--jason


On Aug 25, 2006, at 1:11 PM, Dain Sundstrom wrote:

> It is my recollection that we assumed they were automatically added  
> and the reality was they weren't so I had to add them explicitly to  
> the manifest class path.
>
> -dain
>
> On Aug 25, 2006, at 12:54 PM, Jacek Laskowski wrote:
>
>> On 8/25/06, Jason Dillon <ja...@planet57.com> wrote:
>>> But, do they automatically make it onto the classpath?  This snip
>>> does not really lead me to believe that it does or does not.
>>
>> Well, I wish I could test it out, but don't know how. I have never
>> used it explicitly. I'm pretty sure it doesn't have to be on
>> CLASSPATH. Wait, I'm not sure if I did not mess it up with ext
>> classloader.
>>
>> Jacek
>>
>> -- 
>> Jacek Laskowski
>> http://www.laskowski.net.pl
>


Re: Endorsed dirs

Posted by Dain Sundstrom <da...@iq80.com>.
It is my recollection that we assumed they were automatically added  
and the reality was they weren't so I had to add them explicitly to  
the manifest class path.

-dain

On Aug 25, 2006, at 12:54 PM, Jacek Laskowski wrote:

> On 8/25/06, Jason Dillon <ja...@planet57.com> wrote:
>> But, do they automatically make it onto the classpath?  This snip
>> does not really lead me to believe that it does or does not.
>
> Well, I wish I could test it out, but don't know how. I have never
> used it explicitly. I'm pretty sure it doesn't have to be on
> CLASSPATH. Wait, I'm not sure if I did not mess it up with ext
> classloader.
>
> Jacek
>
> -- 
> Jacek Laskowski
> http://www.laskowski.net.pl


Re: Endorsed dirs

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 8/25/06, Jason Dillon <ja...@planet57.com> wrote:
> But, do they automatically make it onto the classpath?  This snip
> does not really lead me to believe that it does or does not.

Well, I wish I could test it out, but don't know how. I have never
used it explicitly. I'm pretty sure it doesn't have to be on
CLASSPATH. Wait, I'm not sure if I did not mess it up with ext
classloader.

Jacek

-- 
Jacek Laskowski
http://www.laskowski.net.pl

Re: Endorsed dirs

Posted by Jason Dillon <ja...@planet57.com>.
But, do they automatically make it onto the classpath?  This snip  
does not really lead me to believe that it does or does not.

--jason


On Aug 25, 2006, at 12:43 PM, Jacek Laskowski wrote:

> On 8/25/06, Jason Dillon <ja...@planet57.com> wrote:
>> Anyone know if the jars in the endorsed dir need to be added to the
>> classpath... or will the jvm just suck up all *.jar files and load
>> them anyways?
>
> No, they needn't.
>
> An excerpt from 'Endorsed Standards Classes Deployment'
> (http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html):
>
> Classes implementing newer versions of endorsed standards should be
> placed in JAR files. The system property java.endorsed.dirs specifies
> one or more directories that the Java runtime environment will search
> for such JAR files. If more than one directory path is specified by
> java.endorsed.dirs, they must be separated by File.pathSeparatorChar.
> If no value is set for java.endorsed.dirs, then Sun Microsystem's
> implementation of the Java 2 Platform looks for JAR files in a default
> standard location:
>
>    <java-home>\lib\endorsed          [Microsoft Windows]
>    <java-home>/lib/endorsed          [Solaris or Linux]
>
> Here <java-home> refers to the directory where the runtime software is
> installed (which is the top-level directory of the Java 2 Runtime
> Environment or the jre directory in the Java 2 SDK).
>
> The Java runtime environment will use classes in such JAR files to
> override the corresponding classes provided in the Java 2 Platform as
> shipped by Sun.
>
> Jacek
>
> -- 
> Jacek Laskowski
> http://www.laskowski.net.pl


Re: Endorsed dirs

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 8/25/06, Jason Dillon <ja...@planet57.com> wrote:
> Anyone know if the jars in the endorsed dir need to be added to the
> classpath... or will the jvm just suck up all *.jar files and load
> them anyways?

No, they needn't.

An excerpt from 'Endorsed Standards Classes Deployment'
(http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html):

Classes implementing newer versions of endorsed standards should be
placed in JAR files. The system property java.endorsed.dirs specifies
one or more directories that the Java runtime environment will search
for such JAR files. If more than one directory path is specified by
java.endorsed.dirs, they must be separated by File.pathSeparatorChar.
If no value is set for java.endorsed.dirs, then Sun Microsystem's
implementation of the Java 2 Platform looks for JAR files in a default
standard location:

    <java-home>\lib\endorsed          [Microsoft Windows]
    <java-home>/lib/endorsed          [Solaris or Linux]

Here <java-home> refers to the directory where the runtime software is
installed (which is the top-level directory of the Java 2 Runtime
Environment or the jre directory in the Java 2 SDK).

The Java runtime environment will use classes in such JAR files to
override the corresponding classes provided in the Java 2 Platform as
shipped by Sun.

Jacek

-- 
Jacek Laskowski
http://www.laskowski.net.pl

Re: Endorsed dirs

Posted by Jason Dillon <ja...@planet57.com>.
Yup, it definitely is not happy if these jars are not on the classpath.

--jason


On Aug 28, 2006, at 10:03 AM, Dain Sundstrom wrote:

> IIRC you will get exceptions on a 1.4 JVM if xerces is not  
> available since the local attribute manager uses a few custom  
> xerces properties.
>
> -dain
>
> On Aug 27, 2006, at 10:47 PM, Jason Dillon wrote:
>
>> I guess we could try omitting the xerces jars from the classpath  
>> of server.jar and see if it works or not...
>>
>> --jason
>>
>>
>> On Aug 26, 2006, at 5:41 PM, Heinz Drews wrote:
>>
>>> Everything loaded from directories specified by
>>> -Djava.endorsed.dirs={dirlist} is loaded by the bootstrap  
>>> classloader.
>>> The documentation in Tomcat indicates that the endorsed dirs are
>>> managed differently.  But the classes are visible in a classloader.
>>>
>>> On 8/26/06, David Jencks <da...@yahoo.com> wrote:
>>>> IIRC Tomcat needs this stuff set only for validation: it doesn't
>>>> actually do _anything_ with the endorsed directories or their
>>>> contents to set up or influence any classloaders.
>>>>
>>>> I think someone needs to do some experiments to determine:
>>>> - if the jars in endorsed need to be added explicitly to some
>>>> classloader
>>>> - if that classloader has to be the system (?? application??
>>>> boot??????) classloader or if any classloader that includes a  
>>>> jar in
>>>> endorsed gets to use the stuff in the jar in preference to the  
>>>> stuff
>>>> in the jvm.
>>>>
>>>> My unvalidated impression agrees with Dain
>>>>
>>>> thanks
>>>> david jencks
>>>>
>>>> On Aug 25, 2006, at 7:44 PM, anita kulshreshtha wrote:
>>>>
>>>> >    IIRC, The tomcat container needs to be started with
>>>> > java.endorsed.dirs system property set to a dir where the xerces
>>>> > parser
>>>> > is available. It uses the endorsed dir mechanism to override the
>>>> > default parser. The server manifest.mf contains an entry
>>>> > Endorsed-Dirs: lib/endorsed
>>>> >   which is used by Deamon (read by CommandLineManifest) to set  
>>>> this
>>>> > property before starting Geronimo. It should have been enough,  
>>>> but it
>>>> > seems we have been adding it to the classpath also. I do not  
>>>> know if
>>>> > this property is used by anyone else.
>>>> >
>>>> > Thanks
>>>> > Anita
>>>> >
>>>> > --- Dain Sundstrom <da...@iq80.com> wrote:
>>>> >
>>>> >> IIRC, they have to be on the classpath.
>>>> >>
>>>> >> -dain
>>>> >>
>>>> >> On Aug 25, 2006, at 12:21 PM, Jason Dillon wrote:
>>>> >>
>>>> >>> Anyone know if the jars in the endorsed dir need to be added  
>>>> to the
>>>> >>
>>>> >>> classpath... or will the jvm just suck up all *.jar files  
>>>> and load
>>>> >>
>>>> >>> them anyways?
>>>> >>>
>>>> >>> Was just wondering that if that is the case, and we add them  
>>>> to the
>>>> >>
>>>> >>> classpath, does that just waste bytes for an unused classloader
>>>> >> and/
>>>> >>> or slow down the initial boot?
>>>> >>>
>>>> >>> --jason
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>> > __________________________________________________
>>>> > Do You Yahoo!?
>>>> > Tired of spam?  Yahoo! Mail has the best spam protection around
>>>> > http://mail.yahoo.com
>>>>
>>>>
>


Re: Endorsed dirs

Posted by Dain Sundstrom <da...@iq80.com>.
IIRC you will get exceptions on a 1.4 JVM if xerces is not available  
since the local attribute manager uses a few custom xerces properties.

-dain

On Aug 27, 2006, at 10:47 PM, Jason Dillon wrote:

> I guess we could try omitting the xerces jars from the classpath of  
> server.jar and see if it works or not...
>
> --jason
>
>
> On Aug 26, 2006, at 5:41 PM, Heinz Drews wrote:
>
>> Everything loaded from directories specified by
>> -Djava.endorsed.dirs={dirlist} is loaded by the bootstrap  
>> classloader.
>> The documentation in Tomcat indicates that the endorsed dirs are
>> managed differently.  But the classes are visible in a classloader.
>>
>> On 8/26/06, David Jencks <da...@yahoo.com> wrote:
>>> IIRC Tomcat needs this stuff set only for validation: it doesn't
>>> actually do _anything_ with the endorsed directories or their
>>> contents to set up or influence any classloaders.
>>>
>>> I think someone needs to do some experiments to determine:
>>> - if the jars in endorsed need to be added explicitly to some
>>> classloader
>>> - if that classloader has to be the system (?? application??
>>> boot??????) classloader or if any classloader that includes a jar in
>>> endorsed gets to use the stuff in the jar in preference to the stuff
>>> in the jvm.
>>>
>>> My unvalidated impression agrees with Dain
>>>
>>> thanks
>>> david jencks
>>>
>>> On Aug 25, 2006, at 7:44 PM, anita kulshreshtha wrote:
>>>
>>> >    IIRC, The tomcat container needs to be started with
>>> > java.endorsed.dirs system property set to a dir where the xerces
>>> > parser
>>> > is available. It uses the endorsed dir mechanism to override the
>>> > default parser. The server manifest.mf contains an entry
>>> > Endorsed-Dirs: lib/endorsed
>>> >   which is used by Deamon (read by CommandLineManifest) to set  
>>> this
>>> > property before starting Geronimo. It should have been enough,  
>>> but it
>>> > seems we have been adding it to the classpath also. I do not  
>>> know if
>>> > this property is used by anyone else.
>>> >
>>> > Thanks
>>> > Anita
>>> >
>>> > --- Dain Sundstrom <da...@iq80.com> wrote:
>>> >
>>> >> IIRC, they have to be on the classpath.
>>> >>
>>> >> -dain
>>> >>
>>> >> On Aug 25, 2006, at 12:21 PM, Jason Dillon wrote:
>>> >>
>>> >>> Anyone know if the jars in the endorsed dir need to be added  
>>> to the
>>> >>
>>> >>> classpath... or will the jvm just suck up all *.jar files and  
>>> load
>>> >>
>>> >>> them anyways?
>>> >>>
>>> >>> Was just wondering that if that is the case, and we add them  
>>> to the
>>> >>
>>> >>> classpath, does that just waste bytes for an unused classloader
>>> >> and/
>>> >>> or slow down the initial boot?
>>> >>>
>>> >>> --jason
>>> >>
>>> >>
>>> >
>>> >
>>> > __________________________________________________
>>> > Do You Yahoo!?
>>> > Tired of spam?  Yahoo! Mail has the best spam protection around
>>> > http://mail.yahoo.com
>>>
>>>


Re: Endorsed dirs

Posted by Jason Dillon <ja...@planet57.com>.
I guess we could try omitting the xerces jars from the classpath of  
server.jar and see if it works or not...

--jason


On Aug 26, 2006, at 5:41 PM, Heinz Drews wrote:

> Everything loaded from directories specified by
> -Djava.endorsed.dirs={dirlist} is loaded by the bootstrap classloader.
> The documentation in Tomcat indicates that the endorsed dirs are
> managed differently.  But the classes are visible in a classloader.
>
> On 8/26/06, David Jencks <da...@yahoo.com> wrote:
>> IIRC Tomcat needs this stuff set only for validation: it doesn't
>> actually do _anything_ with the endorsed directories or their
>> contents to set up or influence any classloaders.
>>
>> I think someone needs to do some experiments to determine:
>> - if the jars in endorsed need to be added explicitly to some
>> classloader
>> - if that classloader has to be the system (?? application??
>> boot??????) classloader or if any classloader that includes a jar in
>> endorsed gets to use the stuff in the jar in preference to the stuff
>> in the jvm.
>>
>> My unvalidated impression agrees with Dain
>>
>> thanks
>> david jencks
>>
>> On Aug 25, 2006, at 7:44 PM, anita kulshreshtha wrote:
>>
>> >    IIRC, The tomcat container needs to be started with
>> > java.endorsed.dirs system property set to a dir where the xerces
>> > parser
>> > is available. It uses the endorsed dir mechanism to override the
>> > default parser. The server manifest.mf contains an entry
>> > Endorsed-Dirs: lib/endorsed
>> >   which is used by Deamon (read by CommandLineManifest) to set this
>> > property before starting Geronimo. It should have been enough,  
>> but it
>> > seems we have been adding it to the classpath also. I do not  
>> know if
>> > this property is used by anyone else.
>> >
>> > Thanks
>> > Anita
>> >
>> > --- Dain Sundstrom <da...@iq80.com> wrote:
>> >
>> >> IIRC, they have to be on the classpath.
>> >>
>> >> -dain
>> >>
>> >> On Aug 25, 2006, at 12:21 PM, Jason Dillon wrote:
>> >>
>> >>> Anyone know if the jars in the endorsed dir need to be added  
>> to the
>> >>
>> >>> classpath... or will the jvm just suck up all *.jar files and  
>> load
>> >>
>> >>> them anyways?
>> >>>
>> >>> Was just wondering that if that is the case, and we add them  
>> to the
>> >>
>> >>> classpath, does that just waste bytes for an unused classloader
>> >> and/
>> >>> or slow down the initial boot?
>> >>>
>> >>> --jason
>> >>
>> >>
>> >
>> >
>> > __________________________________________________
>> > Do You Yahoo!?
>> > Tired of spam?  Yahoo! Mail has the best spam protection around
>> > http://mail.yahoo.com
>>
>>


Re: Endorsed dirs

Posted by Heinz Drews <he...@gmail.com>.
Everything loaded from directories specified by
-Djava.endorsed.dirs={dirlist} is loaded by the bootstrap classloader.
The documentation in Tomcat indicates that the endorsed dirs are
managed differently.  But the classes are visible in a classloader.

On 8/26/06, David Jencks <da...@yahoo.com> wrote:
> IIRC Tomcat needs this stuff set only for validation: it doesn't
> actually do _anything_ with the endorsed directories or their
> contents to set up or influence any classloaders.
>
> I think someone needs to do some experiments to determine:
> - if the jars in endorsed need to be added explicitly to some
> classloader
> - if that classloader has to be the system (?? application??
> boot??????) classloader or if any classloader that includes a jar in
> endorsed gets to use the stuff in the jar in preference to the stuff
> in the jvm.
>
> My unvalidated impression agrees with Dain
>
> thanks
> david jencks
>
> On Aug 25, 2006, at 7:44 PM, anita kulshreshtha wrote:
>
> >    IIRC, The tomcat container needs to be started with
> > java.endorsed.dirs system property set to a dir where the xerces
> > parser
> > is available. It uses the endorsed dir mechanism to override the
> > default parser. The server manifest.mf contains an entry
> > Endorsed-Dirs: lib/endorsed
> >   which is used by Deamon (read by CommandLineManifest) to set this
> > property before starting Geronimo. It should have been enough, but it
> > seems we have been adding it to the classpath also. I do not know if
> > this property is used by anyone else.
> >
> > Thanks
> > Anita
> >
> > --- Dain Sundstrom <da...@iq80.com> wrote:
> >
> >> IIRC, they have to be on the classpath.
> >>
> >> -dain
> >>
> >> On Aug 25, 2006, at 12:21 PM, Jason Dillon wrote:
> >>
> >>> Anyone know if the jars in the endorsed dir need to be added to the
> >>
> >>> classpath... or will the jvm just suck up all *.jar files and load
> >>
> >>> them anyways?
> >>>
> >>> Was just wondering that if that is the case, and we add them to the
> >>
> >>> classpath, does that just waste bytes for an unused classloader
> >> and/
> >>> or slow down the initial boot?
> >>>
> >>> --jason
> >>
> >>
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
>
>

Re: Endorsed dirs

Posted by David Jencks <da...@yahoo.com>.
IIRC Tomcat needs this stuff set only for validation: it doesn't  
actually do _anything_ with the endorsed directories or their  
contents to set up or influence any classloaders.

I think someone needs to do some experiments to determine:
- if the jars in endorsed need to be added explicitly to some  
classloader
- if that classloader has to be the system (?? application??  
boot??????) classloader or if any classloader that includes a jar in  
endorsed gets to use the stuff in the jar in preference to the stuff  
in the jvm.

My unvalidated impression agrees with Dain

thanks
david jencks

On Aug 25, 2006, at 7:44 PM, anita kulshreshtha wrote:

>    IIRC, The tomcat container needs to be started with
> java.endorsed.dirs system property set to a dir where the xerces  
> parser
> is available. It uses the endorsed dir mechanism to override the
> default parser. The server manifest.mf contains an entry
> Endorsed-Dirs: lib/endorsed
>   which is used by Deamon (read by CommandLineManifest) to set this
> property before starting Geronimo. It should have been enough, but it
> seems we have been adding it to the classpath also. I do not know if
> this property is used by anyone else.
>
> Thanks
> Anita
>
> --- Dain Sundstrom <da...@iq80.com> wrote:
>
>> IIRC, they have to be on the classpath.
>>
>> -dain
>>
>> On Aug 25, 2006, at 12:21 PM, Jason Dillon wrote:
>>
>>> Anyone know if the jars in the endorsed dir need to be added to the
>>
>>> classpath... or will the jvm just suck up all *.jar files and load
>>
>>> them anyways?
>>>
>>> Was just wondering that if that is the case, and we add them to the
>>
>>> classpath, does that just waste bytes for an unused classloader
>> and/
>>> or slow down the initial boot?
>>>
>>> --jason
>>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com


Re: Endorsed dirs

Posted by anita kulshreshtha <a_...@yahoo.com>.
   IIRC, The tomcat container needs to be started with
java.endorsed.dirs system property set to a dir where the xerces parser
is available. It uses the endorsed dir mechanism to override the
default parser. The server manifest.mf contains an entry
Endorsed-Dirs: lib/endorsed
  which is used by Deamon (read by CommandLineManifest) to set this
property before starting Geronimo. It should have been enough, but it
seems we have been adding it to the classpath also. I do not know if
this property is used by anyone else.

Thanks
Anita

--- Dain Sundstrom <da...@iq80.com> wrote:

> IIRC, they have to be on the classpath.
> 
> -dain
> 
> On Aug 25, 2006, at 12:21 PM, Jason Dillon wrote:
> 
> > Anyone know if the jars in the endorsed dir need to be added to the
>  
> > classpath... or will the jvm just suck up all *.jar files and load 
> 
> > them anyways?
> >
> > Was just wondering that if that is the case, and we add them to the
>  
> > classpath, does that just waste bytes for an unused classloader
> and/ 
> > or slow down the initial boot?
> >
> > --jason
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Endorsed dirs

Posted by Dain Sundstrom <da...@iq80.com>.
IIRC, they have to be on the classpath.

-dain

On Aug 25, 2006, at 12:21 PM, Jason Dillon wrote:

> Anyone know if the jars in the endorsed dir need to be added to the  
> classpath... or will the jvm just suck up all *.jar files and load  
> them anyways?
>
> Was just wondering that if that is the case, and we add them to the  
> classpath, does that just waste bytes for an unused classloader and/ 
> or slow down the initial boot?
>
> --jason