[jboss-user] [JBoss Seam] - Unable to unit tests for similar reasons.

sidragon do-not-reply at jboss.com
Wed Aug 30 11:31:43 EDT 2006


I have been fighting with this problem for days now.  I get the following stack trace when trying to get components:

javax.naming.NamingException: Local server is not initialized
  |  at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
  |  at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
  |  at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
  |  at javax.naming.InitialContext.init(InitialContext.java:223)
  |  at javax.naming.InitialContext.<init>(InitialContext.java:197)
  |  at org.jboss.seam.util.Naming.getInitialContext(Naming.java:26)
  |  at org.jboss.seam.util.Naming.getInitialContext(Naming.java:37)
  |  at org.jboss.seam.Component.instantiate(Component.java:774)
  |  at org.jboss.seam.Component.newInstance(Component.java:731)
  |  at org.jboss.seam.Component.newInstance(Component.java:1308)
  |  at org.jboss.seam.Component.getInstance(Component.java:1263)
  |  at org.jboss.seam.Component.getInstance(Component.java:1253)
  |  at net.sidragon.seam.example.RegistrationTest$1.invokeApplication(RegistrationTest.java:39)
  |  at org.jboss.seam.mock.SeamTest$Script.run(SeamTest.java:242)
  |  at net.sidragon.seam.example.RegistrationTest.testPersonRegister(RegistrationTest.java:21)

I am following the examples almost precisely (aside from my own application considerations), but no matter what I cannot get around this.  I get another exception as well when trying to access my data source.

javax.persistence.PersistenceException: No Persistence provider for EntityManager named seamExampleDatasource
  |  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:41)
  |  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
  |  at net.sidragon.seam.example.PersonRegisterActionTest.testPersonRegisterAction(PersonRegisterActionTest.java:19)

My "applicaiton" (it is just a toy for learning Seam) works great when running live in JBoss, so I think all my configuration is correct.

Can someone provide me with a checklist of things to look into?  I will also gladly provide bits of this as requested.  (Dumping all of it here would be time consuming and probably of little value.  Generally assume that I am doing things as specified by the Booking example.)

Any help would be greatly appreciated!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968400#3968400

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968400



More information about the jboss-user mailing list