[JBoss JIRA] (SHRINKRES-211) java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
by Antimo Di Comite (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-211?page=com.atlassian.jira.plu... ]
Antimo Di Comite commented on SHRINKRES-211:
--------------------------------------------
Hi Karel,
i was tryng to run test using embedded container.
So as you suggest i have switched to managed container (Jboss AS 7.1) , now the error is different, so may be i should ask for info in another thread or on other forum (don't know it it's a bug at this point)?
New dependency managment
{code}
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-bom</artifactId>
<version>2.1.2</version>
<scope>test</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>test</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
{code}
Then
I have to add
{code}
<dependency>
<groupId>org.jboss.arquillian.core</groupId>
<artifactId>arquillian-core-api</artifactId>
<version>1.1.4.Final</version>
<scope>test</scope>
</dependency>
{code}
Because i have a
{code}
Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/core/api/threading/ExecutorService
{code}
And now the deploy on local instance of Jboss seems to work fine ( i will test with a simpler test as soon as i have a little time but i think all is fine)
Essentially the problem is to add a jar dependencies present in maven (mistral-be) to the deployed test (see previous comment in this post).
Finally i use this code
{code}
String str = "C:\\IntellijProject\\Import***\\import****\\migrazione****-be\\pom.xml";
JavaArchive pomFiles = ShrinkWrap.create(MavenImporter.class)
.loadPomFromFile(str).importBuildOutput().as(JavaArchive.class);
/* https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu... */
JavaArchive[] mistral_be = Maven.configureResolver().workOffline().resolve("it.****.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < mistral_be.length ; i++) {
pomFiles = pomFiles.merge(mistral_be[i]);
}
pomFiles.as(ZipExporter.class).exportTo(new File ("C:\\temp\\res.zip"));
{code}
It generate quite a big zip file only to check the result, but while try'n to deploy to jboss 7.1.1
{code}
18:46:17,003 INFO [org.jboss.as.repository] (management-handler-thread - 2) JBAS014900: Content added at location C:\jboss\jboss-as-7.1.1.Final\standalone\data\content\bc\b6fd502db2696342419c17a6d2ed82a4176a4e\content
18:46:17,008 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "arquillian-service"
{code}
I have an error:
{code}
org.jboss.arquillian.container.spi.client.container.DeploymentException: Could not deploy to container: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"postImportBE-1.0-SNAPSHOT.jar\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"postImportBE-1.0-SNAPSHOT.jar\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"postImportBE-1.0-SNAPSHOT.jar\""}}
{code}
As i see in the app server log it is
{code}
Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes.
{code}
I see in the META_INF of the zipped file directory a lot o files coming from transitive dependencies of mistral-be, so the problem could be this. Is there anyway to generate a JAR file with a valid signature? Or may be i am using a wrong aprroach to solve this problem (contruct jar in another way or similar idea)?
{code}
And why the dependencies in pom:
<dependency>
<groupId>it.**.mistral</groupId>
<artifactId>mistral-be</artifactId>
<version>0.1.0</version>
<scope>compile</scope>
</dependency>
{code}
is not directly impor by this instruction? Did i miss something?
{code}
String str = "C:\\IntellijProject\\Import***\\import****\\migrazione****-be\\pom.xml";
JavaArchive pomFiles = ShrinkWrap.create(MavenImporter.class)
.loadPomFromFile(str).importBuildOutput().as(JavaArchive.class);
{code}
Thank you
Antimo
> java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> --------------------------------------------------------------------
>
> Key: SHRINKRES-211
> URL: https://issues.jboss.org/browse/SHRINKRES-211
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: maven
> Affects Versions: 2.1.0
> Environment: Windows 7
> Reporter: Antimo Di Comite
> Labels: testsuite_stability
>
> I'm having trouble creating a JUnit test using a pom.xml dependency.
> The test are being run with Arquillian
> @RunWith(Arquillian.class)
> In this method
> {code}
> @Deployment
> public static JavaArchive createDeployment() {
> First, I create a JavaArchive with the package of the project I'm testing
> JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
> addPackages(true,
> "migrazioneGeaPersistenzaTampone",
> "migrazioneGeaPersistenza",
> "it.**.mistral.importGEA4.task",
> "migrazioneGeaPersistenzaAccess"
> ).
> addClasses(java.sql.Connection.class)
> .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> {code}
> Then when I launch the test, there are some missing dependencies
> Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
> present in this dependency
> {code}
> <dependency>
> <groupId>it.**.mistral</groupId>
> <artifactId>mistral-be</artifactId>
> <version>0.1.0</version>
> <scope>compile</scope>
> </dependency>
> {code}
> I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
> a)
> {code}
> JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
> {code}
> or
> {code}
> Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
> {code}
> The dependency is ignored in either way (i'm missing something?)
> b)
> {code}
> JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < mistral_be.length ; i++) {
> merge = merge.merge(mistral_be[i]);
> }
> {code}
> With a simple
> {code}
> System.out.println(merge.toString(true));
> {code}
> I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
> But exiting the method with a
> {code}
> return merge;
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
> {code}
> Adding another dependencies to protobuf :
> {code}
> // Trym'g to add protobuf dependencies
> JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < prto_buf.length ; i++) {
> projectPackages = projectPackages.merge(proto_buf[i]);
> }
> {code}
> Keep ending with the same error
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> These are an extract of dependencies in pom.xml:
> {code}
> <dependency>
> <groupId>org.jboss.spec</groupId>
> <artifactId>jboss-javaee-6.0</artifactId>
> <version>1.0.0.Final</version>
> <type>pom</type>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.container</groupId>
> <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
> <version>1.0.0.CR3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-depchain</artifactId>
> <version>2.1.0</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.5.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> </dependencyManagement>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-212) SAXParserFactory issues with JBoss AS and EAP
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-212?page=com.atlassian.jira.plu... ]
Karel Piwko updated SHRINKRES-212:
----------------------------------
Status: Resolved (was: Pull Request Sent)
Fix Version/s: 2.2.0-cr-1
Resolution: Done
Landed in https://github.com/shrinkwrap/resolver/commit/3ab4fd08f71f18641cd469436e3...
> SAXParserFactory issues with JBoss AS and EAP
> ---------------------------------------------
>
> Key: SHRINKRES-212
> URL: https://issues.jboss.org/browse/SHRINKRES-212
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: gradle
> Affects Versions: 2.2.0-beta-1
> Reporter: Michal Matloka
> Assignee: Michal Matloka
> Fix For: 2.2.0-cr-1
>
>
> Running Embedded Gradle Importer on Jboss AS/EAP/early WildFly results in following exception
> {code}
> java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment()
> Caused by:
> java.lang.reflect.InvocationTargetException
> Caused by:
> org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
> at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:53)
> at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
> at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
> at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:71)
> at org.jboss.shrinkwrap.impl.gradle.archive.importer.embedded.EmbeddedGradleImporterImpl.importBuildOutput(EmbeddedGradleImporterImpl.java:217)
> at org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment(FullGreeterTest.java:23)
> Caused by:
> org.gradle.internal.exceptions.LocationAwareException: Could not resolve all dependencies for configuration ':compile'.
> Caused by:
> org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':compile'.
> Caused by:
> org.gradle.api.internal.artifacts.ivyservice.ModuleVersionResolveException: Could not resolve javax:javaee-api:7.0.
> Required by:
> org.jboss.shrinkwrap.resolver.example:single-module:1.0.0
> Caused by:
> javax.xml.parsers.FactoryConfigurationError: Provider __redirected.__SAXParserFactory not found
> Caused by:
> java.lang.ClassNotFoundException: __redirected/__SAXParserFactory
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-212) SAXParserFactory issues with JBoss AS and EAP
by Michal Matloka (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-212?page=com.atlassian.jira.plu... ]
Michal Matloka updated SHRINKRES-212:
-------------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://issues.jboss.org/browse/SHRINKRES-212
> SAXParserFactory issues with JBoss AS and EAP
> ---------------------------------------------
>
> Key: SHRINKRES-212
> URL: https://issues.jboss.org/browse/SHRINKRES-212
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: gradle
> Affects Versions: 2.2.0-beta-1
> Reporter: Michal Matloka
> Assignee: Michal Matloka
>
> Running Embedded Gradle Importer on Jboss AS/EAP/early WildFly results in following exception
> {code}
> java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment()
> Caused by:
> java.lang.reflect.InvocationTargetException
> Caused by:
> org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
> at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:53)
> at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
> at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
> at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:71)
> at org.jboss.shrinkwrap.impl.gradle.archive.importer.embedded.EmbeddedGradleImporterImpl.importBuildOutput(EmbeddedGradleImporterImpl.java:217)
> at org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment(FullGreeterTest.java:23)
> Caused by:
> org.gradle.internal.exceptions.LocationAwareException: Could not resolve all dependencies for configuration ':compile'.
> Caused by:
> org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':compile'.
> Caused by:
> org.gradle.api.internal.artifacts.ivyservice.ModuleVersionResolveException: Could not resolve javax:javaee-api:7.0.
> Required by:
> org.jboss.shrinkwrap.resolver.example:single-module:1.0.0
> Caused by:
> javax.xml.parsers.FactoryConfigurationError: Provider __redirected.__SAXParserFactory not found
> Caused by:
> java.lang.ClassNotFoundException: __redirected/__SAXParserFactory
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-212) SAXParserFactory issues with JBoss AS and EAP
by Michal Matloka (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-212?page=com.atlassian.jira.plu... ]
Michal Matloka updated SHRINKRES-212:
-------------------------------------
Description:
Running Embedded Gradle Importer on Jboss AS/EAP/early WildFly results in following exception
{code}
java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment()
Caused by:
java.lang.reflect.InvocationTargetException
Caused by:
org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:53)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:71)
at org.jboss.shrinkwrap.impl.gradle.archive.importer.embedded.EmbeddedGradleImporterImpl.importBuildOutput(EmbeddedGradleImporterImpl.java:217)
at org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment(FullGreeterTest.java:23)
Caused by:
org.gradle.internal.exceptions.LocationAwareException: Could not resolve all dependencies for configuration ':compile'.
Caused by:
org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':compile'.
Caused by:
org.gradle.api.internal.artifacts.ivyservice.ModuleVersionResolveException: Could not resolve javax:javaee-api:7.0.
Required by:
org.jboss.shrinkwrap.resolver.example:single-module:1.0.0
Caused by:
javax.xml.parsers.FactoryConfigurationError: Provider __redirected.__SAXParserFactory not found
Caused by:
java.lang.ClassNotFoundException: __redirected/__SAXParserFactory
{code}
> SAXParserFactory issues with JBoss AS and EAP
> ---------------------------------------------
>
> Key: SHRINKRES-212
> URL: https://issues.jboss.org/browse/SHRINKRES-212
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: gradle
> Affects Versions: 2.2.0-beta-1
> Reporter: Michal Matloka
> Assignee: Michal Matloka
>
> Running Embedded Gradle Importer on Jboss AS/EAP/early WildFly results in following exception
> {code}
> java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment()
> Caused by:
> java.lang.reflect.InvocationTargetException
> Caused by:
> org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
> at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:53)
> at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
> at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
> at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:71)
> at org.jboss.shrinkwrap.impl.gradle.archive.importer.embedded.EmbeddedGradleImporterImpl.importBuildOutput(EmbeddedGradleImporterImpl.java:217)
> at org.jboss.shrinkwrap.resolver.example.FullGreeterTest.createDeployment(FullGreeterTest.java:23)
> Caused by:
> org.gradle.internal.exceptions.LocationAwareException: Could not resolve all dependencies for configuration ':compile'.
> Caused by:
> org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':compile'.
> Caused by:
> org.gradle.api.internal.artifacts.ivyservice.ModuleVersionResolveException: Could not resolve javax:javaee-api:7.0.
> Required by:
> org.jboss.shrinkwrap.resolver.example:single-module:1.0.0
> Caused by:
> javax.xml.parsers.FactoryConfigurationError: Provider __redirected.__SAXParserFactory not found
> Caused by:
> java.lang.ClassNotFoundException: __redirected/__SAXParserFactory
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-211) java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-211?page=com.atlassian.jira.plu... ]
Karel Piwko edited comment on SHRINKRES-211 at 10/13/14 10:35 AM:
------------------------------------------------------------------
Hi Antimo,
I'm a bit confused here. Where does this CNFE happens? During tests? During deployments? Somewhere else? Do I understand correctly that {{ merge.toString(true) }} prints that {{ com.google.protobuf.GeneratedMessage }} file is present?
I guess this is a classloader problem. As you are using embedded container, that protobuf class is not present on it's classpath. Any chance you can run with managed container instead (separated JVM)? Or can you provide output of dependency:tree ?
was (Author: kpiwko):
Hi Antimo,
I'm a bit confused here. Where does this CNFE happens? During tests? During deployments? Somewhere else? Do I understand correctly that {{merge.toString(true) }} prints that com.google.protobuf.GeneratedMessage file is present?
I guess this is a classloader problem. As you are using embedded container, that protobuf class is not present on it's classpath. Any chance you can run with managed container instead (separated JVM)? Or can you provide output of dependency:tree ?
> java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> --------------------------------------------------------------------
>
> Key: SHRINKRES-211
> URL: https://issues.jboss.org/browse/SHRINKRES-211
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: maven
> Affects Versions: 2.1.0
> Environment: Windows 7
> Reporter: Antimo Di Comite
> Labels: testsuite_stability
>
> I'm having trouble creating a JUnit test using a pom.xml dependency.
> The test are being run with Arquillian
> @RunWith(Arquillian.class)
> In this method
> {code}
> @Deployment
> public static JavaArchive createDeployment() {
> First, I create a JavaArchive with the package of the project I'm testing
> JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
> addPackages(true,
> "migrazioneGeaPersistenzaTampone",
> "migrazioneGeaPersistenza",
> "it.**.mistral.importGEA4.task",
> "migrazioneGeaPersistenzaAccess"
> ).
> addClasses(java.sql.Connection.class)
> .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> {code}
> Then when I launch the test, there are some missing dependencies
> Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
> present in this dependency
> {code}
> <dependency>
> <groupId>it.**.mistral</groupId>
> <artifactId>mistral-be</artifactId>
> <version>0.1.0</version>
> <scope>compile</scope>
> </dependency>
> {code}
> I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
> a)
> {code}
> JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
> {code}
> or
> {code}
> Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
> {code}
> The dependency is ignored in either way (i'm missing something?)
> b)
> {code}
> JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < mistral_be.length ; i++) {
> merge = merge.merge(mistral_be[i]);
> }
> {code}
> With a simple
> {code}
> System.out.println(merge.toString(true));
> {code}
> I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
> But exiting the method with a
> {code}
> return merge;
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
> {code}
> Adding another dependencies to protobuf :
> {code}
> // Trym'g to add protobuf dependencies
> JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < prto_buf.length ; i++) {
> projectPackages = projectPackages.merge(proto_buf[i]);
> }
> {code}
> Keep ending with the same error
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> These are an extract of dependencies in pom.xml:
> {code}
> <dependency>
> <groupId>org.jboss.spec</groupId>
> <artifactId>jboss-javaee-6.0</artifactId>
> <version>1.0.0.Final</version>
> <type>pom</type>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.container</groupId>
> <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
> <version>1.0.0.CR3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-depchain</artifactId>
> <version>2.1.0</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.5.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> </dependencyManagement>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-211) java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-211?page=com.atlassian.jira.plu... ]
Karel Piwko commented on SHRINKRES-211:
---------------------------------------
Hi Antimo,
I'm a bit confused here. Where does this CNFE happens? During tests? During deployments? Somewhere else? Do I understand correctly that {{merge.toString(true) }} prints that com.google.protobuf.GeneratedMessage file is present?
I guess this is a classloader problem. As you are using embedded container, that protobuf class is not present on it's classpath. Any chance you can run with managed container instead (separated JVM)? Or can you provide output of dependency:tree ?
> java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> --------------------------------------------------------------------
>
> Key: SHRINKRES-211
> URL: https://issues.jboss.org/browse/SHRINKRES-211
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: maven
> Affects Versions: 2.1.0
> Environment: Windows 7
> Reporter: Antimo Di Comite
> Labels: testsuite_stability
>
> I'm having trouble creating a JUnit test using a pom.xml dependency.
> The test are being run with Arquillian
> @RunWith(Arquillian.class)
> In this method
> {code}
> @Deployment
> public static JavaArchive createDeployment() {
> First, I create a JavaArchive with the package of the project I'm testing
> JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
> addPackages(true,
> "migrazioneGeaPersistenzaTampone",
> "migrazioneGeaPersistenza",
> "it.**.mistral.importGEA4.task",
> "migrazioneGeaPersistenzaAccess"
> ).
> addClasses(java.sql.Connection.class)
> .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> {code}
> Then when I launch the test, there are some missing dependencies
> Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
> present in this dependency
> {code}
> <dependency>
> <groupId>it.**.mistral</groupId>
> <artifactId>mistral-be</artifactId>
> <version>0.1.0</version>
> <scope>compile</scope>
> </dependency>
> {code}
> I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
> a)
> {code}
> JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
> {code}
> or
> {code}
> Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
> {code}
> The dependency is ignored in either way (i'm missing something?)
> b)
> {code}
> JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < mistral_be.length ; i++) {
> merge = merge.merge(mistral_be[i]);
> }
> {code}
> With a simple
> {code}
> System.out.println(merge.toString(true));
> {code}
> I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
> But exiting the method with a
> {code}
> return merge;
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
> {code}
> Adding another dependencies to protobuf :
> {code}
> // Trym'g to add protobuf dependencies
> JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < prto_buf.length ; i++) {
> projectPackages = projectPackages.merge(proto_buf[i]);
> }
> {code}
> Keep ending with the same error
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> These are an extract of dependencies in pom.xml:
> {code}
> <dependency>
> <groupId>org.jboss.spec</groupId>
> <artifactId>jboss-javaee-6.0</artifactId>
> <version>1.0.0.Final</version>
> <type>pom</type>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.container</groupId>
> <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
> <version>1.0.0.CR3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-depchain</artifactId>
> <version>2.1.0</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.5.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> </dependencyManagement>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-211) java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-211?page=com.atlassian.jira.plu... ]
Karel Piwko updated SHRINKRES-211:
----------------------------------
Description:
I'm having trouble creating a JUnit test using a pom.xml dependency.
The test are being run with Arquillian
@RunWith(Arquillian.class)
In this method
{code}
@Deployment
public static JavaArchive createDeployment() {
First, I create a JavaArchive with the package of the project I'm testing
JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
addPackages(true,
"migrazioneGeaPersistenzaTampone",
"migrazioneGeaPersistenza",
"it.**.mistral.importGEA4.task",
"migrazioneGeaPersistenzaAccess"
).
addClasses(java.sql.Connection.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
{code}
Then when I launch the test, there are some missing dependencies
Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
present in this dependency
{code}
<dependency>
<groupId>it.**.mistral</groupId>
<artifactId>mistral-be</artifactId>
<version>0.1.0</version>
<scope>compile</scope>
</dependency>
{code}
I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
a)
{code}
JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
{code}
or
{code}
Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
{code}
The dependency is ignored in either way (i'm missing something?)
b)
{code}
JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < mistral_be.length ; i++) {
merge = merge.merge(mistral_be[i]);
}
{code}
With a simple
{code}
System.out.println(merge.toString(true));
{code}
I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
But exiting the method with a
{code}
return merge;
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
{code}
Adding another dependencies to protobuf :
{code}
// Trym'g to add protobuf dependencies
JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < prto_buf.length ; i++) {
projectPackages = projectPackages.merge(proto_buf[i]);
}
{code}
Keep ending with the same error
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
These are an extract of dependencies in pom.xml:
{code}
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<version>1.0.0.CR3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<version>2.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
{code}
was:
I'm having trouble creating a JUnit test using a pom.xml dependency.
The test are being run with Arquillian
@RunWith(Arquillian.class)
In this method
@Deployment
public static JavaArchive createDeployment() {
First, I create a JavaArchive with the package of the project I'm testing
JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
addPackages(true,
"migrazioneGeaPersistenzaTampone",
"migrazioneGeaPersistenza",
"it.**.mistral.importGEA4.task",
"migrazioneGeaPersistenzaAccess"
).
addClasses(java.sql.Connection.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
Then when I launch the test, there are some missing dependencies
Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
present in this dependency
<dependency>
<groupId>it.**.mistral</groupId>
<artifactId>mistral-be</artifactId>
<version>0.1.0</version>
<scope>compile</scope>
</dependency>
I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
a)
JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
or
Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
The dependency is ignored in either way (i'm missing something?)
b)
JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < mistral_be.length ; i++) {
merge = merge.merge(mistral_be[i]);
}
With a simple
System.out.println(merge.toString(true));
I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
But exiting the method with a
return merge;
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
Adding another dependencies to protobuf :
// Trym'g to add protobuf dependencies
JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < prto_buf.length ; i++) {
projectPackages = projectPackages.merge(proto_buf[i]);
}
Keep ending with the same error
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
These are an extract of dependencies in pom.xml:
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<version>1.0.0.CR3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<version>2.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
> java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> --------------------------------------------------------------------
>
> Key: SHRINKRES-211
> URL: https://issues.jboss.org/browse/SHRINKRES-211
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: maven
> Affects Versions: 2.1.0
> Environment: Windows 7
> Reporter: Antimo Di Comite
> Labels: testsuite_stability
>
> I'm having trouble creating a JUnit test using a pom.xml dependency.
> The test are being run with Arquillian
> @RunWith(Arquillian.class)
> In this method
> {code}
> @Deployment
> public static JavaArchive createDeployment() {
> First, I create a JavaArchive with the package of the project I'm testing
> JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
> addPackages(true,
> "migrazioneGeaPersistenzaTampone",
> "migrazioneGeaPersistenza",
> "it.**.mistral.importGEA4.task",
> "migrazioneGeaPersistenzaAccess"
> ).
> addClasses(java.sql.Connection.class)
> .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> {code}
> Then when I launch the test, there are some missing dependencies
> Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
> present in this dependency
> {code}
> <dependency>
> <groupId>it.**.mistral</groupId>
> <artifactId>mistral-be</artifactId>
> <version>0.1.0</version>
> <scope>compile</scope>
> </dependency>
> {code}
> I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
> a)
> {code}
> JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
> {code}
> or
> {code}
> Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
> {code}
> The dependency is ignored in either way (i'm missing something?)
> b)
> {code}
> JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < mistral_be.length ; i++) {
> merge = merge.merge(mistral_be[i]);
> }
> {code}
> With a simple
> {code}
> System.out.println(merge.toString(true));
> {code}
> I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
> But exiting the method with a
> {code}
> return merge;
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
> {code}
> Adding another dependencies to protobuf :
> {code}
> // Trym'g to add protobuf dependencies
> JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < prto_buf.length ; i++) {
> projectPackages = projectPackages.merge(proto_buf[i]);
> }
> {code}
> Keep ending with the same error
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> These are an extract of dependencies in pom.xml:
> {code}
> <dependency>
> <groupId>org.jboss.spec</groupId>
> <artifactId>jboss-javaee-6.0</artifactId>
> <version>1.0.0.Final</version>
> <type>pom</type>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.container</groupId>
> <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
> <version>1.0.0.CR3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-depchain</artifactId>
> <version>2.1.0</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.5.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> </dependencyManagement>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-211) java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
by Antimo Di Comite (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-211?page=com.atlassian.jira.plu... ]
Antimo Di Comite commented on SHRINKRES-211:
--------------------------------------------
Dependencie
> java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> --------------------------------------------------------------------
>
> Key: SHRINKRES-211
> URL: https://issues.jboss.org/browse/SHRINKRES-211
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: maven
> Affects Versions: 2.1.0
> Environment: Windows 7
> Reporter: Antimo Di Comite
> Labels: testsuite_stability
>
> I'm having trouble creating a JUnit test using a pom.xml dependency.
> The test are being run with Arquillian
> @RunWith(Arquillian.class)
> In this method
> @Deployment
> public static JavaArchive createDeployment() {
> First, I create a JavaArchive with the package of the project I'm testing
> JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
> addPackages(true,
> "migrazioneGeaPersistenzaTampone",
> "migrazioneGeaPersistenza",
> "it.**.mistral.importGEA4.task",
> "migrazioneGeaPersistenzaAccess"
> ).
> addClasses(java.sql.Connection.class)
> .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> Then when I launch the test, there are some missing dependencies
> Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
> present in this dependency
> <dependency>
> <groupId>it.**.mistral</groupId>
> <artifactId>mistral-be</artifactId>
> <version>0.1.0</version>
> <scope>compile</scope>
> </dependency>
> I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
> a)
> JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
> or
> Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
> The dependency is ignored in either way (i'm missing something?)
> b)
> JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < mistral_be.length ; i++) {
> merge = merge.merge(mistral_be[i]);
> }
> With a simple
> System.out.println(merge.toString(true));
> I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
> But exiting the method with a
> return merge;
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
> Adding another dependencies to protobuf :
> // Trym'g to add protobuf dependencies
> JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < prto_buf.length ; i++) {
> projectPackages = projectPackages.merge(proto_buf[i]);
> }
> Keep ending with the same error
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> These are an extract of dependencies in pom.xml:
> <dependency>
> <groupId>org.jboss.spec</groupId>
> <artifactId>jboss-javaee-6.0</artifactId>
> <version>1.0.0.Final</version>
> <type>pom</type>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.container</groupId>
> <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
> <version>1.0.0.CR3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-depchain</artifactId>
> <version>2.1.0</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.5.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> </dependencyManagement>
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months
[JBoss JIRA] (SHRINKRES-211) java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
by Antimo Di Comite (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-211?page=com.atlassian.jira.plu... ]
Antimo Di Comite updated SHRINKRES-211:
---------------------------------------
Description:
I'm having trouble creating a JUnit test using a pom.xml dependency.
The test are being run with Arquillian
@RunWith(Arquillian.class)
In this method
@Deployment
public static JavaArchive createDeployment() {
First, I create a JavaArchive with the package of the project I'm testing
JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
addPackages(true,
"migrazioneGeaPersistenzaTampone",
"migrazioneGeaPersistenza",
"it.**.mistral.importGEA4.task",
"migrazioneGeaPersistenzaAccess"
).
addClasses(java.sql.Connection.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
Then when I launch the test, there are some missing dependencies
Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
present in this dependency
<dependency>
<groupId>it.**.mistral</groupId>
<artifactId>mistral-be</artifactId>
<version>0.1.0</version>
<scope>compile</scope>
</dependency>
I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
a)
JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
or
Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
The dependency is ignored in either way (i'm missing something?)
b)
JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < mistral_be.length ; i++) {
merge = merge.merge(mistral_be[i]);
}
With a simple
System.out.println(merge.toString(true));
I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
But exiting the method with a
return merge;
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
Adding another dependencies to protobuf :
// Trym'g to add protobuf dependencies
JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < prto_buf.length ; i++) {
projectPackages = projectPackages.merge(proto_buf[i]);
}
Keep ending with the same error
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
These are an extract of dependencies in pom.xml:
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<version>1.0.0.CR3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<version>2.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
was:
I'm having trouble creating a JUnit test using a pom.xml dependency.
The test are being run with Arquillian
@RunWith(Arquillian.class)
In this method
@Deployment
public static JavaArchive createDeployment() {
First, I create a JavaArchive with the package of the project I'm testing
JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
addPackages(true,
"migrazioneGeaPersistenzaTampone",
"migrazioneGeaPersistenza",
"it.**.mistral.importGEA4.task",
"migrazioneGeaPersistenzaAccess"
).
addClasses(java.sql.Connection.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
Then when I launch the test, there are some missing dependencies
Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
present in this dependency
<dependency>
<groupId>it.**.mistral</groupId>
<artifactId>mistral-be</artifactId>
<version>0.1.0</version>
<scope>compile</scope>
</dependency>
I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
a)
JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
or
Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
The dependency is ignored in either way (i'm missing something?)
b)
JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < mistral_be.length ; i++) {
merge = merge.merge(mistral_be[i]);
}
With a simple
System.out.println(merge.toString(true));
I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
But exiting the method with a
return merge;
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
Adding another dependencies to protobuf :
// Trym'g to add protobuf dependencies
JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
for (int i = 0; i < prto_buf.length ; i++) {
projectPackages = projectPackages.merge(proto_buf[i]);
}
Keep ending with the same error
throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> --------------------------------------------------------------------
>
> Key: SHRINKRES-211
> URL: https://issues.jboss.org/browse/SHRINKRES-211
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: maven
> Affects Versions: 2.1.0
> Environment: Windows 7
> Reporter: Antimo Di Comite
> Labels: testsuite_stability
>
> I'm having trouble creating a JUnit test using a pom.xml dependency.
> The test are being run with Arquillian
> @RunWith(Arquillian.class)
> In this method
> @Deployment
> public static JavaArchive createDeployment() {
> First, I create a JavaArchive with the package of the project I'm testing
> JavaArchive merge = ShrinkWrap.create(JavaArchive.class).
> addPackages(true,
> "migrazioneGeaPersistenzaTampone",
> "migrazioneGeaPersistenza",
> "it.**.mistral.importGEA4.task",
> "migrazioneGeaPersistenzaAccess"
> ).
> addClasses(java.sql.Connection.class)
> .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> Then when I launch the test, there are some missing dependencies
> Unable to resolve any beans for Types: [class it.**.**.be.service.EnvironmentRootService]
> present in this dependency
> <dependency>
> <groupId>it.**.mistral</groupId>
> <artifactId>mistral-be</artifactId>
> <version>0.1.0</version>
> <scope>compile</scope>
> </dependency>
> I have tried lots of different things to add these dependencies, the best one seems to be using the ShrinkWrap Resolvers (https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc, particullarry this paragraph https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolu...)
> a)
> JavaArchive[] archives = Maven.resolver().loadPomFromFile(path_to_pom_file). importDependencies(ScopeType.TEST,ScopeType.COMPILE). resolve().withTransitivity().as(JavaArchive.class);
> or
> Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies() .resolve().withTransitivity().asFile();
> The dependency is ignored in either way (i'm missing something?)
> b)
> JavaArchive[] mistral_be = Maven.configureResolver().workOffline(). resolve("it.**.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < mistral_be.length ; i++) {
> merge = merge.merge(mistral_be[i]);
> }
> With a simple
> System.out.println(merge.toString(true));
> I can see that all files from dependencies are present! Anyway I use local repository workoffline() Maybe I am missing some dependencies?
> But exiting the method with a
> return merge;
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage....Caused by: java.lang.ClassNotFoundException: com.google.protobuf.GeneratedMessage" error.
> Adding another dependencies to protobuf :
> // Trym'g to add protobuf dependencies
> JavaArchive[] prtoo_buf = Maven.configureResolver().withMavenCentralRepo(true).resolve("com.google.protobuf:protobuf-java:2.3.0").withTransitivity().as(JavaArchive.class);
> for (int i = 0; i < prto_buf.length ; i++) {
> projectPackages = projectPackages.merge(proto_buf[i]);
> }
> Keep ending with the same error
> throws a "java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessage
> These are an extract of dependencies in pom.xml:
> <dependency>
> <groupId>org.jboss.spec</groupId>
> <artifactId>jboss-javaee-6.0</artifactId>
> <version>1.0.0.Final</version>
> <type>pom</type>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.container</groupId>
> <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
> <version>1.0.0.CR3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-depchain</artifactId>
> <version>2.1.0</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.5.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> </dependencyManagement>
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
11 years, 5 months