0
我試圖運行在JUnit JBoss的遠程,我得到一個錯誤:如何解決JBoss Remote錯誤?
Caused by: java.lang.VerifyError: Cannot inherit from final class
這裏是遠程JUnit類的一部分:
import static org.junit.Assert.*;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.SessionManager;
public class Test1 {
private static SessionManager _service;
@BeforeClass
public static void doSms() throws Exception {
String JBOSS_CONTEXT = "org.jboss.naming.remote.client.InitialContextFactory";
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, JBOSS_CONTEXT);
properties.put(Context.PROVIDER_URL, "remote://localhost:4447");
properties.put(Context.SECURITY_PRINCIPAL, "testuser");
properties.put(Context.SECURITY_CREDENTIALS, "testpassword");
_service = (SessionManager) new InitialContext(properties).lookup("java:global/SessionManager");
}
}
我已經刪除了雙JAR(/ W不同版本),沒有任何變化。 – Glavryba 2014-09-02 07:38:31