Re: Getting rid of Import-Package and Export-Package

2010-07-21 Thread Sudhir Dharmadhikari

Hi Richard,
Thanks for reply. I understand system bundle is redundant.
With following setup, I am getting Export-Package which are all my 
application code. I got rid of that because I was getting several 
errors. But may be that is not necessary (export should not have any 
issues whether its being used by any other bundle or not) .

Thanks.

Richard S. Hall wrote:


On 7/20/10 5:13 PM, Sudhir Dharmadhikari wrote:
Hi Richard - Thanks for your inputs. It worked using !*. As per 
documentation, it should export all classes and it is. Right now, no 
other bundle will use any exported packages from my bundle , so I 
wanted to get rid of this header at all from manifest . Similarly, 
there are hundreds of entries in Import-Package but none of them is 
needed . So I am disabling it as you suggested. That worked, but it 
created new header Ignore-Package and ignored all the one which were 
getting included. Just in case you wanted to see my configuration..


Here is my code,
plugin
groupIdorg.apache.felix/groupId
artifactIdmaven-bundle-plugin/artifactId
extensionstrue/extensions
version2.1.0/version
configuration instructions 
Embed-Dependency*;scope=compile|runtime/Embed-Dependency

Bundle-ClassPath{maven-dependencies},./Bundle-ClassPath
Embed-Transitivetrue/Embed-Transitive
Bundle-RequiredExecutionEnvironmentJavaSE-1.6/Bundle-RequiredExecutionEnvironment 


Bundle-Activatorosgi.Activator/Bundle-Activator
Require-Bundleorg.eclipse.osgi;bundle-version=3.5.2/Require-Bundle
Import-Package!*/Import-Package
Export-Package!*/Export-Package


It doesn't seem like this should be necessary for Export-Package, 
since the default is to export nothing.


The Ignore-Package header is purely informational from BND, it is 
ignored.


Additionally, requiring the system bundle is really bad practice.

- richard


/instructions
/configuration /plugin


Richard S. Hall wrote:

 On 7/20/10 1:20, Sudhir Dharmadhikari wrote:
I am trying simple osgi bundle which has every dependency embedded 
inside my bundle. By default, bundle-plugin creates several entries 
in Import-Package and Export-Package . I want to get rid of them 
completely. I tried several ways . If I try giving empty 
Import-Package , it fails at build. I tried blank _exportcontents, 
does not work too !


Any clue ?


I don't believe it should ever export anything by default, so if it 
is exporting it seems you must be telling it to do so somehow. On 
the other hand, it imports everything not included in the bundle by 
default. Not importing anything at all is harder than you might 
think. If you need any of the OSGi API then you need to import those 
packages; if you use any of the javax packages then you need to 
import them. But specifying !* should not import anything.


- richard



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Getting rid of Import-Package and Export-Package

2010-07-21 Thread Richard S. Hall

 On 7/21/10 13:02, Sudhir Dharmadhikari wrote:

Hi Richard,
Thanks for reply. I understand system bundle is redundant.


It isn't redundant, it is actually bad practice. The OSGi spec doesn't 
dictate what the system bundle exports, so framework implementations can 
vary here. And even if the spec defined a default value, most impls 
allow this to be configured, so you still couldn't be sure what you were 
getting from the system bundle.


Requiring the system bundle simply hides the real dependencies of your 
bundle so frameworks cannot know if they are actually satisfying them or 
not.


- richard

With following setup, I am getting Export-Package which are all my 
application code. I got rid of that because I was getting several 
errors. But may be that is not necessary (export should not have any 
issues whether its being used by any other bundle or not) .

Thanks.

Richard S. Hall wrote:


On 7/20/10 5:13 PM, Sudhir Dharmadhikari wrote:
Hi Richard - Thanks for your inputs. It worked using !*. As per 
documentation, it should export all classes and it is. Right now, no 
other bundle will use any exported packages from my bundle , so I 
wanted to get rid of this header at all from manifest . Similarly, 
there are hundreds of entries in Import-Package but none of them is 
needed . So I am disabling it as you suggested. That worked, but it 
created new header Ignore-Package and ignored all the one which were 
getting included. Just in case you wanted to see my configuration..


Here is my code,
plugin
groupIdorg.apache.felix/groupId
artifactIdmaven-bundle-plugin/artifactId
extensionstrue/extensions
version2.1.0/version
configuration instructions 
Embed-Dependency*;scope=compile|runtime/Embed-Dependency

Bundle-ClassPath{maven-dependencies},./Bundle-ClassPath
Embed-Transitivetrue/Embed-Transitive
Bundle-RequiredExecutionEnvironmentJavaSE-1.6/Bundle-RequiredExecutionEnvironment 


Bundle-Activatorosgi.Activator/Bundle-Activator
Require-Bundleorg.eclipse.osgi;bundle-version=3.5.2/Require-Bundle 


Import-Package!*/Import-Package
Export-Package!*/Export-Package


It doesn't seem like this should be necessary for Export-Package, 
since the default is to export nothing.


The Ignore-Package header is purely informational from BND, it is 
ignored.


Additionally, requiring the system bundle is really bad practice.

- richard


/instructions
/configuration /plugin


Richard S. Hall wrote:

 On 7/20/10 1:20, Sudhir Dharmadhikari wrote:
I am trying simple osgi bundle which has every dependency embedded 
inside my bundle. By default, bundle-plugin creates several 
entries in Import-Package and Export-Package . I want to get rid 
of them completely. I tried several ways . If I try giving empty 
Import-Package , it fails at build. I tried blank _exportcontents, 
does not work too !


Any clue ?


I don't believe it should ever export anything by default, so if it 
is exporting it seems you must be telling it to do so somehow. On 
the other hand, it imports everything not included in the bundle by 
default. Not importing anything at all is harder than you might 
think. If you need any of the OSGi API then you need to import 
those packages; if you use any of the javax packages then you need 
to import them. But specifying !* should not import anything.


- richard



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Heap Dump Warning

2010-07-21 Thread David Leangen

Hi,

I have been getting these errors lately.

Is anybody able to tell me exactly what they mean? I don't know if I should be 
concerned or not...


Thanks!
=David


2010-07-22 14:17:54,532 [Low Memory Detector] WARN
org.apache.felix.webconsole.plugins.memoryusage.internal.MemoryUsageSupport - 
Received Memory Threshold Exceed Notification, dumping Heap
2010-07-22 14:17:59,010 [Low Memory Detector] DEBUG
org.apache.felix.webconsole.plugins.memoryusage.internal.MemoryUsageSupport - 
dumpSunMBean: Dumped Heap to 
/home/dleangen/runtime/trunk/runner/equinox/org.eclipse.osgi/bundles/14/data/dumps/heap.1279775874534.hprof
 using Sun HotSpot MBean
2010-07-22 14:17:59,015 [Low Memory Detector] WARN
org.apache.felix.webconsole.plugins.memoryusage.internal.MemoryUsageSupport - 
Heap dumped to 
/home/dleangen/runtime/trunk/runner/equinox/org.eclipse.osgi/bundles/14/data/dumps/heap.1279775874534.hprof
-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org