[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [equinox-dev] FW: Debugging Equinox bundles (not in Eclipse)

Great. Seems to work now, but I'm not sure exactly what the issue was.
However, the problem was solved by one or more of:
* Using 3.3
* Starting equinox with -clean before running my own app
* Fiddling with the manifest and rebuilding the bundle
* Having a good lunch

I suspect it was probably the last one!

Cheers! 

-----Original Message-----
From: equinox-dev-bounces@xxxxxxxxxxx
[mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Alex Blewitt
Sent: 16 February 2007 12:43
To: Equinox development mailing list
Subject: Re: [equinox-dev] FW: Debugging Equinox bundles (not in Eclipse)

Should work; I've done this myself from Java code (both 3.2 and 3.3).
What it would look like is:

java -classpath org.eclipse.osgi_.....jar org,example.StartEquinox

If you run the -console, do you get the osgi> prompt at the shell? In
which case, what shows up when you do e.g. 'ss' or 'diag 1' or
whatever the number of your bundle is?

You might also want to try "-console","1234" and then doing 'telnet
1234' to get to the console; that would rule out any in/out stream
problems. You might also want/need the -noExit, in case you're seeing
it startup/shutdown almost immediately.

Lastly, is it possible that the bundle is already present, and because
it's got the same version number and URL, it's not actually doing an
update? In other words, it's quite likely that the *first* time you
did it, you installed the  bundle w/o the manifest entry
'Import-Package', and then although you changed it the 2nd time,
because you've not changed the URL/version, it's using the old one.
You could fix this by (in the console) doing an 'uninstall 1', or
bumping the version number, or using a different URL/symbollic name.

>From the JavaDoc (well, draft at
http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.platform.doc.isv
/reference/osgi/org/osgi/framework/BundleContext.html):

1. If a bundle containing the same location string is already
installed, the Bundle object for that bundle is returned.

In other words, it doesn't actually do an update, it just gives you
the bundle back again.

bundle.update() would ensure that it's up-to-date.

Alex.



On 16/02/07, Richard Colvin <rcolvin@xxxxxxxxxxx> wrote:
>
> Thanks Alex. Not the problem, I'm afraid - I've got the import in the
> manifest and I'm using 3.2.1 anyway (I've tried without the import too).
> Maybe I'll try 3.3. I think it's a classloader issue that I hope can be
> fixed by one of the many properties or cmd line args you can start equinox
> with, but I've no idea which one(s).
>
> (Nice presentation at the JSIG yesterday BTW)
>
> -----Original Message-----
> From: equinox-dev-bounces@xxxxxxxxxxx
> [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Alex Blewitt
> Sent: 16 February 2007 12:00
> To: Equinox development mailing list
> Subject: Re: [equinox-dev] FW: Debugging Equinox bundles (not in Eclipse)
>
> You've probably got
>
> Import-Package: org.osgi.framework
>
> missing from your Manifest. Eclipse 3.2 didn't used to barf at that,
> but Eclipse 3.3 does. (It's basically a fixed bug)
>
> Alex.
>
> On 16/02/07, Richard Colvin <rcolvin@xxxxxxxxxxx> wrote:
> >
> >
> >
> >
> > I'm trying to start equinox and one bundle in an IDE (but not Eclipse,
> where
> > I know the support is built in) using the following code:
> >
> >
> >
> > public class StartEquinox {
> >
> >     public static void main(String[] args) {
> >
> >         try {
> >
> >             BundleContext bc = EclipseStarter.startup(new
> > String[]{"-console"}, null);
> >
> >             InputStream is = new
> > FileInputStream("./myfirstbundle/myfirstbundle.jar");
> >
> >             bc.installBundle("myfirstbundle ", is).start();
> >
> >         } catch (Exception e) {
> >
> >             e.printStackTrace();
> >
> >         }
> >
> >
> >
> >     }
> >
> > }
> >
> >
> >
> > What I get is a stack trace:
> >
> >
> >
> > org.osgi.framework.BundleException: The activator
> > com.stentra.myfirstbundle.Activator for bundle
> > myfirstbundle is invalid
> >
> >             at
> >
>
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(
> AbstractBundle.java:141)
> >
> >             at
> >
>
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleConte
> xtImpl.java:962)
> >
> > .
> >
> >
> >
> > Caused by: java.lang.NoClassDefFoundError:
> > org/osgi/framework/BundleActivator
> >
> >
> >
> > Using  java -jar <equinox.jar> and intalling stuff manually works fine.
> >
> >
> >
> > So presumably there is some classloader type issues here. Is there any
> easy
> > way round this?
> >
> >
> >
> > Thanks in advance.
> >
> >
> >
> >
> >
> > Richard Colvin
> >
> >
> > _______________________________________________
> > equinox-dev mailing list
> > equinox-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/equinox-dev
> >
> >
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev