我正在将一个excel(xls)文件上传到s3,然后另一个应用程序应该从s3下载该文件并使用Apache POI阅读器进行解析.读者接受inputstream类型作为输入,但要正确解析它所期望的excel PushbackInputStream.我从s3下载的文件中获得的输入流是类型的S3ObjectInputStream.我如何转换S3ObjectInputStream为PushbackInputStream?
我尝试直接传递S3ObjectInputStream(因为这是一个inputStream)PushbackInputStream,但它导致以下异常:
org.springframework.batch.item.ItemStreamException: Failed to initialize the reader
at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:147)
at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:96)
.....
.....
Caused by: java.lang.IllegalStateException: InputStream MUST either support mark/reset, or be wrapped as a PushbackInputStream
at org.springframework.batch.item.excel.poi.PoiItemReader.openExcelFile(PoiItemReader.java:82)
.....
Run Code Online (Sandbox Code Playgroud)
我尝试将S3ObjectInputStream转换为PushbackInputStream,但它导致了classcastexception.
java.lang.ClassCastException: com.amazonaws.services.s3.model.S3ObjectInputStream cannot be cast to java.io.PushbackInputStream
Run Code Online (Sandbox Code Playgroud)
任何人都知道解决方案
我正在使用Selenium 3.3.1,我正在测试下面的代码.
运行后显示以下错误:
线程"main"中的异常java.lang.IllegalStateException:驱动程序可执行文件的路径必须由webdriver.gecko.driver系统属性设置; 有关更多信息,请参阅 https://github.com/mozilla/geckodriver.最新版本可以从https://github.com/mozilla/geckodriver/releases下载到 com.google.common.base.Preconditions.checkState(Preconditions.java:738)org.openqa.selenium.remote.service.位于org.openqa.selenium.firefox.GeckoDriverService.access的DriverService.findExecutable(DriverService.java:111)org.openqa.selenium.firefox.GeckoDriverService上的$ 100(GeckoDriverService.java:38)$ Builder.findDefaultExecutable(GeckoDriverService.java:112 )org.openqa.selenium.remote.service.DriverService $ Builder.build(DriverService.java:302)org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:233)org.openqa.selenium. firefox.FirefoxDriver.(FirefoxDriver.java:125)位于Selenium_login的Selenium_login.(Selenium_login.java:13)org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:121).(Selenium_login.java:70) /home/ali/.cache/netbeans/dev/executor-snippets/run.xml:53:Java返回:1 BUILD FAILED(总时间:0秒)
Java代码:
import java.io.*;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Selenium_login {
public WebDriver driver = new FirefoxDriver();
/**
* Open the test website.
*/
public void openTestSite() {
driver.navigate().to("http://testing-ground.scraping.pro/login");
}
/**
*
* @param username
* @param Password
*
* Logins into the website, by entering provided username and
* …Run Code Online (Sandbox Code Playgroud) <?php echo Form::open(['method' => 'POST', 'url' => ['/cart/add/'. "{{$product->product_id }}"]] )?>
<?php echo Form::button('Agregar al Carro', ['class' => 'btn-u btn-u-sea-shop btn-u-lg', 'type' => 'submit']) ?>
<?php echo Form::close() ?>
Run Code Online (Sandbox Code Playgroud)
我需要$product在模板中打印变量。
是否有CSS方式来制作onclick删除线按钮。因此,当您单击按钮(文本)时,所选链接将获得删除线text-decoration?
随附图片作为说明。

在解析XML文件时,我的文档构建器正在寻找DTD,有时它会引发错误(服务器崩溃)。因此,当我用Google搜索时,从这里得到了以下解决方案,在解析XML时忽略了DTD(我使用的解决方案是VOTE --- 90)。我的IDE中的字母显示以下错误。
The method setFeature(String, boolean) is undefined for the type DocumentBuilderFactory
然后我认为这是我的Maven版本的问题,然后找到了以下链接。
它说它是内置在JDK中的,所以IDE本身会建议我导入。
我的JDK版本是
Java版本“ 1.8.0_121” Java™SE运行时环境(内部版本1.8.0_121-b13)Java HotSpot(TM)64位服务器VM(内部版本25.121-b13,混合模式)
我正在使用Ionize cms作为我网站的后端,我想创建自己的标签 - 用于从我自己的表中传递数据.我已经按照本教程创建自定义标记,并通过它 - 将数据传递给视图,但我不断收到错误:
标签缺失:演示,范围:.
这是我的观点:
<ul>
<ion:demo:details>
<li><ion:detail field="user_name" /></li>
</ion:demo:details>
</ul>
Run Code Online (Sandbox Code Playgroud)
以下是我添加到TagManager.php的更改
public static $tag_definitions = array
(
// <ion:demo:authors /> calls the method “tag_details”
"demo:details" => "tag_details",
"demo:details:detail" => "tag_detail",
);
Run Code Online (Sandbox Code Playgroud)
我还尝试创建一个简单的codeigniter控制器并使用view()传递数据并执行以下操作:
<ul>
<?php foreach($details as $detail): ?>
<li>
<?php echo $detail['name'] ?>
</li>
<?php endforeach ;?>
</ul>
Run Code Online (Sandbox Code Playgroud)
但是我得到了未定义的错误$details.
我正在为刚接触开发的人准备一个小项目.它包含一些HTML内容,他们应该用Javascript制作一些形状,如矩形或三角形.表格应该由"*""绘制".由于我将介绍 元素和一些简单的for和if-constructs,我希望它们创建一个如下所示的矩形:
* * * *
* * *
* * * *
* * *
* * * *
Run Code Online (Sandbox Code Playgroud)
在不同的大小.
我可以想象一个看起来像这样的代码:
for (j = 0; j < 10; j++) {
for (i = 1; i <= 20; i++) {
if (j % 2 == 1) {
if (i % 2 == 1) {
document.write("*");
} else {
document.write(" ");
}
} else {
if (i % 2 != 1) {
document.write("*");
} else {
document.write(" ");
}
}
}
document.write("<br/>"); …Run Code Online (Sandbox Code Playgroud)我只想在我的标题下划线 50%。这是我的代码,尝试使用border-bottom.
h1{
font-size:50px;
font-weight: bold;
border-bottom: 5px solid blue;
}Run Code Online (Sandbox Code Playgroud)
<div>
<h1>TITLE</h1>
</div>Run Code Online (Sandbox Code Playgroud)
我正在尝试创建一个外部发光效果来包围图像。
正如您在下面的代码段中看到的那样,使用该box-shadow属性,我只能将发光相对于图像大小降低,从而产生类似阴影的效果,而不是围绕整个图像的发光。
有什么办法可以达到这个效果吗?
#container {
background-color: black;
height: 100px;
width: 100px;
padding: 30px;
}
img {
border-radius: 50%;
width: 100px;
box-shadow: -10px -10px 10px -10px rgba(255, 255, 255, 1);
}Run Code Online (Sandbox Code Playgroud)
<div id='container'>
<img src='http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png' />
</div>Run Code Online (Sandbox Code Playgroud)
我有一个类
public class CreditCardDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements creditcard.CreditCardDocument
{
public CreditCardDocumentImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType);
}
}
Run Code Online (Sandbox Code Playgroud)
该类正在实现“CreditCardDocument”接口。
界面就像
public interface CreditCardDocument extends org.apache.xmlbeans.XmlObject
{
Run Code Online (Sandbox Code Playgroud)
现在,如果我想访问该构造函数
CreditCardDocument creditCardDocument = new CreditCardDocumentImpl(CreditCardDocumentImpl.class.instanceType());
Run Code Online (Sandbox Code Playgroud)
它抛出错误,
groovy.lang.MissingMethodException: No signature of method: static creditcard.impl.CreditCardDocumentImpl.instanceType() is applicable for argument types: () values: []
Run Code Online (Sandbox Code Playgroud)
我不明白是什么错误。我需要传递给构造函数的参数是什么?
css ×4
html ×4
java ×4
php ×2
amazon-s3 ×1
apache-poi ×1
codeigniter ×1
dom ×1
echo ×1
excel ×1
firefox ×1
fonts ×1
inputstream ×1
java-8 ×1
javascript ×1
laravel ×1
maven ×1
selenium ×1
xml ×1
xmlbeans ×1