You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by x <xi...@gmail.com> on 2008/11/05 17:43:01 UTC

[ApacheDS] Problem with AbstratctBootstrapSchema

I'm reposting with fixed subject field and response below . . . -- Tim

> Hi,
>
> I'm working on embedding apacheds in a custom container.  I'm running into
a
> problem with the following line in AbstractBootstrapSchema:
>
> private static final String DEFAULT_PACKAGE_NAME =
> AbstractBootstrapSchema.class.getPackage().getName();
>
> The classloader I'm using does not set the package field, so when this
class
> is loaded I'm getting a NullPointerException.  I'm looking to see if I can
> change the classloader somehow, but my reading of the Classload docs
> indicates getPackage() is allowed to return null.
>
Otherwise, we can test with this function :

public static String getpkg(Class cl){
String clname = cl.getName();
int lastDot = clname.lastIndexOf('.');
return clname.substring(0,lastDot);
}

(found this workaround here : http://coverlipse.sourceforge.net/faq.php)

Which version of ADS are you working with ?

Emmanuel,

I was working with 1.5.4, but I'm now trying with the 1.5.5 source.  I made
the fix to set the package name, but now I am getting this stack trace:

org.apache.directory.server.schema.bootstrap.partition.UniqueResourceException:
Problem locating bootstrap partition database file list. Be sure there is
exactly one bootstrap partition jar in your classpath.
No resources named
'org/apache/directory/server/schema/bootstrap/partition/DBFILES' located on
classpath
    at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.getUniqueResource(DbFileListing.java:144)
    at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.getUniqueResourceAsStream(DbFileListing.java:134)
    at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.init(DbFileListing.java:82)
    at
org.apache.directory.server.schema.bootstrap.partition.DbFileListing.<init>(DbFileListing.java:51)


So it seems like another potential issue with the classloader I am trying to
use.  This will take some time to troubleshoot.

Thanks

Re: [ApacheDS] Problem with AbstratctBootstrapSchema

Posted by x <xi...@gmail.com>.
On Wed, Nov 5, 2008 at 11:59 AM, Emmanuel Lecharny <el...@gmail.com>wrote:

> x wrote:
>
>> Emmanuel,
>>
>> I was working with 1.5.4, but I'm now trying with the 1.5.5 source.  I
>> made
>> the fix to set the package name, but now I am getting this stack trace:
>>
>>
> Ok, nothing serious. Just do that :
>
> cd apacheds/bootstrap-partition
> mvn clean install
>
> and it will work.
>
> This DBFILES file is containing all the LDAP elements needed to bootstrap
> the server (the metabase), but sadly, if you simply build the server, then
> do a mvn eclipse:eclipse, this file is wipped out.
>
> To summarize, if you want to build ADS :
> - goto your root project (you will have the apacheds, shared, project,
> daemon  and install subdirectories there)
> - mvn clean install
> - mvn eclipse:eclipse
> - cd apacheds/bootstrap-partition
> - mvn clean install
>
> that's it !
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
I believe my issue is that there is something going on with how resources
are loaded by the custom classloader I'm using.  If I put the resource files
into the system/server classloader, things work.  I've putting this on the
back burner for now due to other issues.  Thanks for the ideas.

Re: [ApacheDS] Problem with AbstratctBootstrapSchema

Posted by Emmanuel Lecharny <el...@gmail.com>.
x wrote:
> Emmanuel,
>
> I was working with 1.5.4, but I'm now trying with the 1.5.5 source.  I made
> the fix to set the package name, but now I am getting this stack trace:
>   
Ok, nothing serious. Just do that :

cd apacheds/bootstrap-partition
mvn clean install

and it will work.

This DBFILES file is containing all the LDAP elements needed to 
bootstrap the server (the metabase), but sadly, if you simply build the 
server, then do a mvn eclipse:eclipse, this file is wipped out.

To summarize, if you want to build ADS :
- goto your root project (you will have the apacheds, shared, project, 
daemon  and install subdirectories there)
- mvn clean install
- mvn eclipse:eclipse
- cd apacheds/bootstrap-partition
- mvn clean install

that's it !

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org