小编jav*_*uin的帖子

sun.net.httpserver太多字节无法写入流

我写了我自己的小http服务器 com.sun.net.httpserver.HttpServer

public void handle(HttpExchange t) throws IOException {
    OutputStream os = t.getResponseBody();
    os.write(generateResponse(t).getBytes());
    os.close();
}
Run Code Online (Sandbox Code Playgroud)

如果我尝试写入输出流并且响应较大,则1024会出现以下异常:

java.io.IOException: insufficient bytes written to stream
        at sun.net.httpserver.FixedLengthOutputStream.close(FixedLengthOutputStream.java:89)
        at sun.net.httpserver.PlaceholderOutputStream.close(ExchangeImpl.java:454)
        at MyHttpServer$MyHandler.handle(MyHttpServer.java:49)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
        at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
        at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
        at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
        at sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:158)
        at sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:431)
        at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:396)
        at java.lang.Thread.run(Thread.java:745)
Run Code Online (Sandbox Code Playgroud)

java http

5
推荐指数
2
解决办法
3422
查看次数

有没有一种简单的方法来创建一个新的Wildfly服务器实例

有没有一种简单的方法来创建一个新的Wildfly服务器实例.

在JBoss AS5中你所要做的就是创建一个默认或全部的副本并启动jboss:

run.sh -c [New instance name]
Run Code Online (Sandbox Code Playgroud)

没有这样的选择 standalone.sh

jboss5.x wildfly

4
推荐指数
1
解决办法
2492
查看次数

最后一页的 XSL-FO 页脚

我有一个带有页眉和页脚的 XSL-FO 文件。

我为页眉和页脚添加了静态内容,但我希望页脚只显示在最后一页。

我怎样才能做到这一点?

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
        <fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm"
                               margin-left="1cm" margin-right="1cm">
            <fo:region-body margin-top="90mm" margin-bottom="80mm"/>
            <fo:region-before extent="90mm"/>
            <fo:region-after extent="80mm"/>
            <fo:region-start/>
            <fo:region-end/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="A4">
        <fo:static-content flow-name="xsl-region-before">
            <fo:block>
                <fo:external-graphic src="images/logo.png" content-width="scale-to-fit" height="50mm"/>
            </fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after">
            <fo:block>
                <fo:external-graphic src="images/signature.gif" content-width="scale-to-fit" height="50mm"/>
            </fo:block>
        </fo:static-content>
        <fo:flow flow-name="xsl-region-body">
            ...
        </fo:flow>
    </fo:page-sequence>
</fo:root>
Run Code Online (Sandbox Code Playgroud)

static xsl-fo footer

3
推荐指数
1
解决办法
5459
查看次数

libocci.so:未定义的引用

我正在尝试使用 occi 连接到 oracle,但没有成功。

  • 操作系统 = Ubuntu 14.04 LTS
  • g++ = g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2
  • Oracle 客户端 = 11.2.0.3

我下载并解压:

  • Instantclient-basic-linux.x64-11.2.0.3.0.zip
  • Instantclient-sdk-linux.x64-11.2.0.3.0.zip
  • Instantclient-sqlplus-linux.x64-11.2.0.3.0.zip

sqlplus 可以很好地连接到数据库。

我尝试编译我的代码:

g++ -o target/benefits_select benefits_select.cpp -L/data/etc/oracle/instantclient_11_2 -I/data/etc/oracle/instantclient_11_2/sdk/include -locci
Run Code Online (Sandbox Code Playgroud)

我得到以下结果:

/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `OCISubscriptionDisable'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `ldxend'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `OCIPConvertRowidToUb1'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `OCIPGetDefTZ'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `OCITypeByRef'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `OCIDateTimeGetTimeZoneName'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `lxgucs2utf'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `lnxsgn'
/data/etc/oracle/instantclient_11_2/libocci.so: undefined reference to `OCIPGetErrorMessage'
/data/etc/oracle/instantclient_11_2/libocci.so: …
Run Code Online (Sandbox Code Playgroud)

c++ linux oracle

3
推荐指数
1
解决办法
5702
查看次数

在 nginx 日志文件名中包含日期

我正在运行 nginx 1.15.6,并且尝试在 nginx 日志文件名中包含当前日期。

像这样的事情:access_log /var/log/nginx/access.2018.11.07.log main;

有人知道怎么做吗?

nginx

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

footer ×1

http ×1

java ×1

jboss5.x ×1

linux ×1

nginx ×1

oracle ×1

static ×1

wildfly ×1

xsl-fo ×1