小编use*_*262的帖子

无法在Eclipse中将应用程序部署到Glassfish 4.1

我在Ubuntu上安装了Glassfish 4.1和Eclipse Luna.当我尝试运行一个简单的Web应用程序(jsp + servlet + java bean)时,我收到了以下错误:

Publishing to Glassfish 4 at localhost[domain1].. has encountered a problem. cannot Deploy mvcprj1 deploy is failing=Application with name [mvcprj1] is not deployed

glassfish服务器日志或eclipse控制台中都没有出现任何内容.

java eclipse glassfish java-ee

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

Django-rest-auth使用cookie代替Authorization标头

我想使用Django Rest Framework作为后端来构建SPA应用程序。该应用程序将使用令牌身份验证。

为了获得最大的安全性,我想将身份验证令牌存储在httpOnly cookie中,因此无法从javascript访问它。但是,由于无法从javascript访问cookie,因此无法设置“ Authorization:Token ...”标头。

因此,我的问题是,我可以使DRF身份验证系统(或Django-Rest-Knox / Django-Rest-JWT)从Cookie中读取身份验证令牌,而不是从“ Authorization”标头中读取身份验证令牌吗?还是“授权”标头是在DRF中进行身份验证的唯一正确方法?

django cookies django-rest-framework django-rest-auth django-rest-framework-jwt

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

在Glassfish中,Derby Pool ping失败并出现java.net.ConnectException

我刚刚在Ubuntu 14.04上安装了Glassfish 4.1并尝试ping DerbyPool但是它失败了java.net.ConnectException.

DerbyPool的Ping连接池失败.无法分配连接,因为:java.net.ConnectException:在端口1527上连接到服务器localhost时出错,并显示消息Connection refused.请查看server.log以获取更多详细信息.

server.log中:

[2015-01-02T20:51:12.361 + 0200] [glassfish 4.1] [警告] [test.connection.pool.failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid :_ThreadID = 42 _ThreadName = admin-listener(4)] [timeMillis:1420224672361] [levelValue:900] [[RAR8054:为池[DerbyPool]创建非池化[test]连接时出现异常,无法分配Connection,因为:java .net.ConnectException:在端口1527上连接到服务器localhost时出错,并显示消息Connection refused.]]

[2015-01-02T20:51:12.366 + 0200] [glassfish 4.1] [SEVERE] [] [org.glassfish.admingui] [tid:_ThreadID = 40 _ThreadName = admin-listener(2)] [timeMillis:1420224672366] [ levelValue:1000] [[RestResponse.getResponse()给出失败.endpoint ='http:// localhost:4848/management/domain/resources/ping-connection-pool.json'; attrs ='{id = DerbyPool}']]

在其上安装了Glassfish 4.1和Ubuntu 14.04的另一台计算机上也出现了同样的问题.

java glassfish java-ee ubuntu-14.04

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

组件中的 React-Redux 状态与 store 中的状态不同

我正在使用 React 和 Redux 构建应用程序。

我有一个 Account 组件,它从componentWillMount方法中的服务器获取数据。在获取数据时,组件必须显示“正在加载”文本,因此我已将“isFetching”属性添加到帐户缩减程序中。从服务器获取数据时,此属性设置为 true。

问题是,在获取数据时,render方法中“isFetching”属性的值为 false,而同时 的值为store.getState().account.isFetchingtrue(必须如此)。这导致例外,因为this.props.isFetching是假的,那么代码是试图展示this.props.data.protectedString,而data仍然被从服务器加载(所以它为空)。

我假设 mapStateToProps 绑定了一些错误的值(可能是初始状态),但我不知道为什么以及如何修复它。

这是我的 AccountView 代码:

import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actionCreators from '../../actions/account';

class AccountView extends React.Component {
    componentWillMount() {
        const token = this.props.token;
        // fetching the data using credentials
        this.props.actions.accountFetchData(token);
    }

    render() {
        console.log("store state", window.store.getState().account); // isFetching == true …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs redux react-redux

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