Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » [OSGI+SpringDM] Published service is not injected(Published service is not injected)
[OSGI+SpringDM] Published service is not injected [message #855298] Tue, 24 April 2012 17:38
Paul Vlasin is currently offline Paul VlasinFriend
Messages: 3
Registered: April 2012
Junior Member

I am trying to create a simple vaadin+osgi+springdm integration.
I have 4 bundles - just the target platform
1 public interface no spring context xml's
1 public implementation of the above interface
in META-INF/spring folder i have two xml's
<?xml version="1.0" encoding="UTF-8"?>
    <bean id="myEmailServiceOSGi" class=""/>

<?xml version="1.0" encoding="UTF-8"?>
	<!-- Publish UserServiceImpl instance as UserService in the OSGi services 
		registry -->

	<osgi:service id="es" ref="myEmailServiceOSGi" interface=""/>


In x.y.vaadin.main I am trying to consume the published service like so:
the context.xml
<?xml version="1.0" encoding="UTF-8"?>

    <bean id="MainApplication" class="x.y.vaadin.main.MainApplication">
        <property name="emailService" ref="myEmailServiceImported"></property>

and the context-osgi.xml

    <!-- Consume UserService from the OSGi services registry -->
    <osgi:reference id="myEmailServiceImported" interface="" cardinality="0..1" timeout="1000"/>

has a property of type IEmailService and a public getter and setter.

Still when i try to use the property IEmailService from MainApplication I get a NPE.

I did some debugging and put a breakpoint in the setter.
	public void setEmailService(IEmailService emailService) {
		this.emailService = emailService;

but i get
org.springframework.osgi.service.ServiceUnavailableException: service matching filter=[(&(] unavailable

Can anyone tell me if I am doing something wrong, or why my email service is not injected by spring?

p.s. attached is the startup log

[Updated on: Tue, 24 April 2012 17:56]

Report message to a moderator

Previous Topic:Bundle not appear in Target Platform
Next Topic:Equinox Console: Tab Completion and History?
Goto Forum:

Current Time: Sun Oct 17 14:05:38 GMT 2021

Powered by FUDForum. Page generated in 0.01705 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top