Bug 1051585
Summary: | Kie-spring cannot create KieModule in container on Windows | ||
---|---|---|---|
Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Marek Winkler <mwinkler> |
Component: | BRE | Assignee: | Mario Fusco <mfusco> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Marek Winkler <mwinkler> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.0.0 | CC: | kmansoor, mwinkler, rrajasek, rzhang, vigoyal |
Target Milestone: | ER2 | Keywords: | Regression |
Target Release: | 6.0.1 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
When trying to deploy a Maven project with a WAR file on EAP6 in a Windows environment (2012 Server and Windows 8.1), the kie-spring throws a NullPointerException when trying to load KieModule. The deployment doesn't seem to raise any errors, but the server log shows the error and the WAR file is not actually deployed.
Cause:
Consequence:
Fix:
Result:
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2014-08-06 19:57:22 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1058254 | ||
Attachments: |
Description
Marek Winkler
2014-01-10 16:10:52 UTC
Created attachment 848278 [details]
server.log with NPE
Marek, just to be clear, does this problem also happens in other platforms (e.g. Linux) or only on Windows? The problem appears only on Windows (2012 Server and Windows 8.1 so far), for instance RHEL 6 and Solaris are ok. I suspect a problem with path separators but it is just a guess. By comparing the upstream log, this issue is not picked up in CR1 tag(sync.2014.01.14) and needs to flag to 6.0.1. The original NPE is fixed, but another problem remains: ClasspathKieProject fails to find pom.properties because it tries to locate it in a EAP module directory: (http-/127.0.0.1:8080-1) Unable to load pom.properties from/w:/workspace/brms-bre-container-matrix-jvm-os/36a0f575/jboss-eap-6.1/modules/system/layers/base/sun/jdk/main/service-loader-resources/ and not in the deployed application. Subsequently, the resources for KieBases defined in spring context cannot be found: 03:33:51,520 WARN [org.drools.compiler.kie.builder.impl.AbstractKieModule] (http-/127.0.0.1:8080-1) No files found for KieBase kbaseDRL, searching folder \workspace\brms-bre-container-matrix-jvm-os\36a0f575\jboss-eap-6.1\modules\system\layers\base\sun\jdk\main\service-loader-resources Please see the attached server.log part for details (it comes from our test suite, not the reproducer attached). I will verify that the reproducer illustrates this (as soon as I can get to a Windows machine) and attach a new reproducer, if necessary. Created attachment 865581 [details]
server.log part illustrating searching wrong directory for pom.properties
Part of server.log illustrating the problem on our test suite. I will attach the log corresponding to a simpler reproducer as soon as possible.
Created attachment 865889 [details]
Maven project with reproducer updated to ER1
Adding maven project with reproducer updated to ER1. Just build it, deploy onto EAP 6.1.1 on Windows and see server.log.
Created attachment 865938 [details]
server.log from deploying the ER1 reproducer on Windows
This behavior is also true for: Ubuntu 12.4 Kie 6.0.1 Tomcat 7. java.lang.NullPointerException 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) This problem started appearing when we migrated from EAP 6.1.0 to EAP 6.1.1. In EAP 6.1.0 when I tried to retrieve the root of the application context path with: applicationContext.getResource("classpath:/").getURL(); I got something like: vfs:/content/kie-spring-war-1.0.0-SNAPSHOT.war/WEB-INF/classes/ Conversely on EAP 6.1.1 that same statement returns something like: file:/opt/jboss/modules/system/layers/base/sun/jdk/main/service-loader-resources/ that doesn't make any sense (under my point of view). What I did to workaround this problem was getting the moduleName from the ModuleClassLoader and artificially recreating the url I got on EAP 6.1.0 with: new URL("vfs:/content/" + moduleName + "/WEB-INF/classes/") However as reported with this ticket this solution worked on linux but not on Windows. Now I've found a more robust way to obtain the correct vfs url. In particular doing: getClass().getClassLoader().getResources("/") returns an enumaration having as first element the usual meaningless url: file:/opt/jboss/modules/system/layers/base/sun/jdk/main/service-loader-resources/ Nevertheless iterating this enumeration it is possible to retrieve the correct url in one of its subsequent element. I tested that the vfs url retrieved in this way is correct on both linux and Windows. Please pardon my ignorance if I missed the point. It seems as though this issue was perceived to be only affecting Windows. This is not correct, I am getting this exception on Ubuntu, so It is Linux & Windows. My environment: Ubuntu 12.04.4 LTS Drools: 6.0.1 Spring 4.0 Verified that this issue has been fixed in BRMS 6.0.1 ER2 when running on Windows. Kamal, could you verify this in your Ubuntu environment, and create a separate JIRA for this if it did not work? The reason is that I cannot replicate your issue in any of the supported configurations for BRMS. Thanks a lot for reporting this! Please drop me an email, if you needed further information. |