junit - Arquillian:Could not setup GlassFish Embedded Runtime -
i try make test arquillian in maven project in every execution of test gives me following exception:
grave: exception in command execution : java.lang.noclassdeffounderror: javax/validation/parameternameprovider tests run: 1, failures: 0, errors: 1, skipped: 0, time elapsed: 0.855 sec <<< failure! tests in error: es.costa.service.test.magali.personafactortest: not setup glassfish embedded runtime caused by: org.glassfish.embeddable.glassfishexception: plaintextactionreporterfailurejava.lang.noclassdeffounderror: javax/validation/parameternameproviderjava.lang.noclassdeffounderror: javax/validation/parameternameprovider java.lang.runtimeexception: not setup glassfish embedded runtime
this pom.xml:
<dependencymanagement> <dependencies> <dependency> <groupid>org.jboss.arquillian</groupid> <artifactid>arquillian-bom</artifactid> <version>1.0.3.final</version> <scope>import</scope> <type>pom</type> </dependency> </dependencies> </dependencymanagement> <dependencies> <dependency> <groupid>org.jboss.ejb3</groupid> <artifactid>jboss-ejb3-ext-api</artifactid> <version>2.1.0</version> </dependency> <dependency> <groupid>es.costa</groupid> <artifactid>costa-interfaces</artifactid> <version>${project.version}</version> </dependency> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>org.jboss.arquillian.junit</groupid> <artifactid>arquillian-junit-container</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator</artifactid> <version>5.1.3.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator-annotation-processor</artifactid> <version>5.0.3.final</version> </dependency> </dependencies> <build> <sourcedirectory>ejbmodule/src/main/java</sourcedirectory> <testsourcedirectory>ejbmodule/src/test/java</testsourcedirectory> <resources> <resource> <directory>ejbmodule/src/main/resources</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <testresources> <testresource> <directory>ejbmodule/src/test/resources</directory> </testresource> </testresources> <plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>${maven-compiler-plugin.version}</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>cp1252</encoding> </configuration> </plugin> <plugin> <artifactid>maven-surefire-plugin</artifactid> <version>2.12</version> </plugin> <plugin> <artifactid>maven-ejb-plugin</artifactid> <version>${maven-ejb-plugin.version}</version> <configuration> <ejbversion>${ejb.version}</ejbversion> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-shade-plugin</artifactid> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <artifactset> <includes> <include>es.costa</include> </includes> </artifactset> <finalname>${artifactid}-${project.version}</finalname> </configuration> </plugin> <plugin> <groupid>org.jboss.as.plugins</groupid> <artifactid>jboss-as-maven-plugin</artifactid> <configuration> <filename>${artifactid}-${project.version}.jar</filename> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>dev</id> <activation> <activebydefault>true</activebydefault> </activation> <dependencies> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-entitymanager</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>javax.persistence</groupid> <artifactid>persistence-api</artifactid> <version>${javax-persistance.version}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>jenkins</id> <dependencies> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-entitymanager</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>javax.persistence</groupid> <artifactid>persistence-api</artifactid> <version>${javax-persistance.version}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arquillian-glassfish-embedded</id> <activation> <activebydefault>true</activebydefault> </activation> <dependencies> <dependency> <groupid>org.jboss.arquillian.container</groupid> <artifactid>arquillian-glassfish-embedded-3.1</artifactid> <version>1.0.0.cr3</version> <scope>test</scope> </dependency> <dependency> <groupid>org.glassfish.main.extras</groupid> <artifactid>glassfish-embedded-all</artifactid> <version>3.1.2</version> <scope>provided</scope> </dependency> <dependency> <groupid>com.h2database</groupid> <artifactid>h2</artifactid> <version>1.3.166</version> <scope>test</scope> </dependency> </dependencies> <build> <testresources> <testresource> <directory>ejbmodule/src/test/resources</directory> </testresource> <testresource> <directory>ejbmodule/src/test/resources-glassfish-embedded</directory> </testresource> </testresources> <plugins> <plugin> <artifactid>maven-surefire-plugin</artifactid> <version>2.12</version> <configuration> <systempropertyvariables> <arquillian.launch>glassfish-embedded</arquillian.launch> <java.util.logging.config.file> ${project.build.testoutputdirectory}/logging.properties </java.util.logging.config.file> <derby.stream.error.file> ${project.build.directory}/derby.log </derby.stream.error.file> </systempropertyvariables> </configuration> </plugin> </plugins> </build> </profile> </profiles>
this arquillian.xml
<?xml version="1.0" encoding="utf-8"?> <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"> <container qualifier="glassfish-embedded" default="true"> <configuration> <property name="resourcesxml"> ejbmodule/src/test/resources-glassfish-embedded/glassfish-resources.xml </property> </configuration> </container>
this glassfish-resources.xml
<?xml version="1.0" encoding="utf-8"?> <!doctype resources public "-//glassfish.org//dtd glassfish application server 3.1 resource definitions//en" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"> <resources> <jdbc-resource pool-name="arquillianembeddedh2pool" jndi-name="jdbc/arquillian"/> <jdbc-connection-pool name="arquillianembeddedh2pool" res-type="javax.sql.datasource" datasource-classname="org.h2.jdbcx.jdbcdatasource"> <property name="user" value="sa"/> <property name="password" value=""/> <property name="url" value="jdbc:h2:file:target/databases/h2/db"/> </jdbc-connection-pool>
i removed block of code :
<dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator</artifactid> <version>5.1.3.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator-annotation-processor</artifactid> <version>5.0.3.final</version> </dependency>
and think solved problem have other error message :
arquillianservletrunner not found. not determine contextroot protocolmetadata, please contact deployablecontainer developer.
Comments
Post a Comment