users@glassfish.java.net

Re: spring component-scan problem in packed osgi WAB

From: <forums_at_java.net>
Date: Wed, 8 Feb 2012 10:36:13 -0600 (CST)

 Update: I tried to deploy an open war as bundle (using "asadmin deploy
--type OSGI" command), and received the same exception:

 

2012-02-08 18:30:23,194 [pool-28-thread-1]
(PathMatchingResourcePatternResolver.java:532) WARN - Cannot search for
matching files underneath URL [bundle://275.0:2/examples/services/] because
it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [bundle://275.0:2/examples/services/]
cannot be resolved to absolute file path because it does not reside in the
file system: bundle://275.0:2/examples/services/ at
org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204) at
org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)
at org.springframework.core.io.UrlResource.getFile(UrlResource.java:168) at
org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:528)
... 2012-02-08 18:30:23,194 [pool-28-thread-1]
(PathMatchingResourcePatternResolver.java:353) DEBUG - Resolved location
pattern [classpath*:examples/services/**/*.class] to resources [] My spring
applicationContext.xml looks like this: <?xml version="1.0"
encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<context:annotation-config/> <tx:annotation-driven /> <context:component-scan
base-package="examples.services" /> </beans> Is there a way to make
"component-scan" work in osgi bundle?   thank you
 


--
[Message sent by forum member 'okna2000']
View Post: http://forums.java.net/node/883365