I changed the pom and removed the jpa stuff and added tomee-maven-plugin. Strange thing is that everything works then. So I then deployed the war to a tomee install I still had and after putting the jar in the libs dir and changing the tomee.xml it works there too. Clearly both eclipse and intellij do something that breaks this. I will investigate further.
Ron On Wed, Aug 26, 2015 at 11:18 AM Romain Manni-Bucau <[email protected]> wrote: > guess it means you have to: > 1) make your project compiling (remove JPA stuff ;)) > 2) do your setup with tomee maven plugin to let us reproduce as you > > Side note: I removed the driver from the webapp when tested, can have an > impact maybe - classloaders matters > > > Romain Manni-Bucau > @rmannibucau <https://twitter.com/rmannibucau> | Blog > <http://rmannibucau.wordpress.com> | Github < > https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http://www.tomitribe.com> > > 2015-08-26 11:12 GMT+02:00 Ron Smits <[email protected]>: > > > Romain > > > > I love your brevity. Did you test this with my example project? We see > the > > resource being made during startup in Catalina.out but when we use > > @Resource in the application it is null without any exceptions or errors. > > > > Ron > > > > Op wo 26 aug. 2015 10:08 schreef Romain Manni-Bucau < > [email protected] > > >: > > > > > tested on master and it works fine if mongo driver is in lib directory > > *of > > > tomee*. > > > > > > > > > Romain Manni-Bucau > > > @rmannibucau <https://twitter.com/rmannibucau> | Blog > > > <http://rmannibucau.wordpress.com> | Github < > > > https://github.com/rmannibucau> | > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > > > <http://www.tomitribe.com> > > > > > > 2015-08-26 6:41 GMT+02:00 Ron Smits <[email protected]>: > > > > > > > The jar is in the libs directory > > > > > > > > Op di 25 aug. 2015 22:50 schreef Romain Manni-Bucau < > > > [email protected] > > > > >: > > > > > > > > > Hi > > > > > > > > > > Did you put mongo in tomee libs? If not server cant create the > > resource > > > > > before deploying app as intended by tomee.xml. > > > > > Le 25 août 2015 22:48, "Ron Smits" <[email protected]> a écrit : > > > > > > > > > > > A colleague of mine pointed me to this problem. A resource for a > > > > mongodb > > > > > > database is defined in $TOMEE_HOME/conf/tomee.xml: > > > > > > > > > > > > <Resource id="mongoUri" > class-name="com.mongodb.MongoClientURI" > > > > > > constructor="uri"> > > > > > > uri mongodb://localhost/test > > > > > > </Resource> > > > > > > > > > > > > This should get picked up by a ApplicationScoped producer. But it > > is > > > > not. > > > > > > When the resource is defined in WEB-INF/resources.xml it works > > fine. > > > > > > During the startup of the server the resource is created as can > be > > > seen > > > > > in > > > > > > catalina.out. > > > > > > > > > > > > I made a very small example at > > https://github.com/ronsmits/mongotest > > > > > > Please > > > > > > tell us what we are doing wrong. > > > > > > > > > > > > Ron > > > > > > > > > > > > > > > > > > > > >
