[1.2.3] [spring-1.0.2] tests do not work when activating spring component scanning

88 views
Skip to first unread message

Géraud

unread,
Nov 30, 2011, 3:07:11 PM11/30/11
to play-fr...@googlegroups.com
I have a testing issue while using spring module:
  • I first created a new project and ran the 3 simple generated tests; it worked fine
  • Then I added a dependency on the spring module :
    • I manually installed the plugin (unzipping the module in ${PLAY_HOME}/modules/spring-1.0.2)
    • I added the line "- play -> spring 1.0.2" in my dependencies.yml file
    • I ran the play dependencies --sync command
  • Running tests worked fine again.
  • Then I added a simple conf/application-context.xml file (see its content below)
  • Running tests worked fine again.
  • Then I activated spring component-scanning (adding "play.spring.component-scan=true" in conf/application.conf file)
  • Then I ran again tests:
  • Here I had the following error:
    Oops: BeanDefinitionStoreException
    An unexpected error occured caused by exception BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\STS-2.8.0\workspace\play-empty-app\precompiled\java\ApplicationTest.class (Le chemin d'accès spécifié est introuvable)
    (see stack trace below)


application-context.xml content:

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

Full stack trace:

Oops: BeanDefinitionStoreException
An unexpected error occured caused by exception BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\STS-2.8.0\workspace\play-empty-app\precompiled\java\ApplicationTest.class (Le chemin d'accès spécifié est introuvable)

play.exceptions.UnexpectedException: Unexpected Error
        at play.Play.start(Play.java:525)
        at play.Play.detectChanges(Play.java:599)
        at play.Invoker$Invocation.init(Invoker.java:186)
        at Invocation.HTTP Request(Play!)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\STS-2.8.0\workspace\play-empty-app\precompiled\java\ApplicationTest.class (Le chemin d'accès spécifié est introuvable)
        at play.modules.spring.PlayClassPathBeanDefinitionScanner.findCandidateComponents(PlayClassPathBeanDefinitionScanner.java:91)
        at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:201)
        at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.scan(ClassPathBeanDefinitionScanner.java:180)
        at play.modules.spring.SpringPlugin.onApplicationStart(SpringPlugin.java:93)
        at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:425)
        at play.Play.start(Play.java:495)
        ... 3 more
Caused by: java.io.FileNotFoundException: C:\STS-2.8.0\workspace\play-empty-app\precompiled\java\ApplicationTest.class (Le chemin d'accès spécifié est introuvable)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at play.modules.spring.PlayClassPathBeanDefinitionScanner.findCandidateComponents(PlayClassPathBeanDefinitionScanner.java:67)
        ... 8 more


Question:

It seems that component-scanned packages must be precompiled, but the play precompile command does not take test folder into account...

Did I miss something ?


Yannick Legros

unread,
May 14, 2012, 9:18:44 AM5/14/12
to play-fr...@googlegroups.com
I face same issue.
Have you find any solution?

Géraud

unread,
May 17, 2012, 9:46:49 PM5/17/12
to play-fr...@googlegroups.com
 
No, sorry...
And I did stop trying to use the Play Framework. Not really covering my needs.
Reply all
Reply to author
Forward
0 new messages