|
Re: newbie: how should bundle code log in equinox? [message #84990 is a reply to message #84975] |
Sat, 24 March 2007 20:35 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
If you've already got commons-logging installed, you can use that. However, getting the .properties file is tricky; the easiest way is to put it into a fragment that attaches to the log4j plugin, though you can also export the package of a directory containing the name (or just the name of the properties file itself).
Did you look in .metadata/.log? It wouldn't be printed out to the console in any case.
Alex.
|
|
|
|
Re: newbie: how should bundle code log in equinox? [message #85020 is a reply to message #85005] |
Sun, 25 March 2007 17:40 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
The location of .metadata is inside wherever the workspace is -- for example, user.home. So it might be something like c:\Documents and Settings\userid\Application Data\workspace\.metadata\.log or something like that.
Windows will hide .metadata from showing in some views, but you can go into it via a command prompt if you want (and/or enable the showing of hidden files in Windows explorer).
Anyway, back to the log4j question ...
Do you have 3 separate bundles or 1 bundle with 3 jars in it?
Alex.
|
|
|
|
Re: newbie: how should bundle code log in equinox? [message #85067 is a reply to message #85035] |
Mon, 26 March 2007 11:05 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
OK, if you have 1 bundle with 3 jars in it, you can just put the log4j.properties file in the root of the project and it will pick it up. You will need to make sure you edit build.properties to ensure that the bin.includes also lists this file (otherwise it won't be there when you export it).
If your bundle is ACTIVE, and there's a Bundle-Activator: com.foo.Activator, and that's your Activator's method, then yes, this code should have been run. In fact, if it didn't work (say, it couldn't create the file) and an exception occured, your bundle wouldn't be ACTIVE -- it would go back to RESOLVED.
Can you verify that the Bundle-Activator is indeed pointing to this class? If you mis-spell the entry (e.g. Bondle-Activator) then you'd get exactly this behaviour since it wouldn't find the entry and thus use a default of no activator.
Alex.
|
|
|
Re: newbie: how should bundle code log in equinox? [message #85082 is a reply to message #85067] |
Mon, 26 March 2007 13:54 |
David Donohue Messages: 104 Registered: July 2009 |
Senior Member |
|
|
Alex,
Once again you have lead me to the solution!
It turns out that after building, my MANIFEST.MF file was wrong. It had only 3 lines and was generated by the ant <jar...> command. You see, in order to assemble my standalone OSGi app, I am packaging it using ant. Probably not the preferred way, but I did not see a better way to package and deploy a standalone OSGi app from Eclipse.
So I had this in my build.xml file
<jar destfile="${destination.jar.file}">
and this ignored my bundle's META-INF/MANIFEST.MF file, and instead created its own MANIFEST.MF file.
I changed this ant directive to
<jar destfile="${destination.jar.file}" filesetmanifest="merge">
and now I get the proper MANIFEST.MF in my bundle's final jar file. My bundle is running, it is writing my test file, and I can see console output from my libraries (Jetty, etc). Looks like I might finally have a working development environment. Whew
MANY Thanks, Alex!
David
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04784 seconds