小编Den*_*ees的帖子

无法分配内存:8

从今天开始,当我尝试在2.3.3 Android平台上运行NetBeans中的应用程序时,它向我显示:

无法分配内存:8

此应用程序已请求Runtime以不寻常的方式终止它.有关更多信息,请联系应用程序的支持团队.

并且模拟器不想启动.

这是我第一次看到它,并且google没有相关信息,我甚至尝试了两个版本的NetBeans 6.9.1和7.0.1,仍然是同样的错误.

android netbeans android-emulator

368
推荐指数
12
解决办法
23万
查看次数

收到致命警报:handshake_failure通过SSLHandshakeException

我有授权SSL连接的问题.我创建了Struts Action,它通过Client Authorized SSL证书连接到外部服务器.在我的行动中我试图将一些数据发送到银行服务器但没有任何运气,因为我从服务器得到以下错误的结果:

error: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
Run Code Online (Sandbox Code Playgroud)

我的Action类从我的Action类发送数据到服务器

//Getting external IP from host
    URL whatismyip = new URL("http://automation.whatismyip.com/n09230945.asp");
    BufferedReader inIP = new BufferedReader(new InputStreamReader(whatismyip.openStream()));

    String IPStr = inIP.readLine(); //IP as a String

    Merchant merchant;

    System.out.println("amount: " + amount + ", currency: " + currency + ", clientIp: " + IPStr + ", description: " + description);

    try {

        merchant = new Merchant(context.getRealPath("/") + "merchant.properties");

    } catch (ConfigurationException e) {

        Logger.getLogger(HomeAction.class.getName()).log(Level.INFO, "message", e);
        System.err.println("error: " + e.getMessage());
        return …
Run Code Online (Sandbox Code Playgroud)

java ssl ssl-certificate sslhandshakeexception

118
推荐指数
8
解决办法
48万
查看次数

更多精神疯狂 - 解析器类型(规则与int_parser <>)和元编程技术

问题在底部以粗体显示,问题也通过最终的蒸馏代码片段进行了总结.

我试图统一我的类型系统(类型系统从类型到字符串)和单个组件(由Lakos定义).我正在使用boost::array,, boost::variantboost::mpl,以实现这一目标.我想让我的类型的解析器和生成器规则统一在一个变体中.有一个未定义的类型,一个int4(见下文)类型和一个int8类型.该变体读作variant<undefined, int4,int8>.

int4特征:

struct rbl_int4_parser_rule_definition
{
  typedef boost::spirit::qi::rule<std::string::iterator, rbl_int4()> rule_type;

  boost::spirit::qi::int_parser<rbl_int4> parser_int32_t;

  rule_type rule;

  rbl_int4_parser_rule_definition()
  {
    rule.name("rbl int4 rule");
    rule = parser_int32_t;  
  }
};

template<>
struct rbl_type_parser_rule<rbl_int4>
{
  typedef rbl_int4_parser_rule_definition string_parser;
};
Run Code Online (Sandbox Code Playgroud)

上面的变体从未定义开始,然后我初始化规则.我有一个问题,导致50页的错误,我终于设法跟踪它,Variant operator=在分配期间使用,而a boost::spirit::qi::int_parser<>不能分配给另一个(operator =).

相比之下,我的未定义类型没有问题:

struct rbl_undefined_parser_rule_definition
{
  typedef boost::spirit::qi::rule<std::string::iterator, void()> rule_type;
  rule_type rule;

  rbl_undefined_parser_rule_definition()
  {
    rule.name("undefined parse rule");
    rule = boost::spirit::qi::eps;
  }
};

template<>
struct rbl_type_parser_rule<rbl_undefined>
{
  typedef rbl_undefined_parser_rule_definition string_parser;
};
Run Code Online (Sandbox Code Playgroud)

蒸馏问题:

#include <string>
#include <boost/spirit/include/qi.hpp> …
Run Code Online (Sandbox Code Playgroud)

c++ boost boost-spirit template-meta-programming

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

Google OAUTH:请求中的重定向URI与注册的重定向URI不匹配

我正试图从我的基于Java的网络应用程序上传到YouTube,我花了几天时间来了解问题的原因和地点,我无法得到它,因为现在我正在把头发拉出来.

我在Google控制台中注册了我的网络应用程序,因此我获得了一对客户端ID和密码以及使用我的配置下载JSON类型文件的可能性.

所以这是配置:

{
    "web":{
        "auth_uri":"https://accounts.google.com/o/oauth2/auth",
        "client_secret":"***",
        "token_uri":"https://accounts.google.com/o/oauth2/token",
        "client_email":"***",
        "redirect_uris":["http://localhost:8080/WEBAPP/youtube-callback.html","http://www.WEBAPP.md/youtube-callback.html"],
        "client_x509_cert_url":"***",
        "client_id":"***",
        "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
        "javascript_origins":["http://www.WEBAPP.md/"]
    }
}
Run Code Online (Sandbox Code Playgroud)

我如何从Google获取默认网址?

The redirect URI in the request: http://localhost:8080/Callback did not match a registered redirect URI

它总是给我默认的http://localhost:8080/CallbackURL而不是我的.

IDE控制台告诉我:

Please open the following address in your browser: https://accounts.google.com/o/oauth2/auth?client_id=***&redirect_uri=http://localhost:8080/Callback&response_type=code&scope=https://www.googleapis.com/auth/youtube.upload Attempting to open that address in the default browser now...

我使用的是最新版本的依赖项: google-api-services-youtube v3-rev99-1.17.0-rcgoogle-api-services-youtubeAnalytics v1-rev35-1.17.0-rc

java youtube-api google-oauth youtube-data-api google-oauth-java-client

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

使用Struts 2和Struts的cookie

我有以下(缩短)struts2动作:

public class MyAction extends BaseAction implements CookiesAware {

  public String execute() {

    if (cookiesMap.containsKey("BLAH"))
      blah=Integer.parseInt(cookiesMap.get("BLAH"));

      return "success";
  }

  // For handling cookies
  Map<String, String> cookiesMap;
  @Override
  public void setCookiesMap(Map<String, String> cookiesMap) {
    this.cookiesMap = cookiesMap;
  }
}
Run Code Online (Sandbox Code Playgroud)

当我执行'cookiesMap.containsKey'时,我得到一个空指针异常 - 在我看来,没有调用setCookiesMap.我已经实现了CookiesAware界面,所以我认为它应该被调用 - 我错过了什么吗?

谢谢

java cookies struts2

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

配置Hibernate C3P0连接池

我在使用Spring和Hibernate开发基于Struts2的Web应用程序时偶然发现了一个问题.

当我刷新网站几次,例如2-4次时,Hibernate出现了一个关于太多连接的例外.我试图实现C3P0连接池,并遇到一些问题


hibernate.cfg.xml的配置:

<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/axelle</property>
<property name="hibernate.connection.username">axelle</property>
<property name="hibernate.connection.password">dbpassword</property>
<property name="hibernate.current_session_context_class">thread</property>    

<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
Run Code Online (Sandbox Code Playgroud)

applicationContext.xml中

<bean id="propertyConfigurer"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
      p:location="classpath:jdbc.properties"/>

<bean id="dataSource"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"
      p:driverClassName="${jdbc.driverClassName}"
      p:url="${jdbc.url}"
      p:username="${jdbc.username}"
      p:password="${jdbc.password}"
      p:connectionProperties="${jdbc.connectionProperties}"/>

<!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="configLocation">
        <value>classpath:hibernate.cfg.xml</value>
    </property>
</bean>

<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory"> …
Run Code Online (Sandbox Code Playgroud)

spring hibernate connection-pooling struts2 c3p0

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

7
推荐指数
2
解决办法
9196
查看次数

返回SVN命令时出现以下错误

当我想将我的项目提交给SVN时,会弹出以下错误:

org.tigris.subversion.javahl.ClientException:
Working copy '/media/Data/NETBEANS_PROJECTS/myproject/web/pages/ajax-fragments' locked; try performing 'cleanup'
Run Code Online (Sandbox Code Playgroud)

我使用NetBeans 7.1(尝试使用7.0.1和6.9,相同)和CollabNet Subversion控件插件.他想用'清理'告诉我什么?

svn netbeans

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

客户端的外部IP地址

听起来很有趣,但我如何从客户端获取外部IP地址?

我尝试了一些东西,但对我没用.

首先,我试过

request.getRemoteAddr()
Run Code Online (Sandbox Code Playgroud)

我得到的结果为:0:0:0:0:0:0:0:1

在第二位,我试过

InetAddress ip = InetAddress.getLocalHost();
ip.getHostAddress());
Run Code Online (Sandbox Code Playgroud)

我得到的结果是:127.0.0.1

在第三位我试过了

        URL whatismyip = new URL("http://checkip.dyndns.org:8245/");
        BufferedReader inIP = new BufferedReader(new InputStreamReader(whatismyip.openStream()));

        String IPStrOld = inIP.readLine(); //IP as a String
        String IPStrNewest = IPStrOld.replace("<html><head><title>Current IP Check</title></head><body>Current IP Address: ", "");
        String IPStr = IPStrNewest.replace("</body></html>", "");
Run Code Online (Sandbox Code Playgroud)

但我只获得服务器的外部IP

并为最后一个地方

        URL whatismyip = new URL("http://automation.whatismyip.com/n09230945.asp");
        BufferedReader inIP = new BufferedReader(new InputStreamReader(whatismyip.openStream()));
        String ip = inIP.readLine();
Run Code Online (Sandbox Code Playgroud)

这是一样的,我只得到服务器的外部IP

那么,这笔交易是什么?

java external ip-address

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

Struts2和NetBeans 7

我找不到任何针对NetBeans 7的ngbit支持.我必须为我的Web应用程序开发安装Struts2.对于NetBeans 6.9,我的旧版ngbit 0.4工作正常,但对于NetBeans 7不起作用.由于HTML5,我需要NetBeans 7.

当我尝试安装org-netbeans-modules-web-frameworks-struts2.nbm时,NetBeans会出现以下错误:

某些插件需要安装插件编辑器库.在版本> = 2.10.1.10.2(发行版本2)中请求插件编辑器库,但仅找到3.8.1.13.8(发行版本不同于2).
以下插件受到影响:Struts2支持

谢谢.

netbeans struts2 netbeans-7

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