Erro no plugin vraptor-jaspereports

60 views
Skip to first unread message

Rafael Delanhese

unread,
Apr 23, 2018, 12:08:01 PM4/23/18
to caelum-vraptor
Fala galera, tudo certo?

Então estou com o seguinte problema ao fazer o build no meu projeto, quando eu coloco a dependência do plugin vraptor-jasperepots no pom e ao tentar fazer o build do projeto, apresenta um que falta a classe org.apache.commons.lang.StringUltils.
O erro acontece mesmo colocando a dependência da biblioteca no pom, alguém sabe como resolver isso?  

Rodrigo Turini

unread,
Apr 24, 2018, 6:57:36 AM4/24/18
to caelum-...@googlegroups.com
oi Rafael

normalmente, quando fala que alguma classe está faltando é por alguma dessas situações:

- você realmente não tem a classe
- você tem versões diferentes, que conflitam

No seu caso, já que mesmo adicionando não funcionou, talvez seja a segunda. Pra descobrir você pode rodar um mvn dependency:tree e ver quem está trazendo ele e quais versões.

Se quiser mande a saída por aqui que ajudamos a interpretar

abracos
--
Você recebeu essa mensagem porque está inscrito no grupo "caelum-vraptor" dos Grupos do Google.
Para cancelar inscrição nesse grupo e parar de receber e-mails dele, envie um e-mail para caelum-vrapto...@googlegroups.com.
Para postar nesse grupo, envie um e-mail para caelum-...@googlegroups.com.
Acesse esse grupo em https://groups.google.com/group/caelum-vraptor.
Para mais opções, acesse https://groups.google.com/d/optout.

Rafael Delanhese

unread,
Apr 24, 2018, 6:38:35 PM4/24/18
to caelum-vraptor
Rodrigo, não consegui executar  o "mvn dependency:tree" porque não sei como fazer isso, até pesquisei sobre mas obtive sucesso. Se puder me indicar como fazer isso no Netbeans eu agradeceria.

Mas vou postar alguns testes que eu fiz:

Adicionei a dependência da seguinte maneira no pom:

<dependency>
<groupId>br.com.prixma</groupId>
  <artifactId>vraptor-jasperreport</artifactId>
  <version>4.1.1</version>
  <exclusions>
             <exclusion>  
               <groupId>net.sf.jasperreports</groupId>
               <artifactId>jasperreports</artifactId>
             </exclusion>
          </exclusions> 
</dependency>

Dessa forma eu consigo fazer  build do projeto, porém não roda no tomcat porque falta as dependências do jasper. Tentei adicionar o Jasper em separado porém o erro voltou. 

Rafael Delanhese

unread,
Apr 24, 2018, 9:50:56 PM4/24/18
to caelum-vraptor
Rodrigo, depois de algumas tentativas, acho que consegui, seria um resultado tipo esse:

[INFO] br.com.caelum:vraptor-blank-project:war:4.2.1-SNAPSHOT
[INFO] +- br.com.caelum:vraptor:jar:4.2.0.Final:compile
[INFO] |  +- com.google.guava:guava:jar:15.0:compile
[INFO] |  +- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] |  +- net.vidageek:mirror:jar:1.6.1:compile
[INFO] |  +- com.thoughtworks.paranamer:paranamer:jar:2.7:compile
[INFO] |  +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
[INFO] |  |  +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] |  |  \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.2.4:compile
[INFO] |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] |  +- javax.interceptor:javax.interceptor-api:jar:1.2:compile
[INFO] |  +- javax.ejb:javax.ejb-api:jar:3.2:compile
[INFO] |  |  \- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] |  \- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] +- br.com.caelum:iogi:jar:1.0.0:compile
[INFO] +- org.jboss.weld.servlet:weld-servlet-core:jar:2.1.2.Final:compile
[INFO] |  +- org.jboss.weld:weld-spi:jar:2.1.Final:compile
[INFO] |  |  \- javax.inject:javax.inject:jar:1:compile
[INFO] |  +- org.jboss.spec.javax.el:jboss-el-api_3.0_spec:jar:1.0.0.Alpha1:compile
[INFO] |  \- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] +- org.jboss.weld:weld-core-impl:jar:2.1.2.Final:compile
[INFO] |  +- javax.enterprise:cdi-api:jar:1.1:compile
[INFO] |  +- org.jboss.weld:weld-api:jar:2.1.Final:compile
[INFO] |  +- org.jboss.classfilewriter:jboss-classfilewriter:jar:1.0.4.Final:compile
[INFO] |  +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:jar:1.0.0.Alpha1:compile
[INFO] |  \- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec:jar:1.0.0.Alpha3:compile
[INFO] +- javax.el:el-api:jar:2.2:provided
[INFO] +- org.hibernate:hibernate-validator-cdi:jar:5.1.1.Final:compile
[INFO] |  \- org.hibernate:hibernate-validator:jar:5.1.1.Final:compile
[INFO] |     \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.5:compile
[INFO] |  \- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] +- br.com.caelum.vraptor:vraptor-jpa:jar:4.0.5:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.3.1.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:4.3.1.Final:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.4.Final:compile
[INFO] |  \- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] +- mysql:mysql-connector-java:jar:6.0.6:compile
[INFO] +- org.eclipse.persistence:eclipselink:jar:2.5.2:compile
[INFO] |  +- org.eclipse.persistence:javax.persistence:jar:2.1.0:compile
[INFO] |  \- org.eclipse.persistence:commonj.sdo:jar:2.1.1:compile
[INFO] +- org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen.processor:jar:2.5.2:provided
[INFO] |  +- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.5.2:provided
[INFO] |  |  \- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.5.2:provided
[INFO] |  \- org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.5.2:provided
[INFO] |     +- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.5.2:provided
[INFO] |     \- org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:jar:2.5.2:provided
[INFO] +- org.sitemesh:sitemesh:jar:3.0.1:compile
[INFO] +- jaxen:jaxen:jar:full:compile
[INFO] +- joda-time:joda-time:jar:2.9.9:compile
[INFO] +- joda-time:joda-time-hibernate:jar:1.3:compile
[INFO] +- org.jadira.usertype:usertype.core:jar:3.1.0.CR1:compile
[INFO] |  \- org.jadira.usertype:usertype.spi:jar:3.1.0.CR1:compile
[INFO] +- br.com.caelum.vraptor:vraptor-jodatime:jar:4.1.0-RC3:compile
[INFO] +- br.com.caelum.vraptor:vraptor-brutauth:jar:4.0.4:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.3.3:compile
[INFO] +- commons-io:commons-io:jar:2.6:compile
[INFO] +- br.com.caelum.vraptor:vraptor-i18n:jar:4.0.1:compile
[INFO] |  \- org.jboss.weld.servlet:weld-servlet:jar:2.1.2.Final:compile
[INFO] +- br.com.caelum.vraptor:vraptor-simplemail:jar:4.1.0-RC4:compile
[INFO] |  +- com.amazonaws:aws-java-sdk:jar:1.2.10:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.2:compile (version selected from constraint [1.1,2.0))
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.5.5:compile (version selected from constraint [4.1,5.0))
[INFO] |  |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.9:compile
[INFO] |  |  +- commons-codec:commons-codec:jar:1.3:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile (version selected from constraint [1.4,))
[INFO] |  |  \- stax:stax-api:jar:1.0.1:compile
[INFO] |  \- br.com.caelum.vraptor:vraptor-freemarker:jar:4.1.0-RC3:compile
[INFO] |     \- org.freemarker:freemarker:jar:2.3.16:compile
[INFO] +- br.com.caelum.vraptor:vraptor-environment:jar:1.1.1:compile
[INFO] +- org.apache.commons:commons-email:jar:1.2:compile
[INFO] |  +- javax.mail:mail:jar:1.4.1:compile
[INFO] |  \- javax.activation:activation:jar:1.1:compile
[INFO] \- br.com.prixma:vraptor-jasperreport:jar:4.1.1:compile
[INFO]    +- net.sf.jasperreports:jasperreports:jar:5.5.2:compile
[INFO]    |  +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO]    |  +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO]    |  +- commons-digester:commons-digester:jar:2.1:compile
[INFO]    |  +- com.lowagie:itext:jar:2.1.7.js2:compile
[INFO]    |  |  +- bouncycastle:bcmail-jdk14:jar:138:compile
[INFO]    |  |  +- bouncycastle:bcprov-jdk14:jar:138:compile
[INFO]    |  |  \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile
[INFO]    |  |     +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile
[INFO]    |  |     \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile
[INFO]    |  +- jfree:jcommon:jar:1.0.15:compile
[INFO]    |  +- jfree:jfreechart:jar:1.0.12:compile
[INFO]    |  +- eclipse:jdtcore:jar:3.1.0:compile
[INFO]    |  +- org.codehaus.castor:castor:jar:1.2:compile
[INFO]    |  +- com.fasterxml.jackson.core:jackson-core:jar:2.1.4:compile
[INFO]    |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.1.4:compile
[INFO]    |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.4:compile
[INFO]    |  +- org.apache.lucene:lucene-core:jar:4.5.1:compile
[INFO]    |  +- org.apache.lucene:lucene-analyzers-common:jar:4.5.1:compile
[INFO]    |  +- org.apache.lucene:lucene-queryparser:jar:4.5.1:compile
[INFO]    |  |  +- org.apache.lucene:lucene-queries:jar:4.5.1:compile
[INFO]    |  |  \- org.apache.lucene:lucene-sandbox:jar:4.5.1:compile
[INFO]    |  |     \- jakarta-regexp:jakarta-regexp:jar:1.4:compile
[INFO]    |  \- org.olap4j:olap4j:jar:0.9.7.309-JS-3:compile
[INFO]    \- org.hamcrest:hamcrest-all:jar:1.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.475 s
[INFO] Finished at: 2018-04-24T22:48:11-03:00
[INFO] ------------------------------------------------------------------------


Em terça-feira, 24 de abril de 2018 07:57:36 UTC-3, Rodrigo Turini escreveu:

Rodrigo Turini

unread,
Apr 26, 2018, 9:22:56 AM4/26/18
to caelum-...@googlegroups.com
jasperreport é a unica dependencia que causa esse conflito? se for, teria que ir dando exclude nas dependencias dele que usam o commons, pra chegar na que está conflitando. 

Rafael Delanhese

unread,
Apr 26, 2018, 3:43:16 PM4/26/18
to caelum-vraptor
Sim, quando eu excluo a dependência do jasper do plugin ele faz o build. Fiz alguns testes que falou mas o problema persiste.
De qualquer modo vou colocar aqui o log do erro que dá, as vezes você enxerga algo.

--- maven-assembly-plugin:2.3:assembly (distribution-eclipse) @ vraptor-blank-project ---
Reading assembly descriptor: assembly-eclipse.xml
Downloading: file:C:\Users\Rafael Delanhese\Documents\Geoambiental\CORRETO\vraptor-blank-project/lib/com/lowagie/itext/2.1.7.js5/itext-2.1.7.js5.pom
Exception in thread "pool-1-thread-1" java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at org.apache.maven.wagon.providers.file.FileWagon.resolveDestinationPath(FileWagon.java:206)
at org.apache.maven.wagon.providers.file.FileWagon.resourceExists(FileWagon.java:265)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:577)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 7 more
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 11:00.741s
Finished at: Thu Apr 26 16:40:12 BRT 2018
Final Memory: 71M/400M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.3:assembly (distribution-eclipse) on project vraptor-blank-project: Execution distribution-eclipse of goal org.apache.maven.plugins:maven-assembly-plugin:2.3:assembly failed: A required class was missing while executing org.apache.maven.plugins:maven-assembly-plugin:2.3:assembly: org/apache/commons/lang/StringUtils
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-assembly-plugin:2.3
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/plugins/maven-assembly-plugin/2.3/maven-assembly-plugin-2.3.jar
urls[1] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
urls[2] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar
urls[3] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
urls[4] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
urls[5] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
urls[6] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
urls[7] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
urls[8] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
urls[9] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
urls[10] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[11] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[12] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
urls[13] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
urls[14] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar
urls[15] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/shared/file-management/1.1/file-management-1.1.jar
urls[16] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar
urls[17] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.jar
urls[18] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
urls[19] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar
urls[20] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
urls[21] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[22] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
urls[23] = file:/C:/Users/Rafael%20Delanhese/.m2/repository/org/apache/maven/shared/maven-repository-builder/1.0-alpha-2/maven-repository-builder-1.0-alpha-2.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------: org.apache.commons.lang.StringUtils
-> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:

Rafael Delanhese

unread,
May 2, 2018, 2:56:31 PM5/2/18
to caelum-vraptor
Problema solucionado removendo este plugin:

 <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <id>distribution</id>
                        <phase>package</phase>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <goals>
                            <goal>assembly</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>distribution-eclipse</id>
                        <phase>package</phase>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly-eclipse.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <goals>
                            <goal>assembly</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Por hora resolveu o problema com a dependência. 
Reply all
Reply to author
Forward
0 new messages