我在重复调用java.lang.ArrayIndexOutOfBoundsException: -64
的spring restfull请求时收到此POSTMAN
。
我在这样的方法上使用GET方法:
@RestController
public class SchedulerController{
@Autowired
private ReportScheduler reportScheduler;
@RequestMapping(value = "/utilizationReport", method = RequestMethod.GET)
private void saveCompany() throws MasterNotRunningException, ZooKeeperConnectionException, ServiceException, IOException{
System.out.println("Hi");
reportScheduler.methodC();
}
}
DAO类(方法C的实现):
@Repository
@EnableScheduling
public class ReportScheduler {
Configuration hbaseConfig;
@Resource(name = "jdbcTemplatePOSTGRESQL")
private JdbcTemplate jdbcTemplate;
@Resource(name = "jdbcTemplateDRILL")
private JdbcTemplate jdbcTemplateDrill;
@Scheduled(cron="0 21 11 ? * *")
public void methodC() throws MasterNotRunningException, ZooKeeperConnectionException, ServiceException, IOException {
hbaseConfig = DbCon.connectHBase();
String sql="select DISTINCT websocket_key from iot.sensor_configuration where sensor_type='Energy'";
List<Map<String,Object>> queryForList = jdbcTemplate.queryForList(sql);
int i=0;
for (Map<String, Object> map : queryForList) {
i++;
String websocket_key=(String) map.get("websocket_key");
Date date = DateUtils.addDays(new Date(), -1);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String yestDate = sdf.format(date);
yestDate="2017-01-26";
insertDataAtNight(websocket_key, yestDate,i);
}
}
@SuppressWarnings("unused")
public void insertDataAtNight(String webscoket_key,String yestDate,int i){
System.out.println("Inside");
List<Map<String,Object>> queryForList=null;
List<String> list=new ArrayList<String>();
Double totalenergy=0.0;
String websocket_key=null;
String datetime=null;
String date=null;
try
{
String sql = ""
+ "SELECT CONVERT_FROM(row_key, 'UTF8') AS row_key, "
+ "CONVERT_FROM(iot_energy_table.details.energy, 'UTF8') AS energy, "
+ "CONVERT_FROM(iot_energy_table.details.websocket_key, 'UTF8') AS websocket_key, "
//+ "CONVERT_FROM(iot_energy_table.details.updated_time, 'UTF8') AS date, "
+ "CONVERT_FROM(iot_energy_table.details.updated_time, 'UTF8') AS updated_time FROM hbase.iot_energy_table "
+ "where iot_energy_table.details.websocket_key='"+webscoket_key+"' AND iot_energy_table.details.updated_time BETWEEN '"+yestDate+" 00:00:01' AND '"+yestDate+" 23:59:59' AND iot_energy_table.details.energy <> 'Nan' ";
//+ "order by iot_energy_table.details.updated_time DESC limit 1";
queryForList= jdbcTemplateDrill.queryForList(sql);
for (Map<String, Object> map : queryForList) {
String energy=map.get("energy").toString();
websocket_key=map.get("websocket_key").toString();
datetime=map.get("updated_time").toString();
String a[]=datetime.split(" ");
date=a[0];
totalenergy=totalenergy+Double.parseDouble(energy);
list.add(energy);
}
Double startEnergy=0.0;
Double endEnergy=0.0;
if(!list.isEmpty()){
startEnergy=Double.parseDouble(list.get(0));
endEnergy=Double.parseDouble(list.get(list.size()-1));
}
else
{
startEnergy=0.0;
endEnergy=0.0;
}
Double energyConsumed=endEnergy-startEnergy;
String sql1 = ""
+ "INSERT INTO iot.energy_report( "
+ " websocket_key, updated_time, "
+ " energy_consumed_per_day) "
+ " VALUES (?, ?, "
+ " ?)";
int update = jdbcTemplate.update(sql1,new Object[]{webscoket_key,yestDate,energyConsumed});
HTable energyPacket = new HTable(hbaseConfig, "iot_energy_report");
try
{
Put data = new Put(Bytes.toBytes((yestDate+(i)).toString() + ""));
data.add(Bytes.toBytes("details"), Bytes.toBytes("websocket_key"),
Bytes.toBytes(webscoket_key.toString()));
data.add(Bytes.toBytes("details"), Bytes.toBytes("updated_time"),
Bytes.toBytes(yestDate.toString()));
data.add(Bytes.toBytes("details"), Bytes.toBytes("energy_consumed_per_day"),
Bytes.toBytes(energyConsumed.toString()));
energyPacket.put(data);
}
catch(Exception e)
{
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
/*
@Scheduled(fixedRate = 5000)
public void reportCurrentTime() {
}
*/
}
这是我在POSTMAN中得到的回应:
<html>
<head>
<title>Apache Tomcat/7.0.62 - Error report</title>
<style>
<!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}-->
</style>
</head>
<body>
<h1>HTTP Status 500 - java.lang.reflect.InvocationTargetException</h1>
<HR size="1" noshade="noshade">
<p>
<b>type</b> Exception report
</p>
<p>
<b>message</b>
<u>java.lang.reflect.InvocationTargetException</u>
</p>
<p>
<b>description</b>
<u>The server encountered an internal error that prevented it from fulfilling this request.</u>
</p>
<p>
<b>exception</b>
<pre>java.io.IOException: java.lang.reflect.InvocationTargetException
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:457)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:434)
org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:315)
org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2380)
com.trinity.login.util.DbCon.connectHBase(DbCon.java:47)
com.trinity.admin.scheduler.ReportScheduler.methodC(ReportScheduler.java:48)
com.trinity.admin.scheduler.SchedulerController.saveCompany(SchedulerController.java:23)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</pre>
</p>
<p>
<b>root cause</b>
<pre>java.lang.reflect.InvocationTargetException
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:455)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:434)
org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:315)
org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2380)
com.trinity.login.util.DbCon.connectHBase(DbCon.java:47)
com.trinity.admin.scheduler.ReportScheduler.methodC(ReportScheduler.java:48)
com.trinity.admin.scheduler.SchedulerController.saveCompany(SchedulerController.java:23)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</pre>
</p>
<p>
<b>root cause</b>
<pre>java.lang.ExceptionInInitializerError
org.apache.hadoop.hbase.ClusterId.parseFrom(ClusterId.java:64)
org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:69)
org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:83)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.retrieveClusterId(HConnectionManager.java:897)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:694)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:455)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:434)
org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:315)
org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2380)
com.trinity.login.util.DbCon.connectHBase(DbCon.java:47)
com.trinity.admin.scheduler.ReportScheduler.methodC(ReportScheduler.java:48)
com.trinity.admin.scheduler.SchedulerController.saveCompany(SchedulerController.java:23)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</pre>
</p>
<p>
<b>root cause</b>
<pre>java.lang.IllegalArgumentException: java.net.UnknownHostException: apachehadoopmaster1
org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:418)
org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:231)
org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider.getProxy(ConfiguredFailoverProxyProvider.java:125)
org.apache.hadoop.io.retry.RetryInvocationHandler.<init>(RetryInvocationHandler.java:73)
org.apache.hadoop.io.retry.RetryInvocationHandler.<init>(RetryInvocationHandler.java:64)
org.apache.hadoop.io.retry.RetryProxy.create(RetryProxy.java:58)
org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:147)
org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:510)
org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:453)
org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:136)
org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2433)
org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2467)
org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2449)
org.apache.hadoop.fs.FileSystem.get(FileSystem.java:367)
org.apache.hadoop.fs.Path.getFileSystem(Path.java:287)
org.apache.hadoop.hbase.util.DynamicClassLoader.<init>(DynamicClassLoader.java:104)
org.apache.hadoop.hbase.protobuf.ProtobufUtil.<clinit>(ProtobufUtil.java:201)
org.apache.hadoop.hbase.ClusterId.parseFrom(ClusterId.java:64)
org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:69)
org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:83)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.retrieveClusterId(HConnectionManager.java:897)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:694)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:455)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:434)
org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:315)
org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2380)
com.trinity.login.util.DbCon.connectHBase(DbCon.java:47)
com.trinity.admin.scheduler.ReportScheduler.methodC(ReportScheduler.java:48)
com.trinity.admin.scheduler.SchedulerController.saveCompany(SchedulerController.java:23)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</pre>
</p>
<p>
<b>root cause</b>
<pre>java.net.UnknownHostException: apachehadoopmaster1
org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:418)
org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:231)
org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider.getProxy(ConfiguredFailoverProxyProvider.java:125)
org.apache.hadoop.io.retry.RetryInvocationHandler.<init>(RetryInvocationHandler.java:73)
org.apache.hadoop.io.retry.RetryInvocationHandler.<init>(RetryInvocationHandler.java:64)
org.apache.hadoop.io.retry.RetryProxy.create(RetryProxy.java:58)
org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:147)
org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:510)
org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:453)
org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:136)
org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2433)
org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2467)
org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2449)
org.apache.hadoop.fs.FileSystem.get(FileSystem.java:367)
org.apache.hadoop.fs.Path.getFileSystem(Path.java:287)
org.apache.hadoop.hbase.util.DynamicClassLoader.<init>(DynamicClassLoader.java:104)
org.apache.hadoop.hbase.protobuf.ProtobufUtil.<clinit>(ProtobufUtil.java:201)
org.apache.hadoop.hbase.ClusterId.parseFrom(ClusterId.java:64)
org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:69)
org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:83)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.retrieveClusterId(HConnectionManager.java:897)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:694)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:455)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:434)
org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:315)
org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2380)
com.trinity.login.util.DbCon.connectHBase(DbCon.java:47)
com.trinity.admin.scheduler.ReportScheduler.methodC(ReportScheduler.java:48)
com.trinity.admin.scheduler.SchedulerController.saveCompany(SchedulerController.java:23)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</pre>
</p>
<p>
<b>note</b>
<u>The full stack trace of the root cause is available in the Apache Tomcat/7.0.62 logs.</u>
</p>
<HR size="1" noshade="noshade">
<h3>Apache Tomcat/7.0.62</h3>
</body>
</html>
这是控制台中的异常打印:
Jan 27, 2017 12:09:39 PM org.apache.coyote.http11.AbstractHttp11Processor process
INFO: Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.ArrayIndexOutOfBoundsException: -64
at org.apache.coyote.http11.InternalInputBuffer.parseHeader(InternalInputBuffer.java:341)
at org.apache.coyote.http11.InternalInputBuffer.parseHeaders(InternalInputBuffer.java:271)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1007)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
邮递员这是我用来调用请求的请求:
https://localhost:8080/IoTRemotemonitoring/utilizationReport
请告诉我我在这里做了什么错误。
答案 0 :(得分:0)
问题可能是https协议。你在apache实例上配置了https吗?
请记住,由于以下原因引发了原始异常:
java.net.UnknownHostException: apachehadoopmaster1
看看@ adrianshum的评论。可能是那个apache bug。您正在使用受影响的Apache Tomcat / 7.0.62版本之一。