Thomas Watson | 1 Dec 15:52
Picon
Favicon

Re: What bundle class loaded from

Catching up on e-mail from the holiday, this may have been answered.

Check out the method:

org.eclipse.core.runtime.FileLocator.getBundleFile(Bundle)

Tom



"Fredrik Alströmer" ---11/26/2008 08:46:19 AM---I'm aware of this, but I figured this was the equinox mailing list, so


From:

"Fredrik Alströmer" <roe-HdqwJFMAzpg@public.gmane.org>

To:

"Equinox development mailing list" <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

Date:

11/26/2008 08:46 AM

Subject:

Re: [equinox-dev] What bundle class loaded from



I'm aware of this, but I figured this was the equinox mailing list, so
maybe there's an equinox answer? :)

On Wed, Nov 26, 2008 at 14:58, BJ Hargrave <hargrave-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> wrote:
> Not in any standard way. A framework is free to store an installed bundle in
> any way is chooses. It could keep the original JAR file, expand it to the
> file system, put all the entries in a database, convert it to some VM
> optimized format, etc.
> --
>
> BJ Hargrave
> Senior Technical Staff Member, IBM
> OSGi Fellow and CTO of the OSGi Alliance
> hargrave-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
> office: +1 386 848 1781
> mobile: +1 386 848 3788
>
>
> From: "Fredrik Alströmer" <roe-HdqwJFMAzpg@public.gmane.org>
> To:
> "Equinox development mailing list" <equinox-dev <at> eclipse.org>
> Date: 2008/11/26 08:46
> Subject: Re: [equinox-dev] What bundle class loaded from
> Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
> ________________________________
>
>
> On a similar note, is there a way to access the actual bundle file?
> Like for running an external javac-process (think tomcat jasper),
> which needs a classpath.
>
> On Mon, Nov 24, 2008 at 18:15, BJ Hargrave <hargrave-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> wrote:
>> PackageAdmin.getBundle(Class)
>> --
>>
>> BJ Hargrave
>> Senior Technical Staff Member, IBM
>> OSGi Fellow and CTO of the OSGi Alliance
>> hargrave-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
>> office: +1 386 848 1781
>> mobile: +1 386 848 3788
>>
>>
>> From:
>> Oleg Zhurakousky <oleg.zhurakousky-F46XhrxXyN8RB7SZvlqPiA@public.gmane.org>
>> To: Equinox development mailing list <equinox-dev <at> eclipse.org>
>> Date: 2008/11/24 12:04
>> Subject: [equinox-dev] What bundle class loaded from
>> Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
>> ________________________________
>>
>>
>> I know how to do it the "hard way", but was wondering if there is and
>> elegant way to determine which Bundle loaded a class?
>> Thanks
>> Oleg
>> _______________________________________________
>> equinox-dev mailing list
>> equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
>> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>>
>>
>> _______________________________________________
>> equinox-dev mailing list
>> equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
>> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>>
>>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
>
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Jens Goldhammer | 1 Dec 16:46

Equinox aspects: Several problems for Load-Time-Weaving in a eclipse product!


Hello,

I have downloaded the equinox aspectj extension and integrated into eclipse
how it is mentioned in the user guide.
The hello world aspectj example works great for me. I can dynamically start
and stop the aspectj service and the classes seam to be reloading at
run-time.

I have zipped the folders org.aspectj.runtime_1.6.1.20080703120000 and
org.aspectj.weaver_1.6.1.20080703120000 (project
org.eclipse.equinox.weaving.demo.target) from the example to two jar files
and copied it to the eclipse plugins directory. I reloaded the target
platform, so the plugins are considered.  

After playing with some examples, I tried to integrate aspects into our
eclipse product which is based on 3.4.1. I have created a config.ini
(modified the prebaked config.ini of eclipse export mechanism) which looks
like this one:

# default start level for the bundles
osgi.bundles.defaultStartLevel=4

osgi.bundles=org.eclipse.equinox.common <at> 2\:start,
org.eclipse.update.configurator <at> 3\:start, org.eclipse.core.runtime <at> start,
org.eclipse.equinox.weaving.aspectj <at> start,
org.eclipse.equinox.weaving.caching.j9 <at> start,
org.eclipse.equinox.weaving.caching <at> 2\:start, com.ibm.icu, [our bundles],
org.apache.log4j,org.aspectj.runtime,org.aspectj.weaver,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.databinding,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.equinox.app,org.eclipse.equinox.event,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.equinox.weaving.aspectj,org.eclipse.equinox.weaving.caching,org.eclipse.equinox.weaving.caching.j9,org.eclipse.equinox.weaving.hook,org.eclipse.help,org.eclipse.jface,org.eclipse.jface.databinding,org.eclipse.osgi.services,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.ui,org.eclipse.ui.workbench,org.junit,org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86

#osgi.configuration.cascaded=false
osgi.clean=true

# AOSGi
osgi.framework.extensions=org.eclipse.equinox.weaving.hook
aj.weaving.verbose=true
org.aspectj.weaver.showWeaveInfo=true
org.aspectj.osgi.debug=true

After configuring it there are two problems:

1. If I start the product configuration via eclipse, I can see following in
the osgi console after running ss:
4 <<LAZY>>    org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839
5 <<LAZY>>    org.eclipse.equinox.weaving.caching.j9_1.0.0.200808061839

The two bundles for aspectj are not active after starting the osgi platform.
I don´t know why! Something prevents loading the aspectj bundles. My
presumption is that the required bundles
org.aspectj.runtime_1.6.1.20080703120000.jar and
org.aspectj.weaver_1.6.1.20080703120000.jar are loaded to late from the
org.eclipse.update.configurator which loads all bundles from the plugins
directory. Or anyboday think there is another problem?

After starting the two bundles manually with start [bundle-ids], my trace
aspect which traces method calls is working for this session. But how I can
deactivate it during runtime? I made a stop for the bundle 4
(org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839) and the main
Activator of our application will be stopped!!! I thought I can dynamically
start and stop the aspect bundle?

Another approach was to stop the bundle with the compiled aspect inside. But
it does not work, too. The tracing still is working. I think, the aspect is
cached... Can I prevent this?

2. I made a shutdown of the ogsi plattform and there are two different
situations.

2.1 If I restart the product WITHOUT the parameter osgi.clean=true, the
needed bundles are started:

4 ACTIVE      org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839
5 ACTIVE      org.eclipse.equinox.weaving.caching.j9_1.0.0.200808061839
6 ACTIVE      org.eclipse.equinox.weaving.caching_1.0.0.200808061839

My bundle with the aspect is also active. But I get severeal messages on
console which are like this one: "Info no configuration found. Disabling
weaver for bundler [...]".
I think, the aspect in one of my bundles cannot be found. At all, the trace
aspect does not work!

2.2 If I restart the product WITH the parameter osgi.clean=true, I have the
same situation as mentioned under point 1! The required bundles are not
loaded...

What does it mean to me? I have always to start the osgi platform with
osgi.clean=true, so in this case I cannot have the advantage of osgi
caching. At all, we cannot rely on the equinox aspects. Maybe somebody can
help me to fix the problem.

Thanks,
Jens Goldhammer
fme AG
--

-- 
View this message in context: http://www.nabble.com/Equinox-aspects%3A-Several-problems-for-Load-Time-Weaving-in-a-eclipse-product%21-tp20774467p20774467.html
Sent from the Equinox - Dev mailing list archive at Nabble.com.

Martin Lippert | 1 Dec 17:01
Picon
Favicon
Gravatar

Re: Equinox aspects: Several problems for Load-Time-Weaving in a eclipse product!

Hi Jens!

I am sure we can get your setting to work well with equinox aspects. 
Firstofall, I see that you are using an old version of equinox aspects. 
You should definitely download and use M3 of equinox aspects, this is 
much more stable, especially in the case of dynamics.

Your config.ini looks good, I would just add a start level of 4 to the 
o.e.e.weaving.aspectj bundle. You definitely don't need to start your 
system with the osgi.clean option=true. The latest versions of equinox 
aspects work with and without cleaning the configuration area.

If you would like to use dynamics for aspects, the best way to go is to 
install and uninstall aspect bundles. Every time an aspect bundle is 
installed and got resolved, the aspect is woven into the system, 
including a refresh of already running bundles. Telling you that you 
need to know that some Eclipse bundles do not behave well within an 
dynamic environment. For example refreshing swt or the workbench at 
runtime does not work. So if you would like to dynamically install and 
uninstall aspects you should take care that the effected bundles behave 
nicely within a dynamic environment.

HTH,
-Martin

Jens Goldhammer wrote:
> Hello,
> 
> I have downloaded the equinox aspectj extension and integrated into eclipse
> how it is mentioned in the user guide.
> The hello world aspectj example works great for me. I can dynamically start
> and stop the aspectj service and the classes seam to be reloading at
> run-time.
> 
> I have zipped the folders org.aspectj.runtime_1.6.1.20080703120000 and
> org.aspectj.weaver_1.6.1.20080703120000 (project
> org.eclipse.equinox.weaving.demo.target) from the example to two jar files
> and copied it to the eclipse plugins directory. I reloaded the target
> platform, so the plugins are considered.  
> 
> After playing with some examples, I tried to integrate aspects into our
> eclipse product which is based on 3.4.1. I have created a config.ini
> (modified the prebaked config.ini of eclipse export mechanism) which looks
> like this one:
> 
> # default start level for the bundles
> osgi.bundles.defaultStartLevel=4
> 
> osgi.bundles=org.eclipse.equinox.common <at> 2\:start,
> org.eclipse.update.configurator <at> 3\:start, org.eclipse.core.runtime <at> start,
> org.eclipse.equinox.weaving.aspectj <at> start,
> org.eclipse.equinox.weaving.caching.j9 <at> start,
> org.eclipse.equinox.weaving.caching <at> 2\:start, com.ibm.icu, [our bundles],
> org.apache.log4j,org.aspectj.runtime,org.aspectj.weaver,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.databinding,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.equinox.app,org.eclipse.equinox.event,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.equinox.weaving.aspectj,org.eclipse.equinox.weaving.caching,org.eclipse.equinox.weaving.caching.j9,org.eclipse.equinox.weaving.hook,org.eclipse.help,org.eclipse.jface,org.eclipse.jface.databinding,org.eclipse.osgi.services,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.ui,org.eclipse.ui.workbench,org.junit,org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86
> 
> #osgi.configuration.cascaded=false
> osgi.clean=true
> 
> # AOSGi
> osgi.framework.extensions=org.eclipse.equinox.weaving.hook
> aj.weaving.verbose=true
> org.aspectj.weaver.showWeaveInfo=true
> org.aspectj.osgi.debug=true
> 
> After configuring it there are two problems:
> 
> 1. If I start the product configuration via eclipse, I can see following in
> the osgi console after running ss:
> 4 <<LAZY>>    org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839
> 5 <<LAZY>>    org.eclipse.equinox.weaving.caching.j9_1.0.0.200808061839
> 
> The two bundles for aspectj are not active after starting the osgi platform.
> I don´t know why! Something prevents loading the aspectj bundles. My
> presumption is that the required bundles
> org.aspectj.runtime_1.6.1.20080703120000.jar and
> org.aspectj.weaver_1.6.1.20080703120000.jar are loaded to late from the
> org.eclipse.update.configurator which loads all bundles from the plugins
> directory. Or anyboday think there is another problem?
> 
> After starting the two bundles manually with start [bundle-ids], my trace
> aspect which traces method calls is working for this session. But how I can
> deactivate it during runtime? I made a stop for the bundle 4
> (org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839) and the main
> Activator of our application will be stopped!!! I thought I can dynamically
> start and stop the aspect bundle?
> 
> Another approach was to stop the bundle with the compiled aspect inside. But
> it does not work, too. The tracing still is working. I think, the aspect is
> cached... Can I prevent this?
> 
> 2. I made a shutdown of the ogsi plattform and there are two different
> situations.
> 
> 2.1 If I restart the product WITHOUT the parameter osgi.clean=true, the
> needed bundles are started:
> 
> 4 ACTIVE      org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839
> 5 ACTIVE      org.eclipse.equinox.weaving.caching.j9_1.0.0.200808061839
> 6 ACTIVE      org.eclipse.equinox.weaving.caching_1.0.0.200808061839
> 
> My bundle with the aspect is also active. But I get severeal messages on
> console which are like this one: "Info no configuration found. Disabling
> weaver for bundler [...]".
> I think, the aspect in one of my bundles cannot be found. At all, the trace
> aspect does not work!
> 
> 2.2 If I restart the product WITH the parameter osgi.clean=true, I have the
> same situation as mentioned under point 1! The required bundles are not
> loaded...
> 
> What does it mean to me? I have always to start the osgi platform with
> osgi.clean=true, so in this case I cannot have the advantage of osgi
> caching. At all, we cannot rely on the equinox aspects. Maybe somebody can
> help me to fix the problem.
> 
> Thanks,
> Jens Goldhammer
> fme AG
Andrew Eisenberg | 1 Dec 17:40
Gravatar

Re: Equinox aspects: Several problems for Load-Time-Weaving in a eclipse product!

I have an update site for equinox aspects here:
http://download.eclipse.org/tools/ajdt/34/dev/equinox-aspects

You can try to install from there.  The installation will
automatically update your config.ini for you.  Should work, but you
need to have AspectJ pre-installed.

If Martin's suggestions don't work for you, you can try installing
from the update site.

On Mon, Dec 1, 2008 at 8:01 AM, Martin Lippert <lippert@...> wrote:
> Hi Jens!
>
> I am sure we can get your setting to work well with equinox aspects.
> Firstofall, I see that you are using an old version of equinox aspects. You
> should definitely download and use M3 of equinox aspects, this is much more
> stable, especially in the case of dynamics.
>
> Your config.ini looks good, I would just add a start level of 4 to the
> o.e.e.weaving.aspectj bundle. You definitely don't need to start your system
> with the osgi.clean option=true. The latest versions of equinox aspects work
> with and without cleaning the configuration area.
>
> If you would like to use dynamics for aspects, the best way to go is to
> install and uninstall aspect bundles. Every time an aspect bundle is
> installed and got resolved, the aspect is woven into the system, including a
> refresh of already running bundles. Telling you that you need to know that
> some Eclipse bundles do not behave well within an dynamic environment. For
> example refreshing swt or the workbench at runtime does not work. So if you
> would like to dynamically install and uninstall aspects you should take care
> that the effected bundles behave nicely within a dynamic environment.
>
> HTH,
> -Martin
>
>
> Jens Goldhammer wrote:
>>
>> Hello,
>>
>> I have downloaded the equinox aspectj extension and integrated into
>> eclipse
>> how it is mentioned in the user guide.
>> The hello world aspectj example works great for me. I can dynamically
>> start
>> and stop the aspectj service and the classes seam to be reloading at
>> run-time.
>>
>> I have zipped the folders org.aspectj.runtime_1.6.1.20080703120000 and
>> org.aspectj.weaver_1.6.1.20080703120000 (project
>> org.eclipse.equinox.weaving.demo.target) from the example to two jar files
>> and copied it to the eclipse plugins directory. I reloaded the target
>> platform, so the plugins are considered.
>> After playing with some examples, I tried to integrate aspects into our
>> eclipse product which is based on 3.4.1. I have created a config.ini
>> (modified the prebaked config.ini of eclipse export mechanism) which looks
>> like this one:
>>
>> # default start level for the bundles
>> osgi.bundles.defaultStartLevel=4
>>
>> osgi.bundles=org.eclipse.equinox.common <at> 2\:start,
>> org.eclipse.update.configurator <at> 3\:start, org.eclipse.core.runtime <at> start,
>> org.eclipse.equinox.weaving.aspectj <at> start,
>> org.eclipse.equinox.weaving.caching.j9 <at> start,
>> org.eclipse.equinox.weaving.caching <at> 2\:start, com.ibm.icu, [our bundles],
>>
>> org.apache.log4j,org.aspectj.runtime,org.aspectj.weaver,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.databinding,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.equinox.app,org.eclipse.equinox.event,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.equinox.weaving.aspectj,org.eclipse.equinox.weaving.caching,org.eclipse.equinox.weaving.caching.j9,org.eclipse.equinox.weaving.hook,org.eclipse.help,org.eclipse.jface,org.eclipse.jface.databinding,org.eclipse.osgi.services,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.ui,org.eclipse.ui.workbench,org.junit,org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86
>>
>> #osgi.configuration.cascaded=false
>> osgi.clean=true
>>
>> # AOSGi
>> osgi.framework.extensions=org.eclipse.equinox.weaving.hook
>> aj.weaving.verbose=true
>> org.aspectj.weaver.showWeaveInfo=true
>> org.aspectj.osgi.debug=true
>>
>> After configuring it there are two problems:
>>
>> 1. If I start the product configuration via eclipse, I can see following
>> in
>> the osgi console after running ss:
>> 4 <<LAZY>>    org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839
>> 5 <<LAZY>>    org.eclipse.equinox.weaving.caching.j9_1.0.0.200808061839
>>
>> The two bundles for aspectj are not active after starting the osgi
>> platform.
>> I don´t know why! Something prevents loading the aspectj bundles. My
>> presumption is that the required bundles
>> org.aspectj.runtime_1.6.1.20080703120000.jar and
>> org.aspectj.weaver_1.6.1.20080703120000.jar are loaded to late from the
>> org.eclipse.update.configurator which loads all bundles from the plugins
>> directory. Or anyboday think there is another problem?
>>
>> After starting the two bundles manually with start [bundle-ids], my trace
>> aspect which traces method calls is working for this session. But how I
>> can
>> deactivate it during runtime? I made a stop for the bundle 4
>> (org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839) and the main
>> Activator of our application will be stopped!!! I thought I can
>> dynamically
>> start and stop the aspect bundle?
>>
>> Another approach was to stop the bundle with the compiled aspect inside.
>> But
>> it does not work, too. The tracing still is working. I think, the aspect
>> is
>> cached... Can I prevent this?
>>
>> 2. I made a shutdown of the ogsi plattform and there are two different
>> situations.
>>
>> 2.1 If I restart the product WITHOUT the parameter osgi.clean=true, the
>> needed bundles are started:
>>
>> 4 ACTIVE      org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839
>> 5 ACTIVE      org.eclipse.equinox.weaving.caching.j9_1.0.0.200808061839
>> 6 ACTIVE      org.eclipse.equinox.weaving.caching_1.0.0.200808061839
>>
>> My bundle with the aspect is also active. But I get severeal messages on
>> console which are like this one: "Info no configuration found. Disabling
>> weaver for bundler [...]".
>> I think, the aspect in one of my bundles cannot be found. At all, the
>> trace
>> aspect does not work!
>>
>> 2.2 If I restart the product WITH the parameter osgi.clean=true, I have
>> the
>> same situation as mentioned under point 1! The required bundles are not
>> loaded...
>>
>> What does it mean to me? I have always to start the osgi platform with
>> osgi.clean=true, so in this case I cannot have the advantage of osgi
>> caching. At all, we cannot rely on the equinox aspects. Maybe somebody can
>> help me to fix the problem.
>>
>> Thanks,
>> Jens Goldhammer
>> fme AG
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
Thomas Watson | 2 Dec 00:15
Picon
Favicon

Equinox tagged for Galileo I-Build

The map file has been updated for the following Bug changes:
+ Bug 174362. Accommodate Maven in expected JAR naming scheme in EclipseStarter.searchFor() (FIXED)
+ Bug 217009. [launcher] [jnlp] use the Eclipse-BundleShape header (NEW)
+ Bug 241980. launcher lib has dependency on libgcc_s.so.0 (FIXED)
+ Bug 250967. [ds] Component Resolve Thread gets a null context classloader (FIXED)
+ Bug 255687. 64 bit cocoa launcher (FIXED)
+ Bug 256053. Launching console using new Eclipse launcher (a la 132) (FIXED)
+ Bug 256802. IPath.makeRelativeTo for equivalent Paths should return an empty path (FIXED)

The following projects have changed:
org.eclipse.equinox.launcher.motif.hpux.ia64_32
org.eclipse.equinox.ds
org.eclipse.equinox.launcher.cocoa.macosx
org.eclipse.equinox.launcher
org.eclipse.equinox.executable
org.eclipse.equinox.launcher.motif.aix.ppc
org.eclipse.equinox.common
org.eclipse.equinox.util
org.eclipse.osgi

Tom

Miles Sabin | 2 Dec 12:48
Gravatar

Re: Framework extensions must be co-located with the org.eclipse.osgi bundle?

On Fri, Nov 28, 2008 at 6:51 PM, Simon Kaegi <Simon_Kaegi@...> wrote:
> That sounds reasonable. If you haven't already why not open a bug as this
> feels like it's more complex than it should be.

Done now,

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=257178

Cheers,

Miles
Picon
Picon

Administrating equinox in production

Hey guys,

I've doing some development with equinox and I want to bring it into production. I was quite happy with using
console over telnet, but there is a problem.

I'm using framework org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar and first problem is you can
connect via telnet only once. Well I couldn't connect more than once.

After doing following we got sometimes interesting problems:
echo disconnect | telnet localhost 1923

JVMDUMP006I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError" - please wait.
JVMDUMP007I JVM Requesting Snap dump using '/home/importer/Snap.20081202.125141.5210320.0001.trc'
JVMDUMP010I Snap dump written to /home/importer/Snap.20081202.125141.5210320.0001.trc
JVMDUMP007I JVM Requesting Heap dump using '/home/importer/heapdump.20081202.125141.5210320.0002.phd'
JVMDUMP010I Heap dump written to /home/importer/heapdump.20081202.125141.5210320.0002.phd
JVMDUMP007I JVM Requesting Java dump using '/home/importer/javacore.20081202.125141.5210320.0003.txt'
JVMDUMP010I Java dump written to /home/importer/javacore.20081202.125141.5210320.0003.txt
JVMDUMP013I Processed dump event "systhrow", detail "java/lang/OutOfMemoryError".
Exception in thread "OSGi Console" java.lang.OutOfMemoryError
        at java.lang.StringBuffer.ensureCapacityImpl(StringBuffer.java:335)
        at java.lang.StringBuffer.append(StringBuffer.java:111)
        at java.io.BufferedReader.readLine(BufferedReader.java:356)
        at java.io.BufferedReader.readLine(BufferedReader.java:373)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.getInput(FrameworkConsole.java:350)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.confirm(FrameworkCommandInterpreter.java:452)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter._disconnect(FrameworkCommandInterpreter.java:425)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:136)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:302)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:287)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:223)
        at java.lang.Thread.run(Thread.java:735)

So my question. How can I administrate equinox via telnet or on another way so more computer can connect to.
The problem is that if someone connects to telnet and stays connected nobody different can do anything on equinox.

Maybe someone have a hint or some interesting bundle.

Regards

Miguel
--

-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a
Fabien Autrel | 2 Dec 13:46
Picon
Favicon

plugin host problem

Dear all,

I am new to the osgi framework and I have a question.
I have developped an application in which I want to add plugins. I have 
chosen the osgi framework to implement that but I am now facing a 
problem: my application manages the bundles through an instance of 
BundleContext obtained via a call to EclipseStarter.startup();
I have defined an interface which the plugins must implement, I have 
developped a plugin implementing the interface, the bundle is loaded and 
started without any problem but a  ClassCastException is raised when I 
try to obtain the service implementation in my application though this 
piece of code:
IPolicyProcessorService service = (IPolicyProcessorService) 
context.getService(serviceRefs[i]);
where serviceRefs[i] is the ServiceReference object corresponding to the 
plugin.

If my understanding of classloaders is correct, this exception is raised 
because the IPolicyProcessorService class file has been loaded by two 
different class loaders in the application and in the bundle so even 
though the loaded data on the disk is the same, I cannot make the cast.
So I understand that I could encapsulate my application in a bundle, my 
plugin in a bundle and import the plugin interface class from another 
bundle but it would be quite a big amount of work to modify my application.

So my final question is, is there a way of using the services exposed by 
bundles from a "host" application running equinox like I'm trying to do?

Thank you!
Fabien Autrel | 2 Dec 14:18
Picon
Favicon

Re: plugin host problem

I answer to myself as I have understood how to work around the problem.
I realize that the way I'm developing my application is not the good way 
using osgi, I might soon repackage it into a bundle.
So by changing the system property osgi.parentClassloader, I can set the 
system to use the same class loader so the cast I'm doing to get the 
service implementation is ok.

Fabien Autrel a écrit :
> Dear all,
>
> I am new to the osgi framework and I have a question.
> I have developped an application in which I want to add plugins. I 
> have chosen the osgi framework to implement that but I am now facing a 
> problem: my application manages the bundles through an instance of 
> BundleContext obtained via a call to EclipseStarter.startup();
> I have defined an interface which the plugins must implement, I have 
> developped a plugin implementing the interface, the bundle is loaded 
> and started without any problem but a  ClassCastException is raised 
> when I try to obtain the service implementation in my application 
> though this piece of code:
> IPolicyProcessorService service = (IPolicyProcessorService) 
> context.getService(serviceRefs[i]);
> where serviceRefs[i] is the ServiceReference object corresponding to 
> the plugin.
>
> If my understanding of classloaders is correct, this exception is 
> raised because the IPolicyProcessorService class file has been loaded 
> by two different class loaders in the application and in the bundle so 
> even though the loaded data on the disk is the same, I cannot make the 
> cast.
> So I understand that I could encapsulate my application in a bundle, 
> my plugin in a bundle and import the plugin interface class from 
> another bundle but it would be quite a big amount of work to modify my 
> application.
>
> So my final question is, is there a way of using the services exposed 
> by bundles from a "host" application running equinox like I'm trying 
> to do?
>
> Thank you!
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>

Simon Kaegi | 2 Dec 14:53
Picon

Re: Administrating equinox in production

Is the OOME easily reproducible? If so, please follow up and open a bug.
--
Unfortunately the console is currently limited to a single connection. There are also various http consoles to look at from both knopflerfish and felix (both require some tweaking) however IMO the console is still the best bet.
It might be worth a look to see what changes are involved to support multiple telnet connections as most of the support is localized close to the FrameworkConsole class.

-Simon


"Miguel Cabeza Cabrera" ---12/02/2008 07:41:37 AM---Hey guys,


From:

"Miguel Cabeza Cabrera" <m.c.c-Mmb7MZpHnFY@public.gmane.org>

To:

equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

Date:

12/02/2008 07:41 AM

Subject:

[equinox-dev] Administrating equinox in production



Hey guys,

I've doing some development with equinox and I want to bring it into production. I was quite happy with using console over telnet, but there is a problem.

I'm using framework org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar and first problem is you can connect via telnet only once. Well I couldn't connect more than once.

After doing following we got sometimes interesting problems:
echo disconnect | telnet localhost 1923

JVMDUMP006I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError" - please wait.
JVMDUMP007I JVM Requesting Snap dump using '/home/importer/Snap.20081202.125141.5210320.0001.trc'
JVMDUMP010I Snap dump written to /home/importer/Snap.20081202.125141.5210320.0001.trc
JVMDUMP007I JVM Requesting Heap dump using '/home/importer/heapdump.20081202.125141.5210320.0002.phd'
JVMDUMP010I Heap dump written to /home/importer/heapdump.20081202.125141.5210320.0002.phd
JVMDUMP007I JVM Requesting Java dump using '/home/importer/javacore.20081202.125141.5210320.0003.txt'
JVMDUMP010I Java dump written to /home/importer/javacore.20081202.125141.5210320.0003.txt
JVMDUMP013I Processed dump event "systhrow", detail "java/lang/OutOfMemoryError".
Exception in thread "OSGi Console" java.lang.OutOfMemoryError
       at java.lang.StringBuffer.ensureCapacityImpl(StringBuffer.java:335)
       at java.lang.StringBuffer.append(StringBuffer.java:111)
       at java.io.BufferedReader.readLine(BufferedReader.java:356)
       at java.io.BufferedReader.readLine(BufferedReader.java:373)
       at org.eclipse.osgi.framework.internal.core.FrameworkConsole.getInput(FrameworkConsole.java:350)
       at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.confirm(FrameworkCommandInterpreter.java:452)
       at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter._disconnect(FrameworkCommandInterpreter.java:425)
       at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:136)
       at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:302)
       at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:287)
       at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:223)
       at java.lang.Thread.run(Thread.java:735)

So my question. How can I administrate equinox via telnet or on another way so more computer can connect to. The problem is that if someone connects to telnet and stays connected nobody different can do anything on equinox.

Maybe someone have a hint or some interesting bundle.

Regards

Miguel
--
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev



Gmane