looks ok Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau
2014/1/9 Milo Jaden <[email protected]>: > Well I don’t really know how NetBeans goes about doing things. But basically > you want to end up with an ejb-jar file (let’s call it app.jar) where the > META-INF folder is at the root: > > extract app.jar produces: > > \META-INF\resources.json > \META-INF\persistence.xml > \META-INF\MANIFEST.MF > \com\mycompany\model\MyEntity.class > etc… > > try calling jar -xvf app.jar (after NetBeans creates the jar file) to see if > its creating as above. > > Milo > > > > On 9 Jan 2014, at 15:32, Kay Wrobel <[email protected]> wrote: > >> My persistence.xml looks like that. Thanks. >> >> However, I can't seem to make TomEE pick up the resources.json file. Now, I >> don't have a maven project, just a regular project in NetBeans. I'm confused >> about the location of where to put the file as I don't have >> src/main/resources... I've tried to create a META-INF directory under Source >> Packages (in NetBeans) and put the file there. That didn't work. Then I >> tried to move the json file in the same location as the persistence.xml >> file, which in my case under NetBeans is physically under src/conf. That >> didn't work either. So hmmm... >> >> On 01/09/2014 09:19 AM, Milo Jaden wrote: >>> Well it works without specifying the type for me, so I’m guessing its not >>> needed, not sure if its needed for the resources.xml. >>> >>> Just want to confirm that you have in your persistence.xml a tag of the >>> following: >>> >>> <jta-data-source>MusicPulseDataSource</jta-data-source> >>> >>> (i.e the name of the datasource that you’ve put in the resources.xml) >>> >>> Milo >>> >>> On 9 Jan 2014, at 15:19, Kay Wrobel <[email protected]> wrote: >>> >>>> Milo: thanks for the example. I'm comparing it to the resources.xml file >>>> and notice one difference: there's no resource type (e.g. >>>> javax.sql.DataSource). Is that implied or default? >>>> >>>> On 01/09/2014 08:55 AM, Milo Jaden wrote: >>>>> Hi, >>>>> >>>>> My complete file, resources.json (obviously i changed the login details >>>>> :P): >>>>> >>>>> { >>>>> "resources": { >>>>> "MusicPulseDataSource": { >>>>> "properties": { >>>>> "JdbcDriver": "com.mysql.jdbc.Driver", >>>>> "JdbcUrl": >>>>> "jdbc:mysql://localhost:3306/MYDATABASE", >>>>> "UserName": “db_user", >>>>> "Password": “db_password", >>>>> "JtaManaged": true, >>>>> "MaxActive": 200 >>>>> } >>>>> } >>>>> } >>>>> } >>>>> >>>>> >>>>> Remember to have it in src/main/resources/META-INF/resources.json >>>>> (alongside my persistence.xml) >>>>> >>>>> and my pom.xml packaging is: >>>>> >>>>> <packaging>ejb</packaging> >>>>> >>>>> an ejb jar. >>>>> >>>>> >>>>> Milo >>>>> >>>>> >>>>> On 9 Jan 2014, at 14:53, Kay Wrobel <[email protected]> wrote: >>>>> >>>>>> Interesting. Can you send me a sample of sucha file? Also, any reason >>>>>> why a regular resources.xml doesn't work? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Kay >>>>>> >>>>>> >>>>>> On 01/09/2014 05:13 AM, Milo Jaden wrote: >>>>>>> I have a resources.json (same thing as resources.xml) located at >>>>>>> src/resources/META-INF/resources.json in my maven project. My project >>>>>>> is an EJB jar and when running OpenEJB it picks up the resources.json >>>>>>> fine. >>>>>>> >>>>>>> >>>>>>> On 9 Jan 2014, at 06:07, Romain Manni-Bucau <[email protected]> >>>>>>> wrote: >>>>>>> >>>>>>>> Hi >>>>>>>> >>>>>>>> No but we can think to a resources-fragment.xml. the main issue it has >>>>>>>> is >>>>>>>> it add deployment data to lib which are generally not aware of it. The >>>>>>>> idea >>>>>>>> is even the opposite ans uqe ${xxx} for resources values and set it as >>>>>>>> system properties >>>>>>>> Le 9 janv. 2014 04:19, "Kay Wrobel" <[email protected]> a écrit : >>>>>>>> >>>>>>>>> Question: Is it possible to put the resources.xml file that defines a >>>>>>>>> data >>>>>>>>> source inside an EJB jar instead of putting it inside a WAR under >>>>>>>>> WEB-INF??? The reason why I'm asking is that it would be very >>>>>>>>> convenient if >>>>>>>>> I could put the data source definition inside the EJB that matches the >>>>>>>>> remote database. >>>>>>>>> >>>>>>>>> The documentation just mentions the WEB-INF location or defining the >>>>>>>>> data >>>>>>>>> source directly on the server inside tomee.xml. >>>>>>>>> >>>>>>>>> Thanks. >>>>>>>>> >>>>>>>>> Kay >>>>>>>>> >> >
