2015-09-16 17:10 GMT-07:00 cfnz <[email protected]>: > 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? > > JavaEE actually
> 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). > > this is not directly linked, surely a side effect of something else, we would need more detail on how to reproduce it > 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. > > tomee.xml is external to the app so allows you to deploy the same binary in multiple environment but otherwise resources.xml is good > 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 test uses the classpath so META-INF and not WEB-INF which is the war place (unknown in classpath mode) Just to be sure: where do you create WEB-INF? in src/main/webapp? it doesnt change anything for me. Didn't you also change dependencies or java version? > 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. >
