我可以使用以下命令连接到ec2实例,但今天我无法使用它连接.
ssh -i abcKey.pem ubuntu@ec2-x-x-x-x.ap-southeast-1.compute.amazonaws.com -v
Run Code Online (Sandbox Code Playgroud)
以下是详细说明.我在EC2中打开了SSH端口(我可以连接到昨天)
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ec2-x-x-x-x.ap-southeast-1.compute.amazonaws.com [x-x-x-x] port 22.
debug1: Connection established.
debug1: identity file abcKey.pem type -1
debug1: identity file abcKey.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: …Run Code Online (Sandbox Code Playgroud) 当我xjc -d src/ -p com.test IFC2X3.xsd在下面的xsd上运行命令时,它会产生冲突.
....
<xs:element name="IfcCondenserTypeEnum" nillable="true">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="ifc:IfcCondenserTypeEnum">
<xs:attributeGroup ref="ex:instanceAttributes">
</xs:attributeGroup>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:simpleType name="IfcCondenserTypeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="watercooledshelltube">
</xs:enumeration>
<xs:enumeration value="watercooledshellcoil">
</xs:enumeration>
<xs:enumeration value="watercooledtubeintube">
</xs:enumeration>
<xs:enumeration value="watercooledbrazedplate">
</xs:enumeration>
<xs:enumeration value="aircooled">
</xs:enumeration>
<xs:enumeration value="evaporativecooled">
</xs:enumeration>
<xs:enumeration value="userdefined">
</xs:enumeration>
<xs:enumeration value="notdefined">
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
....
Run Code Online (Sandbox Code Playgroud)
错误:
parsing a schema...
compiling a schema...
[ERROR] A class/interface with the same name "com.test.IfcCondenserTypeEnum" is already in use. Use a class customization to resolve this …Run Code Online (Sandbox Code Playgroud) 我想使用WiX 3.6在安装过程中创建一个数据库.我遵循了许多教程,但我认为我做错了.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension">
<Product Id="{A704CA9E-2833-4276-A8A8-148F1047332F}" Name="DbInstallerTest" Language="1033" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="2de42bd8-acc2-48bf-b3c6-09745d3a2ea4">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="DbInstallerTest" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="DbInstallerTest" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="CMPDbInsatller"
Guid="{1749E57D-9CE4-42F8-924C-2A2E368B51E4}">
<CreateFolder Directory="INSTALLFOLDER"/>
<util:User Id="SqlUser"
Name="sa"
Password="Abc123@"/>
</Component>
<Component Id="cmp2"
Guid="{C3596364-61A0-4628-9153-1BA11DB4B778}">
<CreateFolder Directory="INSTALLFOLDER"/>
<sql:SqlDatabase Id="Id_db"
Database="TestDatabase1"
Server="(local)\SQLExpress"
CreateOnInstall="yes"
User="SqlUser" …Run Code Online (Sandbox Code Playgroud) 我按照这个链接并将ActiveMq 5.6与JBoss eap 6.3集成在一起.我想在我的poc项目中使用MDB.虽然战争部署成功,但onMessage()方法不会被解雇.
QueueName:employee_q
MDB,
package com.test.oms.mdb;
import java.util.logging.Logger;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.Message;
import javax.jms.MessageListener;
import org.jboss.ejb3.annotation.ResourceAdapter;
import com.test.oms.entity.Employee;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue.employee_q") })
@ResourceAdapter("activemq-ra.rar")
public class QueueListener implements MessageListener {
private final static Logger LOGGER = Logger.getLogger(QueueListener.class
.toString());
@Override
public void onMessage(Message rcvMessage) {
LOGGER.info("____________OnMessage fired______________");
Employee emp = null;
if (rcvMessage instanceof Employee) {
emp = …Run Code Online (Sandbox Code Playgroud) 这个链接解释了WildFly的新功能.在Migrating The Database Connection -> JDBC Driver本文下解释了有关为应用程序使用jdbc驱动程序的两种方法.我尝试将其作为模块安装,它工作正常.问题是哪种方式更好,何时更好,whether deploy it as any other application package or install it as a module?
(我注意到将其作为模块安装对于集群环境是必要的.我在寻找,还有其他原因吗?)
以下是我当前json体的日志.我想为这个机构增加新的属性."NewPropertyName": "value".由于值在数据库中,因此我使用类中介来添加此属性.
[2015-05-18 05:47:08,730] INFO - LogMediator To: /a/create-project, MessageID: urn:uuid:b7b6efa6-5fff-49be-a94a-320cee1d4406, Direction: request, _______BODY_______ =
{
"token": "abc123",
"usertype":"ext",
"request": "create"
}
Run Code Online (Sandbox Code Playgroud)
班级调解员的中介方法,
public boolean mediate(MessageContext mc) {
mc.setProperty("key", "vale retrived from db");
return true;
}
Run Code Online (Sandbox Code Playgroud)
但这并不像我预期的那样有效.我找不到任何使用类介体向json body添加属性的指南,请帮忙.
我想检查用户是否已传递USERNAME的参数,其默认值为local.我试图看看如果值是本地的,我是否收到消息.问题在于以下方式.这不起作用.
<Property Id="USERNAME" Value="local"/>
<?define uName = [USERNAME]?>
<?if $(var.uName) = local ?>
<Condition Message="$(var.uName)">0</Condition>
<?endif?>
Run Code Online (Sandbox Code Playgroud)
但是,如果我将代码更改为以下代码,它将给出消息.
<?define uName = local?>
<?if $(var.uName) = local ?>
<Condition Message="$(var.uName)">0</Condition>
<?endif?>
Run Code Online (Sandbox Code Playgroud)
以下代码将USERNAME属性的值分配给uName变量.
<Property Id="USERNAME" Value="local"/>
<?define uName = [USERNAME]?>
<Condition Message="$(var.uName)">0</Condition>
Run Code Online (Sandbox Code Playgroud)
上面的代码在消息框中打印"local".
我尝试了很多场景,可以找到问题所在.比较变量值时,分配为,
<?define uName = [USERNAME]?>
Run Code Online (Sandbox Code Playgroud)
虽然该值已分配给uName,但我们无法进行比较.我在这里做错了吗?或者还有另一种解决这类问题的方法吗?
这个类加密数据值,首先我得到密码如下,
KeyStore primaryKeyStore = getKeyStore(keyStoreFile, password, keyType, provider);
java.security.cert.Certificate certs = primaryKeyStore.getCertificate(aliasName);
cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, certs);
Run Code Online (Sandbox Code Playgroud)
但是上面代码的最后一行给出了以下错误。错误的密钥用法是什么意思?我不能将此证书用于加密目的吗?是否有单独的加密证书?
Caused by: java.security.InvalidKeyException: Wrong key usage
at javax.crypto.Cipher.init(Cipher.java:1640)
at javax.crypto.Cipher.init(Cipher.java:1549)
at my.test.ciphertool.CipherTool.initCipher(CipherTool.java:167)
... 1 more
Run Code Online (Sandbox Code Playgroud) 我想在一些逻辑中间停止芭蕾舞女演员计划.如何使用代码停止芭蕾舞女演员正在运行的程序?我正在寻找与java中的System.exit(0)相当的东西.