调试界面的问题&java.lang.Exception: java.lang.ArrayIndexOutOfBoundsException: 1

来源:4-15 流量统计实战之Driver开发

慕容3565349

2021-04-05

输入正文

C:\Software\Java\jdk1.8\bin\java.exe "-javaagent:C:\Software\IntelliJ IDEA 2020.3.3\lib\idea_rt.jar=50706:C:\Software\IntelliJ IDEA 2020.3.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Software\Java\jdk1.8\jre\lib\charsets.jar;C:\Software\Java\jdk1.8\jre\lib\deploy.jar;C:\Software\Java\jdk1.8\jre\lib\ext\access-bridge-64.jar;C:\Software\Java\jdk1.8\jre\lib\ext\cldrdata.jar;C:\Software\Java\jdk1.8\jre\lib\ext\dnsns.jar;C:\Software\Java\jdk1.8\jre\lib\ext\jaccess.jar;C:\Software\Java\jdk1.8\jre\lib\ext\jfxrt.jar;C:\Software\Java\jdk1.8\jre\lib\ext\localedata.jar;C:\Software\Java\jdk1.8\jre\lib\ext\nashorn.jar;C:\Software\Java\jdk1.8\jre\lib\ext\sunec.jar;C:\Software\Java\jdk1.8\jre\lib\ext\sunjce_provider.jar;C:\Software\Java\jdk1.8\jre\lib\ext\sunmscapi.jar;C:\Software\Java\jdk1.8\jre\lib\ext\sunpkcs11.jar;C:\Software\Java\jdk1.8\jre\lib\ext\zipfs.jar;C:\Software\Java\jdk1.8\jre\lib\javaws.jar;C:\Software\Java\jdk1.8\jre\lib\jce.jar;C:\Software\Java\jdk1.8\jre\lib\jfr.jar;C:\Software\Java\jdk1.8\jre\lib\jfxswt.jar;C:\Software\Java\jdk1.8\jre\lib\jsse.jar;C:\Software\Java\jdk1.8\jre\lib\management-agent.jar;C:\Software\Java\jdk1.8\jre\lib\plugin.jar;C:\Software\Java\jdk1.8\jre\lib\resources.jar;C:\Software\Java\jdk1.8\jre\lib\rt.jar;C:\Users\Mr wu\OneDrive - hechuan-A1\Code\IdeaProjects\hadoop-train-v2\target\classes;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-client\2.6.0-cdh5.15.1\hadoop-client-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-common\2.6.0-cdh5.15.1\hadoop-common-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\com\google\guava\guava\11.0.2\guava-11.0.2.jar;C:\Users\Mr wu\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;C:\Users\Mr wu\.m2\repository\org\apache\commons\commons-math3\3.1.1\commons-math3-3.1.1.jar;C:\Users\Mr wu\.m2\repository\xmlenc\xmlenc\0.52\xmlenc-0.52.jar;C:\Users\Mr wu\.m2\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;C:\Users\Mr wu\.m2\repository\commons-codec\commons-codec\1.4\commons-codec-1.4.jar;C:\Users\Mr wu\.m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar;C:\Users\Mr wu\.m2\repository\commons-net\commons-net\3.1\commons-net-3.1.jar;C:\Users\Mr wu\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\Mr wu\.m2\repository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;C:\Users\Mr wu\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\Mr wu\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;C:\Users\Mr wu\.m2\repository\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar;C:\Users\Mr wu\.m2\repository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar;C:\Users\Mr wu\.m2\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;C:\Users\Mr wu\.m2\repository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar;C:\Users\Mr wu\.m2\repository\org\slf4j\slf4j-api\1.7.5\slf4j-api-1.7.5.jar;C:\Users\Mr wu\.m2\repository\org\slf4j\slf4j-log4j12\1.7.5\slf4j-log4j12-1.7.5.jar;C:\Users\Mr wu\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.8.8\jackson-core-asl-1.8.8.jar;C:\Users\Mr wu\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.8.8\jackson-mapper-asl-1.8.8.jar;C:\Users\Mr wu\.m2\repository\org\apache\avro\avro\1.7.6-cdh5.15.1\avro-1.7.6-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\com\thoughtworks\paranamer\paranamer\2.3\paranamer-2.3.jar;C:\Users\Mr wu\.m2\repository\org\xerial\snappy\snappy-java\1.0.4.1\snappy-java-1.0.4.1.jar;C:\Users\Mr wu\.m2\repository\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar;C:\Users\Mr wu\.m2\repository\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-auth\2.6.0-cdh5.15.1\hadoop-auth-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\httpcomponents\httpclient\4.2.5\httpclient-4.2.5.jar;C:\Users\Mr wu\.m2\repository\org\apache\httpcomponents\httpcore\4.2.4\httpcore-4.2.4.jar;C:\Users\Mr wu\.m2\repository\org\apache\directory\server\apacheds-kerberos-codec\2.0.0-M15\apacheds-kerberos-codec-2.0.0-M15.jar;C:\Users\Mr wu\.m2\repository\org\apache\directory\server\apacheds-i18n\2.0.0-M15\apacheds-i18n-2.0.0-M15.jar;C:\Users\Mr wu\.m2\repository\org\apache\directory\api\api-asn1-api\1.0.0-M20\api-asn1-api-1.0.0-M20.jar;C:\Users\Mr wu\.m2\repository\org\apache\directory\api\api-util\1.0.0-M20\api-util-1.0.0-M20.jar;C:\Users\Mr wu\.m2\repository\org\apache\curator\curator-framework\2.7.1\curator-framework-2.7.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\curator\curator-client\2.7.1\curator-client-2.7.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\curator\curator-recipes\2.7.1\curator-recipes-2.7.1.jar;C:\Users\Mr wu\.m2\repository\com\google\code\findbugs\jsr305\3.0.0\jsr305-3.0.0.jar;C:\Users\Mr wu\.m2\repository\org\apache\htrace\htrace-core4\4.0.1-incubating\htrace-core4-4.0.1-incubating.jar;C:\Users\Mr wu\.m2\repository\org\apache\zookeeper\zookeeper\3.4.5-cdh5.15.1\zookeeper-3.4.5-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\commons\commons-compress\1.4.1\commons-compress-1.4.1.jar;C:\Users\Mr wu\.m2\repository\org\tukaani\xz\1.0\xz-1.0.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-hdfs\2.6.0-cdh5.15.1\hadoop-hdfs-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\mortbay\jetty\jetty-util\6.1.26.cloudera.4\jetty-util-6.1.26.cloudera.4.jar;C:\Users\Mr wu\.m2\repository\io\netty\netty\3.10.5.Final\netty-3.10.5.Final.jar;C:\Users\Mr wu\.m2\repository\io\netty\netty-all\4.0.23.Final\netty-all-4.0.23.Final.jar;C:\Users\Mr wu\.m2\repository\xerces\xercesImpl\2.9.1\xercesImpl-2.9.1.jar;C:\Users\Mr wu\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar;C:\Users\Mr wu\.m2\repository\org\fusesource\leveldbjni\leveldbjni-all\1.8\leveldbjni-all-1.8.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-mapreduce-client-app\2.6.0-cdh5.15.1\hadoop-mapreduce-client-app-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-mapreduce-client-common\2.6.0-cdh5.15.1\hadoop-mapreduce-client-common-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-yarn-client\2.6.0-cdh5.15.1\hadoop-yarn-client-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-yarn-server-common\2.6.0-cdh5.15.1\hadoop-yarn-server-common-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-mapreduce-client-shuffle\2.6.0-cdh5.15.1\hadoop-mapreduce-client-shuffle-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-yarn-api\2.6.0-cdh5.15.1\hadoop-yarn-api-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-mapreduce-client-core\2.6.0-cdh5.15.1\hadoop-mapreduce-client-core-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-yarn-common\2.6.0-cdh5.15.1\hadoop-yarn-common-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\javax\xml\bind\jaxb-api\2.2.2\jaxb-api-2.2.2.jar;C:\Users\Mr wu\.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;C:\Users\Mr wu\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\Mr wu\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;C:\Users\Mr wu\.m2\repository\com\sun\jersey\jersey-core\1.9\jersey-core-1.9.jar;C:\Users\Mr wu\.m2\repository\com\sun\jersey\jersey-client\1.9\jersey-client-1.9.jar;C:\Users\Mr wu\.m2\repository\org\codehaus\jackson\jackson-jaxrs\1.8.8\jackson-jaxrs-1.8.8.jar;C:\Users\Mr wu\.m2\repository\org\codehaus\jackson\jackson-xc\1.8.8\jackson-xc-1.8.8.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-mapreduce-client-jobclient\2.6.0-cdh5.15.1\hadoop-mapreduce-client-jobclient-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-aws\2.6.0-cdh5.15.1\hadoop-aws-2.6.0-cdh5.15.1.jar;C:\Users\Mr wu\.m2\repository\com\amazonaws\aws-java-sdk-bundle\1.11.134\aws-java-sdk-bundle-1.11.134.jar;C:\Users\Mr wu\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.2.3\jackson-core-2.2.3.jar;C:\Users\Mr wu\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.2.3\jackson-databind-2.2.3.jar;C:\Users\Mr wu\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.2.3\jackson-annotations-2.2.3.jar;C:\Users\Mr wu\.m2\repository\org\apache\hadoop\hadoop-annotations\2.6.0-cdh5.15.1\hadoop-annotations-2.6.0-cdh5.15.1.jar" com.imooc.bigdata.hadoop.mr.access.AccessLocalApp

[INFO ] method:org.apache.hadoop.conf.Configuration.warnOnceIfDeprecated(Configuration.java:1274)

session.id is deprecated. Instead, use dfs.metrics.session-id

[INFO ] method:org.apache.hadoop.metrics.jvm.JvmMetrics.init(JvmMetrics.java:76)

Initializing JVM Metrics with processName=JobTracker, sessionId=

[WARN ] method:org.apache.hadoop.mapreduce.JobResourceUploader.uploadFiles(JobResourceUploader.java:64)

Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.

[WARN ] method:org.apache.hadoop.mapreduce.JobResourceUploader.uploadFiles(JobResourceUploader.java:171)

No job jar file set.  User classes may not be found. See Job or Job#setJar(String).

[INFO ] method:org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:283)

Total input paths to process : 1

[INFO ] method:org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:202)

number of splits:1

[INFO ] method:org.apache.hadoop.mapreduce.JobSubmitter.printTokens(JobSubmitter.java:291)

Submitting tokens for job: job_local2030575255_0001

[INFO ] method:org.apache.hadoop.mapreduce.Job.submit(Job.java:1311)

The url to track the job: http://localhost:8080/

[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1356)

Running job: job_local2030575255_0001

[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.createOutputCommitter(LocalJobRunner.java:498)

OutputCommitter set in config null

[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:124)

File Output Committer Algorithm version is 1

[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:139)

FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false

[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.createOutputCommitter(LocalJobRunner.java:516)

OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter

[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:475)

Waiting for map tasks

[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:251)

Starting task: attempt_local2030575255_0001_m_000000_0

[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:124)

File Output Committer Algorithm version is 1

[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:139)

FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false

[INFO ] method:org.apache.hadoop.yarn.util.ProcfsBasedProcessTree.isAvailable(ProcfsBasedProcessTree.java:190)

ProcfsBasedProcessTree currently is supported only on Linux.

[INFO ] method:org.apache.hadoop.mapred.Task.initialize(Task.java:631)

 Using ResourceCalculatorProcessTree : org.apache.hadoop.yarn.util.WindowsBasedProcessTree@5c8104db

[INFO ] method:org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:762)

Processing split: file:/C:/Users/Mr wu/OneDrive - hechuan-A1/Code/IdeaProjects/hadoop-train-v2/access/input/access.log:0+2332

[INFO ] method:org.apache.hadoop.mapred.MapTask$MapOutputBuffer.setEquator(MapTask.java:1212)

(EQUATOR) 0 kvi 26214396(104857584)

[INFO ] method:org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1005)

mapreduce.task.io.sort.mb: 100

[INFO ] method:org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1006)

soft limit at 83886080

[INFO ] method:org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1007)

bufstart = 0; bufvoid = 104857600

[INFO ] method:org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1008)

kvstart = 26214396; length = 6553600

[INFO ] method:org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:403)

Map output collector class = org.apache.hadoop.mapred.MapTask$MapOutputBuffer

[INFO ] method:org.apache.hadoop.mapred.MapTask$MapOutputBuffer.flush(MapTask.java:1467)

Starting flush of map output

[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:483)

map task executor complete.

[WARN ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:587)

job_local2030575255_0001

java.lang.Exception: java.lang.ArrayIndexOutOfBoundsException: 1

at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:489)

at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:549)

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1

at com.imooc.bigdata.hadoop.mr.access.AccessMapper.map(AccessMapper.java:20)

at com.imooc.bigdata.hadoop.mr.access.AccessMapper.map(AccessMapper.java:13)

at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)

at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:793)

at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)

at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:270)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1377)

Job job_local2030575255_0001 running in uber mode : false

[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1384)

 map 0% reduce 0%

[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1397)

Job job_local2030575255_0001 failed with state FAILED due to: NA

[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1402)

Counters: 0


Process finished with exit code -1

http://img.mukewang.com/szimg/606ace0a099e336530002000.jpg

写回答

1回答

Michael_PK

2021-04-05

贴出你的代码



java.lang.ArrayIndexOutOfBoundsException: 1

这句话是最基础的Array的异常信息,数组下标越界,那就说明你很可能是split或者类似的方法产生出一个字符串数组时,可能由于分隔符不对,导致根据就获得不到index为1的值。  你在你的map拆分数据哪里debug下,你看看你的按照分隔符拆分的对吗

0
2
Michael_PK
回复
慕容3565349
log4j 一要放到resource下 二如果你想看到详细的日志信息,可以调整log4j的日志级别,比如info,debug之类的。这个异常其实不需要日志信息,只要走一个debug,就知道你截取的数据对不对了
2021-04-07
共2条回复

Hadoop 系统入门+核心精讲

从Hadoop核心技术入手,掌握数据处理中ETL应用,轻松进军大数据

2397 学习 · 902 问题

查看课程