Exception in SmirnovTest - java

For the given data set and code, SmirnovTest shows the given exception-
data1[30]=
{190.0, 173.33, 174.67, 174.0, 177.33, 171.33, 166.0, 184.0, 176.67, 179.33, 163.33, 152.0, 175.33, 147.33, 169.33, 183.33, 196.0, 170.0, 176.0, 142.0, 168.0, 173.33, 179.33, 154.67, 160.67, 175.33, 158.0, 159.33, 158.0, 171.33 };
data2[20]=
{46.04, 23.8, 23.29, 15.35, 52.62, 59.46, 42.02, 50.31, 32.07, 16.87, 16.72, 62.91, 48.74, 52.87, 57.32, 15.61, 59.3, 45.62, 64.22, 61.42};
SmirnovTest test=new SmirnovTest(data1, data2);
test.getSP();
test.getTestStatistic();
Exception in thread "main" java.lang.IllegalArgumentException: Invalid SP -3.126388037344441E-13
Is there any problem in data set?

Related

Getting org.apache.solr.common.SolrException: java.lang.IllegalArgumentException: caused by empty node name specified #1

Getting org.apache.solr.common.SolrException: java.lang.IllegalArgumentException: Invalid path string "//10.52.21.4:8021/solr" caused by empty node name specified #1 while trying to connect to solr client.
Full Logs:
org.apache.solr.common.SolrException: java.lang.IllegalArgumentException: Invalid path string "//10.52.21.4:8021/solr" caused by empty node name specified #1
at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:171)
at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:117)
at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:107)
at org.apache.solr.common.cloud.ZkStateReader.<init>(ZkStateReader.java:277)
at org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider.connect(ZkClientClusterStateProvider.java:140)
at org.apache.solr.client.solrj.impl.CloudSolrClient.connect(CloudSolrClient.java:383)
at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:805)
at org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:793)
at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:178)
at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:195)
I am getting the error while trying to execute below block of code:
String solrUrl="http://10.52.21.4:8021/solr/";
ArrayList<String> fields = new ArrayList<String>();
CollectionAdminResponse response = ( CollectionAdminResponse ) request.process( new CloudSolrClient.Builder().withZkHost( solrUrl ).build() );
fields = ( ArrayList<String> ) response.getResponse().get( "collections" );
Anybody please help with the problem.

Java DataStax Cassandra exception error

I am getting this error on insert in java. Is there a way to prepare
the insert for the driver error?
Error:
Exception in thread "main" com.datastax.driver.core.exceptions.InvalidQueryException: Expected 4 or 0 byte int (10)
List<Flight> flightList = ProcessFlightsCSV.processFlights("flights_from_pg.csv");
for (Flight flight : flightList) {
System.out.println(flight);
Insert query = QueryBuilder.insertInto("flights")
.value("id", flight.getId())
.value("year", flight.getYear())
.value("fl_date", flight.getFlDate())
.value("airline_id", flight.getAirlineId())
.value("carrier", flight.getCarrier())
.value("fl_num", flight.getFlNum())
.value("origin_airport_id", flight.getOriginAirportId())
.value("origin", flight.getOrigin())
.value("origin_city_name", flight.getOriginCityName())
.value("origin_state_abr", flight.getOriginStateAbr())
.value("dest", flight.getDest())
.value("day_of_month", flight.getDayOfMonth())
.value("dest_city_name", flight.getDestCityName())
.value("dest_state_abr", flight.getDestStateAbr())
.value("dep_time", flight.getDepTime())
.value("arr_time", flight.getArrTime())
.value("distance", flight.getDistance());
session.execute(query);
}
Hopefully you have proper session before executing this query.
Update your session.execute(query.toString());

onErrorReturn in RxJava2 only caught the first error

I threw two exceptions in a flowable, and I used onErrorReturn to catch those exceptions. But I found that only the first exception was caught. How to catch all the exceptions?
Flowable.create(emitter -> {
emitter.onError(new Exception("error1"));
emitter.onError(new Exception("error2"));
}, BackpressureStrategy.MISSING)
.onErrorReturn(e -> {
System.out.println("Got error " + e.getMessage());
return "error";
})
.subscribe();
Output:
Got error error1
io.reactivex.exceptions.UndeliverableException: java.lang.Exception: error2
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:349)
at io.reactivex.internal.operators.flowable.FlowableCreate$BaseEmitter.onError(FlowableCreate.java:271)
at com.example.springboottest.SimpleApplication.lambda$main$0(SimpleApplication.java:48)
at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:72)
at io.reactivex.Flowable.subscribe(Flowable.java:13094)
at io.reactivex.internal.operators.flowable.FlowableOnErrorReturn.subscribeActual(FlowableOnErrorReturn.java:33)
at io.reactivex.Flowable.subscribe(Flowable.java:13094)
at io.reactivex.Flowable.subscribe(Flowable.java:13030)
at io.reactivex.Flowable.subscribe(Flowable.java:12890)
at com.example.springboottest.SimpleApplication.main(SimpleApplication.java:54)
Caused by: java.lang.Exception: error2
... 8 more
Exception in thread "main" io.reactivex.exceptions.UndeliverableException: java.lang.Exception: error2
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:349)
at io.reactivex.internal.operators.flowable.FlowableCreate$BaseEmitter.onError(FlowableCreate.java:271)
at com.example.springboottest.SimpleApplication.lambda$main$0(SimpleApplication.java:48)
at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:72)
at io.reactivex.Flowable.subscribe(Flowable.java:13094)
at io.reactivex.internal.operators.flowable.FlowableOnErrorReturn.subscribeActual(FlowableOnErrorReturn.java:33)
at io.reactivex.Flowable.subscribe(Flowable.java:13094)
at io.reactivex.Flowable.subscribe(Flowable.java:13030)
at io.reactivex.Flowable.subscribe(Flowable.java:12890)
at com.example.springboottest.SimpleApplication.main(SimpleApplication.java:54)
Caused by: java.lang.Exception: error2
... 8 more
An Observable ends after it completes or encounters an error. This is a part of the contract and there is no way around that property.
The only way you could handle 'multiple' exceptions in an observable is if it is handled like a value, not an exception. This would end up looking like Scala's Either construct in practice.

VMware vCenter API exception:The request refers to an unexpected or unknown type?

The console shows exception:"The request refers to an unexpected or unknown type" when I create a cluster.please help me. code shows the following:
vimPort.login(serviceContent.getSessionManager(),
userName, password, null);
ManagedObjectReference data = getDatacenterByName2("Datacenter");
String name = "cluster_hi";
ClusterConfigSpec spec = new ClusterConfigSpec();
ClusterDasConfigInfo value = new ClusterDasConfigInfo();
value.setAdmissionControlEnabled(true);
value.setEnabled(true);
spec.setDasConfig(value);
vimPort.createCluster(data, name, spec);
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
The request refers to an unexpected or unknown type.
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:119)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:129)
at com.sun.proxy.$Proxy35.createCluster(Unknown Source)
at com.huawei.robo.common.vcenterclient.VcenterClientImpl.main(VcenterClientImpl.java:162)

marvin image color difference plugin error

I am getting a null pointer exception whenever i am trying to process two images for color difference. The code is
MarvinImageIO.saveImage(currentFrame, "check1.jpg");
MarvinImageIO.saveImage(template, "check2.jpg");
currentFrame=MarvinImageIO.loadImage("check1.jpg");
template=MarvinImageIO.loadImage("check2.jpg");
// System.out.println(currentFrame.getWidth()+" "+currentFrame.getHeight()+" "+template.getWidth()+" "+template.getHeight());
scale(currentFrame, template, template.getWidth(), template.getHeight());
MarvinImagePlugin diff = MarvinPluginLoader.loadImagePlugin("org.marvinproject.image.difference.differenc eColor.jar");
MarvinAttributes attr = new MarvinAttributes();
attr.set("total", 0);
System.out.println(attr.get("total"));
diff.process(currentFrame, template,attr);
The error is on the diff.process statement. The images are not null and so is the attr.
Error statement is
Exception in thread "Thread-3" java.lang.NullPointerException
at org.marvinproject.image.difference.differenceColor.DifferenceColor.process(DifferenceColor.java:67)
at marvin.plugin.MarvinAbstractImagePlugin.process(MarvinAbstractImagePlugin.java:65)
at censor_player.player$MyThread.run(player.java:142)

Categories

Resources