E ai galera…
Achar sobre esse assunto na internet está sendo muito dificil… esse erro não ocorreu comigo está acontecendo outro… se puderem me ajudar…
estou integrando o com o maven + seam + testng + embedded-jboss-beta3
em meu POM.XML RAIZ, adicionei as seguintes linhas…importantes na config… o rsto é da app msm. p não deixar mt grande vou colocar as partes importantes.
POM.XML RAIZ
................
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>hibernate-all</artifactId>
<version>beta3.SP5</version>
<scope>provided</scope>
</dependency>
..................................
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.7</version>
<classifier>jdk15</classifier>
</dependency>
</dependencies>
</dependencyManagement>
POM.XML da minha app que possui um SeamTest
....
<dependencies>
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>hibernate-all</artifactId>
<version>beta3.SP5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
...................
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded-all</artifactId>
<version>beta3.SP5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded-all</artifactId>
<version>beta3.SP5</version>
<exclusions>
<exclusion>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-deployers-client-spi</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-deployers-core-spi</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>hibernate-all</artifactId>
<version>beta3.SP5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>thirdparty-all</artifactId>
<version>beta3.SP5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded</artifactId>
<version>beta3.SP5</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-deployers-client-spi</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
....................
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded-bootstrap</artifactId>
<type>zip</type>
<version>beta3</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
</configuration>
<id>download-embedded-jboss-bootstrap</id>
<phase>process-test-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
</execution>
<execution>
<configuration>
<artifactItems>
<artifactItem>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.testOutputDirectory}/endorsed</outputDirectory>
</configuration>
<id>download-jaxb-api</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.testOutputDirectory}/bootstrap</additionalClasspathElement>
</additionalClasspathElements>
<childDelegation>true</childDelegation>
<useSystemClassLoader>true</useSystemClassLoader>
<argLine>-Djava.endorsed.dirs=${project.build.testOutputDirectory}/endorsed -Dsun.lang.ClassLoader.allowArraySyntax=true</argLine>
</configuration>
</plugin>
</plugins>
.......................
<testSourceDirectory>src/test/java</testSourceDirectory>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
Dentro da pasta src\test\resources adicionei a pasta bootstrap do embedded-jboss-beta3.zip, ficando src\test\resources\bootstrap
No diretório src\test\resources\bootstrap\deploy adiconei o arquivo xxx-ds.xml com as configurações de conexao com BD
xxx-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>acessoDatasource</jndi-name>
<connection-url>jdbc:oracle:thin:@172.27.254.65:1521:LDOHML01</connection-url>
<driver-class>oracle.jdbc.pool.OracleDataSource</driver-class>
<user-name>usu01</user-name>
<password>ttsu01</password>
</local-tx-datasource>
</datasources>
Meu arquivo testng.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count ="5"skipfailedinvocationCounts="false" verbose="1" name="acesso-jsf" junit="false" parallel="false" annotations="JDK">
<test verbose ="3"name="com.login.acesso.jsf.SistemaBeanTest" junit="false" annotations="JDK">
<classes>
<class name="com.login.acesso.jsf.SistemaBeanTest"/>
</classes>
</test>
</suite>
persistence.xml
[code]<?xml version="1.0" encoding="UTF-8"?>
<persistence-unit name="acessoDataBase" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:/acessoDatasource</non-jta-data-source>
<class>com.login.acesso.entity.Sistema</class>
<class>com.login.acesso.entity.Perfil</class>
<class>com.login.acesso.entity.Funcionalidade</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>
[/code]
Quando executo através do comendo
ocorre o seguinte erro
[code]*** CONTEXTS IN ERROR: Name -> Error
vfsfile:/D:/development/workspaces/eclipse/workspace/acesso/acesso-jsf/target/test-classes/bootstrap/deploy/xxx-ds.xml -> java.net.ConnectException: Connection timed out: connect
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:149)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024)
at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:262)
at org.testng.SuiteRunner.run(SuiteRunner.java:191)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
at org.testng.TestNG.run(TestNG.java:701)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)[/code]
Quando executo pelo TestNG dentro do Eclipse funciona, porém sem o JNDI. Qual será o problema de integração com Maven2, alguém já conseguiu colocar p funcionar???
Abraçoss