Bug 1207368

Summary: NullPointerException from Hello example (hello.properties file missing)
Product: Red Hat Enterprise MRG Reporter: Irina Boverman <iboverma>
Component: qpid-javaAssignee: Irina Boverman <iboverma>
Status: CLOSED ERRATA QA Contact: Jiri Prajzner <jprajzne>
Severity: medium Docs Contact:
Priority: medium    
Version: DevelopmentCC: esammons, iboverma, jprajzne, jross, messaging-bugs, messaging-qe-bugs, mtoth, pematous, zkraus
Target Milestone: 3.2Keywords: Regression, WorkAround
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-java-0.30-7 Doc Type: Bug Fix
Doc Text:
Previously the `hello.properties` file was located in `org/apache/qpid/example` (together with the example sources) and the binaries were compiled to the same location. Starting with MRG-3.1, the source and hello.properties location was changed to src/main/java/org/apache/qpid/example/ while the compiled binaries were still saved to the old location. This caused the Hello example to not be able to read the `hello.properties` file and resulted in a NullPointerException. The bug fix permanently moves the java source for examples into `/examples/org` instead of `examples/src/main/java/org` which puts the content back into the correct classpath context for the example start script. This corrects the workaround present in https://bugzilla.redhat.com/show_bug.cgi?id=1206503[BZ#1206503].
Story Points: ---
Clone Of: 1206503 Environment:
Last Closed: 2015-10-08 13:10: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:

Comment 2 Rajith Attapattu 2015-04-28 16:18:58 UTC
The solution to this is to adjust the paths in the rpm structure accordingly

Comment 3 Rajith Attapattu 2015-04-28 17:59:39 UTC
The hello.properties is loaded via the classpath.
Therefore it needs to be within a jar file (where Hello.java code is packaged) or in a path where Hello.java is compiled to when run_example.sh is executed.

This is best handled by whoever is creating the rpms as run_example.sh is a rpm specific artifact and not present in upstream.

I haven't been creating rpms for a while and therefore,
1. It would be faster for the maintainer to handle this, as I will have to re-orient myself with the new setup.

2. I don't know the reason why the structure was changed. Therefore this change is best handled with the person who changed the paths to figure out why it was done.

If assistance is required, I'm happy to help.

Comment 6 Jared MORGAN 2015-07-20 00:10:52 UTC
Hi Irina.

I've created a release note for this because it corrects a Known Issue from the previous z-stream. Let me know if the wording is OK, bearing in mind the material change was to move files around, and that particular comment was set to private.

Comment 7 Jiri Prajzner 2015-07-23 13:07:13 UTC
List of installed packages:
yum list installed "*qpid-java*"
qpid-java-client.noarch 0.32-2
qpid-java-common.noarch 0.32-2
qpid-java-example.noarch 0.32-2

yum list installed "*openjdk*"
java-1.7.0-openjdk 1:1.7.0.75-2.5.4.2
java-1.7.0-openjdk-devel 1:1.7.0.75-2.5.4.2
java-1.7.0-openjdk-headless 1:1.7.0.75-2.5.4.2

Platforms:
i686, x86_64

RHELs:
6.7, 7.1

Comment 11 Jiri Prajzner 2015-09-02 13:03:11 UTC
List of installed packages:
yum list installed "*qpid-java*"
qpid-java-client.noarch 0.30-7
qpid-java-common.noarch 0.30-7
qpid-java-example.noarch 0.30-7

Platforms:
i686, x86_64

RHELs:
6.7, 7.1

Comment 13 errata-xmlrpc 2015-10-08 13:10:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-1879.html