Bug 856186
Summary: | NullPointerException when trying to deploy war on EAP 6 in domain mode using CLI and createPackageBackedResource method | |||
---|---|---|---|---|
Product: | [JBoss] JBoss Operations Network | Reporter: | bkramer <bkramer> | |
Component: | Plugin -- JBoss EAP 6, CLI | Assignee: | Jay Shaughnessy <jshaughn> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | |
Severity: | high | Docs Contact: | ||
Priority: | urgent | |||
Version: | JON 3.1.0 | CC: | fbrychta, hrupp, jshaughn, loleary, mazz, myarboro | |
Target Milestone: | --- | |||
Target Release: | JON 3.1.2 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | 856188 | |||
: | 856188 856819 (view as bug list) | Environment: | ||
Last Closed: | 2013-09-11 11:04: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: | 856819 | |||
Bug Blocks: |
Description
bkramer
2012-09-11 12:16:40 UTC
Please note that invoking the same operation from the UI, no error occurs. The problem fundamentally lies in the fact that the relevant rhq_package_version.file_name field is not set, and that downstream the AS7 plugin code assumes it is set, in BaseComponent.deployContent(). What needs to be determined is whether rhq_package_version.file_name should always be set or whether BaseComponent.deployContent() is making a false assumption. The rhq_package_version.file_name field is optional in the db and in the entity but I'm not sure if that is correct. Perhaps it should default to the package name. Then again, perhaps the accessing code should handle an unset fileName and use the package name. This works in the UI, and not in the CLI script above, because they take two different approaches to creating the PackageVersion that backs the resource. The ResourceFactoryManager.createPackageBackedResource() method provides only file bytes as the backing content (it does provide a packageName, though). The GUI first uploads the backing file, which allows initial PackageVersion creation while being able to provide file details, including the file name, since the file is actually provided by the upload. I'll need to discuss this with Stefan and maybe othrs to determine how we should approach the issue. As it stands now I don't see a workaround for the CLI, as there seems no way other than file upload to get the file_name set. I think it is by design that PackageVersion.filename cam be null. There really isn't any guarantee that the filename from which content is uploaded actually reflects anything valid about the content itself. It is the package name that must be unique, for example. Content for a package could feasibly be entered via a text box, for example. Or, the same filename could be used to upload content for multiple packages. After talking with Stefan my current feeling is that we should not change the way that the PackageVersion code is working, and the SLSB layer should stay the same. The plugin code should remove its dependence on the filename value, in favor of the package name. The question is whether there is some fundamental issue with that approach. By changing the plugin code only we avoid any unintended impact on users of the content system. And the patch is limited to a plugin upgrade. Note that although code has changed in the relevant plugin method between 310GA and Master, the reliance on filename remains. I will need to talk to Heiko about this and am requesting feedback from him... I don't recall details, but Stefan is currently the ultimate source in content stuff :) I think the requirement on filename came from the fact that in the UI you upload e.g. foo.war to and thus get foo.war passed as file name, which is then taken as name of the deployment without any need for further user interaction. I do not pretend that this is correct. Fixed upstream. cherry picked master commmit (123a951be3bd28161cdf7ccf3d45e59124d86489) : a6336be9a1c8859a5e511214cc4e01e417b62c4f Moving to ON_QA as available for test with build : https://brewweb.devel.redhat.com//buildinfo?buildID=244662. Verified on 3.1.2.ER2. Sucessfully deployed war using ResourceFactoryManager.createPackageBackedResource() |