[JBoss Seam] - testing in pojo environment with eclipse
by valbosoft
Hello,
I have a working seam application in eclipse, and I'm now trying to set a test.
No ejb is used. The application runs on tomcat from within eclipse.
When I run the test, Seam seems to start up ok, but I get the following error:
| 12:16:06,621 INFO [Environment] Hibernate 3.2.1
| 12:16:06,621 INFO [Environment] hibernate.properties not found
| 12:16:06,637 INFO [Environment] Bytecode provider name : cglib
| 12:16:06,668 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
| 12:16:18,715 INFO [AnnotationBinder] Binding entity from annotated class: com.inmobiliaria.entity.Inmueble
| 12:16:18,824 INFO [EntityBinder] Bind entity com.inmobiliaria.entity.Inmueble on table Inmueble
|
| ...
| 12:16:19,496 INFO [NamingHelper] JNDI InitialContext properties:{}
| 12:16:19,574 ERROR [NamingHelper] Could not obtain initial context
| javax.naming.NamingException: Local server is not initialized
| at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:30)
| at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
| at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
| at javax.naming.InitialContext.init(Unknown Source)
| at javax.naming.InitialContext.<init>(Unknown Source)
| at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
| at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
| at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
| at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
| at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
| at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
| at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
| at com.inmobiliaria.test.PersonaTest.getEntityManager(PersonaTest.java:76)
| at com.inmobiliaria.test.PersonaTest.testRegisterAction(PersonaTest.java:19)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
| at org.testng.internal.Invoker.invokeMethod(Invoker.java:470)
| at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:564)
| at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:830)
| at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
| at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
| at org.testng.TestRunner.runWorkers(TestRunner.java:678)
| at org.testng.TestRunner.privateRun(TestRunner.java:624)
| at org.testng.TestRunner.run(TestRunner.java:495)
| at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
| at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
| at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
| at org.testng.SuiteRunner.run(SuiteRunner.java:190)
| at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
| at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
| at org.testng.TestNG.run(TestNG.java:699)
| at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
| at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:122)
| 12:16:19,590 FATAL [DatasourceConnectionProvider] Could not find datasource: java:/DefaultDS
I guess the test environment cannot find the persistence.xml
Can anybody give a pointer on where I should place it? Or what else could be the cause?
I've tried several options: place it in src/WEB-INF, created a resources source directory with a WEB-INF directory, but no luck.
Regards, Bo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085402#4085402
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085402
18 years, 10 months
[JBoss Tools (users)] - Re: Everything You Wanted to Know about Seam, but were afrai
by djfjboss
I'm trying to follow the examples given in http://labs.jboss.com/jbossseam/gettingstarted but it all goes horribly wrong when I try to use the JBossEclipse IDE.
This refers to using Seam 1.2 with JBoss 4.0.5 via the JEMS 1.2 installer.
It also mentions Seam 1.3 which, as far as I can see from http://labs.jboss.com/jbossseam/download/index.html, does not even exist.
Seam 2.0 plus JBoss 4.2 may be an alternative but, reading the installation manual for JBoss, it isn't clear if not using a JEMS installer leaves you with a lot of manual configuration to do. I simply want to install a JBoss AS, get the Seam hooked up with it and develop a simple application within Eclipse, a modest and common requirement I would have thought.
JBoss 4.2.1 may work (for you) but it uses Seam 2.0 which is beta which rather puts me off. The idea of hacking some jars whose purpose is unknown to me is even less appealing. Is there not a stable version/combination of these elements that actually works? If not, then maybe I need to look elsewhere. I am looking to evaluate Seam/EJB3 which looks/ed an interesting combination but so far it does not seem to be living up to expectations - it seems very painful and fragile, or maybe I'm doing something wrong, hence my appeal. If anyone out there has had success with this combination I'd be very grateful if they would take some time to clearly outline the steps that are involved or, if it's already written down, point me to what I'm clearly missing.
Thanks again.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085392#4085392
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085392
18 years, 10 months