Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Cewolf dataset producer returns the error java.land.NullPointerException

Posted on 2006-05-18
2
Medium Priority
?
595 Views
Last Modified: 2012-05-05
java.lang.NullPointerException

The following lines produced a severe error:
        for (int m = 0; m < arrayLength; m++) {
            l = subailmentsOccurance[m];
            // hbDataset.setValue(new Integer(l), subailments[i], chartCategories[j]);
            hbDataset.addValue(new Integer(l), subailments[m], chartCategories[j]);
        }

SEVERE ERROR:
CewolfServlet: your producer of type de.laures.cewolf.pandemicMonitorCharts.ChartsBean1 produced a null dataset.

I'm sure the arrays referred to contain values since
        j = 0;
        for (int m = 0; m < arrayLength; m++) {
            System.out.print(+m);
            System.out.print("\t\t");            
            System.out.print("Subailment: ");
            System.out.print("\t\t");
            System.out.print(subailments[m]);
            System.out.print("\t\t\t");            
            System.out.print(+ subailmentsOccurance[m]);
            System.out.print("\t\t");
            System.out.print(chartCategories[j]);
            System.out.println();
        }
gives:
0      Subailment:       none                 1           SUB-AILMENTS
1      Subailment:       other                  1            SUB-AILMENTS
2      Subailment:       tuberculosis       8      SUB-AILMENTS
3      Subailment:       pneumonia      1      SUB-AILMENTS

Where could the problem lie?
0
Comment
Question by:Rrugemalira
2 Comments
 
LVL 6

Accepted Solution

by:
avinthm earned 440 total points
ID: 16716713
Hi ,
> hbDataset.addValue(new Integer(l), subailments[m], chartCategories[j]);
i think this is throwing the exception.
hbDataset should be null.
add this statement as the first line of for loop
System.out.println(hbDataset);

if it prints null then .....try to allocate memory to it.

cheers
0
 

Author Comment

by:Rrugemalira
ID: 16718844
Thanks for the advise avinthm,
When I was getting the error I had the statement:
DefaultCategoryDataset hbdataset = new;

I have changed it to:
DefaultCategoryDataset hbDataset = new DefaultCategoryDataset();

and hbDataset is no longer null.


0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this step by step method when setting up QuickBooks Online. They will allow you to explore the various features of the advanced settings available to you.
Herein one will find an aggregate of some of my experience building and deploying virtualization stacks both in standalone, clustered Hyper-V, clustered Hyper-V with a Scale-Out File Server (SOFS) backend, and Storage Spaces Direct (S2D).
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question