使用wildfly配置arquillian时,entitymanager为null

时间:2017-12-11 13:29:50

标签: java jboss jboss-arquillian

我是arquillian的新手,上面遇到了一个问题。 这是我的pom.xml: https://github.com/langker/LendingPlat/blob/master/pom.xml

这里是arquillian.xml(我也不确定这个文件是否已被读取,因为当我更改了值时,没有新的事情发生): https://github.com/langker/LendingPlat/blob/master/src/main/java/META-INF/arquillian.xml

测试代码在这里: https://github.com/langker/LendingPlat/blob/master/src/test/java/me/langker/LendingPlat/test/UserTest.java

错误跟踪为:

private EditText editTextEmail;
private EditText editTextSubject;
private EditText editTextMessage;

//Send button
private Button buttonSend;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //Initializing the views

    editTextMessage = (EditText) findViewById(R.id.editTextMessage);

    buttonSend = (Button) findViewById(R.id.buttonSend);

    //Adding click listener
    buttonSend.setOnClickListener(this);
}


private void sendEmail() {
    //Getting content for email
    String email = "xxxxxxx";
    String subject = "xxxxx";
    String message = editTextMessage.getText().toString().trim();

    //Creating SendMail object
    SendMail sm = new SendMail(this, email, subject, message);

    //Executing sendmail to send email
    sm.execute();
}

@Override
public void onClick(View v) {
    sendEmail();
}
}

1 个答案:

答案 0 :(得分:0)

好的,我终于解决了。我像这样编辑了pom.xml,但它确实有效。

https://github.com/langker/LendingPlat/blob/c3d79e71d907cc26d98fe855d2c3c65cfa994b04/pom.xml