Chrome driver exception NoSuchMethodError - java

I am trying to write test case, using ChromeDriver but while trying to initialise ChromeDriver instance getting exception as,
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:111)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:302)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)
at DemoTests.test(DemoTests.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
struggling on it, but unable to fix it. How can I fix this issue? Following is my code base,
#Test
public void test() {
ChromeDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("www.google.com");
}

It appears you are using wrong version of Google guava. Check the web driver document of the version you are using to see which guava version you should use.

Generally this error will occur when you're using >45 version of chrome and selenium webdriver < 3 version.
The best way to resolve is to upgrade your selenium webdriver version.
http://www.seleniumhq.org/download/
Download selenium-java-3.4.0.zip under Selenium Client & WebDriver Language Bindings

Ensure that there is no mismatch in Selenium Webdriver versions. For example ensure that same version is in C:\Program Files\SmartBear\SoapUI-5.4.0\bin\lib and C:\Program Files\SmartBear\SoapUI-5.4.0\bin and C:\Program Files\SmartBear\SoapUI-5.4.0\bin\ext in case you are running from SOAPUI Groovy

Add below dependency to resolve the issue:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.28.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>23.0</version>
</dependency>

Related

How to unit test and send messages to embedded broker?

I need to run an embedded ActiveMQ Artemis.
Having this code:
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
Session session = connectionFactory.createConnection().createSession();
MessageProducer producer = session.createProducer(null);
JmsRequest jmsRequest = new JmsRequest("jsonMsg", JmsRequestStatus.NEW, "targetQueueTESTTEST");
Topic topic = session.createTopic(jmsRequest.getTargetQueue());
TextMessage message = session.createTextMessage(jmsRequest.getJsonMsg());
producer.send(topic, message);
Returns me this exception:
javax.jms.JMSException: Failed to create session factory
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:886)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:299)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:294)
at com.americanwell.caretalks.jms.entities.PracticeITTest.aaa(PracticeITTest.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: java.lang.IllegalStateException: java.lang.ClassNotFoundException: org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory
at org.apache.activemq.artemis.utils.ClassloadingUtil.newInstanceFromClassLoader(ClassloadingUtil.java:59)
at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$2.run(ClientSessionFactoryImpl.java:1002)
at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$2.run(ClientSessionFactoryImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.instantiateConnectorFactory(ClientSessionFactoryImpl.java:999)
at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.<init>(ClientSessionFactoryImpl.java:181)
at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:781)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:884)
How can I solve this issue? How can I get the session from the embedded broker?
The main problem here is this:
java.lang.ClassNotFoundException: org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory
You need to put org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory on your classpath so the application an use it. This class is in the artemis-server Maven module, e.g.:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>2.13.0</version>
</dependency>
If you're constructing your classpath manually then just include the artemis-server-<version>.jar. It's shipped in the broker distribution in the lib directory.

How to add test-jar and jar as dependency in a maven multimodule project?

I have a maven multimodule project of the form
main
query
...
storage
storage-config
storage-utils
storage-common
tools
I have a class com.vnera.storage.config.ElasticsearchEmbedded.java residing under test folder in storage-config which I want to use in storage-utils from a class TestStorageUtils under test scope. storage-utils also needs storage-config in main phase.
In query module I have added dependency of storage-utils test-jar. But whenever I am trying to access TestStorageUtils in from a test in query module. It is throwing me the below error. All compilation is running fine.
java.lang.NoClassDefFoundError: com/van/storage/config/ElasticsearchEmbedded
at com.van.storage.utils.TestStorageUtils.setUp(TestStorageUtils.java:92)
at com.van.query.SearchUtilsTests.setUp(SearchUtilsTests.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: com.van.storage.config.ElasticsearchEmbedded
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
The necessary pom is placed below:-
query/pom.xml
storage/pom.xml
storage/config/pom.xml
storage/utils/pom.xml
Can someone let me know what is going wrong and how can I solve this?
Maven Version - 3.5.3
query module also need to declare the test-jar dependency of storage-config.
<dependency>
<groupId>com.van</groupId>
<artifactId>storage-config</artifactId>
<version>${main.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
<type>test-jar</type>
</dependency>

java.lang.NoSuchMethodError: putMemberOffset

I am working on windows 10 with jdk1.8 I am getting following error. I tried a lot but unable to find the reason why getting this error, error snap is as follows.
java.lang.NoSuchMethodError: putMemberOffset
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:525)
at org.bytedeco.javacpp.Loader.load(Loader.java:411)
at org.bytedeco.javacpp.Loader.load(Loader.java:354)
at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.bytedeco.javacpp.Loader.load(Loader.java:386)
at org.bytedeco.javacpp.Loader.load(Loader.java:354)
at org.bytedeco.javacpp.opencv_imgcodecs.<clinit>(opencv_imgcodecs.java:13)
at com.ob.libj.ProcessImageJavaCV.start(ProcessImageJavaCV.java:23)
at UTest.testCountThreshold(UTest.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
This is my pom.xml
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacv</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv-platform</artifactId>
<version>3.2.0-1.3</version>
</dependency>
<dependency>
<groupId>io.humble</groupId>
<artifactId>humble-video-all</artifactId>
<version>0.2.1</version>
</dependency>
</dependencies>
I also use lastest Fiji jars.
I think it must be a compatibility problem between Opencv and Fiji because the error comes when I use both.
Have you any idea how to fix it?
thanks
This seems to be a version compatibility problem. One of the libraries (it seems to be OpenCV) has been compiled against a version of the another (probably fiji) that contains the method in question (putMemberOffset) but the version that's available on the classpath when you run the application/test doesn't contain that method, hence the error.
Besides that it could be a different library that both OpenCV and fiji have been compiled against but in different versions.
To fix that use compatible versions of the libraries. To find out which ones that are you'd need to find which library is in conflict and which versions the libraries you use depend on - you should be able to see that in those libraries' documentation or pom.xml or in maven's output (you might have to enable the verbose option though).

Maven doesn't seem to be downloading the whole jar

I am following this tutorial to create tests using Selenium. I have added the com.google.guava dependency to my pom like this:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>r09</version>
</dependency>
However, maven seems to be downloading this jar incompletely. There seem to be classes missing. One such is the com.google.common.base.Optional. On the maven repo page, towards the bottom under Source Control there is a link that shows code with the Optional class. But when I look under Maven Dependencies in eclipse, I see this:
(there is no class named Optional)
Where are the rest of the classes?
I have tried re-downloading the jar multiple times but it has had no effect.
Some more information:
I am adding the selenium server dependency like this:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.41.0</version>
</dependency>
StackTrace:
java.lang.NoClassDefFoundError: com/google/common/base/Optional
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.loadCustomExtension(NewProfileExtensionConnection.java:156)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.addWebDriverExtensionIfNeeded(NewProfileExtensionConnection.java:148)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:80)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:191)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
at com.amsgeo.mspWebManager.web.ui.SeleniumTest.testingSelenium(SeleniumTest.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Optional
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 33 more
You are using an old version of google-guava package, cause google guava is in the meantime at version 17. And the problem you are facing that you are looking against the current most-up-to-date code in version control.
Optional was added in Guava 10.0. Also note that the most recent version of Guava is 17.0 and that 9.0 (r09) is over 3 years old at this point.
(Also, it appears that selenium 2.41.0 depends on Guava 15.0: see the <dependencyManagement> section of the pom here.)

Problems to use embedded EJBContainer in Glassfish 4.0

I'm working on Junit tests do validate SessionBeans in my project. There are a local session bean with no interfaces and I want to lookup it in my test.
So, I put this dependence in pom.xml of my ejb module (same of the test):
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>4.0</version>
<scope>test</scope>
</dependency>
So, I've build my test method:
#Test
public void authenticateUser() throws NamingException {
EJBContainer container = EJBContainer.createEJBContainer();
AccessControlService service = (AccessControlService)container.getContext().lookup("java:global/app/module/AccessControlService");
UserCredentials cred = new UserCredentials("admin", AccessControlUtil.getEncryptedPassword("adminadmin".toCharArray()));
try {
AccessControlSession session = service.authenticate(cred);
} catch (Exception ex) {
Logger.getLogger(AccessControlTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
After execute the test, I received this exception stacktrace:
SEVERE: EJB6001:Caught exception instantiating EmbeddedContainer.
java.lang.NoSuchMethodError: org.glassfish.hk2.utilities.AbstractActiveDescriptor.<init>(Ljava/util/Set;Ljava/lang/Class;Ljava/lang/String;Ljava/util/Set;Lorg/glassfish/hk2/api/DescriptorType;Lorg/glassfish/hk2/api/DescriptorVisibility;ILjava/lang/Boolean;Ljava/lang/String;Ljava/util/Map;)V
at org.jvnet.hk2.config.DomDescriptor.<init>(DomDescriptor.java:56)
at org.jvnet.hk2.config.Dom.register(Dom.java:210)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:245)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:190)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:231)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:238)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:190)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:231)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:190)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:231)
at org.jvnet.hk2.config.ConfigParser.handleElement(ConfigParser.java:190)
at org.jvnet.hk2.config.ConfigParser.parse(ConfigParser.java:100)
at org.jvnet.hk2.config.ConfigParser.parse(ConfigParser.java:94)
at org.glassfish.config.support.DomainXml.parseDomainXml(DomainXml.java:259)
at org.glassfish.config.support.DomainXml.run(DomainXml.java:117)
at org.jvnet.hk2.config.ConfigurationPopulator.populateConfig(ConfigurationPopulator.java:58)
at org.glassfish.hk2.bootstrap.HK2Populator.populateConfig(HK2Populator.java:158)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.populateConfig(AbstractModulesRegistryImpl.java:211)
at com.sun.enterprise.module.bootstrap.Main.createServiceLocator(Main.java:273)
at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.newGlassFish(StaticGlassFishRuntime.java:111)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createContainer(EJBContainerProviderImpl.java:205)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:129)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
at br.com.dynavideo.AccessControlTest.authenticateUser(AccessControlTest.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
I also tried to set EJBContainer properties as provider, appname or module. But the same error occurs. Any ideas how to solve this problem?
Thanks!
Try this. Solved it for me (with a different approach):
<repositories>
<repository>
<id>maven.java.net</id>
<name>Java.net Repository for Maven</name>
<url>https://maven.java.net/content/groups/promoted/</url>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/glassfish/</url>
</repository>
</repositories>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>4.0.1-b02</version>
<scope>test</scope>
</dependency>

Categories