You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 7 Members of 4087 |
| Forum: Seam Users |
17. Mar 2008, 17:55 CET | Link |
Hi,
I wrote my first, simple TestNG test, extending SeamTest just like the examples. The test itself is empty and does nothing. When I run it, I get the following exception:
Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: userSearch at org.jboss.seam.Component.getJndiName(Component.java:438) at org.jboss.seam.Component.<init>(Component.java:243) at org.jboss.seam.Component.<init>(Component.java:217) at org.jboss.seam.init.Initialization.addComponent(Initialization.java:961) ... 27 more ... Removed 22 stack frames
Is this a classpath issue? I've added all sorts of jars to the classpath but still get the exception.
Environment: IBM RAD 6.1.
Thanks in advance for any help, Bill
Anyone? I don't even know where to begin looking...
Hi,
I write here to know if you've found a solution to your problem, because I'm facing the same right now...
FAILED CONFIGURATION: @BeforeClass init java.lang.RuntimeException: Could not create Component: myComponent at org.jboss.seam.init.Initialization.addComponent(Initialization.java:976) at org.jboss.seam.init.Initialization.installComponents(Initialization.java:898) at org.jboss.seam.init.Initialization.init(Initialization.java:576) at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:939) at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923) at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42) Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: myComponent at org.jboss.seam.Component.getJndiName(Component.java:438) at org.jboss.seam.Component.<init>(Component.java:243) at org.jboss.seam.Component.<init>(Component.java:217) at org.jboss.seam.init.Initialization.addComponent(Initialization.java:961) ... 27 more ... Removed 22 stack framesMy components.xml for tests uses this jndi pattern
#{ejbName}/localMy classpath uses : jboss-embedded-all.jar hibernate-all.jar thirdparty-all.jar testng.jar bootstrap (a folder that I picked from Seam and imported without any modification... I would be glad to know if tests could work without this one)
Any clue to make this work ? Does someone know a resource that explain exactly how the Seam tests work with testng ?
Thanks
Dazzx
PS : I tried to create a project with seam-gen to see tests working, but It didn't work...
No, I haven't gotten it working. Instead, I thought I'd try to get out-of-the-box TestNG tests (from seam-gen) working with JBoss. I can't even get those to work, although the error is slightly different. See my new post here.
I had same issues - finally it was resolved by adding web-root folder into test-run class-path (how to do it - depends from IDE you are using - I used NetBeans and JUnit4 to run tests)
Since web-root is not added into class-path, test runner cannot find WEB-INF/components.xml during Seam initialization - and used default settings
With Best Regards,
Alexey Kakunin
EmForge Configuration Management
`<core:init debug="true" jndi-pattern="#{ejbName}/local"/>`
There is no ear named in this jndi pattern as you're outside any ear.
An alternative consists in putting this into your seam.properties:
org.jboss.seam.core.init.jndiPattern = #{ejbName}/local
Anyway, you need this bootstrap directory in your test classpath if you want any advanced feature while testing. For example, this is where you deploy your datasource descriptor (bootstrap/deploy).