On Sep 28, 2010, at 12:16 AM, Ivan wrote:
> Hi,
> In the past, while deploying a standalone ejb module, we renamed it with
> ejb.jar and packaged in in the car package, and we use the same way now in
> OSGI, which means ejb.jar is added to the bundle-classpath.
> This causes some failures, while scanning the annotations, it uses the codes
> below, while the zipFileDiscroveryRequired is called, the parameter s is
> ejb.jar, which leads to all the classes are ignored. I am wondering why we
> wrapper the initial ejb jar file, why not directly use it ?
We'll have to add stuff to it (currently the serialized gbean state) but I
think that would be fine.
thanks
david jencks
> --->
> final String location = module.getModuleId();
> boolean useLocation = location != null
> && !location.isEmpty()
> && !module.getJarLocation().endsWith(".war");
> if (useLocation) {
> ResourceDiscoveryFilter filter = new
> ResourceDiscoveryFilter() {
>
> @Override
> public boolean rangeDiscoveryRequired(DiscoveryRange
> discoveryRange) {
> return discoveryRange ==
> DiscoveryRange.BUNDLE_CLASSPATH || discoveryRange ==
> DiscoveryRange.FRAGMENT_BUNDLES;
> }
>
> @Override
> public boolean zipFileDiscoveryRequired(String s) {
> return s.equals(location);
> }
>
> @Override
> public boolean directoryDiscoveryRequired(String s) {
> return s.equals(location);
> }
> };
>
> return new BundleAnnotationFinder(packageAdmin, bundle,
> filter);
> } else {
> ResourceDiscoveryFilter filter = new
> ResourceDiscoveryFilter() {
>
> @Override
> public boolean rangeDiscoveryRequired(DiscoveryRange
> discoveryRange) {
> return discoveryRange ==
> DiscoveryRange.BUNDLE_CLASSPATH || discoveryRange ==
> DiscoveryRange.FRAGMENT_BUNDLES;
> }
>
> @Override
> public boolean zipFileDiscoveryRequired(String s) {
> return true;
> }
>
> @Override
> public boolean directoryDiscoveryRequired(String s) {
> return true;
> }
> };
>
> return new BundleAnnotationFinder(packageAdmin, bundle,
> filter);
> }
> }
> <---
> --
> Ivan