Question: Restriction on non-empty directory on cass path

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question: Restriction on non-empty directory on cass path

yumin qi-2
Hi,

  The question is for CDS. When dump CDS using (tried with Ioi's AppCDS
patch)
  -Xshare:dump -XX:+UseAppCDS  -cp somedir:somedir/somefile.jar

   if somedir does not contain any classes file, but other non class files,
it will fail here:

ClassLoaderExt::add_class_path_entry(...):

         tty->print_cr("Error: non-empty directory '%s'", path);
         exit_with_path_failure("Cannot have non-empty directory in
boot/ext/app classpaths", NULL);

   Why not just skip adding such class path entry? Will it fail on share if
those entries skipped?
   Is this a design behavior?
   User some time append such directories to class path, and will confuse
on such failure on CDS since it won't fail on non-CDS way.

    Any inputs really appreciated.

  Thanks
  Yumin
Reply | Threaded
Open this post in threaded view
|

Re: Question: Restriction on non-empty directory on cass path

Ioi Lam
This was a design decision. CDS require any directories on the classpath
to be empty (I think we really should discourage directories to be use
in the classpath). The reason is that it's difficult to check whether
the any class files have been added/modified/removed -- if we don't do
such checks, then the program will load different classes depending on
whether CDS is enabled.

What's the reason for your users to append directories to the classpath?

Thanks

- Ioi


On 12/12/17 9:18 PM, yumin qi wrote:

> Hi,
>
>   The question is for CDS. When dump CDS using (tried with Ioi's
> AppCDS patch)
>   -Xshare:dump -XX:+UseAppCDS  -cp somedir:somedir/somefile.jar
>
>    if somedir does not contain any classes file, but other non class
> files, it will fail here:
>
> ClassLoaderExt::add_class_path_entry(...):
>          tty->print_cr("Error: non-empty directory '%s'", path);
>          exit_with_path_failure("Cannot have non-empty directory in
> boot/ext/app classpaths", NULL);
>
>    Why not just skip adding such class path entry? Will it fail on
> share if those entries skipped?
>    Is this a design behavior?
>    User some time append such directories to class path, and will
> confuse on such failure on CDS since it won't fail on non-CDS way.
>     Any inputs really appreciated.
>
>   Thanks
>   Yumin

Reply | Threaded
Open this post in threaded view
|

Re: Question: Restriction on non-empty directory on cass path

yumin qi-2
Ioi,
  The user has script to run their apps,  the script is large and setting
is little awkward. When use AppCDS, they modified the existing script and
failed here.
  So the solution is remove all such directories from class path.

Thanks
Yumin

On Tue, Dec 12, 2017 at 9:28 PM, Ioi Lam <[hidden email]> wrote:

> This was a design decision. CDS require any directories on the classpath
> to be empty (I think we really should discourage directories to be use in
> the classpath). The reason is that it's difficult to check whether the any
> class files have been added/modified/removed -- if we don't do such checks,
> then the program will load different classes depending on whether CDS is
> enabled.
>
> What's the reason for your users to append directories to the classpath?
>
> Thanks
>
> - Ioi
>
>
>
> On 12/12/17 9:18 PM, yumin qi wrote:
>
>> Hi,
>>
>>   The question is for CDS. When dump CDS using (tried with Ioi's AppCDS
>> patch)
>>   -Xshare:dump -XX:+UseAppCDS  -cp somedir:somedir/somefile.jar
>>
>>    if somedir does not contain any classes file, but other non class
>> files, it will fail here:
>>
>> ClassLoaderExt::add_class_path_entry(...):
>>          tty->print_cr("Error: non-empty directory '%s'", path);
>>          exit_with_path_failure("Cannot have non-empty directory in
>> boot/ext/app classpaths", NULL);
>>
>>    Why not just skip adding such class path entry? Will it fail on share
>> if those entries skipped?
>>    Is this a design behavior?
>>    User some time append such directories to class path, and will confuse
>> on such failure on CDS since it won't fail on non-CDS way.
>>     Any inputs really appreciated.
>>
>>   Thanks
>>   Yumin
>>
>
>