tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remo (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (TOMEE-1801) Injection not working in WebModule
Date Tue, 10 May 2016 06:40:12 GMT

     [ https://issues.apache.org/jira/browse/TOMEE-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Remo resolved TOMEE-1801.
-------------------------
    Resolution: Invalid

> Injection not working in WebModule
> ----------------------------------
>
>                 Key: TOMEE-1801
>                 URL: https://issues.apache.org/jira/browse/TOMEE-1801
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 7.0.0-M3
>            Reporter: Remo
>
> I'm using TomEE 7 M3 together with DeltaSpike 1.6.3 to do unit testing of JEE applications.
JPA, Injection, EJB beans work fine. It stops working when I adda WEB-INF directory with a
beans.xml/web.xml. Reason is here:
> {code}
> Thread [main] (Suspended)	
> 	owns: OpenEjbContainerControl  (id=44)	
> 	DeploymentsResolver.processUrls(String, List<URL>, ClassLoader, Set<RequireDescriptors>,
List<URL>) line: 341	
> 	DeploymentsResolver.loadFromClasspath(ClassLoader) line: 255	
> 	ConfigurationFactory.getModulesFromClassPath(List<File>, ClassLoader) line: 697

> 	ConfigurationFactory.getOpenEjbConfiguration(Openejb) line: 574	
> 	ConfigurationFactory.getOpenEjbConfiguration() line: 626	
> 	Assembler.getOpenEjbConfiguration() line: 485	
> 	Assembler.build() line: 464	
> 	OpenEJB$Instance.<init>(Properties, ApplicationServer) line: 151	
> 	OpenEJB$Instance.<init>(Properties) line: 67	
> 	OpenEJB.init(Properties, ApplicationServer) line: 308	
> 	OpenEJB.init(Properties) line: 279	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native
method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
> 	Method.invoke(Object, Object...) line: 483	
> 	OpenEJBInstance.init(Properties) line: 36	
> 	LocalInitialContextFactory.init(Properties) line: 98	
> 	LocalInitialContextFactory.init(Hashtable) line: 62	
> 	LocalInitialContextFactory.getInitialContext(Hashtable) line: 46	
> 	NamingManager.getInitialContext(Hashtable<?,?>) line: 684	
> 	InitialContext.getDefaultInitCtx() line: 313	
> 	InitialContext.init(Hashtable<?,?>) line: 244	
> 	InitialContext.<init>(Hashtable<?,?>) line: 216	
> 	OpenEjbContainerControl.boot(Map<?,?>) line: 102	
> 	CdiTestRunner$ContainerAwareTestContext.applyBeforeClassConfig(Class) line: 463	
> 	CdiTestRunner$BeforeClassStatement.evaluate() line: 366	
> 	CdiTestRunner$AfterClassStatement.evaluate() line: 393	
> 	CdiTestRunner(ParentRunner<T>).run(RunNotifier) line: 363	
> 	CdiTestRunner.run(RunNotifier) line: 142	
> 	JUnit4TestReference.run(TestExecution) line: 86	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 459	
> 	RemoteTestRunner.runTests(TestExecution) line: 675	
> 	RemoteTestRunner.run() line: 382	
> 	RemoteTestRunner.main(String[]) line: 192	
> {code}
>  final Class<? extends DeploymentModule> moduleType = deploymentLoader.discoverModuleType(url,
classLoader, requireDescriptors);
>             
> The moduleType becomes a "WebModule" and is no longer considered in the subsequent if
statement. 
>    if (AppModule.class.isAssignableFrom(moduleType) ||
>                         EjbModule.class.isAssignableFrom(moduleType) ||
>                         PersistenceModule.class.isAssignableFrom(moduleType) ||
>                         ConnectorModule.class.isAssignableFrom(moduleType) ||
>                         ClientModule.class.isAssignableFrom(moduleType)) {
> As a consequence, the CDI container does not load any beans that are in my current project.

> I do start the unit test from Eclipse and M2E. So it does use classpath resolution from
my "target/classes" and "target/test-classes". 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message