-
1. Re: JBAS011440: Can't find a persistence unit named null in deployment
david.salter Apr 19, 2012 7:34 AM (in response to b69)Try changing to:
arch.addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml:);
instead of your current line that adds the persistence.xml file assuming that you have a META-INF/persistence.xml file within your test/resources folder of your project.
-
2. Re: JBAS011440: Can't find a persistence unit named null in deployment
b69 Apr 19, 2012 9:23 AM (in response to david.salter)Ok, thanks! Now its running!
Conclusion:
With regards to ShrinkWrap, overall descriptions are missing. From javadoc it's possible to deduce, what could work. But it's a stony, very time consuming trial and error way!
It works, but I still don't know why! Why it is src/test/resources Folder? Why it must be mentioned twice? What is the difference between the solution where you mention it only once and the used one, where the same information is given twice?
What exactly does the "beans.xml" declaration?
It would be nice if such background information is given somewhere in a tutorial, or any other documentation.
-
3. Re: JBAS011440: Can't find a persistence unit named null in deployment
david.salter Apr 19, 2012 12:10 PM (in response to b69)1 of 1 people found this helpfulHi. I'm glad it's working now.
The src/test/resources folder is the standard path for test resources for Maven so all resources go in there or subfolders.
The first parameter to .addAsResource() specifies the file to add to the archive. You want to add the persistence.xml file which is in the META-INF folder. The second parameter specifies where this file goes in the archive. So it looks like the info is given twice, but this is not the case.
Beans.xml is needed to allow CDI beans. If you aren't using those I don't think it's not needed.
-
4. Re: JBAS011440: Can't find a persistence unit named null in deployment
b69 Apr 20, 2012 4:28 AM (in response to david.salter)Thanks for the clarifications. However I would prefer to see all of this in a general documentation. I don't feel good, when I just know, “how it works”. I need to know, “why it works”. Only the latter gives me the freedom to choose the most adequate solution.
Example beans.xml and CDI.
I’m using EJB (JSR-318) not CDI (JSR-299). So beans.xml goes with CDI. Does EJB require another MetaData configuration with ShrinkWrap? You see the kind of questions, which I would like to have answered in a document giving me the whole overview.
-
5. Re: JBAS011440: Can't find a persistence unit named null in deployment
david.salter Apr 20, 2012 4:53 AM (in response to b69)1 of 1 people found this helpfulHi,
I'd recommend looking at the Arquillian Guides - that should answer most of your questions.
-
6. Re: JBAS011440: Can't find a persistence unit named null in deployment
b69 Apr 20, 2012 7:40 AM (in response to david.salter)Aah! looks not bad. I was just not able to find it!
I'm reading through. I'll tell you the outcome.