Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1050987

Summary: Kie-spring cannot create KieModule in EWS 2.0.1 Tomcat 7
Product: [Retired] JBoss BRMS Platform 6 Reporter: Marek Winkler <mwinkler>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: etirelli, rrajasek, rzhang
Target Milestone: CR1Keywords: Regression
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:18:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Maven project with WAR illustrating the issue none

Description Marek Winkler 2014-01-09 13:17:53 UTC
Description of problem:

The following NPE is thrown, when Kie-spring tries to create KieModule on EWS 2 Tomcat 7:

java.lang.NullPointerException: null
	at java.io.File.<init>(File.java:277)
	at org.drools.compiler.kie.builder.impl.ClasspathKieProject.getPomProperties(ClasspathKieProject.java:228)
	at org.kie.spring.KModuleBeanFactoryPostProcessor.postProcessBeanFactory(KModuleBeanFactoryPostProcessor.java:93)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:653)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
	at org.jboss.qa.brms.test.SpringContainerTest.getApplicationContext(SpringContainerTest.java:46)
	at org.jboss.qa.brms.test.SpringContainerTest.getApplicationContext(SpringContainerTest.java:36)
	at org.jboss.qa.brms.bre.spring.EventListenersTest.getSession(EventListenersTest.java:81)
	at org.jboss.qa.brms.bre.spring.EventListenersTest.testProcessEventMemoryListener(EventListenersTest.java:66)

This is probably similar problem we had with EAP 6.1.1 (BZ 1036556).

Version-Release number of selected component (if applicable):

BRMS 6.0.0 ER7
EWS 2.0.1 Tomcat 7

How reproducible:

I tried to use the reproducer from BZ 1036556 for the start, but it needs to be tailored for EWS. I will prepare and attach the reproducer as soon as possible.

Actual results:

The NPE is thrown.

Expected results:

KieModule is created without errors.

Comment 1 Marek Winkler 2014-01-09 16:34:28 UTC
Created attachment 847730 [details]
Maven project with WAR illustrating the issue

Comment 2 Marek Winkler 2014-01-09 16:59:35 UTC
I have investigated the problem and found out that the issue is related to the location of pom.properties in the WAR which is being deployed onto EWS:

1. if the WAR contains pom.properties in META-INF/maven/groupId/artifactId/pom.properties file, kie-spring loads fine,

2. if the WAR contains pom.properties in WEB-INF/classes/META-INF/maven/groupId/artifactId/pom.properties, the above NPE is thrown and kie-spring fails to load the KieModule.

You can use the attached maven project to generate WAR for experiments - the WAR illustrates the first variant. If you just open it and move META-INF folder into WEB-INF/classes, you will get the NPE.

I am leaving this issue open for two reasons:

- the NPE should not happen - user should probably get more user-friendly message in the log,

- afaik, the META-INF directory can actually be located in a WAR in two places (/ and WEB-INF/classes) [1] - I suggest we support both locations to avoid potential problems for our users.

Having said that, I think that this issue might not necessarily be a blocker for 6.0.0.

[1] http://stackoverflow.com/questions/17997731/maven-war-has-meta-inf-folder-in-two-places

Comment 4 Marek Winkler 2014-01-23 18:47:39 UTC
Verified on BRMS 6.0.0 CR1.