小编Yog*_*ogu的帖子

在GlassFish 4.0中为xerces使用认可的标准覆盖机制

如何使用认可的标准机制在GlassFish 4.0 WAR应用程序中使用xerces?根据文档*,你应该把它放进去domain-dir/lib/endorsed.但是,当我将xercesImpl,xml-apis以及xml-resolver放在那里时,这些类在WAR中的类中不可用.这最可能是由于文档和默认配置之间的不一致:domain.xml不列出domain-dir/lib/endorsed.

当我包含它或放入文件时glassfish-install-dir/lib/endorsed,启动失败,出现以下异常:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
    at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Caused by: A MultiException has 5 exceptions.  They are:
1. javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxOutputFactory not found
2. java.lang.IllegalStateException: Unable to perform operation: create on com.sun.enterprise.v3.server.DomainXmlPersistence
3. javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
4. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.sun.enterprise.v3.server.GFDomainXml errors were found
5. java.lang.IllegalStateException: Unable …
Run Code Online (Sandbox Code Playgroud)

java glassfish endorsed xerces2-j java-ee-7

6
推荐指数
0
解决办法
667
查看次数

使用docker swarm自动配置新主机

当docker swarm检测到没有足够的资源来安排所有服务时,如何自动配置新机器?

我使用rancher和docker swarm调度程序的设置,如果资源不足,服务创建失败:

exit status 1: Creating stresstest2_workerb1_1 Creating stresstest2_workerb2_1 no resources available to schedule container
Run Code Online (Sandbox Code Playgroud)

我可以轮询这个状态并在需要时调用docker机器,但是rancher不会尝试重新安排丢失的服务.我想知道是否有更集成的解决方案,也许是docker swarm中的一个钩子,可以用来动态调用docker-machine来创建或删除机器.

我目前正在使用Docker 1.11 + Docker Swarm或Docker 1.12在Swarm模式下决定Rancher,所以任何解决方案都可以.

docker docker-swarm docker-machine rancher

5
推荐指数
1
解决办法
271
查看次数

从 WebStorm 运行 Jasmine 测试

WebStorm 在 Jasmine 的测试用例旁边显示图标,似乎应该有一个运行它的选项,但菜单只是说:Nothing here

WebStrom 测试套件

由于我没有找到有关此功能的任何文档,我想知道是否应该可以运行这样的测试,如果可以,条件是什么。

javascript intellij-idea node.js jasmine webstorm

5
推荐指数
1
解决办法
1588
查看次数

将值插入SQL float列会生成奇怪的结果

我正在研究一个传统的ASP应用程序.我试图将值(40.33)插入到SQL Server 2000中恰好是浮点类型的字段中.我在应用程序中看到的每个地方(通过一些日志记录)都会向存储过程发送40.33.当我在调用时对数据库运行SQL事件探查器时,我在跟踪中看到的值是4.033000183105469e + 001

所有额外的垃圾来自哪里(183105469)?

为什么当我通过40或40.25时没有什么额外的?

这只是使用float的奇怪副作用之一吗?当我写一些东西时,我通常使用金钱或小数或其他东西,所以不熟悉float数据类型.

sql sql-server floating-point

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

使用位操作将两个数字相加

我正在解决GeeksForGeeks的以下练习问题:

编写一个函数 Add() 返回两个整数之和。该函数不应使用任何算术运算符(+、++、–、-、.. 等)。

C#中给定的解决方案是:

public static int Add(int x, int y)
{
    // Iterate till there is no carry  
    while (y != 0)
    {
        // carry now contains common set bits of x and y
        int carry = x & y;

        // Sum of bits of x and y where at least one of the bits is not set
        x = x ^ y;

        // Carry is shifted by one so that adding it to x …
Run Code Online (Sandbox Code Playgroud)

c# algorithm bit-manipulation

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

命名空间不在类库c#中工作

我正在尝试使用我在另一个项目中创建的一些类来创建一个类库.其中一个类使用图像并需要System.Drawing命名空间.但是,当我尝试将我的项目中的代码复制到我的类库中的新类时,我得到一个错误,说当前上下文中不存在图像对象,并且

命名空间System中不存在类型或命名空间名称"Drawing"(您是否缺少using指令或程序集引用?)

作为另一个项目的一部分,它在其他类中工作正常.为什么会这样?

.net c#

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

如何使用PHP File api写入原始字节?

我想将原始字节/字节流写入文件中的位置.这就是我目前所拥有的:

$fpr = fopen($out, 'r+');
fseek($fpr, 1); //seek to second byte
fwrite($fpr, 0x63); 
fclose($fpr);
Run Code Online (Sandbox Code Playgroud)

这当前从字节偏移1开始写入实际字符串值"99".IE,它写入字节"9"和"9".我只想写实际的一个字节值0x63,恰好代表数字99.

谢谢你的时间.

php file-io

2
推荐指数
1
解决办法
5948
查看次数

PHP问题$ _GET

$_GETvar 有一个非常奇怪的问题.

这是我的代码:

if(isset($_GET['offer'])) {
    $params = array();
    $params['wifi'] = "%wifi%";
    $params['publisher'] = "%pubid%";
    $params['framework'] = "%framework%";
    $params['date'] = "%cachebuster%";

    foreach($params as $key=>$param){

    $array[$_GET[$key]] = $_GET[$key];

    }

    print_r($array);
}
Run Code Online (Sandbox Code Playgroud)

这是我发送的网址:http: //example.com/track/?offer = g58fFPK49fk4&click_id =%guid%&wifi =%wifi%&publisher = appubid%&framework =%framework%&date =%cachebuster%

这是我得到的奇怪输出:

Array ( [%wifi%] => %wifi% [%pubid%] => %pubid% [%framework%] => %framework% [Êchebuster%] => Êchebuster% )
Run Code Online (Sandbox Code Playgroud)

为什么%cachebuster%会变成Êchebuster%

php get

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

PHP从文件中删除

嗨,我已搜索周围,没有什么是相当我需要什么,我是可怕的用PHP迄今.

基本上,我有一个文本文件作为数据库.

每行都有以下形式:

id|lat|lng|details
Run Code Online (Sandbox Code Playgroud)

哪里:

id是唯一的整数,latlng是浮子和details是一个字符串.

我有一个客户端页面(在user-pass下锁定),其中用户输入唯一ID,PHP脚本应该删除文件中具有该唯一ID的行.

我该如何做到这一点?

谢谢,

php file-io

0
推荐指数
1
解决办法
484
查看次数

登录脚本需要PHP帮助

当我使用正确的用户名和密码登录时,我收到错误"错误的用户名或密码"数据库连接有效,我认为密码+用户名检查有问题.

    <?php
    $host="mysql12-int.cp.hostnet.nl"; // Host name
    $username="u33936_mick"; // username
    $password="//password was correct"; // password
    $db_name="db33936_axe"; // Database name
    $tbl_name="users"; // Table name


    mysql_connect("$host", "$username", "$password");
    mysql_select_db("$db_name");



    $myusername = stripslashes($myusername);
    $mypassword = stripslashes($mypassword);
    $myusername = mysql_real_escape_string($myusername);
    $mypassword = mysql_real_escape_string($mypassword);
    $sql = 'SELECT * FROM `users` LIMIT 0, 30 WHERE username="$myusername" and        
    password="$mypassword"';
    $result=mysql_query($sql);


    $count=mysql_num_rows($result);



    if($count==1){
      session_register("username");
      session_register("password");
      header("location:index.php");
    } else {
      echo "Wrong Username or Password";
    }
    ?> 
Run Code Online (Sandbox Code Playgroud)

这是我的表格

     <form name="login" method="post" action="login.php">
                <fieldset id="inputs">
                    <input id="myusername" type="text" name="myusername"    
    placeholder="Username" required=""> …
Run Code Online (Sandbox Code Playgroud)

php forms login

0
推荐指数
1
解决办法
298
查看次数