You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Javier Kohen <ja...@buddystream.com> on 2004/12/13 22:22:30 UTC

[launcher] NullPointerException using sysproperty

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

I'm trying to set some system properties from the launcher. I plan to
use the same launcher for several applications, all of which depend on
the same system properties, therefore I wanted to avoid duplicating the
system properties; specially because the properties should be user
modifiable.

I first tried to create a system.property file that I would attempt to
load directly from the project element in launcher.xml -- then I
realized that the file attribute of the sysproperty tag indicates that
the value represents a file name and not a file to read.

My second approach was defining the system properties inline in the
launcher.xml file. The problem is that when I try to reference this from
the project.launcher.syspropertyset element I get a
NullPointerException. Setting the same properties directly inside the
project.launcher.syspropertyset works fine. See below.

Here's the fragment that causes the NPE:

<syspropertyset id="system.properties">
~  <sysproperty key="org.xml.sax.driver"
value="org.apache.xerces.parsers.SAXParser"/>
</syspropertyset>

<target ..>
~  <launch ..>
~    [..]
~    <syspropertyset>
~      <sysproperty refid="system.properties"/>
~    </syspropertyset>
~  </launch>
</target>

While this one works:
<target ..>
~  <launch ..>
~    [..]
~    <syspropertyset>
~      <sysproperty key="org.xml.sax.driver"
value="org.apache.xerces.parsers.SAXParser"/>
~    </syspropertyset>
~  </launch>
</target>

There is no stack trace printed along with the NPE. I tested on Linux
with JDKs 1.4.2 and 5.0.

Thanks,
- --
VP Of Technology: Javier Kohen

BuddyStream Technologies

http://www.buddystream.com/

PHONE : 1-(313)-581-4899
FAX : 1-(313)-581-4899


This message is intended only for the individual or entity to which it
is addressed. It may contain privileged, confidential information
which is exempt from disclosure under applicable laws. If you are not
the intended recipient, please note that you are strictly prohibited
from disseminating or distributing this information (other than to the
intended recipient) or copying this information. If you have received
this communication in error, please notify us immediately by E-mail or
by telephone at 1-(313)-205-3982.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBvggW823633cP2P8RAp67AJwO24pNON92JqFsvOhiXW9ZkxTQKACeMmTQ
Msi5XynbJxvvjqNUiGP8UYA=
=OslV
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [launcher] NullPointerException using sysproperty

Posted by Javier Kohen <ja...@buddystream.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi again,

Hmmm... my fault. Read below.

Javier Kohen wrote:
|
| Hi,
|
| I'm trying to set some system properties from the launcher. I plan to
| use the same launcher for several applications, all of which depend on
| the same system properties, therefore I wanted to avoid duplicating the
| system properties; specially because the properties should be user
| modifiable.

[..]

| My second approach was defining the system properties inline in the
| launcher.xml file. The problem is that when I try to reference this from
| the project.launcher.syspropertyset element I get a
| NullPointerException. Setting the same properties directly inside the
| project.launcher.syspropertyset works fine. See below.

[..]

I found out that I was supposed to use a syspropertyset element to refer
the ID instead of a sysproperty. Still a gracefully error would be
helpful. I step traced the NullPointerException to somewhere within
org.apache.commons.launcher.LaunchTask.execute(), but I'm not sure if
the bug is there or just in ant, as I'm pretty new to ant & friends.

Thanks to all who at least read my original post,

- --
VP Of Technology: Javier Kohen

BuddyStream Technologies

http://www.buddystream.com/

PHONE : 1-(313)-581-4899
FAX : 1-(313)-581-4899


This message is intended only for the individual or entity to which it
is addressed. It may contain privileged, confidential information
which is exempt from disclosure under applicable laws. If you are not
the intended recipient, please note that you are strictly prohibited
from disseminating or distributing this information (other than to the
intended recipient) or copying this information. If you have received
this communication in error, please notify us immediately by E-mail or
by telephone at 1-(313)-205-3982.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBvlEC823633cP2P8RAhcyAJ9jB5zQnwv2LS3VG/LgaGgzIIBk+QCeLQmA
TMv2MuNedGXhbxqvJ+7F2bg=
=mjg6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org