I have learnt that beans.xml is related to CDI (rather than EJBs). I am not sure how the resources.xml file fits in. If I want to inject a datasource, is this part of CDI or EJBs?
As soon as I add a resources.xml file things stop working... actually, whenever I add any xml file (or text file, haven't tested any others) under WEB-INF, I get the following (regardless of content): org.apache.openejb.OpenEjbContainer$NoModulesFoundException: No modules found to deploy. 1)Maybe descriptors are placed in incorrect location. Descriptors could go under: <base-dir>/META-INF or <base-dir>/WEB-INF but not directly under <base-dir> Check 'Application Discovery via the Classpath' docs page for more info 2)Maybe no modules are present in the classpath. ...etc I also added in a beans.xml file just in-case, same error (tried it in WEB-INF and META-INF). Why am I trying to add a resources.xml? I was just testing pulling out the datasource settings into a config file rather than in the java source. I may be completely barking up the wrong tree, but here are steps to reproduce what I am doing: svn co http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/jpa-eclipselink cd jpa-eclipselink mvn test >>> All OK Create WEB-INF/resources.xml file (or, it would seem, any file) mvn clean test >>> Fail with error mentioned above Turn on CDI by creating WEB-INF/beans.xml file with following content (also tried it in META-INF) (why? Just doing it just in case... :-)): <bean></bean> mvn clean test >>> Fail with following error (as before) Remove the test file, mvn clean test and it works again. It seems strange that even adding an empty abc.txt file in the WEB-INF dir would change behaviour... is this expected? Regards Colin -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/How-to-add-resources-and-still-scan-for-beans-tp4676236p4676277.html Sent from the TomEE Users mailing list archive at Nabble.com.
