I'm not sure what's going on in your specific case (although you should not need to embed/inline your framework as this will be picked up from the bundle directory). Anyway this (http://blog.principia-it.co.uk/2012/06/18/osgi-logging-a-noobs-adventures/) may give some clues on better ways to handle logging, and particularly how to 'drop in' a more OSGi way to handle logging while still using log4j calls.
On 9 Aug 2012, at 00:52, lessonz wrote:
> Okay, I'm probably missing something rudimentary, but I'm at a bit of a
> loss. I have an application embedding Felix:
>
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <extensions>true</extensions>
> <configuration>
> <instructions>
>
> <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
> <Bundle-Name>test</Bundle-Name>
> <Embed-Dependency>
>
> *;artifactId=org.apache.felix.framework;inline=true,
> *;groupId=${project.groupId};scope=runtime
> </Embed-Dependency>
> <Embed-Directory>bundle</Embed-Directory>
> <Embed-Transitive>true</Embed-Transitive>
> <Import-Package>
> *
> </Import-Package>
>
> <Main-Class>${project.groupId}.${project.artifactId}.Main</Main-Class>
> </instructions>
> <obrRepository>NONE</obrRepository>
> </configuration>
> </plugin>
>
> To explain, there is a little extra going on here as I also throw all of my
> own bundles in the jars:/bundle/ directory. At runtime, I'm loading those
> bundles into Felix container.
>
> That seems to work just fine. But now I'd like for my main application to
> be able to use log4j, and I'm having a devil of a time embedding it into my
> executable jar so I can have it on my classpath. I've tried using the
> maven-shade-plugin in conjunction with the above, but that produced quite a
> mess. Anyone have any ideas?
>
> Cheers
signature.asc
Description: Message signed with OpenPGP using GPGMail

