Yeah I tried something similar, but did not work still the same error.
Main Topics
Browse All TopicsHi,
I'm trying to write an application to run on app startup to lad values from XML file to
static java members. When I try to invoke a static java method with a primitive boolean
as parameter it fails with the below stacktrace.
Root element of the doc is configuration
Total no of classes : 3
Class Name : com.tsswireless.applicatio
Variable :refPointX value :31.14 type :java.lang.Double
setRefPointX
Variable :refPointY value :108.36 type :java.lang.Double
setRefPointY
Variable :speedMatrixID value :01 type :java.lang.String
setSpeedMatrixID
Class Name : com.tsswireless.applicatio
Variable :addressInfoFlag value :1 type :boolean
java.lang.NullPointerExcep
at sun.reflect.NativeMethodAc
at sun.reflect.NativeMethodAc
at sun.reflect.DelegatingMeth
at java.lang.reflect.Method.i
at com.tsswireless.applicatio
The XML file is :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<class>
<name>com.tsswireless.appl
<variable>
<name>refPointX</name>
<value>31.14</value>
<type>java.lang.Double</ty
</variable>
<variable>
<name>refPointY</name>
<value>108.36</value>
<type>java.lang.Double</ty
</variable>
<variable>
<name>speedMatrixID</name>
<value>01</value>
<type>java.lang.String</ty
</variable>
</class>
<class>
<name>com.tsswireless.appl
<variable>
<name>addressInfoFlag</nam
<value>1</value>
<type>boolean</type>
</variable>
<variable>
<name>loadInfoFlag</name>
<value>1</value>
<type>boolean</type>
</variable>
</class>
<class>
<name>com.tsswireless.appl
<variable>
<name>directDistanceRatio<
<value>23.45</value>
<type>java.lang.Double</ty
</variable>
</class>
</configuration>
How do I resolve this? Also, is this the best way to do it? I'm trying to dynamically load values from the XML file. With this approach just creatign the java classes
and mentioning the package path should be good enough to load the values into the app.
Thanks,
Raja
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Resolved the issue. The problem was the Class methods that werebeing invoked were not marked static.
And the invoke call is being passed a null value. For non - static members an instance of the class is supposed to be passed,
for static members null is to be used.
Thanks for your help on this.
Thanks,
Rama
Business Accounts
Answer for Membership
by: TimYatesPosted on 2009-08-18 at 07:24:03ID: 25123551
Have you tried using Boolean.TRUE and Boolean.FALSE when setting the value?
Select allOpen in new window