Ng-admin menu links to listView not working with backend

I have an ng-admin application with java backend. After setting an entity i want to add menu tab clicking on which it should follow me to list view also it changes url, for example ('localhost:3000/dashboard -> localhost:3000/users/list'). Instead of that it change url like this ('localhost:3000/dashboard -> localhost:3000/dashboard#%20users%20list') and nothing happens.

Ui-router states are as easy as this:

  // For any unmatched url, redirect to /
    $urlRouterProvider.otherwise("/");

    // Now set up the states
    $stateProvider
        .state('/', {
            parent: 'ng-admin',
            url: "/",
        })
        .state('login', {
            url: "/login",
            templateUrl: loginTemplate,
            controller: 'LoginController',
            controllerAs: 'vm'
        })
    ;

Java url mapping is
@RequestMapping("**/{path:[^\.]*}")
public String index() {
return "redirect:/";
}

I add menu as written in docs for ng-admin:

var admin = nga.application('myAdm') // application main title
        .debug(false) // debug disabled
        .baseApiUrl('/api/'); // main API endpoint
    var users = nga.entity('users')
        .label('Users')
        .baseApiUrl('/api/users/');

    // set the application entities
    admin
        .addEntity(users);
    //and here is the trouble part
    admin.menu(nga.menu()
        .addChild(nga.menu(users)
            .title('Admin users')
            .icon('<i class="fa fa-user-secret"></i>')
        )

Also as i found it generate link in menu html like <a href="#users"></a>
Any ideas how to make it work?

‘java.util.List com.dropbox.client2.DropboxAPI$Entry.contents’ on a null object reference

I have an android application which has been working perfectly until now. Recently, I’m having an error regarding the dropbox download. I’ve been using this app and the dropbox download for months but I never had this error yet. I tried to solve it but I found nothing similar. Is something wrong with dropbox or I made some mistake?

Thanks very much in advance!

public void downAndLoad() {
AsyncTask<String, Void, Void> asyncTask = new AsyncTask<String, Void, Void>() {
        @Override@Override
        protected Void doInBackground(String... strings) {

            AndroidAuthSession session = null;
            try {
                session = buildSession();
            } catch (DropboxException e) {
                e.printStackTrace();
            }
            dropboxAPI = new DropboxAPI<>(session);
            String[] fnames = null;
            DropboxAPI.Entry dirent = null;
            try {
                dirent = dropboxAPI.metadata("/", 1000, null, true, null);
            } catch (DropboxException e) {
                e.printStackTrace();
            }
        }

            ArrayList<DropboxAPI.Entry> files = new ArrayList<DropboxAPI.Entry>();
            ArrayList<String> dir = new ArrayList<String>();


            int i = 0;
            for (DropboxAPI.Entry ent : dirent.contents) {
                files.add(ent);// Add it to the list of thumbs we can choose from
                //dir = new ArrayList<String>();
                dir.add(files.get(i++).path);
            }

            fnames = dir.toArray(new String[dir.size()]);           

Error:

10-01 00:31:08.963 11769-11961/com.example.brobert.tonda E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
                                                                        Process: com.example.brobert.tonda, PID: 11769
                                                                        java.lang.RuntimeException: An error occurred while executing doInBackground()
                                                                            at android.os.AsyncTask$3.done(AsyncTask.java:318)
                                                                            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
                                                                            at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
                                                                            at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                                            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                                            at java.lang.Thread.run(Thread.java:762)
                                                                         Caused by: java.lang.NullPointerException: Attempt to read from field 'java.util.List com.dropbox.client2.DropboxAPI$Entry.contents' on a null object reference
                                                                            at com.example.brobert.tonda.dldb_lp$1.doInBackground(dldb_lp.java:149)
                                                                            at com.example.brobert.tonda.dldb_lp$1.doInBackground(dldb_lp.java:126)
                                                                            at android.os.AsyncTask$2.call(AsyncTask.java:304)
                                                                            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) 
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
                                                                            at java.lang.Thread.run(Thread.java:762) 

Java Convert Long to Currency, Why is there 1 cent difference and What’s the safe way to convert such long to currency? [duplicate]

This question already has an answer here:

Following is my code to convert long (cents) to dollar, however, there is 1 cent difference.

My expected answer is: $123,456,789,123,456.47, but the output is $123,456,789,123,456.48

public static void main(String[] args) {
    long l = 12345678912345647L;    
    double d = l / 100.00;
    NumberFormat formatter = NumberFormat.getCurrencyInstance();
    System.out.println(formatter.format(d));
}

Cant connect postgresql database with angular 4 via java

I hava postgresql database and then i connect it to java model all was good and working. After that i try use Angular 4 to create UI of my application, but something wrong and then i start the application, i see just button “Show more goods!” without first md-card.In browser i dont have error. If someone see what i do wrong please say it to me.(sorry for my bad english).

GoodsController.java(without show import)

@RestController
public class GoodsController {
private static Logger logger = (Logger) 
LoggerFactory.getLogger(GoodsController.class.getName());

private final GoodsService goodsService;

@Autowired
public GoodsController(GoodsService goodsService) {
    this.goodsService = goodsService;
}

@RequestMapping(value = "/goods/all", method = RequestMethod.GET)
public ResponseEntity<?> findAll() {
    logger.info("Getting all goods");
    List<Goods> resultList = goodsService.findAll();
    return new ResponseEntity<List<Goods>>(resultList, HttpStatus.OK);
}
}

goods.component.ts

import {Component, Inject, OnInit} from "@angular/core";
import {GoodsServiceImpl} from "../service/igoods.service";
import {Goods} from "../model/goods";

@Component({
    selector: 'goods',
    templateUrl: '../../assets/html/goods.component.html',
    styleUrls: ['../../assets/style/goods.component.css']
})
export class GoodsComponent implements OnInit {

goods: Goods[];

constructor(@Inject('goodsService') private goodsService: GoodsServiceImpl) 
{

}

ngOnInit(): void {
    this.findAll();
}

findAll(): void {
    this.goodsService.findAll()
        .subscribe((goods: Goods[]) => this.goods = goods),
            (error => alert(error.message));
}
}

goods.service.ts

import {Injectable} from "@angular/core";
import {Headers, Http, RequestOptions, Response, URLSearchParams} from 
"@angular/http";
import "rxjs/add/operator/toPromise";
import {Observable} from "rxjs";
import {GoodsServiceImpl} from "../igoods.service";
import {Goods} from "../../model/goods";

const ALL_GOODS_PATH = 'api/goods/all';
const ONE_GOODS_PATH = 'api/goods';

@Injectable()
export class GoodsService implements GoodsServiceImpl {

constructor(private http: Http) {
}

findAll(): Observable<Goods[]> {
    return this.http.get(ALL_GOODS_PATH)
        .map((response: Response) => {
            response.json()
        })
        .catch((error: any) => Observable.throw(error));
}

goods.component.html

<md-card *ngFor='let oneGoods of goods'>
<md-card-title>{{oneGoods.title}}</md-card-title>
<img md-card-image src='/assets/image/001.jpeg' alt='picture'>
<div class='card-footer' color='primary'>
    <md-card-content>{{oneGoods.description}}</md-card-content>
    <button md-raised-button color='primary' [routerLink]='["/goods", 
oneGoods.id]'>Read more...</button>
</div>
</md-card>
<md-card>
<button md-raised-button color='primary'>Show more goods!</button>
</md-card>

igoods.service.ts

import {Observable} from "rxjs";
import {Goods} from "../model/goods";

export interface GoodsServiceImpl {

findAll(): Observable<Goods[]>;

getOne(id: number): Observable<Goods>;

save(goods: Goods): Observable<Goods>;
}

goods.ts

import Cities from './cities';
import {Users} from './user';
import Categories from './categories';


export class Goods {
  id: number;
  title: string;
  description: string;
  city: Cities;
  author: Users;
  price: number;
  created_date: Date = new Date();
  category: Categories;
}

Latencies issues which G1GC

I am facing a continues increase in GC pauses with G1GC algorithm. The service latencies continue to grow over time.
Once this happens, i restart my service and the latencies go back to normal. Post startup, the latencies again continue to increase over time.

At the time of startup, the service latencies are around ~200ms, but within 24 hours, they go up to 350ms, and continue to increase in a linear fashion.

The increase in service latencies match the increase in GarbageCollection metrics.

Service specifications –

I am running a java application (JDK-8) on M4-2X large boxes with 50 active threads per box. Service runs at an 12GB heap. The average latency of a request is about 250ms, and the rate of incoming requests is about ~20 per second per box.

G1G1 configurations –

        <jvmarg line="-Xms12288M"/>
        <jvmarg line="-Xmx12288M"/>

        <jvmarg line="-verbose:gc" />
        <jvmarg line="-XX:+UseG1GC"/>
        <jvmarg line="-XX:+PrintGCDetails" />
        <jvmarg line="-XX:+PrintGCTimeStamps" />
        <jvmarg line="-XX:+PrintTenuringDistribution" />
        <jvmarg line="-XX:+PrintGCApplicationStoppedTime" />
        <jvmarg line="-XX:MaxGCPauseMillis=250"/>
        <jvmarg line="-XX:ParallelGCThreads=20" />
        <jvmarg line="-XX:ConcGCThreads=5" />
        <jvmarg line="-XX:-UseGCLogFileRotation"/>

GC logs –

79488.355: Total time for which application threads were stopped: 0.0005309 seconds, Stopping threads took: 0.0000593 seconds
79494.559: [GC pause (G1 Evacuation Pause) (young)
Desired survivor size 369098752 bytes, new threshold 15 (max 15)
- age   1:   64725432 bytes,   64725432 total
- age   2:    8867888 bytes,   73593320 total
- age   3:    2503592 bytes,   76096912 total
- age   4:     134344 bytes,   76231256 total
- age   5:    3729424 bytes,   79960680 total
- age   6:     212000 bytes,   80172680 total
- age   7:     172568 bytes,   80345248 total
- age   8:     175312 bytes,   80520560 total
- age   9:     282480 bytes,   80803040 total
- age  10:     160952 bytes,   80963992 total
- age  11:     140856 bytes,   81104848 total
- age  12:     153384 bytes,   81258232 total
- age  13:     123648 bytes,   81381880 total
- age  14:      76360 bytes,   81458240 total
- age  15:      63888 bytes,   81522128 total
, 2.5241014 secs]
   [Parallel Time: 2482.2 ms, GC Workers: 20]
      [GC Worker Start (ms): Min: 79494558.9, Avg: 79494567.4, Max: 79494602.1, Diff: 43.2]
      [Ext Root Scanning (ms): Min: 0.0, Avg: 140.9, Max: 2478.3, Diff: 2478.3, Sum: 2818.8]
      [Update RS (ms): Min: 0.0, Avg: 5.3, Max: 41.9, Diff: 41.9, Sum: 106.9]
         [Processed Buffers: Min: 0, Avg: 23.2, Max: 80, Diff: 80, Sum: 465]
      [Scan RS (ms): Min: 0.1, Avg: 0.2, Max: 0.4, Diff: 0.3, Sum: 4.1]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.4]
      [Object Copy (ms): Min: 0.0, Avg: 41.9, Max: 68.7, Diff: 68.7, Sum: 837.9]
      [Termination (ms): Min: 0.0, Avg: 2282.3, Max: 2415.8, Diff: 2415.8, Sum: 45645.3]
         [Termination Attempts: Min: 1, Avg: 21.5, Max: 68, Diff: 67, Sum: 430]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.2, Diff: 0.1, Sum: 1.0]
      [GC Worker Total (ms): Min: 2435.8, Avg: 2470.7, Max: 2482.0, Diff: 46.2, Sum: 49414.5]
      [GC Worker End (ms): Min: 79497037.9, Avg: 79497038.1, Max: 79497041.0, Diff: 3.1]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 0.9 ms]
   [Other: 40.9 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 37.7 ms]
      [Ref Enq: 0.8 ms]
      [Redirty Cards: 0.4 ms]
      [Humongous Register: 0.1 ms]
      [Humongous Reclaim: 0.1 ms]
      [Free CSet: 1.3 ms]
   [Eden: 5512.0M(5512.0M)->0.0B(4444.0M) Survivors: 112.0M->128.0M Heap: 8222.2M(12.0G)->2707.5M(12.0G)]
 [Times: user=19.63 sys=0.18, real=2.53 secs]
79497.083: Total time for which application threads were stopped: 2.5252654 seconds, Stopping threads took: 0.0000914 seconds

I am looking for some help with GC configurations. On the basis of my reading, i am planning to increase the number of parallel threads to 32, set G1HeapRegionSize to 16M, and set ConcGCThreads = 8.

Synchronize client data by java message service

I am creating a Bookmanager java project,there are one more clients running at the same time, then all changes made by one client(s) are synchronized to other clients too. E.g: there are 3 clients (A, B and C) running at the same time, if client A adds a new book, then the new book is automatically added to the book list on the GUI of 2 other clients (B and C). How do I do it using Java Message Service.

Google App Script Authorization error for Java

I was able to send a string from App Script to Java Application using
a single function. For instance:

function returnText() {
  return "Hello"; 
}

Java application is able to print the string to a command line.

However, when I add multiple functions to Google App Script, I get an
authorization error. Please see the error below:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 401
Unauthorized

How can I solve this problem?

My public class isn’t declared within the program

With the program below I had created, it won’t allow me to run it as it claims that the class is public and should be declared. How can I fix it so that I can run my program successfully. Thanks

code :

public class DogTest {
    public static void main(String args[]){ // this is the beginning of the methd 
        Dog dog1= new Dog();
        dog1.name = "Bart";
        dog1.size= 100;
        Dog[] myDogs = new Dog[2]; // here is where the array of the dogs begins and it has already set the position to 2 
        myDogs[0]= new Dog();
        // my dogs is a new class 
        myDogs[1]= dog1;
        myDogs[0].name="Fred";
      myDogs[0].size= 43;

Why does Hibernate JPA throw LazyInitialization exception when using getReference()?

I’m using Hibernate 5.2.11 as a JPA provider. I have an annotated class (PurchaseOrder) with another annotated class (Customer) as a field with a many-to-one relationship. BUT because the legacy code had the Customer and PO tables in different databases, I have a call to EntityManager’s getReference() in PurchaseOrder to return the Customer instance. I access these through a home-brewed class that uses Hibernate (details follow).
This is resulting in the following exception:

org.hibernate.LazyInitializationException: could not initialize proxy – no Session

I’ve been reading through the Hibernate, JPA and Java EE docs, but haven’t been able to puzzle out what I’m doing wrong. I know that Hibernate is using a Session behind the scenes to enable JPA capabilities, but when I access .getCustomer(), I’m creating a new EntityManager, so it should have the session it needs.

It’s plain that I’m missing a crucial bit of understanding, but I have no idea what it is. Can anyone enlighten me?

Here is the significant part of Purchase Order, which consists of Strings, Integers, Booleans and LocalDates (ie: they’re all @Basic fields), and Customer as the only contained class:

@Entity
@Table(name = "PurchaseOrder")
public class PurchaseOrder extends BaseEntity { // BaseEntity is a @mappedSuperclass containing the primary key info only.
...
    private Integer customerID;
    private Customer customer;
...
    @Column(name = "customerID")
    public Integer getCustomerID() {
        return customerID;
    }

    public void setCustomerID(Integer customerID) {
        this.customerID = customerID;
    }

    @Transient
    public Customer getCustomer() {
        LOG.info("Getting customer #{}", customerID);
        if (customerID != 0 && (customer == null || !customerID.equals(customer.getId()))) {
            customer = VdtsSysDB.getDB().get(Customer.class, customerID);
        }
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
        this.customerID = customer.getId();
    }
...

And this is Customer, which consists only of @Basic fields:

@Entity
@Table(name = "Customers")
public class Customer extends BaseEntity{
    private String custNo;
    private String businessName;
    private String contact;
...
    @Column(name = "custNo")
    public String getCustNo() {
        return custNo;
    }

    public void setCustNo(String custNo) {
        this.custNo = custNo;
    }

    @Column(name = "Name")
    public String getBusinessName() {
        return businessName;
    }

    public void setBusinessName(String businessName) {
        this.businessName = businessName;
    }

    @Column(name = "Contact")
    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }
    ...

This is my Hibernate utility class:

public class VdtsSysDB {
    private EntityManagerFactory entityManagerFactory;
    private static VdtsSysDB vdtsSysDB;

    public static VdtsSysDB getDB() {
        if (vdtsSysDB == null) {
            vdtsSysDB = new VdtsSysDB();
        }
        return vdtsSysDB;
    }

    private VdtsSysDB() {
        if (entityManagerFactory == null)
            entityManagerFactory = Persistence.createEntityManagerFactory("VDTS_SYSDB");
    }

    public EntityManager getEntityManager() {
        return entityManagerFactory.createEntityManager();
    }

    public void closeEntityManager(EntityManager entityManager) {
        try {
            entityManager.close();
        } catch (Exception e) {
            // Exception logging.
        }
    }
...
    /**
     * Issues an HQL Query and returns the results as a list.
     *
     * @param queryString - An HQL query.
     * @return A list of items representing the returned dataset.
     */
    public <T extends BaseEntity> List<T> query(String queryString) {
        List<T> results = null;
        LOG.info("Query: {}", queryString);
        EntityManager entityManager = null;
        try {
            entityManager = getEntityManager();
            results = entityManager.createQuery(queryString).getResultList();
            entityManager.close();
            LOG.info("Returned {} results.", results.size());
        } catch (Exception e) {
            if (entityManager != null && entityManager.isOpen()) entityManager.close();
            LOG.error("Unable to complete query {}.", queryString, e);
        }
        return results;
    }

    /**
     * Get an object from the database by specifying its class and its ID.
     * @param aClass the class type to be returned.
     * @param id the primary key to the item to be returned.
     * @param <T> the class type to be returned.
     * @return A single instance of the specified item of this class.
     */
    public <T extends BaseEntity> T get(Class aClass, Integer id) {
        LOG.info("Get #: {}, {}", id, aClass.getName());
        T result = null;
        EntityManager entityManager = null;
        try {
            entityManager = getEntityManager();
            Object object = entityManager.getReference(aClass, id);
            result = (T) object;
        } catch (Exception e) {
            LOG.error("Could not get {}", id, e);
        } finally {
            closeEntityManager(entityManager);
        }
        return result;
    }
}

The code which throws the exception is part of a JavaFX 8 application controller. initialize() is called on class load, while refreshPane() is called whenever the attached GUI is displayed. The exception is thrown on the call to Customer.getBusinessName().

@FXML
private TableView<PurchaseOrder> poTable;
@FXML
private TableColumn<PurchaseOrder, String> poNoCol;
@FXML
private TableColumn<PurchaseOrder, String> customerNameCol;
@FXML
private TableColumn<PurchaseOrder, LocalDate> orderDateCol;

@Override
protected void initialize() {
    super.initialize();
    poTable.getSelectionModel().selectedItemProperty().addListener(
            (observable, oldValue, newValue) -> {
                if (newValue != null) selectItem();
            });
    poNoCol.setCellValueFactory(new PropertyValueFactory<>("purchaseOrderNo"));
    customerNameCol.setCellValueFactory(param -> {
        PurchaseOrder po = param.getValue();
        Customer customer = po.getCustomer();
        String name = customer.getBusinessName(); /****** This is the line that throws the exception ******/
        StringProperty observableString = new SimpleStringProperty(name);
        return observableString;
            });
    orderDateCol.setCellValueFactory(new PropertyValueFactory<>("orderDate"));    
...
}

@Override
protected void refreshPane() {
    List<Customer> oList = VdtsSysDB.getDB().query("from Customer");
    customerCombo.setItems(FXCollections.observableList(oList));
    changeTable();
    clearWidgets();
    enableWidgets(false);
}

private void changeTable() {
    poTable.getSelectionModel().clearSelection();
    List<PurchaseOrder> oList = VdtsSysDB.getDB()
            .query("from PurchaseOrder where closed = " + (openRadio.isSelected() ? "0" : "1"));
    poTable.setItems(FXCollections.observableList(oList));
}
...

The full stack trace of the exception:

30-09-17 19:42:05.137 ERROR java.lang.Throwable - Exception in thread "JavaFX Application Thread" org.hibernate.LazyInitializationException: could not initialize proxy - no Session
30-09-17 19:42:05.137 ERROR java.lang.Throwable -   at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:146)
30-09-17 19:42:05.138 ERROR java.lang.Throwable -   at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:259)
30-09-17 19:42:05.139 ERROR java.lang.Throwable -   at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:73)
30-09-17 19:42:05.139 ERROR java.lang.Throwable -   at ca.vdts.buchanan.model.Customer_$$_jvst799_9.getBusinessName(Customer_$$_jvst799_9.java)
30-09-17 19:42:05.139 ERROR java.lang.Throwable -   at ca.vdts.buchanan.endtally.controllers.POController.lambda$initialize$1(POController.java:103)
30-09-17 19:42:05.140 ERROR java.lang.Throwable -   at javafx.scene.control.TableColumn.getCellObservableValue(TableColumn.java:578)
30-09-17 19:42:05.140 ERROR java.lang.Throwable -   at javafx.scene.control.TableColumn.getCellObservableValue(TableColumn.java:563)
30-09-17 19:42:05.140 ERROR java.lang.Throwable -   at javafx.scene.control.TableCell.updateItem(TableCell.java:644)
30-09-17 19:42:05.141 ERROR java.lang.Throwable -   at javafx.scene.control.TableCell.indexChanged(TableCell.java:468)
30-09-17 19:42:05.141 ERROR java.lang.Throwable -   at javafx.scene.control.IndexedCell.updateIndex(IndexedCell.java:116)
30-09-17 19:42:05.141 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.TableRowSkinBase.updateCells(TableRowSkinBase.java:533)
30-09-17 19:42:05.141 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.TableRowSkinBase.init(TableRowSkinBase.java:147)
30-09-17 19:42:05.142 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.TableRowSkin.<init>(TableRowSkin.java:64)
30-09-17 19:42:05.142 ERROR java.lang.Throwable -   at javafx.scene.control.TableRow.createDefaultSkin(TableRow.java:212)
30-09-17 19:42:05.142 ERROR java.lang.Throwable -   at javafx.scene.control.Control.impl_processCSS(Control.java:872)
30-09-17 19:42:05.142 ERROR java.lang.Throwable -   at javafx.scene.Node.processCSS(Node.java:9058)
30-09-17 19:42:05.143 ERROR java.lang.Throwable -   at javafx.scene.Node.applyCss(Node.java:9155)
30-09-17 19:42:05.143 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.VirtualFlow.setCellIndex(VirtualFlow.java:1964)
30-09-17 19:42:05.143 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.VirtualFlow.getCell(VirtualFlow.java:1797)
30-09-17 19:42:05.143 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.VirtualFlow.getCellLength(VirtualFlow.java:1879)
30-09-17 19:42:05.144 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.VirtualFlow.computeViewportOffset(VirtualFlow.java:2528)
30-09-17 19:42:05.144 ERROR java.lang.Throwable -   at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1189)
30-09-17 19:42:05.144 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1087)
30-09-17 19:42:05.144 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.145 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.145 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.145 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.145 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.146 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.146 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.146 ERROR java.lang.Throwable -   at javafx.scene.Parent.layout(Parent.java:1093)
30-09-17 19:42:05.147 ERROR java.lang.Throwable -   at javafx.scene.Scene.doLayoutPass(Scene.java:552)
30-09-17 19:42:05.147 ERROR java.lang.Throwable -   at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
30-09-17 19:42:05.147 ERROR java.lang.Throwable -   at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:355)
30-09-17 19:42:05.147 ERROR java.lang.Throwable -   at java.security.AccessController.doPrivileged(Native Method)
30-09-17 19:42:05.148 ERROR java.lang.Throwable -   at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:354)
30-09-17 19:42:05.148 ERROR java.lang.Throwable -   at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:381)
30-09-17 19:42:05.148 ERROR java.lang.Throwable -   at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
30-09-17 19:42:05.148 ERROR java.lang.Throwable -   at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
30-09-17 19:42:05.149 ERROR java.lang.Throwable -   at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
30-09-17 19:42:05.149 ERROR java.lang.Throwable -   at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
30-09-17 19:42:05.150 ERROR java.lang.Throwable -   at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
30-09-17 19:42:05.150 ERROR java.lang.Throwable -   at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
30-09-17 19:42:05.150 ERROR java.lang.Throwable -   at java.lang.Thread.run(Thread.java:745)

Method is not applicable for its arguments

I am working on a program where it accepts user input and then asks the user to rate 5 issues. The program then displays all of the responses and calculates the total and average. It also displays the issue with the highest total rating and the corresponding issue.

I am trying to call two methods, but I get an error when I try to call the getMaximum and getMinimum methods and I don’t know what I’m doing wrong. How can I properly call the two methods?

And, how can I have the program display the highest total rating, rather than the highest single response?

public  static void  main(String[] args) {
     String[] issues = {"Chocolate","Vanilla","Strawberry","Brownie Fudge","Neapolitan"};



    Scanner input = new Scanner(System.in);

    System.out.println("Please enter the number of responses (up to 10): ");

    int num = input.nextInt();

    int[][] array = new int[num][issues.length];


    for (int count = 0; count < num; count++ ) {
        System.out.println("Enter response for person " + (count+1));
        for (int i = 0; i < issues.length; i++) {
            System.out.println(issues[i]);
            array[count][i] = input.nextInt();
                while (array[count][i] < 1 || array[count][i]>10) {
                    System.out.println("Error: Please input a response between 1-10.");
                    array[count][i] = input.nextInt();
                }
        }

    }

    for (int i = 0; i < issues.length; i++) {
        System.out.printf("%n"+issues[i],":");
        int rating = 0;
        for (int j = 0; j <num; j++) {
            System.out.printf("t"+array[j][i]);
            rating += array[j][i];
        }
        double average = ((double)rating)/num;
        System.out.printf("taverage: "+average);

        int total = 0;

        total = total + rating;
        System.out.printf("ttotal: " + total); 

    }

    getMinimum(array[num][issues.length]);  
    getMaximum(array[num][issues.length]);
    }



    public int getMinimum(int array[][]) {
    int minRating = array[0][0];
    for(int[] min : array) {
        for (int minRate : min) {
            if(minRate < minRating) {
            minRating += minRate;
            }
        }   
    }
    System.out.printf("%nThe lowest rating is  " + minRating + " points.");
    return minRating;
    }

    public int getMaximum(int[][] array) {
    int maxRating = array[0][0];
    for(int[] max : array) {
        for (int maxRate : max) {
            if (maxRate > maxRating) {
                maxRating = maxRate;
            }

        }               System.out.printf("%nThe highest rating is " + maxRating + " points. ");
    }
    return maxRating;

}

}