You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Tim Bond <xi...@gmail.com> on 2008/11/04 03:04:46 UTC

Problem with AbstractBootstrapSchema

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.

-- x

Re: Problem with AbstractBootstrapSchema

Posted by Emmanuel Lecharny <el...@gmail.com>.
Tim Bond wrote:
> 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 ?

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