我一直在关注入门教程,但在使用Maven导入playn项目后卡住了.我正在使用在64位Windows 7上运行的Eclipse Indigo.
所有导入的项目都有相同的错误:
Missing Artifact com.sun:tools:jar in all the pom.xml files.
Run Code Online (Sandbox Code Playgroud)
经过几个小时的搜索论坛,我尝试过:
安装最新的Java 1.6.029更改JAVA_HOME环境变量以指向\program files\Java\jdk1.6_029
更改Eclipse Java首选项以使用JRE jdk1.6_029.
我真的想尝试playn,但为什么有一些帖子我似乎无法找到解决方案的共识答案.有人说Sun从64位jdk中删除了一些东西,其他人说你必须编辑你的xml文件,很多人说你已经改变了你的JAVA_HOME,另一个人说你必须改变Eclipse的VM选项.
任何有关清除此功能的帮助都会受到赞赏,并且可能对许多人有用,因为我这里没有特别奇怪的设置.
(编辑)这是第一个项目中的pom.xml.Eclipse标记行中的错误:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-project</artifactId>
<version>1.1-SNAPSHOT</version>
</parent>
<artifactId>playn-android</artifactId>
<name>PlayN Android</name>
<packaging>jar</packaging>
<repositories>
</repositories>
<dependencies>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- needed because Android uses the same JSON code as playn-java;
that should be factored into a library shared by both backends -->
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-java</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> …Run Code Online (Sandbox Code Playgroud) 我一直在尝试制作一个简单的程序,它取一个小的随机数并在textview中显示给用户.在最终获得随机数生成(我认为)后,程序会在我运行时抛出致命异常.代码没有错误,但我是一个完整的新手,我开始简单,以便我可以学习.几个小时后,我已经提交寻求帮助.我几乎可以肯定我的随机数字片段是在错误的区域,我只是不确定在哪里放.我尝试的每个地方都抛出同样的错误.
这是.java
package com.eai.vgp;
import java.util.Random;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
Random pp = new Random();
int a1 = pp.nextInt(10);
TextView tv = (TextView)findViewById(R.id.tv);{
tv.setText(a1);}
}
Run Code Online (Sandbox Code Playgroud)
XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TextView
android:id="@+id/tv" …Run Code Online (Sandbox Code Playgroud) 所以我使用swing为接口构建了一个Java程序,我没有意识到将它转换为用作Android应用程序是多么困难.有没有办法让我轻松转换或重建在Android市场上销售的程序?如果没有,任何人都可以指向我任何资源,以帮助建立一个Android.
如何在笔记本电脑上的Android模拟器上运行基于蓝牙的应用程序.当我运行蓝牙应用程序时,据说蓝牙设备未连接.我用谷歌搜索,我找到了一种使用方法Oracle VM VirtualBox.我也按照这个步骤,
我这样做了,它工作正常.但问题是,如果我使用蓝牙适配器它工作正常,但我不能使用我的笔记本电脑的内置蓝牙设备与VM机器.如何将内置蓝牙设备与VM Machine连接,如何将其用于测试基于蓝牙的应用程序.请提出一些想法.提前致谢..
使用密钥库和信任库的KeyStore对象有什么区别; 而不是使用KeyManager和TrustManager?
让我解释一下我的要求.我正在使用RESTEasy,需要通过HTTPS使用SSL证书进行REST调用.我需要增加RESTEasy如何创建ClientRequest.这是我最初想到的:
public void afterPropertiesSet() throws Exception {
Assert.isTrue(StringUtils.isNotBlank(getKeystoreName()), "Key Store Name is Blank");
Assert.isTrue(StringUtils.isNotBlank(getKeystorePassword()), "Key Store Password is Blank.");
Assert.isTrue(StringUtils.isNotBlank(getKeystorePath()), "Key Store Path is Blank");
Assert.isTrue(StringUtils.isNotBlank(getTruststoreName()), "Trust Store Name is Blank");
Assert.isTrue(StringUtils.isNotBlank(getTruststorePassword()), "Trust Store Password is Blank.");
Assert.isTrue(StringUtils.isNotBlank(getTruststorePath()), "Trust Store Path is Blank");
// Set the keystore and truststore for mutual authentication
createKeystore();
createTruststore();
if (getHttpClient() == null) {
// Initialize HTTP Client
initializeHttpClient();
}
Assert.notNull(getHttpClient(), "HTTP Client is NULL after initialization");
}
public ClientRequest createClientRequest(String uri) throws …Run Code Online (Sandbox Code Playgroud) 我有一个配置为ID的hibernate实体
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
Run Code Online (Sandbox Code Playgroud)
第一次运行时,新元素的创建工作正常.但是,如果我重新启动我的应用程序并检索回记录,下次当我尝试持久保存此实体时,hibernate会尝试使用在未重新启动应用程序时生成的相同ID.
我收到下面的错误,当使用trace选项运行时,我能够看到ID正在被重用
*Hibernate:插入org_myEntity(entitiyJID,entitityName,id)值(?,?,?)org.hibernate.util.JDBCExceptionReporter
SQL错误:20000,SQLState:23505 org.hibernate.util.JDBCExceptionReporter语句已中止,因为它会已在"TABLE_NAME"上定义的"SQL120725164357680"标识的唯一或主键约束或唯一索引中导致重复键值.org.hibernate.event.def.AbstractFlushingEventListener
无法与会话同步数据库状态org.hibernate.exception.ConstraintViolationException:无法*
顺便说一句,我使用的是hibernate 3.3.2.GA,javax.persistance 2.0.0和Derby 10.5.1数据库
有人知道我这一代可能出现什么问题,我该如何解决?
我正试图在Bootstrap中获得一个基本的下拉菜单:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<div class="dropdown">
<!-- Link or button to toggle dropdown -->
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><a tabindex="-1" href="#">Action</a></li>
<li><a tabindex="-1" href="#">Another action</a></li>
<li><a tabindex="-1" href="#">Something else here</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Separated link</a></li>
</ul>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
然而,没有任何表现.我知道正确引用了本地CSS和JS文件.据我所知,默认的JS包含所有插件.
编辑:感谢大家的反馈.我只能添加,以防人们发现自己处于相同的情况,在复制和粘贴代码段之前,在教程中进一步向下移动.
我修改了我们的ActiveMQ配置,使用ActiveMQ Simple Authentication Plugin,其中包含一个拥有代理所有权限的用户和密码
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser
username="admin"
password="pass"
groups="admins,publishers,consumers" />
</users>
</simpleAuthenticationPlugin>
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" write="producers" read="consumers" admin="admins" />
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
我的java Web应用程序之前通过调用createConnection()而没有任何参数来创建ActiveMQConnectionFactory的实例.
connection = (ActiveMQConnection)connectionFactory.createConnection();
Run Code Online (Sandbox Code Playgroud)
我修改了我的代码,将我的ActiveMQ Simple Authentication Plugin配置中定义的用户名和密码字符串传递给createConnection()方法的重载版本
String username = "admin";
String password = "pass";
connection = (ActiveMQConnection)connectionFactory.createConnection(username, password);
Run Code Online (Sandbox Code Playgroud)
我能够干净地编译我的代码,但在部署时收到'用户无法创建主题'错误
10:51:03,831 ERROR [stderr] (MSC service thread 1-11) javax.jms.JMSException: User admin is not authorized to create: topic://ActiveMQ.Advisory.Connection
10:51:03,832 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
10:51:03,832 ERROR [stderr] (MSC …Run Code Online (Sandbox Code Playgroud) 我在这里读到,2011年中期的Apple电脑应该支持BLE(低功耗蓝牙).有没有办法(可能使用命令行)检查设备和操作系统是否支持BLE?
android ×4
java ×3
android-x86 ×1
annotations ×1
bluetooth ×1
exception ×1
hibernate ×1
httpclient ×1
keystore ×1
macos ×1
maven ×1
playn ×1
random ×1
ssl ×1
swing ×1
textview ×1
truststore ×1
virtualbox ×1