I have build a schema file with help of mondrian and sql server.
Now I am writing code in java for database connection using olap4j.
Code is :
try {
Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
String connectionString1 = "type=OLAP name=sales driver=mondrian.olap4j.MondrianOlap4jDriver location=jdbc:mondrian:Jdbc=jdbc:sqlserver://serverName:1433;database=TempDatabase;Catalog=C:/Schema1.xml;JdbcDrivers=com.microsoft.sqlserver.jdbc.SQLServerDriver username=sa password=p#ssw0rd";
Connection jdbcConnection = DriverManager.getConnection(connectionString1);
OlapConnection connection = ((OlapWrapper)jdbcConnection).unwrap(OlapConnection.class);
OlapStatement olapStatement = connection.createStatement();
} catch (SQLException e) {
e.printStackTrace();
}catch (ClassNotFoundException e) {
e.printStackTrace();
}
But this is giving me Error while running the code :
java.lang.ClassNotFoundException: mondrian.olap4j.MondrianOlap4jDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.tuto.Test.main(Test.java:16)
I am using following jars :
1.asm.jar
2.asm-commons.jar
3.asm-tree.jar
4.javacup.jar
5.olap4j-1.0.0.445.jar
6.olap4j-xmla-1.0.0.445.jar
7.retroweaver.jar
8.retroweaver-rt.jar
9.sqljdbc.jar
10.xercesImpl.jar
11.olap4j-tck-1.0.0.445.jar
Please help me why I am getting this error?
Thanks.
You are trying to use the Mondrian implementation of olap4j, but Mondrian isn't in your class path. You will have to download Mondrian and its dependencies.
Also, you can remove the following libraries.
retroweaver*.jar
olap4j-tck
olap4j-xmla
The retroweaver runtime is only necessary if you use the JDK4 version of olap4j. The olap4j-tck is only useful if you are implementing an olap4j driver and wanted to test it.
Also note that your connection URL is pretty messed up. I'm pretty sure that it won't work. You should check the basic code examples provided here to get you started.
If you are using Maven, here are the dependencies that I used to get it to work:
<dependency>
<groupId>org.olap4j</groupId>
<artifactId>olap4j</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>pentaho</groupId>
<artifactId>mondrian</artifactId>
<version>3.2.1.13885</version>
</dependency>
<dependency>
<groupId>eigenbase</groupId>
<artifactId>eigenbase-xom</artifactId>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>eigenbase</groupId>
<artifactId>eigenbase-properties</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>eigenbase</groupId>
<artifactId>eigenbase-resgen</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-vfs</groupId>
<artifactId>commons-vfs</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-math</groupId>
<artifactId>commons-math</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
and with this repo:
<repository>
<id>pentaho-releases</id>
<url>http://repository.pentaho.org/artifactory/repo/</url>
</repository>
Related
I have the following controller:
#POST
#Path("endpoint")
#Consumes({MediaType.APPLICATION_JSON+ ";charset=utf-8"})
#Produces({MediaType.APPLICATION_JSON + ";charset=utf-8", "application/javascript;charset=utf-8"})
public void postData(#Context HttpHeaders httpHeaders,
#Context HttpServletRequest request, #Context UriInfo uriInfo,
JSONData postedData) {
}
My related pom dependencies are:
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<scope>runtime</scope>
</dependency>
The version resolved in the dependencies is 2.17 for all the dependencies.
I am registering the JacksonFeature class in the properties
jersey.config.server.provider.classnames=org.glassfish.jersey.jackson.JacksonFeature
And I get the following exception when performing a request: (the JSONData class is very simple by now, only a String property annotated with lombok to generate getter and setters)
2020-12-07 12:31:56,910 ERROR [jersey-server-managed-async-executor-0]
JsonExceptionMapper - at
es.colbenson.sb.ws.JsonExceptionMapper.toResponse(JsonExceptionMapper.java:28)
Exception: java.lang.NoSuchMethodError java.lang.NoSuchMethodError:
com.fasterxml.jackson.databind.util.BeanUtil.okNameForSetter(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMethod;)Ljava/lang/String;
at
com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.findNameForDeserialization(JaxbAnnotationIntrospector.java:875)
~[jackson-module-jaxb-annotations-2.3.2.jar:2.3.2]
I've also tried registering the JacksonFeature class on my application constructor:
register(JacksonFeature)
But I can get this working. Any thoughts?
Also I can see this in the exception Stack Trace, which seems to be pointing to a jackson-databind-2.9.8 inside, but I'm not sure if it is a kind of conflict...
at
com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addSetterMethod(POJOPropertiesCollector.java:620)
~[jackson-databind-2.9.8.jar:2.9.8] at
com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addMethods(POJOPropertiesCollector.java:535)
~[jackson-databind-2.9.8.jar:2.9.8] at
com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collectAll(POJOPropertiesCollector.java:309)
~[jackson-databind-2.9.8.jar:2.9.8] at
com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getPropertyMap(POJOPropertiesCollector.java:287)
~[jackson-databind-2.9.8.jar:2.9.8] at
com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getProperties(POJOPropertiesCollector.java:170)
~[jackson-databind-2.9.8.jar:2.9.8]
I had to remove this dependency:
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<scope>runtime</scope>
</dependency>
And add this other
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.9.8</version>
</dependency>
Then register this provider:
jersey.config.server.provider.classnames=com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider
It seems a matter of using the proper jackson binder for this version of jersey
We are using Apache Camel Java DSL and the json-validator component to validate json requests against a json schema. The current camel version is 2.22.0, according to the camel documentation this supports JSON schema v4, v6, v7 and v2019-09 using the NetworkNT JSON Schema library. However, when I try a JSON schema draft 07, I get an error when running tests "Caused by: com.networknt.schema.JsonSchemaException: Unknown Metaschema: http://json-schema.org/draft-07/schema#".
When i revert back to json schema draft 04 it works fine.
Any ideas on how to get this working?
The default draft is the 4th one, but you can override the schema validator (JsonSchemaLoader), by defining a bean.
#Bean(name = "mySchemaLoader")
public JsonSchemaLoader mySchemaLoader() {
return (camelContext, schemaStream) -> JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7)
.getSchema(schemaStream);
}
with that we just create a bean wich will return a V7 schema validator, if you want to override the default configuration
...
ObjectMapper mapper = new ObjectMapper();
JsonSchemaFactory validatorFactory = JsonSchemaFactory.builder(JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7)).objectMapper(mapper).build();
....
So having the bean, you just have to said to camel that you are going to usea that bean via query param
public void configureRemote() throws Exception {
from("direct:getPrescripciones")
.recipientList(
simple"${header.url}?bridgeEndpoint=true"))
.to("json-validator:deliveryReport.schema.json?schemaLoader=#bean:mySchemaLoader")
.end();
}
that's all
here the dependencies I used
<properties>
<java.version>1.8</java.version>
<camel.version>3.4.0</camel.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-json-validator-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jolt</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-servlet-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-swagger-java-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-google-pubsub-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-google-pubsub</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
The camel version supporting the v7 is 3.4.0
The documentation you're looking for is on 2.x and in that case it's correctly noted that only v4 is supported: https://camel.apache.org/components/2.x/json-validator-component.html
I am getting this error:
java.lang.NoClassDefFoundError: org/powermock/reflect/proxyframework/ClassLoaderRegisterProxyFramework
at org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl.registerProxyframework(AbstractCommonTestSuiteChunkerImpl.java:101)
at org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl.chunkClass(AbstractCommonTestSuiteChunkerImpl.java:114)
at org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl.<init>(AbstractCommonTestSuiteChunkerImpl.java:60)
at org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl.<init>(AbstractCommonTestSuiteChunkerImpl.java:54)
at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.<init>(AbstractTestSuiteChunkerImpl.java:58)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.<init>(JUnit4TestSuiteChunkerImpl.java:49)
at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<init>(AbstractCommonPowerMockRunner.java:32)
at org.powermock.modules.junit4.PowerMockRunner.<init>(PowerMockRunner.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:84)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:70)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.ClassNotFoundException: org.powermock.reflect.proxyframework.ClassLoaderRegisterProxyFramework
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 25 more
I've added these dependencies in my pom.xml. I've already checked the stackflow for similar implementations and did a clean install. My project is building file but running tests is giving error. I am trying to run through eclipse.
<!-- Power Mock dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-legacy</artifactId>
<version>1.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>1.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
<scope>test</scope>
</dependency>
I am running java class with PowerMockRunner and injecting my test class using annotation InjectMock. Then mocking static class using MockStatic method. Also, i've added PrepareForTest annotation and added Class which has static methods in that location.
I updated my code and followed few examples, but this error is coming. What am i am doing wrong?
My code is like this.
class A{
void static method testA(String str){ .... do something; }
}
class B{
testB(String s)
{ A.testA(s);
}
}
Now when i try to run test case on my class A using PowerMockRunner. I've given annotations on testcase #preparefortest({A.class}) #runwith(PowerMockRunner.class)
I saw the same error when using PowerMock 1.7.1. In the absence of an explicit dependency, maven was pulling in version 1.6.5 of powermock-core. Adding an explicit dependency on version 1.7.1 of powermock-core fixed this error for me.
So your solution should be to add an explicit dependency on version 1.7.0 of powermock-core:
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>1.7.0</version>
<scope>test</scope>
</dependency>
I have an compile-time error trying to write a SnappySQLJob. Am I missing a dependency?
The error message is:
The type org.apache.spark.sql.catalyst.TableIdentifier cannot be resolved. It is indirectly referenced from required .class files
#Override
public Object runJob(Object sparkContext, Config jobConfig) {
SnappyContext snappyContext = (SnappyContext)sparkContext;
String fileResource = "data.csv";
DataFrame dataFrame = snappyContext.read()
.format("com.databricks.spark.csv")
.option("header", "true")
.option("inferSchema", "true")
.load(fileResource);
// Compile-Time error is on this line
dataFrame.write().insertInto("example_table_col");
return null;
}
Here is my pom.xml dependencies:
<dependency>
<groupId>io.snappydata</groupId>
<artifactId>snappy-core_2.10</artifactId>
<version>0.2.1-PREVIEW</version>
</dependency>
<dependency>
<groupId>io.snappydata</groupId>
<artifactId>snappy-tools_2.10</artifactId>
<version>0.2.1-PREVIEW</version>
<exclusions>
<exclusion>
<artifactId>jdk.tools</artifactId>
<groupId>jdk.tools</groupId>
</exclusion>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
</exclusions>
</dependency>
This old release seems to be missing spark-catalyst dependency. I will suggest upgrading to 0.5 release version instead (snappy-tools is now called snappy-cluster) and the snappydata cluster should also be upgraded to 0.5
For the 0.2.1 release, below should correct the problem:
<dependency>
<groupId>io.snappydata</groupId>
<artifactId>snappy-spark-catalyst_2.10</artifactId>
<version>1.6.0-BETA</version>
</dependency>
<dependency>
<groupId>io.snappydata</groupId>
<artifactId>snappy-spark-sql_2.10</artifactId>
<version>1.6.0-BETA</version>
</dependency>
I could not find a good configuration for JEE7 web application functional testing using arquillian-drone-graphene. Note: I can run CDI and EJB tests in Arquillian test suite; they work fine. My POM.xml is as follows:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.arquillian_core>1.1.8.Final</version.arquillian_core>
<version.arquillian_drone>1.3.1.Final</version.arquillian_drone>
<version.graphine_webdriver>2.0.3.Final</version.graphine_webdriver>
<version.junit>4.12</version.junit>
<version.selenium_bom>2.45.0</version.selenium_bom>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${version.arquillian_core}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>${version.arquillian_drone}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.selenium</groupId>
<artifactId>selenium-bom</artifactId>
<version>${version.selenium_bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<version>${version.graphine_webdriver}</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>arquillian-graphene</artifactId>
<version>${version.graphine_webdriver}</version>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.1</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver-impl</artifactId>
<version>${version.graphine_webdriver}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>arquillian-wildfly-embedded</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<forkMode>always</forkMode>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<jboss.home>${jboss.home}</jboss.home>
<module.path>${jboss.home}/modules</module.path>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jboss.home>/home/wildfly-8.2.0.Test</jboss.home>
</properties>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId>
<version>8.2.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-embedded</artifactId>
<version>8.2.0.Final</version>
</dependency>
</dependencies>
</profile>
</profiles>
and my arquillian.xml is as follows:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<defaultProtocol type="Servlet 3.0"/>
<extension qualifier="webdriver">
<property name="browser">firefox</property>
<property name="loggingPrefs">driver=INFO,profiler=WARNING</property>
</extension>
<container qualifier="arquillian-wildfly-embedded">
</container>
</arquillian>
Could anybody suggest me a good configuration for wildfly-8.2.0.Final + arquillian + Drone + Graphene functional testing POM ?
NOTE: with above configuration, my functional tests always end with following error trace:
testEjb_should_persist_drone(com.syntech.test.ArquillianDroneTest) Time elapsed: 0.391 sec <<< ERROR!
java.lang.RuntimeException: org/apache/http/conn/SchemePortResolver
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:99)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createRemoteDriver(RemoteWebDriverFactory.java:150)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createReusableDriver(RemoteWebDriverFactory.java:178)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:98)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:49)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:130)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:41)
at org.jboss.arquillian.drone.impl.DroneCallableCreator$1.call(DroneCallableCreator.java:89)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.jboss.arquillian.drone.impl.DroneExecutorService$ContextualRunnable.run(DroneExecutorService.java:113)
at java.lang.Thread.run(Thread.java:745)
testEjb_should_persist_embedded_drone(com.syntech.test.ArquillianDroneTest) Time elapsed: 0 sec <<< ERROR!
java.lang.RuntimeException: org/apache/http/conn/SchemePortResolver
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:99)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createRemoteDriver(RemoteWebDriverFactory.java:150)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createReusableDriver(RemoteWebDriverFactory.java:178)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:98)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:49)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:130)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:41)
at org.jboss.arquillian.drone.impl.DroneCallableCreator$1.call(DroneCallableCreator.java:89)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.jboss.arquillian.drone.impl.DroneExecutorService$ContextualRunnable.run(DroneExecutorService.java:113)
at java.lang.Thread.run(Thread.java:745)
serviceFacade_should_be_deployed_drone(com.syntech.test.ArquillianDroneTest) Time elapsed: 0.012 sec <<< ERROR!
java.lang.RuntimeException: org/apache/http/conn/SchemePortResolver
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:99)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createRemoteDriver(RemoteWebDriverFactory.java:150)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createReusableDriver(RemoteWebDriverFactory.java:178)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:98)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:49)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:130)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:41)
at org.jboss.arquillian.drone.impl.DroneCallableCreator$1.call(DroneCallableCreator.java:89)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.jboss.arquillian.drone.impl.DroneExecutorService$ContextualRunnable.run(DroneExecutorService.java:113)
at java.lang.Thread.run(Thread.java:745)
testUserLoginSuccess(com.syntech.test.ArquillianDroneTest) Time elapsed: 0.027 sec <<< ERROR!
java.lang.RuntimeException: org/apache/http/conn/SchemePortResolver
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:99)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createRemoteDriver(RemoteWebDriverFactory.java:150)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createReusableDriver(RemoteWebDriverFactory.java:178)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:98)
at org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory.createInstance(RemoteWebDriverFactory.java:49)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:130)
at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:41)
at org.jboss.arquillian.drone.impl.DroneCallableCreator$1.call(DroneCallableCreator.java:89)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.jboss.arquillian.drone.impl.DroneExecutorService$ContextualRunnable.run(DroneExecutorService.java:113)
at java.lang.Thread.run(Thread.java:745)
com.syntech.test.ArquillianDroneTest Time elapsed: 0.375 sec <<< ERROR!
java.lang.IllegalStateException: Unexpected callable present in Drone Context, should be already instantiated at this moment.
at org.jboss.arquillian.drone.impl.InstanceOrCallableInstanceImpl.asInstance(InstanceOrCallableInstanceImpl.java:57)
at org.jboss.arquillian.drone.impl.DroneEnhancer.deenhanceDrone(DroneEnhancer.java:119)
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:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.drone.impl.DroneDestructor.destroyClassScopedDrone(DroneDestructor.java:93)
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:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.afterClass(EventTestRunnerAdaptor.java:94)
at org.jboss.arquillian.junit.Arquillian$3$1.evaluate(Arquillian.java:223)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)
at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
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:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
INFO [org.jboss.as.connector.subsystems.datasources] JBAS010409: Unbound data source [java:jboss/datasources/ExampleDS]
INFO [org.wildfly.extension.undertow] JBAS017532: Host default-host stopping
INFO [org.wildfly.extension.undertow] JBAS017521: Undertow HTTP listener default suspending
INFO [org.jboss.as.connector.deployers.jdbc] JBAS010418: Stopped Driver service with driver-name = h2
INFO [com.arjuna.ats.jbossatx] ARJUNA032018: Destroying TransactionManagerService
INFO [com.arjuna.ats.jbossatx] ARJUNA032014: Stopping transaction recovery manager
INFO [org.wildfly.extension.undertow] JBAS017520: Undertow HTTP listener default stopped, was bound to /127.0.0.1:8080
INFO [org.wildfly.extension.undertow] JBAS017506: Undertow 1.1.0.Final stopping
INFO [org.jboss.as] JBAS015950: WildFly 8.2.0.Final "Tweek" stopped in 136ms
Results :
Tests in error:
» Runtime org/apache/http/conn/SchemePortResolver
» Runtime org/apache/http/conn/SchemePortResolver
» Runtime org/apache/http/conn/SchemePortResolver
» Runtime org/apache/http/conn/SchemePortResolver
» IllegalState Unexpected callable present in Drone Context, should be alread...
Tests run: 10, Failures: 0, Errors: 5, Skipped: 0
Finally I am done with the help of this link. That was the configuration I was looking for so desperately.
I too had many difficulties in setting up the arquillian framework. Once done, it was so easy to use.
Please check here for more info: http://www.testautomationguru.com/selenium-webdriver-automation-using-arquillian-framework/