[jboss-user] [Installation, Configuration & DEPLOYMENT] - Maven + Embedded EJB + JPA +EJB 3.0 getting Null name

r_sudh do-not-reply at jboss.com
Mon Aug 6 13:54:33 EDT 2007


Hrere is the code that starts up the embedded JBoss micro-container. 

public void beforeIntegrationTests() {
  | 		try {
  | 
  | 			// Boot the JBoss Microcontainer with EJB3 settings, loads
  | 			// ejb3-interceptors-aop.xml
  | 			EJB3StandaloneBootstrap.boot(null);
  | 
  | 			// EJB3StandaloneBootstrap.deployXmlResource("jboss-jms-beans.xml");
  | 			// scan classpath for ejbs and MDBs
  | 			EJB3StandaloneBootstrap.scanClasspath();
  | 
  | 			// Add all EJBs found in the archive that has this file
  | 			deployer = new EJB3StandaloneDeployer();
  | 			deployer.getArchivesByResource().add("META-INF/persistence.xml");
  | 
  | 			// Deploy everything we got
  | 			deployer.create();
  | 			deployer.start();
  | 
  | 			// Create InitialContext from jndi.properties
  | 			initialContext = new InitialContext();
  | 
  | 		} catch (Exception ex) {
  | 			throw new RuntimeException(ex);
  | 		}
  | 	}

I am getting the following stacktrace at 

EJB3StandaloneBootstrap.scanClasspath();


anonymous wrote : java.lang.RuntimeException: java.lang.IllegalArgumentException: Null name
  | 	at brazos.permit.ejb.container.EJB3Container.beforeIntegrationTests(EJB3Container.java:52)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:597)
  | 	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)
  | Caused by: java.lang.IllegalArgumentException: Null name
  | 	at org.jboss.dependency.plugins.AbstractController.getContext(AbstractController.java:114)
  | 	at org.jboss.kernel.plugins.dependency.AbstractKernelController.getContext(AbstractKernelController.java:94)
  | 	at org.jboss.ejb3.embedded.KernelErrors.validate(KernelErrors.java:96)
  | 	at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:281)
  | 	at brazos.permit.ejb.container.EJB3Container.beforeIntegrationTests(EJB3Container.java:38)
  | 	... 22 more


Here is my persistence.xml 

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
  | 	version="1.0">
  | 	<persistence-unit name="myPU">
  | 		<jta-data-source>jdbc/MyDB</jta-data-source>	
  | 		<properties>		
  | 			<property name="toplink.ddl-generation"
  | 				value="create-tables" />		
  | 			<property name="toplink.logging.level" 
  | 				value="FINER" />							
  | 		</properties>		
  | 	</persistence-unit>
  | </persistence>

I'm using maven and my folder structure is as follows:

srv/main/java
      |__________META-INF
                              |________persistence.xml
src/test/java
      |__________EJB2Container.java


Please let me know if there is anything else I can provide to help get this working.

Thanks!

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

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



More information about the jboss-user mailing list