为什么在运行 StAX Parser 时会出现 NullPointerException? [英] Why I get NullPointerException when running StAX Parser?

查看:72
本文介绍了为什么在运行 StAX Parser 时会出现 NullPointerException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用 Java 编写 StAX XML 解析器,但总是出现 NullPointerException 错误.请帮我解决这个问题.完整的问题:

<块引用>

线程main"中的异常java.lang.NullPointerException 在org.example.shoesshop.parser.STAXParser.parseXMLfile(STAXParser.java:68)在 org.example.shoesshop.parser.STAXParser.main(STAXParser.java:101)

这是 StAX 解析器的类:

public class STAXParser extends DefaultHandler {私有静态列表<鞋子>parseXMLfile(字符串文件名){列表<鞋子>shoesList = new ArrayList<>();鞋子鞋子=空;XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();尝试 {XMLEventReader reader = xmlInputFactory.createXMLEventReader(new FileInputStream(fileName));而 (reader.hasNext()){XMLEvent xmlEvent = reader.nextEvent();如果(xmlEvent.isStartElement()){StartElement startElement = xmlEvent.asStartElement();if(startElement.getName().getLocalPart().equals(鞋子")){鞋子 = 新鞋子();属性 idAttr = startElement.getAttributeByName(new QName(id"));if(idAttr != null){shoes.setId(Integer.parseInt(idAttr.getValue()));}} else if (startElement.getName().getLocalPart().equals(title")){xmlEvent = reader.nextEvent();shoes.setTitle(xmlEvent.asCharacters().getData());//错误行 68} else if (startElement.getName().getLocalPart().equals(brand")){xmlEvent = reader.nextEvent();shoes.setBrand(Brand.fromValue(xmlEvent.asCharacters().getData()));} else if (startElement.getName().getLocalPart().equals(category")){xmlEvent = reader.nextEvent();shoes.setCategory(Category.fromValue(xmlEvent.asCharacters().getData()));} else if (startElement.getName().getLocalPart().equals(season")){xmlEvent = reader.nextEvent();shoes.setSeason(Season.fromValue(xmlEvent.asCharacters().getData()));} else if (startElement.getName().getLocalPart().equals(price")){xmlEvent = reader.nextEvent();shoes.setPrice(Double.parseDouble(xmlEvent.asCharacters().getData()));}}如果(xmlEvent.isEndElement()){EndElement endElement = xmlEvent.asEndElement();if(endElement.getName().getLocalPart().equals(鞋子")){shoesList.add(shoes);}}}} catch (FileNotFoundException | XMLStreamException exc) {exc.printStackTrace();} return shoesList;}public static void main(String[] args) 抛出异常 {System.out.println(STAX 解析器");System.out.println();System.out.println("结果:\n");System.out.println();String fileName = "ShoesShop.xml";列表<鞋子>shoesList = parseXMLfile(fileName);//错误行101对于(鞋履:shoesList){System.out.println(shoes.toString());}}}

这是一个 XML 文件

<?xml-stylesheet type = "text/xsl";href = "ShoesShop.xsl"?><ss:ShoesShop xmlns:ss="http://www.example.org/ShoesShop";xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation=http://www.example.org/ShoesShop ShoesShop.xsd"><ss:shoes id="1";股票=真"><ss:title>Baltrum</ss:title><ss:brand>Gucci</ss:brand><ss:category>靴子</ss:category><ss:season>秋天</ss:season><ss:male>male</ss:male></ss:性别><ss:详细信息><ss:highlights>突出显示文本 1</ss:highlights><ss:composition>作文文本1</ss:composition></ss:详细信息><ss:price>734.0</ss:price></ss:鞋子><ss:shoes id="2";股票=真"mostWanted =真"><ss:title>阿马尔菲</ss:title><ss:brand>Dior</ss:brand><ss:category>骡子</ss:category><ss:season>冬天</ss:season><ss:female>female</ss:female></ss:性别><ss:详细信息><ss:highlights>突出显示文本 2</ss:highlights><ss:composition>作文文本2</ss:composition></ss:详细信息><ss:price>364.0</ss:price></ss:鞋子><ss:shoes id="3";股票=真"mostWanted =真"><ss:title>Korfu</ss:title><ss:brand>Mary Katrantzou</ss:brand><ss:category>运动鞋</ss:category><ss:season>春天</ss:season><ss:female>female</ss:female></ss:性别><ss:详细信息><ss:highlights>突出显示文本 3</ss:highlights><ss:composition>作文文本3</ss:composition></ss:详细信息><ss:price>173.0</ss:price></ss:鞋子></ss:鞋店>

还有一个用于鞋类的 Java 类

@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "Shoes", propOrder = {标题",品牌",类别",季节",性别",细节",价格"})公开课鞋扩展实体{@XmlElement(required = true)受保护的字符串标题;@XmlElement(required = true)@XmlSchemaType(name = "string")受保护的品牌品牌;@XmlElement(required = true)@XmlSchemaType(name = "string")受保护的类别;@XmlElement(required = true)@XmlSchemaType(name = "string")受保护的季节;@XmlElement(required = true)受保护的鞋子.性别性别;@XmlElement(required = true)受保护的鞋子.详细信息;受保护的双价;@XmlAttribute(name = "stock", required = true)受保护的布尔股票;@XmlAttribute(name = "mostWanted")受保护的布尔值最想要的;公共字符串 getTitle() {返回标题;}公共无效设置标题(字符串值){this.title = 值;}公共品牌 getBrand(){回归品牌;}公共无效setBrand(品牌价值){this.brand = 价值;}公共类别 getCategory(){退货类别;}public void setCategory(Category value){this.category = 值;}公共季节 getSeason(){回归季节;}public void setSeason(季节值){this.season = 价值;}public Shoes.Gender getGender() {回归性别;}public void setGender(Shoes.Gender value) {this.gender = 值;}public Shoes.Details getDetails() {退货详情;}public void setDetails(Shoes.Details value) {this.details = 值;}公共双 getPrice() {退货价格;}公共无效setPrice(双值){this.price = 价值;}公共布尔 isStock() {退货;}公共无效setStock(布尔值){this.stock = 价值;}公共布尔 isMostWanted() {返回最想要的;}公共无效setMostWanted(布尔值){this.mostWanted = 价值;}@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "", propOrder = {})公共静态类详细信息{@XmlElement(required = true)受保护的字符串突出显示;@XmlElement(required = true)受保护的字符串组合;公共字符串 getHighlights() {返回亮点;}public void setHighlights(String value) {this.highlights = 价值;}公共字符串 getComposition() {返回组合;}public void setComposition(String value) {this.composition = 值;}}@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "", propOrder = {\u043c\u0443\u0436\u0441\u043a\u043e\u0439Or\u0416\u0435\u043d\u0441\u043a\u0438\u0439"})公共静态类性别{@XmlElementRefs({@XmlElementRef(name = "\u0436\u0435\u043d\u0441\u043a\u0438\u0439", namespace = "http://www.example.org/ShoesShop", type = JAXBElement.class, required = false),@XmlElementRef(name = "\u043c\u0443\u0436\u0441\u043a\u043e\u0439", namespace = "http://www.example.org/ShoesShop", type = JAXBElement.class, required = false)})protected List>男女不限;公共列表<JAXBElement<String>>getMaleOrFemale() {if (maleOrFemale == null) {maleOrFemale = new ArrayList>();}返回 this.maleOrFemale;}}@覆盖公共字符串 toString(){StringBuilder builder = new StringBuilder();builder.append("[title=");builder.append(title);builder.append(",brand=");builder.append(brand);builder.append(", category=");builder.append(category);builder.append(", season=");builder.append(季节);builder.append(", price=");builder.append(价格);builder.append("]");返回 builder.toString();}}

我还需要知道如何将接收到的数据写入新的 XML 文件中.

解决方案

UPDATED: 对原始答案的评论:

<块引用>

它不起作用,它给出了同样的错误

这意味着问题是因为 shoes 变量是 null,这很容易在 调试器 中看到.使用调试器可以为我们节省很多时间,所以请开始使用.

为了使 shoes 成为 null,代码似乎遇到了一个 </code> 元素,它不是<code>Shoes</code> 元素.</p><p>要修复代码,请添加空检查,并在处理 <code>Shoes</code> 元素结束时设置 <code>shoes = null</code>:</p><pre class="lang-java prettyprint-override"><code>} else if (startElement.getName().getLocalPart().equals("title")) {if (shoes != null) {//<====== 添加这个shoes.setTitle(reader.getElementText());//<====== 解决这个问题(见原始答案)}</code></pre><p></p><pre class="lang-java prettyprint-override"><code>if (xmlEvent.isEndElement()) {EndElement endElement = xmlEvent.asEndElement();if (endElement.getName().getLocalPart().equals("Shoes")) {shoesList.add(shoes);鞋子=空;//<====== 添加这个}}</code></pre><p><hr/><p><em><strong>原始答案</strong></em></p><p>您的代码是:</p><pre class="lang-java prettyprint-override"><code>} else if (startElement.getName().getLocalPart().equals(title")){xmlEvent = reader.nextEvent();shoes.setTitle(xmlEvent.asCharacters().getData());</code></pre><p>问题在于,如果事件跟在 <code>START_ELEMENT</code> 事件之后,代码不会检查什么类型.可能是这样:</p><ul><li><p>最有可能的是,元素为空,即<code><title/></code>或<code><title><title/></code>,在这种情况下下一个事件是 <code>END_ELEMENT</code>,<code>asCharacters()</code> 返回 <code>null</code>.</p></li><li><p>元素有注释,例如<code><title><!-- 没有标题--><title/></code>,在这种情况下,下一个事件是<code>COMMENT</code>.</code>></li><li><p>该元素具有混合内容,例如<code><title>foo<![CDATA[bar]]><title/></code>,在这种情况下,下一个事件不是全文.</p></li></ul><p>检索元素的文本内容是如此常见,以至于他们为此添加了一个辅助方法:<a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLEventReader.html#getElementText--" rel="nofollow noreferrer"><code>getElementText()</code></a>:</p><块引用><p>读取纯文本元素的内容.前提条件:当前事件是<code>START_ELEMENT</code>.后置条件:当前事件为对应的<code>END_ELEMENT</code>.</p><p><strong>抛出:</strong><br/><code>XMLStreamException</code> - 如果当前事件不是 <code>START_ELEMENT</code> 或者遇到非文本元素</p></blockquote><p>这意味着您的代码应该是:</p><pre class="lang-java prettyprint-override"><code>} else if (startElement.getName().getLocalPart().equals("title")) {shoes.setTitle(reader.getElementText());</code></pre><p><p>I'm trying to write a StAX XML Parser in Java, but always get NullPointerException error. Please help me to solve this issue. Full problem:</p><blockquote> <p>Exception in thread "main" java.lang.NullPointerException at org.example.shoesshop.parser.STAXParser.parseXMLfile(STAXParser.java:68) at org.example.shoesshop.parser.STAXParser.main(STAXParser.java:101)</p> </blockquote><p>Here's a class for StAX Parser:</p><pre><code>public class STAXParser extends DefaultHandler { private static List<Shoes> parseXMLfile(String fileName){ List<Shoes> shoesList = new ArrayList<>(); Shoes shoes = null; XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); try { XMLEventReader reader = xmlInputFactory.createXMLEventReader(new FileInputStream(fileName)); while (reader.hasNext()){ XMLEvent xmlEvent = reader.nextEvent(); if(xmlEvent.isStartElement()){ StartElement startElement = xmlEvent.asStartElement(); if(startElement.getName().getLocalPart().equals("Shoes")){ shoes = new Shoes(); Attribute idAttr = startElement.getAttributeByName(new QName("id")); if(idAttr != null){ shoes.setId(Integer.parseInt(idAttr.getValue())); } } else if (startElement.getName().getLocalPart().equals("title")){ xmlEvent = reader.nextEvent(); shoes.setTitle(xmlEvent.asCharacters().getData()); // error line 68 } else if (startElement.getName().getLocalPart().equals("brand")){ xmlEvent = reader.nextEvent(); shoes.setBrand(Brand.fromValue(xmlEvent.asCharacters().getData())); } else if (startElement.getName().getLocalPart().equals("category")){ xmlEvent = reader.nextEvent(); shoes.setCategory(Category.fromValue(xmlEvent.asCharacters().getData())); } else if (startElement.getName().getLocalPart().equals("season")){ xmlEvent = reader.nextEvent(); shoes.setSeason(Season.fromValue(xmlEvent.asCharacters().getData())); } else if (startElement.getName().getLocalPart().equals("price")){ xmlEvent = reader.nextEvent(); shoes.setPrice(Double.parseDouble(xmlEvent.asCharacters().getData())); } } if(xmlEvent.isEndElement()){ EndElement endElement = xmlEvent.asEndElement(); if(endElement.getName().getLocalPart().equals("Shoes")){ shoesList.add(shoes); } } } } catch (FileNotFoundException | XMLStreamException exc) { exc.printStackTrace(); } return shoesList; } public static void main(String[] args) throws Exception { System.out.println("STAX Parser"); System.out.println(); System.out.println("Result: \n"); System.out.println(); String fileName = "ShoesShop.xml"; List<Shoes> shoesList = parseXMLfile(fileName); //error line 101 for (Shoes shoes:shoesList){ System.out.println(shoes.toString()); } } } </code></pre><p>Here's an XML-file</p><pre><code><?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type = "text/xsl" href = "ShoesShop.xsl"?> <ss:ShoesShop xmlns:ss="http://www.example.org/ShoesShop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/ShoesShop ShoesShop.xsd "> <ss:shoes id="1" stock="true"> <ss:title>Baltrum</ss:title> <ss:brand>Gucci</ss:brand> <ss:category>Boots</ss:category> <ss:season>fall</ss:season> <ss:gender> <ss:male>male</ss:male> </ss:gender> <ss:details> <ss:highlights>Highlights text 1</ss:highlights> <ss:composition>Composition text 1</ss:composition> </ss:details> <ss:price>734.0</ss:price> </ss:shoes> <ss:shoes id="2" stock="true" mostWanted = "true"> <ss:title>Amalfi</ss:title> <ss:brand>Dior</ss:brand> <ss:category>Mules</ss:category> <ss:season>winter</ss:season> <ss:gender> <ss:female>female</ss:female> </ss:gender> <ss:details> <ss:highlights>Highlights text 2</ss:highlights> <ss:composition>Composition text 2</ss:composition> </ss:details> <ss:price>364.0</ss:price> </ss:shoes> <ss:shoes id="3" stock="true" mostWanted = "true"> <ss:title>Korfu</ss:title> <ss:brand>Mary Katrantzou</ss:brand> <ss:category>Sneakers</ss:category> <ss:season>spring</ss:season> <ss:gender> <ss:female>female</ss:female> </ss:gender> <ss:details> <ss:highlights>Highlights text 3</ss:highlights> <ss:composition>Composition text 3</ss:composition> </ss:details> <ss:price>173.0</ss:price> </ss:shoes> </ss:ShoesShop> </code></pre><p>Also here's a Java class for Shoes</p><pre><code>@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Shoes", propOrder = { "title", "brand", "category", "season", "gender", "details", "price" }) public class Shoes extends Entity { @XmlElement(required = true) protected String title; @XmlElement(required = true) @XmlSchemaType(name = "string") protected Brand brand; @XmlElement(required = true) @XmlSchemaType(name = "string") protected Category category; @XmlElement(required = true) @XmlSchemaType(name = "string") protected Season season; @XmlElement(required = true) protected Shoes.Gender gender; @XmlElement(required = true) protected Shoes.Details details; protected double price; @XmlAttribute(name = "stock", required = true) protected boolean stock; @XmlAttribute(name = "mostWanted") protected Boolean mostWanted; public String getTitle() { return title; } public void setTitle(String value) { this.title = value; } public Brand getBrand(){ return brand; } public void setBrand(Brand value){ this.brand = value; } public Category getCategory(){ return category; } public void setCategory(Category value){ this.category = value; } public Season getSeason(){ return season; } public void setSeason(Season value) { this.season = value; } public Shoes.Gender getGender() { return gender; } public void setGender(Shoes.Gender value) { this.gender = value; } public Shoes.Details getDetails() { return details; } public void setDetails(Shoes.Details value) { this.details = value; } public double getPrice() { return price; } public void setPrice(double value) { this.price = value; } public boolean isStock() { return stock; } public void setStock(boolean value) { this.stock = value; } public Boolean isMostWanted() { return mostWanted; } public void setMostWanted(Boolean value) { this.mostWanted = value; } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { }) public static class Details { @XmlElement(required = true) protected String highlights; @XmlElement(required = true) protected String composition; public String getHighlights() { return highlights; } public void setHighlights(String value) { this.highlights = value; } public String getComposition() { return composition; } public void setComposition(String value) { this.composition = value; } } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "\u043c\u0443\u0436\u0441\u043a\u043e\u0439Or\u0416\u0435\u043d\u0441\u043a\u0438\u0439" }) public static class Gender { @XmlElementRefs({ @XmlElementRef(name = "\u0436\u0435\u043d\u0441\u043a\u0438\u0439", namespace = "http://www.example.org/ShoesShop", type = JAXBElement.class, required = false), @XmlElementRef(name = "\u043c\u0443\u0436\u0441\u043a\u043e\u0439", namespace = "http://www.example.org/ShoesShop", type = JAXBElement.class, required = false) }) protected List<JAXBElement<String>> maleOrFemale; public List<JAXBElement<String>> getMaleOrFemale() { if (maleOrFemale == null) { maleOrFemale = new ArrayList<JAXBElement<String>>(); } return this.maleOrFemale; } } @Override public String toString(){ StringBuilder builder = new StringBuilder(); builder.append("[title="); builder.append(title); builder.append(", brand="); builder.append(brand); builder.append(", category="); builder.append(category); builder.append(", season="); builder.append(season); builder.append(", price="); builder.append(price); builder.append("]"); return builder.toString(); } } </code></pre><p>Also I need to know how to write a received data into a new XML-file.</p><div class="h2_lin"> 解决方案 </div><p><em><strong>UPDATED:</strong></em> Comment to original answer:</p><blockquote> <p>It doesn't work, it gives the same error</p> </blockquote><p>That means the problem is because the <code>shoes</code> variable is <code>null</code>, as would have easily been seen with a <em>debugger</em>. Using a debugger would have saved us all a lot of time, so please start using one.</p> <p>In order for <code>shoes</code> to be <code>null</code>, it appears that the code encountered a <code><title></code> element that is not a child of a <code>Shoes</code> element.</p> <p>To fix the code, add a null-check, and also set <code>shoes = null</code> at the end of processing the <code>Shoes</code> element:</p><pre class="lang-java prettyprint-override"><code>} else if (startElement.getName().getLocalPart().equals("title")) { if (shoes != null) { // <===== ADD THIS shoes.setTitle(reader.getElementText()); // <===== Fix this (see original answer) } </code></pre><p> </p><pre class="lang-java prettyprint-override"><code>if (xmlEvent.isEndElement()) { EndElement endElement = xmlEvent.asEndElement(); if (endElement.getName().getLocalPart().equals("Shoes")) { shoesList.add(shoes); shoes = null; // <===== ADD THIS } } </code></pre><p> <hr /> <p><em><strong>ORIGINAL ANSWER</strong></em></p> <p>Your code is:</p><pre class="lang-java prettyprint-override"><code>} else if (startElement.getName().getLocalPart().equals("title")){ xmlEvent = reader.nextEvent(); shoes.setTitle(xmlEvent.asCharacters().getData()); </code></pre><p>The problem is that the code isn't checking what type if event follows the <code>START_ELEMENT</code> event. It could be that:</p> <ul> <li><p>Most likely, the element is empty, i.e. <code><title/></code> or <code><title><title/></code>, in which case the next event is an <code>END_ELEMENT</code>, and <code>asCharacters()</code> returned <code>null</code>.</p> </li> <li><p>The element has a comment, e.g. <code><title><!-- there is no title --><title/></code>, in which case the next event is a <code>COMMENT</code>.</p> </li> <li><p>The element has mixed content, e.g. <code><title>foo<![CDATA[bar]]><title/></code>, in which case the next event is not the full text.</p> </li> </ul> <p>Retrieving the text content of an element is such a common thing that they added a helper method for that: <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLEventReader.html#getElementText--" rel="nofollow noreferrer"><code>getElementText()</code></a>:</p><blockquote> <p>Reads the content of a text-only element. Precondition: the current event is <code>START_ELEMENT</code>. Postcondition: The current event is the corresponding <code>END_ELEMENT</code>.</p> <p><strong>Throws:</strong><br /> <code>XMLStreamException</code> - if the current event is not a <code>START_ELEMENT</code> or if a non text element is encountered</p> </blockquote><p>Which means that your code should be:</p><pre class="lang-java prettyprint-override"><code>} else if (startElement.getName().getLocalPart().equals("title")) { shoes.setTitle(reader.getElementText()); </code></pre><p> <p>这篇关于为什么在运行 StAX Parser 时会出现 NullPointerException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!</p> </div> <div class="arc-body-main-more"> <span onclick="unlockarc('2330384');">查看全文</span> </div> </div> <div> </div> <div class="wwads-cn wwads-horizontal" data-id="166" style="max-width:100%;border: 4px solid #666;"></div> </div> </article> <div id="arc-ad-2" class="mb-1"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5038752844014834" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5038752844014834" data-ad-slot="3921941283"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <div class="widget bgwhite radius-1 mb-1 shadow widget-rel"> <h5>相关文章</h5> <ul> <li> <a target="_blank" title="为什么在运行 StAX Parser 时出现 NullPointerException?" href="/2797821.html"> 为什么在运行 StAX Parser 时出现 NullPointerException?; </a> </li> <li> <a target="_blank" title="为什么在运行 ADF 测试时会出现 MemoryError?" href="/2441436.html"> 为什么在运行 ADF 测试时会出现 MemoryError?; </a> </li> <li> <a target="_blank" title="为什么在运行Android项目时会出现重复的类" href="/1908329.html"> 为什么在运行Android项目时会出现重复的类; </a> </li> <li> <a target="_blank" title="为什么在初始化Spring时会出现NullPointerException" href="/979713.html"> 为什么在初始化Spring时会出现NullPointerException; </a> </li> <li> <a target="_blank" title="为什么在运行 Rspec 时会出现未定义的方法“有"错误?" href="/2757944.html"> 为什么在运行 Rspec 时会出现未定义的方法“有"错误?; </a> </li> <li> <a target="_blank" title="为什么在将String与null进行比较时会出现NullPointerException?" href="/963133.html"> 为什么在将String与null进行比较时会出现NullPointerException?; </a> </li> <li> <a target="_blank" title="为什么下载数据时会出现UnauthorizedAccessException?" href="/2079842.html"> 为什么下载数据时会出现UnauthorizedAccessException?; </a> </li> <li> <a target="_blank" title="自定义ArrayAdapter:为什么会出现NullPointerException?" href="/1776615.html"> 自定义ArrayAdapter:为什么会出现NullPointerException?; </a> </li> <li> <a target="_blank" title="为什么使用pandas apply时会出现AttributeError?" href="/1725451.html"> 为什么使用pandas apply时会出现AttributeError?; </a> </li> <li> <a target="_blank" title="为什么从 eclipse 运行 Google App 时会出现以下错误?" href="/2672693.html"> 为什么从 eclipse 运行 Google App 时会出现以下错误?; </a> </li> <li> <a target="_blank" title="保存到 cassandra 时有时会出现 NullPointerException" href="/2553967.html"> 保存到 cassandra 时有时会出现 NullPointerException; </a> </li> <li> <a target="_blank" title="为什么在使用 pandas apply 时会出现 AttributeError?" href="/2569211.html"> 为什么在使用 pandas apply 时会出现 AttributeError?; </a> </li> <li> <a target="_blank" title="为什么加载我的fxml时会出现stackoverflow?" href="/1001236.html"> 为什么加载我的fxml时会出现stackoverflow?; </a> </li> <li> <a target="_blank" title="为什么Dash上传文件时会出现解析错误?" href="/1754405.html"> 为什么Dash上传文件时会出现解析错误?; </a> </li> <li> <a target="_blank" title="为什么Selenium驱动程序上会出现NullPointerException?" href="/1879577.html"> 为什么Selenium驱动程序上会出现NullPointerException?; </a> </li> <li> <a target="_blank" title="为什么使用 BeautifulSoup 和 IDLE 时会出现递归错误?" href="/2708778.html"> 为什么使用 BeautifulSoup 和 IDLE 时会出现递归错误?; </a> </li> <li> <a target="_blank" title="为什么调用父构造函数时会出现致命错误?" href="/546635.html"> 为什么调用父构造函数时会出现致命错误?; </a> </li> <li> <a target="_blank" title="将 String 与 null 进行比较时,为什么会出现 NullPointerException?" href="/2774062.html"> 将 String 与 null 进行比较时,为什么会出现 NullPointerException?; </a> </li> <li> <a target="_blank" title="为什么包含OpenSSL静态库时会出现编译错误?" href="/935460.html"> 为什么包含OpenSSL静态库时会出现编译错误?; </a> </li> <li> <a target="_blank" title="为什么当将对象转换为整型时会出现InvalidCastException?" href="/505193.html"> 为什么当将对象转换为整型时会出现InvalidCastException?; </a> </li> <li> <a target="_blank" title="为什么当我想安装扩展时会出现 PHP 致命错误" href="/2507130.html"> 为什么当我想安装扩展时会出现 PHP 致命错误; </a> </li> <li> <a target="_blank" title="为什么在设置 IHTMLInputTextElement 的值时会出现访问冲突?" href="/2612378.html"> 为什么在设置 IHTMLInputTextElement 的值时会出现访问冲突?; </a> </li> <li> <a target="_blank" title="为什么从对象获取信息时会出现StackOverflow Error?" href="/2888380.html"> 为什么从对象获取信息时会出现StackOverflow Error?; </a> </li> <li> <a target="_blank" title="为什么包含 OpenSSL 静态库时会出现编译错误?" href="/2843203.html"> 为什么包含 OpenSSL 静态库时会出现编译错误?; </a> </li> <li> <a target="_blank" title="为什么将指针转换为 bool 时会出现性能警告?" href="/2750811.html"> 为什么将指针转换为 bool 时会出现性能警告?; </a> </li> </ul> </div> <div class="mb-1"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5038752844014834" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5038752844014834" data-ad-slot="3921941283"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="side"> <div class="widget widget-side bgwhite mb-1 shadow"> <h5>Java开发最新文章</h5> <ul> <li> <a target="_blank" title="Tomcat 404错误:原始服务器没有找到目标资源的当前表示,或者不愿意透露该目录的存在" href="/664384.html"> Tomcat 404错误:原始服务器没有找到目标资源的当前表示,或者不愿意透露该目录的存在; </a> </li> <li> <a target="_blank" title="由于缺少ServletWebServerFactory bean,无法启动ServletWebServerApplicationContext" href="/908134.html"> 由于缺少ServletWebServerFactory bean,无法启动ServletWebServerApplicationContext; </a> </li> <li> <a target="_blank" title="无法反序列化的java.util.ArrayList实例出来VALUE_STRING的" href="/231593.html"> 无法反序列化的java.util.ArrayList实例出来VALUE_STRING的; </a> </li> <li> <a target="_blank" title="什么是AssertionError?在这种情况下,我应该从我自己的代码中抛出?" href="/741560.html"> 什么是AssertionError?在这种情况下,我应该从我自己的代码中抛出?; </a> </li> <li> <a target="_blank" title="JSON反序列化投掷例外 - 无法反序列化的java.util.ArrayList实例出来START_OBJECT令牌" href="/232414.html"> JSON反序列化投掷例外 - 无法反序列化的java.util.ArrayList实例出来START_OBJECT令牌; </a> </li> <li> <a target="_blank" title="Maven构建错误 - 无法执行目标org.apache.maven.plugins:Maven的组装插件:2.5.5" href="/345036.html"> Maven构建错误 - 无法执行目标org.apache.maven.plugins:Maven的组装插件:2.5.5; </a> </li> <li> <a target="_blank" title="正确使用Optional.ifPresent()" href="/998833.html"> 正确使用Optional.ifPresent(); </a> </li> <li> <a target="_blank" title="获取异常(org.apache.poi.openxml4j.exception - 没有内容类型[M1.13])阅读使用Apache POI XLSX文件时?" href="/219241.html"> 获取异常(org.apache.poi.openxml4j.exception - 没有内容类型[M1.13])阅读使用Apache POI XLSX文件时?; </a> </li> <li> <a target="_blank" title="SpringBoot - 制作jar文件 - 在META-INF / spring.factories中找不到自动配置类" href="/907745.html"> SpringBoot - 制作jar文件 - 在META-INF / spring.factories中找不到自动配置类; </a> </li> <li> <a target="_blank" title="HTTP状态404 - 请求的资源(/)不可用" href="/659888.html"> HTTP状态404 - 请求的资源(/)不可用; </a> </li> </ul> </div> <div class="widget widget-side bgwhite mb-1 shadow"> <h5> 热门教程 </h5> <ul> <li> <a target="_blank" title="Java教程" href="/OnLineTutorial/java/index.html"> Java教程 </a> </li> <li> <a target="_blank" title="Apache ANT 教程" href="/OnLineTutorial/ant/index.html"> Apache ANT 教程 </a> </li> <li> <a target="_blank" title="Kali Linux教程" href="/OnLineTutorial/kali_linux/index.html"> Kali Linux教程 </a> </li> <li> <a target="_blank" title="JavaScript教程" href="/OnLineTutorial/javascript/index.html"> JavaScript教程 </a> </li> <li> <a target="_blank" title="JavaFx教程" href="/OnLineTutorial/javafx/index.html"> JavaFx教程 </a> </li> <li> <a target="_blank" title="MFC 教程" href="/OnLineTutorial/mfc/index.html"> MFC 教程 </a> </li> <li> <a target="_blank" title="Apache HTTP客户端教程" href="/OnLineTutorial/apache_httpclient/index.html"> Apache HTTP客户端教程 </a> </li> <li> <a target="_blank" title="Microsoft Visio 教程" href="/OnLineTutorial/microsoft_visio/index.html"> Microsoft Visio 教程 </a> </li> </ul> </div> <div class="widget widget-side bgwhite mb-1 shadow"> <h5> 热门工具 </h5> <ul> <li> <a target="_blank" title="Java 在线工具" href="/Onlinetools/details/4"> Java 在线工具 </a> </li> <li> <a target="_blank" title="C(GCC) 在线工具" href="/Onlinetools/details/6"> C(GCC) 在线工具 </a> </li> <li> <a target="_blank" title="PHP 在线工具" href="/Onlinetools/details/8"> PHP 在线工具 </a> </li> <li> <a target="_blank" title="C# 在线工具" href="/Onlinetools/details/1"> C# 在线工具 </a> </li> <li> <a target="_blank" title="Python 在线工具" href="/Onlinetools/details/5"> Python 在线工具 </a> </li> <li> <a target="_blank" title="MySQL 在线工具" href="/Onlinetools/Dbdetails/33"> MySQL 在线工具 </a> </li> <li> <a target="_blank" title="VB.NET 在线工具" href="/Onlinetools/details/2"> VB.NET 在线工具 </a> </li> <li> <a target="_blank" title="Lua 在线工具" href="/Onlinetools/details/14"> Lua 在线工具 </a> </li> <li> <a target="_blank" title="Oracle 在线工具" href="/Onlinetools/Dbdetails/35"> Oracle 在线工具 </a> </li> <li> <a target="_blank" title="C++(GCC) 在线工具" href="/Onlinetools/details/7"> C++(GCC) 在线工具 </a> </li> <li> <a target="_blank" title="Go 在线工具" href="/Onlinetools/details/20"> Go 在线工具 </a> </li> <li> <a target="_blank" title="Fortran 在线工具" href="/Onlinetools/details/45"> Fortran 在线工具 </a> </li> </ul> </div> </div> </div> <script type="text/javascript">var eskeys = '为什么,在,运行,stax,parser,时会,出现,nullpointerexception'; var cat = 'cc';';//java</script> </div> <div id="pop" onclick="pophide();"> <div id="pop_body" onclick="event.stopPropagation();"> <h6 class="flex flex101"> 登录 <span onclick="pophide();">关闭</span> </h6> <div class="pd-1"> <div class="wxtip center"> <span>扫码关注<em>1秒</em>登录</span> </div> <div class="center"> <img id="qr" src="https://huajiakeji.com/Content/Images/qrydx.jpg" alt="" style="width:150px;height:150px;" /> </div> <div style="margin-top:10px;display:flex;justify-content: center;"> <input type="text" placeholder="输入验证码" id="txtcode" autocomplete="off" /> <input id="btngo" type="button" onclick="chk()" value="GO" /> </div> <div class="center" style="margin: 4px; font-size: .8rem; color: #f60;"> 发送“验证码”获取 <em style="padding: 0 .5rem;">|</em> <span style="color: #01a05c;">15天全站免登陆</span> </div> <div id="chkinfo" class="tip"></div> </div> </div> </div> <script type="text/javascript" src="https://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> <script type="text/javascript" src="https://img01.yuandaxia.cn/Scripts/highlight.min.js"></script> <script type="text/javascript" src="https://img01.yuandaxia.cn/Scripts/base.js?v=0.22"></script> <script type="text/javascript" src="https://img01.yuandaxia.cn/Scripts/tui.js?v=0.11"></script> <footer class="footer"> <div class="container"> <div class="flink mb-1"> 友情链接: <a href="https://www.it1352.com/" target="_blank">IT屋</a> <a href="https://huajiakeji.com/" target="_blank">Chrome插件</a> <a href="https://www.cnplugins.com/" target="_blank">谷歌浏览器插件</a> </div> <section class="copyright-section"> <a href="https://www.it1352.com" title="IT屋-程序员软件开发技术分享社区">IT屋</a> ©2016-2022 <a href="http://www.beian.miit.gov.cn/" target="_blank">琼ICP备2021000895号-1</a> <a href="/sitemap.html" target="_blank" title="站点地图">站点地图</a> <a href="/Home/Tags" target="_blank" title="站点标签">站点标签</a> <a target="_blank" alt="sitemap" href="/sitemap.xml">SiteMap</a> <a href="/1155981.html" title="IT屋-免责申明"><免责申明></a> 本站内容来源互联网,如果侵犯您的权益请联系我们删除. </section> <!--统计代码--> <script type="text/javascript"> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?0c3a090f7b3c4ad458ac1296cb5cc779"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script type="text/javascript"> (function () { var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </div> </footer> </body> </html>