h2o steam with python "accessing /pypredict." - h2o

I have tried the example under the steam/prediction-service-builder/examples/spam-detection-python , but get some error about
python:
This is an example of NOT SPAM
"Sorry din lock my keypad"
http://localhost:55001/pypredict?Sorry%20%20din%20lock%20my%20keypad
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 406 1</title>
</head>
<body><h2>HTTP ERROR 406</h2>
<p>Problem accessing /pypredict. Reason:
<pre> 1</pre></p><hr /><i><small>Powered by Jetty://</small></i>
<br/>
</body>
</html>

I just ran the tutorial locally, and everything is working correctly for me.
I built the example web service using sh example-python.sh rather than building the service using the web UI at http://localhost:55000.

Related

SSH kex_exchange_identification returning HTTP response in banner line

I'm not sure when this started happening, but I noticed it because it broke my ability to use Github.
I started encountering the error key_exchange_identification: banner line too long when trying to use any git commands that interact with the remote when the remote is Github (haven't tested with Enterprise GH or non-GH locations). Investigating further, I found that the underlying ssh commands were failing because the banner line contained an entire HTML document. ssh -v -T git#ssh.github.com output follows:
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\lwrubles/.ssh/config
debug1: Connecting to ssh.github.com [192.30.255.123] port 443.
debug1: Connection established.
debug1: identity file C:\\Users\\lwrubles\\.ssh\\id_rsa_test type 0
debug1: identity file C:\\Users\\lwrubles\\.ssh\\id_rsa_test-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: kex_exchange_identification: banner line 0: HTTP/1.0 500 handshakefailed
debug1: kex_exchange_identification: banner line 1: Content-Type: text/html
debug1: kex_exchange_identification: banner line 2: Cache-Control: no-cache
debug1: kex_exchange_identification: banner line 3: Content-Length: 17998
debug1: kex_exchange_identification: banner line 4: X-Frame-Options: deny
debug1: kex_exchange_identification: banner line 5: Proxy-Connection: Close
debug1: kex_exchange_identification: banner line 6:
debug1: kex_exchange_identification: banner line 7: <html><head>
debug1: kex_exchange_identification: banner line 8: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
debug1: kex_exchange_identification: banner line 9:
debug1: kex_exchange_identification: banner line 10: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-300.woff2" type="font/woff2" crossorigin="">
debug1: kex_exchange_identification: banner line 11: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-300.woff" type="font/woff" crossorigin="">
debug1: kex_exchange_identification: banner line 12:
debug1: kex_exchange_identification: banner line 13: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-regular.woff2" type="font/woff2" crossorigin="">
debug1: kex_exchange_identification: banner line 14: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-regular.woff" type="font/woff" crossorigin="">
debug1: kex_exchange_identification: banner line 15:
debug1: kex_exchange_identification: banner line 16: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-italic.woff2" type="font/woff2" crossorigin="">
debug1: kex_exchange_identification: banner line 17: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-italic.woff" type="font/woff" crossorigin="">
debug1: kex_exchange_identification: banner line 18:
debug1: kex_exchange_identification: banner line 19: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-600.woff2" type="font/woff2" crossorigin="">
debug1: kex_exchange_identification: banner line 20: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-600.woff" type="font/woff" crossorigin="">
debug1: kex_exchange_identification: banner line 21:
debug1: kex_exchange_identification: banner line 22: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-700.woff2" type="font/woff2" crossorigin="">
debug1: kex_exchange_identification: banner line 23: <link rel="preload" as="font" href="/mwg-internal/de5fs23hm64ds/files/default/font/Open_Sans/open-sans-v15-latin-700.woff" type="font/woff" crossorigin="">
debug1: kex_exchange_identification: banner line 24: <link rel="stylesheet" type="text/css" href="/mwg-internal/de5fs23hm64ds/files/default/stylesheets/en.css">
debug1: kex_exchange_identification: banner line 25: <script src="/mwg-internal/de5fs23hm64ds/files/javascript/sw.js" type="text/javascript"></script>
debug1: kex_exchange_identification: banner line 26: </head>
debug1: kex_exchange_identification: banner line 27:
debug1: kex_exchange_identification: banner line 28: <body>
debug1: kex_exchange_identification: banner line 29: <div class="container">
debug1: kex_exchange_identification: banner line 30: <div class="header">
I have tried:
several different identity files, changed both in the config and on the command line;
accessing ssh.github.com both directly (as above) and via a config file; and
using a new blank config file.
These all produced the same output.
I have also tried using WSL2 Ubuntu 20.04, with its own identity and config files, and that worked perfectly fine, so I don't think it's a proxy or network issue.
debug1: Connecting to ssh.github.com [192.30.255.123] port 443.
According to this you're supposed to be connecting to port 443 on one of github's load balancers. When I connect to that address and port, I get an SSH server version string which is the expected result.
It seems likely that a firewall or similar network device, probably within your local network environment, is interfering with your connections to github. The "/mwg-internal" URL in the HTTP suggests that you're connecting to a McAfee Web Gateway instance.
You could try switching git to use HTTPS URLs for the repo that you're trying to access. If you need to connect through SSH, you should contact your local network administrators for help.

geoserver.log: Could not lookup context gwc as a workspace, trying as group

I've using Geoserver 2.20 downloaded from official site, I have configured gwc cache system and enabled layer for cache and global services over OGC Services on global settings.
When I try this URL I get this:
$ curl 'http://myserver/geoserver/geoserver/gwc/service/wms?SERVICE=WMS&REQUEST=GetMap&BBOX=-180,-90,0,80.33032694475760138&SRS=EPSG:4326&WIDTH=846&HEIGHT=800&LAYERS=ws:mylayer&FORMAT=image/png'
<html>
<head>
<title>GWC Error</title>
<link rel="stylesheet" href="../rest/web/gwc.css" type="text/css"/>
</head>
<body>
<div id="pageHeader"><a id="logo" href="../"><img src="../rest/web/geowebcache_logo.png"/></a></div>
<h4>400: class org.geowebcache.mime.ApplicationMime cannot be cast to class org.geowebcache.mime.ImageMime (org.geowebcache.mime.ApplicationMime and org.geowebcache.mime.ImageMime are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader #3524ee20)</h4></body></html>
Looking in geoserver.log for this request, I get:
2022-04-27 11:47:04,484 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Request matched by universal pattern '/**'
2022-04-27 11:47:04,484 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Matched Path: /gwc/service/wms, QueryString: SERVICE=WMS&REQUEST=GetMap&BBOX=-180,-90,0,80.33032694475760138&SRS=EPSG:4326&WIDTH=846&HEIGHT=800&LAYERS=ws:mylayer&FORMAT=image/png with /**
2022-04-27 11:47:04,485 TRACE [ows.OWSHandlerMapping] - Mapped to HandlerExecutionChain with [org.geoserver.ows.Dispatcher#318ec7d2] and 1 interceptors
2022-04-27 11:47:04,486 DEBUG [geoserver.ows] - Could not lookup context gwc as a workspace, trying as group
2022-04-27 11:47:04,486 DEBUG [geoserver.ows] - Could not lookup context gwc as a layer group either
2022-04-27 11:47:04,486 DEBUG [wms.WMSService] - Recombinining tiles to respond to WMS request
2022-04-27 11:47:04,487 ERROR [geowebcache.GeoWebCacheDispatcher] - class org.geowebcache.mime.ApplicationMime cannot be cast to class org.geowebcache.mime.ImageMime (org.geowebcache.mime.ApplicationMime and org.geowebcache.mime.ImageMime are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader #3524ee20) http://myserver/geoserver/gwc/service/wms
2022-04-27 11:47:04,487 DEBUG [util.ResponseUtils] - class org.geowebcache.mime.ApplicationMime cannot be cast to class org.geowebcache.mime.ImageMime (org.geowebcache.mime.ApplicationMime and org.geowebcache.mime.ImageMime are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader #3524ee20)
2022-04-27 11:47:04,487 ERROR [geowebcache.GeoWebCacheDispatcher] - Request failed
java.lang.ClassCastException: class org.geowebcache.mime.ApplicationMime cannot be cast to class org.geowebcache.mime.ImageMime (org.geowebcache.mime.ApplicationMime and org.geowebcache.mime.ImageMime are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader #3524ee20)
at org.geowebcache.service.wms.WMSTileFuser.<init>(WMSTileFuser.java:325)
at org.geowebcache.service.wms.WMSService.getFuser(WMSService.java:356)
...
I've try with this other URL http://myserver/geoserver/geoserver/ws/gwc/service/wms?SERVICE=WMS&REQUEST=GetMap&BBOX=-180,-90,0,80.33032694475760138&SRS=EPSG:4326&WIDTH=846&HEIGHT=800&LAYERS=ws:mylayer&FORMAT=image/png and don't runs too.
But this other URL for same sever and layer (with) runs ok: http://mysever/geoserver/gwc/demo/ws:mylayer?gridSet=EPSG:4326&format=image/png.
I've looked for this related question (Geoserver:No such workspace 'gwc/service') but do not solve my problem.
How can I solve it?
Regards.
The problem is the URL. It is incorrect.
Correct URL must refer to wmts service and not wms.
So it should be (for this example):
http://myserver/geoserver/geoserver/gwc/service/wmts?SERVICE=WMS&REQUEST=GetMap&BBOX=-180,-90,0,80.33032694475760138&SRS=EPSG:4326&WIDTH=846&HEIGHT=800&LAYERS=ws:mylayer&FORMAT=image/png
Available layers:
http://myserver/geoserver/geoserver/gwc/service/wmts?
Regards.

Spring i18n and l10n error-NoSuchMessageException: No message found under code 'lable' for locale 'hi,en-in;q=0.5'

I am trying to implement i18n and l10n using Spring.I am getting error:
NoSuchMessageException: No message found under code 'lable' for locale 'hi,en-in;q=0.5'
Here is the code snippet:
index.jsp file:
<%-- String lang=request.getHeader("accept-language"); This line will give browser language --%>
<%#page import="org.springframework.context.support.ResourceBundleMessageSource"%>
<%#page import="org.springframework.context.support.ClassPathXmlApplicationContext"%>
<%#page import="org.springframework.context.ApplicationContext"%>
<%#page import="java.util.Locale"%>
<%
String lang=request.getHeader("accept-language");
Locale locale =new Locale(lang);
ApplicationContext ap =new ClassPathXmlApplicationContext("resources/spring.xml");
String value=ap.getMessage("lable",null,locale);
%>
<form action="./hello">
<%=value%>:<input type="text" name="name"/>
<input type="submit" value="submit">
</form>
2 properties files and 1 spring.xml file:
Data_hi.properties: for hindi language
lable=नाम्
Data_te.properties: for Telugu language
lable=సిదర్త్
spring.xml file:
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name ="basename" value="Data"/>
</bean>
</beans>
When I am trying to run the application via Tomcat Server,I am getting the below error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 11
8: String lang=request.getHeader("accept-language");
9: Locale locale =new Locale(lang);
10: ApplicationContext ap =new ClassPathXmlApplicationContext("resources/spring.xml");
11: String value=ap.getMessage("lable",null,locale);
12: %>
13:
14:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
org.springframework.context.NoSuchMessageException: No message found under code 'lable' for locale 'hi,en-in;q=0.5'.
org.springframework.context.support.AbstractMessageSource.getMessage(AbstractMessageSource.java:159)
org.springframework.context.support.AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1259)
org.apache.jsp.index_jsp._jspService(index_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.23 logs.
Apache Tomcat/7.0.23
Please suggest someone where I need to correct the code.I tried on google also but didn't find?
PS:All the required jars and libraries are imported correctly.
Thanks in advance!!!
Agreed with M. Deinum's comments about memory issues, however to resolve your described issue below approaches should work :
either set your browser's language to hindi or telgu as these are the prop files you added in resources and running the code to get it.
or Add one more property file Data_en.properties because your browser's language would be english during execution of jsp code and there was no prop file related to english message and throwing error "NoSuchMessageException: No message found under code 'lable' for locale 'hi,en-in;q=0.5'" which correct quite obviously ;)
I have been trying to implement the same. My interpretation is something like this: After executing the line
String lang=request.getHeader("accept-language");
The variable lang contains the string - hi,en-in;q=0.5 . Consequently the locale value will also be - hi,en-in;q=0.5. while parsing through spring.xml file, IOC searches the locale hi,en-in;q=0.5 within the registered locale names. Since the locale with given name is unavailabe, It prompts the error message:
org.springframework.context.NoSuchMessageException: No message found under code 'lable' for locale 'hi,en-in;q=0.5'.
Possible solution:
Assign "lang" variable with either "te" or "hi".
Set your browser such that the value of
"request.getHeader("accept-language")" will be "te" or "hi".

Spring boot views not working

This is my first Spring Boot example and on the first step. I created a SpringBoot project in STS 3.8 like this:
File -> New Spring Starter Project
Dependecies -> Web
I created the following controller in src/main/java/com.first.boot
IndexController
package com.first.boot;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
public class IndexController {
#RequestMapping("/")
public String index(){
return "index";
}
}
Next, I created view index.html in src/main/resources/templates:
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Getting Started: Serving Web Content</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
Welcome to your first Spring Boot Page
</body>
</html>
Then I run the project as:
Right click on project -> Run as -> Spring Boot App
The console shows proper mappings and Tomcat startup information
Mapped "{[/]}" onto public java.lang.String com.first.boot.IndexController.index()
Tomcat started on port(s): 8080 (http)
Started FirstSpringBootApplication in 4.096 seconds (JVM running for 4.843)
Initializing Spring FrameworkServlet 'dispatcherServlet'
FrameworkServlet 'dispatcherServlet': initialization started
FrameworkServlet 'dispatcherServlet': initialization completed in 64 ms
But whenever I run localhost:8080 on browser, I see this page:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Tue Dec 13 08:22:13 IST 2016
There was an unexpected error (type=Not Found, status=404).
No message available
There are no errors in console.
Adding following dependency solved the issue:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

Using kerberized webhdfs/hdfs with JAVA API

I have a Hadoop cluster with Kerberos enabled I want to put files on HDFS using a windows/linux machine outside the cluster.
Hadoop admin team have provided me with username to access hadoop and keytab file, how should I use them in my java code?
I went through many resources on internet but none of them give any guide for accessing kerberized hadoop from outside the cluster.
Also, Is it necessary to run the code using hadoop jar? if yes how will I run it fromo outside the cluster
Reference
http://blog.rajeevsharma.in/2009/06/using-hdfs-in-java-0200.html
http://princetonits.com/technology/using-filesystem-api-to-read-and-write-data-to-hdfs/
I got kerberos working ,able to generate ticket now
But curl is not working(windows)
curl -i --negotiate u:qjdht93 "http://server:50070/webhdfs/v1/user/qjdht93/?op=LISTSTATUS"
Gives error as
HTTP/1.1 401 Authentication required
Cache-Control: must-revalidate,no-cache,no-store
Date: Mon, 01 Jun 2015 15:26:37 GMT
Pragma: no-cache
Date: Mon, 01 Jun 2015 15:26:37 GMT
Pragma: no-cache
Content-Type: text/html; charset=iso-8859-1
WWW-Authenticate: Negotiate
Set-Cookie: hadoop.auth=; Version=1; Path=/; Expires=Thu, 01-Jan-1970 00:00:00 G
MT; HttpOnly
Content-Length: 1416
Server: Jetty(6.1.26)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 401 Authentication required</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /webhdfs/v1/user/qjdht93. Reason:
<pre> Authentication required</pre></p><hr /><i><small>Powered by Jetty://</s
mall></i><br/>
<br/>
<br/>
Please suggest
This can be achieve through hdfs command. All you need is hadoop distribution and configuration files which present on namenode.
Copy the hadoop distribution on the client node. It means you have to copy the complete hadoop package to the client machine.
Refer this
Get a user ticket from keytab using kinit command which is a command line tool for java.
a. Install jdk in you client machine.
b. Set JAVA_HOME, see here
c. Create a krb5.ini file in the location C:\windows\krb5.ini. This file should contain below information,
[libdefaults]
default_realm = REALM
[realms]
REALM = {
kdc = kdcvalue
admin_server = kdcvalue
default_domain = kdcvalue
}
[domain_realm]
.kdcvalue = REALM
kdcvalue = REALM
REALM - Server Realm name
kdcvalue - Server host name or ip address
d. Make sure java bin path set in the PATH variable in windows machine. Open command prompt, Type the below command to get user ticket.
kinit -k -t keytabfile username
Now you can able to put the file into HDFS using "hadoop fs -put src dest" or using java.

Resources