Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » @Autowired doesn't work when trying to wire a service
@Autowired doesn't work when trying to wire a service [message #553851] Thu, 19 August 2010 08:11 Go to next message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
Hi, I can't make @Autowire work. Bean injection only works if I create the bean and inject it using <bean ....><property name="configurationManager" ref="configurationManager">....

I believe I am doing things as done in greenpages-2.3.0.M1 example. I am using virgo 2.3.0M03

Bundle config exports a service:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/osgi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">


<service ref="configurationManager" interface="com.rits.config.IConfigurationManager"/>

</beans:beans>


Then I import the service in bundle gui (web bundle, applicationContext.xml):

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0 .xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context -3.0.xsd
">

<osgi:reference id="configurationManager" interface="com.rits.config.IConfigurationManager"/>

</beans>

and use the reference in gui-servlet.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0 .xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context -3.0.xsd
">
...

<context:component-scan base-package="com.rits.gui.web" />

</beans>


GuiController class:


package com.rits.gui.web;

import org.apache.commons.lang.text.StrSubstitutor;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.rits.config.Config;
import com.rits.config.IConfigurationManager;

/**
* @author kostantinos.kougios
*
* 24 Mar 2010
*/
@Controller
public class GuiController
{
private final Logger logger = Logger.getLogger(getClass());

@Autowired
private IConfigurationManager configurationManager;

@RequestMapping("/gui.htm")
public void list(final Model model)
{
final String s = StrSubstitutor.replaceSystemProperties("You are running with java.version = ${java.version} and os.name = ${os.name}.");
model.addAttribute("s", s);
if (configurationManager == null) throw new IllegalStateException("not initialized properly");
final Config config = configurationManager.get("../config");
logger.info("rendering gui . Config " + config);
}
}

though autowired, the variable configurationManager is null when the list() is called.

Any ideas? As said, if I convert the guicontroller to a bean and inject using <property>, it works.

Thanks,

Kostas
Re: @Autowired doesn't work when trying to wire a service [message #554039 is a reply to message #553851] Thu, 19 August 2010 19:36 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
Make sure that in web.xml for dispatcher servlet configuration you specify correct (osgi aware) version of ApplicationContext

i.e.
<servlet>
        <servlet-name>servlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                /WEB-INF/spring/servlet/*.xml
            </param-value>
        </init-param>
        <init-param>
            <param-name>contextClass</param-name>
            <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>


What kind of application context hierarchy do you have? that is who is loading applicationContext.xml? Servlet Context listener or you let spring-dm extender pick it up?
Re: @Autowired doesn't work when trying to wire a service [message #554044 is a reply to message #554039] Thu, 19 August 2010 20:41 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
Hi,

I've tried modifying my web.xml like the one you provided without any luck.

My web xml is as follows and configuration wise it is identical to the web.xml of the greenpages example:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>com.rits.gui.web</display-name>
<context-param>
<param-name>contextClass</param-name>
<param-value> org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationCo ntext </param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener </listener-class>
</listener>
<servlet>
<servlet-name>gui</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet </servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>gui</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>gui.htm</welcome-file>
</welcome-file-list>
</web-app>
Re: @Autowired doesn't work when trying to wire a service [message #554045 is a reply to message #553851] Thu, 19 August 2010 20:49 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
I injected my osgi service bean without using @Autowire just to see what's going on. My service bean is instanceof IConfigurationManager but on the debugger I see it as $Proxy134. Maybe that's why @Autowire doesn't work.

But I wonder why the greenpages example works (I didn't run it myself).
Re: @Autowired doesn't work when trying to wire a service [message #554046 is a reply to message #554045] Thu, 19 August 2010 20:54 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
spring-dm injected service will be a proxy. This way its lifecycle is managed.

So proxy should not be an issue. That proxy suppose to be jdk proxy if your service implements an interface.

What are your imports for the web bundle? Can you provide your manifest?

Re: @Autowired doesn't work when trying to wire a service [message #554047 is a reply to message #554046] Thu, 19 August 2010 21:05 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
here is the manifest of the web app that uses the service:

Manifest-Version: 1.0
Class-Path:
Bundle-Name: GUI Web Bundle
Bundle-Version: 1.0
Bundle-SymbolicName: com.rits.gui.web
Web-ContextPath: gui
Bundle-Vendor: RobustIT Solutions
Import-Bundle: com.springsource.org.apache.taglibs.standard;version="[1.1.2,1.1.2] ",
com.springsource.org.apache.log4j;version="[1.2.15,1.3.0)",
com.springsource.org.apache.commons.lang;version="[2.4.0,3.0.0) ",
com.springsource.org.apache.velocity;version="[1.6.2,2.0.0) ",
org.springframework.core;version="[3.0.3.RELEASE,4.0.0)",
org.springframework.web;version="[3.0.3.RELEASE,4.0.0)",
org.springframework.web.servlet;version="[3.0.3.RELEASE,4.0.0) ",
org.springframework.context;version="[3.0.3.RELEASE,4.0.0)",
org.springframework.osgi.core;version="[1.2.1,2.0.0)",
com.rits.virgo.log4j
Import-Package:
org.eclipse.virgo.web.dm;version="[2.0.0.RELEASE,3.0.0.RELEASE) ",
javax.servlet;version="[2.5.0,3.0.0)",
com.rits.config
Export-Package: com.rits.gui.web
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

here is the manifest of the service bundle:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Configuration Service
Bundle-SymbolicName: com.rits.config
Bundle-Version: 1.0.0
Bundle-Vendor: RITS
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Bundle: com.springsource.org.apache.log4j;version="[1.2.15,1.3.0)"
Import-Package: groovy.util,groovy.lang
Export-Package: com.rits.config

Re: @Autowired doesn't work when trying to wire a service [message #554048 is a reply to message #554047] Thu, 19 August 2010 21:15 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
Try this for web bundle:

Import-Bundle: com.springsource.org.apache.taglibs.standard;version="[1.1.2,1.3)",
 com.springsource.javax.servlet.jsp.jstl;version="[1.1.2, 1.1.3)",
com.springsource.org.apache.commons.lang;version="[2.4.0,3.0.0) ",
com.springsource.org.apache.velocity;version="[1.6.2,2.0.0) ",

Import-Package: 
org.eclipse.virgo.web.dm;version="[2.0.0.RELEASE,3.0.0.RELEASE) "

Import-Library: org.springframework.spring;version="${spring.version.range}"


Do you really have to use log4j? Virgo comes with slf4 + logback already. Much nicer combo by the way.

Instead of importing individual spring bundle start out with import library. Minimized from there. At least add
org.springframework.aop;version="${spring.version.range}",
 com.springsource.org.aopalliance;version="1.0.0",
 org.springframework.beans;version="${spring.version.range}",
 org.springframework.core;version="${spring.version.range}",
 org.springframework.context;version="${spring.version.range}",

as a minimum set and plus all of the web bundles (i.e. web and web.servlet.

I think the reason that you are missing aop imports could be causing issues with Autowire. You might want to check virgo logs to see if there is some info in there

Also, you shouldn't need to import
org.springframework.osgi.core;version="[1.2.1,2.0.0)"
unless you are using classes from there in your code.

Regards,
Dmitry
Re: @Autowired doesn't work when trying to wire a service [message #554055 is a reply to message #554048] Thu, 19 August 2010 22:15 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
Hi,yes that was it.

Either by importing springframework.beans or the whole lib, @Autowire works! Strange though that it didn't log an error when it wasn't working.

I am now using the library and configured maven & manifest to use springframework 3.0.4 library. There is a drawback though, I've to download the .libd file myself and place it under virgo/repository/usr folder. Do you know if it is possible for maven to do that? I've configured virgo to use my maven repository:

ext.type=external
ext.searchPattern=repository/ext/{artifact}

usr.type=watched
usr.watchDirectory=repository/usr


mavenrepo.type=external
mavenrepo.searchPattern=${user.home}/.m2/repository/**/{bund le}.jar

chain=ext,usr,mavenrepo


Also for anyone that might be reading: I had to clean the virgo/work directory after upgrading spring version (otherwise I was getting errors). And maven sometimes doesn't copy all resources under the MANIFEST folder. Strange...
Re: @Autowired doesn't work when trying to wire a service [message #554190 is a reply to message #554055] Fri, 20 August 2010 13:24 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
In maven you have to add <type>libd</type> to pull down library. Maven by default goes after "jar" type.

You will also want to add this to the plan if you point it to the maven repo:

mavenrepo.type=external
mavenrepo.searchPattern=${user.home}/.m2/repository/**/{bundle}.jar

mavenrepolibd.type=external
mavenrepolibd.searchPattern=${user.home}/.m2/repository/**/{bundle}.libd

chain=ext,usr,mavenrepo,mavenrepolibd



Word of caution - the larger your app becomes the longer indexing will take and start up might become unacceptable when pointing to maven repo.

Re: @Autowired doesn't work when trying to wire a service [message #554286 is a reply to message #554190] Fri, 20 August 2010 21:47 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
Hi, yes, type=libd but maven doesn't download the libd file. I use a parent pom with child pom configured for each bundle. My parent pom is this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.rits</groupId>
<artifactId>com.rits.virgo</artifactId>
<version>1.0.0</version>
<name>Robust IT Server</name>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding >
<spring.version>3.0.4.RELEASE</spring.version>
<spring.osgi.version>1.2.1</spring.osgi.version>
<jsp.taglibs.version>1.1.2</jsp.taglibs.version>
<logging.version>1.5.10</logging.version>
</properties>
<dependencyManagement>
<dependencies>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.spring-library</artifactId >
<type>libd</type>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>com.springsource.org.codehaus.groovy</artifactId >
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>com.springsource.org.apache.velocity</artifactId >
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>org.springframework.osgi.core</artifactId>
<version>${spring.osgi.version}</version>
<scope>compile</scope>
</dependency>
<!-- <dependency> <groupId>org.springframework.osgi</groupId> <artifactId>org.springframework.osgi.extender</artifactId> <version>${spring.osgi.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.springframework.osgi</groupId> <artifactId>org.springframework.osgi.mock</artifactId> <version>${spring.osgi.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.osgi</groupId> <artifactId>org.eclipse.osgi</artifactId> <version>3.5.100.v20090629</version> <scope>provided</scope> </dependency> -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.io</artifactId >
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>com.springsource.javax.annotation</artifactId>
<version>1.0.0</version>
</dependency>
<!-- <dependency> <groupId>org.springframework.osgi</groupId> <artifactId>org.springframework.osgi.test</artifactId> <scope>test</scope> <version>1.2.1</version> </dependency> -->
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>com.springsource.javax.ejb</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.xml.rpc</groupId>
<artifactId>com.springsource.javax.xml.rpc</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>com.springsource.javax.mail</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>com.springsource.javax.activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>com.springsource.javax.persistence</artifactId >
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>com.springsource.javax.el</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>com.springsource.javax.servlet</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>com.springsource.javax.servlet.jsp</artifactId >
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>com.springsource.javax.servlet.jsp.jstl</artifactId >
<version>${jsp.taglibs.version}</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>com.springsource.org.apache.taglibs.standard</artifactId >
<version>${jsp.taglibs.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.lang</artifactId >
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>com.springsource.slf4j.api</artifactId>
<version>${logging.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>com.springsource.slf4j.bridge</artifactId>
<version>${logging.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.logging</artifactId >
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>com.springsource.org.apache.log4j</artifactId>
<version>1.2.15</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>com.springsource.slf4j.log4j</artifactId>
<version>${logging.version}</version>
</dependency>
<dependency>
<groupId>org.objectweb.asm</groupId>
<artifactId>com.springsource.org.objectweb.asm</artifactId >
<version>3.2.0</version>
</dependency>
<!-- ============================================================ ========================= TESTING DEPENDENCIES ============================================================ ========================= -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>org.springframework.osgi.test</artifactId>
<version>${spring.osgi.version}</version>
<scope>test</scope>
</dependency>
<!-- ============================================================ ========================= /TESTING DEPENDENCIES ============================================================ ========================= -->
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>com.springsource.repository.bundles.snapshot</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Snapshot</name>
<url>http://repository.springsource.com/maven/bundles/snapshot</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundle.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
<repository>
<id>com.springsource.repository.bundle.milestone</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Milestones</name>
<url>http://repository.springsource.com/maven/bundles/milestone</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/release</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.external</id>
<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/external</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.milestone</id>
<name>SpringSource Enterprise Bundle Repository - Milestone Library Releases</name>
<url> http://repository.springsource.com/maven/libraries/milestone</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.snapshot</id>
<name>SpringSource Enterprise Bundle Repository - Snapshot Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/snapshot</url>
</repository>
</repositories>
</project>




My gui web bundle pom is:


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.rits</groupId>
<artifactId>com.rits.virgo</artifactId>
<version>1.0.0</version>
<relativePath>../com.rits.virgo/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.rits</groupId>
<artifactId>com.rits.gui.web</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>gui</name>
<dependencies>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.spring-library</artifactId >
<type>libd</type>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.aspects</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.lang</artifactId >
</dependency>
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>com.springsource.org.apache.log4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>com.springsource.org.apache.velocity</artifactId >
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>com.springsource.javax.servlet</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
<archive>
<manifestFile>META-INF/MANIFEST.MF</manifestFile>
</archive>
<packagingExcludes>WEB-INF/lib/**</packagingExcludes>
<!-- <webappDirectory>../com.rits.virgo/virgo-web-server/pickup/com.rits.gui.web </webappDirectory> -->
<warName>${artifactId}</warName>
<outputDirectory>../com.rits.virgo/virgo-web-server/pickup/ </outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>



But maven doesn't download the libd file. Here are the contents of ~/.m2/org/springframework

org.springframework.aop org.springframework.jms
org.springframework.asm org.springframework.orm
org.springframework.aspects org.springframework.oxm
org.springframework.beans org.springframework.spring-library
org.springframework.context org.springframework.transaction
org.springframework.context.support org.springframework.web
org.springframework.core org.springframework.web.portlet
org.springframework.expression org.springframework.web.servlet
org.springframework.jdbc
Re: @Autowired doesn't work when trying to wire a service [message #554289 is a reply to message #554286] Fri, 20 August 2010 23:12 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
org.springframework.beans org.springframework.spring-library
And it is there
Re: @Autowired doesn't work when trying to wire a service [message #554330 is a reply to message #554289] Sat, 21 August 2010 17:25 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
Thanks, found it, the external repo worked nicely:

ext.type=external
ext.searchPattern=repository/ext/{artifact}

usr.type=watched
usr.watchDirectory=repository/usr

mavenrepo.type=external
mavenrepo.searchPattern=${user.home}/.m2/repository/**/{bund le}.jar

mavenrepolibd.type=external
mavenrepolibd.searchPattern=${user.home}/.m2/repository/**/{ bundle}.libd

chain=mavenrepo,mavenrepolibd,ext,usr


Re: @Autowired doesn't work when trying to wire a service [message #607709 is a reply to message #554045] Thu, 19 August 2010 20:54 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
spring-dm injected service will be a proxy. This way its lifecycle is managed.

So proxy should not be an issue. That proxy suppose to be jdk proxy if your service implements an interface.

What are your imports for the web bundle? Can you provide your manifest?
Re: @Autowired doesn't work when trying to wire a service [message #607731 is a reply to message #554289] Sat, 21 August 2010 17:25 Go to previous message
Kostas Kougios is currently offline Kostas KougiosFriend
Messages: 42
Registered: August 2010
Member
Thanks, found it, the external repo worked nicely:

ext.type=external
ext.searchPattern=repository/ext/{artifact}

usr.type=watched
usr.watchDirectory=repository/usr

mavenrepo.type=external
mavenrepo.searchPattern=${user.home}/.m2/repository/**/{bund le}.jar

mavenrepolibd.type=external
mavenrepolibd.searchPattern=${user.home}/.m2/repository/**/{ bundle}.libd

chain=mavenrepo,mavenrepolibd,ext,usr
Previous Topic:Re: @Autowired doesn't work when trying to wire a service
Next Topic:bundle use spring 2.5.6 conflict with spring 3.0
Goto Forum:
  


Current Time: Fri Apr 19 19:14:40 GMT 2024

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

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

Back to the top