gradle + tomcat = error

55 views
Skip to first unread message

Fabio Ebner

unread,
Mar 17, 2015, 8:02:17 AM3/17/15
to Vraptor
PEssoal

estou tentando novamente utilizar o tomcat + gradle para rodar o vraptor, porem quando vou inicializar ele da o seguinte erro:

log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
Exception starting filter vraptor
java.lang.ClassCastException: br.com.caelum.vraptor.VRaptor cannot be cast to javax.servlet.Filter
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5542)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Error filterStart

alguem ja descobriu o pq?

vlw

Lucas Cavalcanti

unread,
Mar 17, 2015, 7:28:43 PM3/17/15
to caelum-vraptor
VRaptor é uma instancia de Filter, esse erro pode estar acontecendo por causa de classloaders diferentes...

vc declarou a api de servlet como dependencia da sua aplicacao no gradle?

[]'s
Lucas Cavalcanti
@lucascs

--
You received this message because you are subscribed to the Google Groups "caelum-vraptor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caelum-vrapto...@googlegroups.com.
To post to this group, send email to caelum-...@googlegroups.com.
Visit this group at http://groups.google.com/group/caelum-vraptor.
For more options, visit https://groups.google.com/d/optout.

Fabio Ebner

unread,
Mar 17, 2015, 7:33:25 PM3/17/15
to caelum-vraptor
Lucas estou utilizando esse plugin do gradle aqui : https://github.com/bmuschko/gradle-tomcat-plugin

e ja tentei colocar assim:
dependencies {
    def tomcatVersion = '7.0.59'
    tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
           "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
           "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}"
}
e tambem assim:
dependencies {
    def tomcatVersion = '7.0.59'
    tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
           "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
           "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}",
  "javax.inject:javax.inject:1"
  "org.jboss.weld.servlet:weld-servlet:2.1.2.Final" 
}
e tambe ja tentei adicionar
"javax.servlet:jstl:1.2"
"javax.servlet:javax.servlet-api:3.1.0"

porem sem sucesso

Fabio Ebner

unread,
Mar 17, 2015, 7:43:36 PM3/17/15
to caelum-vraptor
pode ser versao do Javax.servlet.Filter?

To unsubscribe from this group and stop receiving emails from it, send an email to caelum-vraptor+unsubscribe@googlegroups.com.
To post to this group, send email to caelum-vraptor@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "caelum-vraptor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caelum-vraptor+unsubscribe@googlegroups.com.
To post to this group, send email to caelum-vraptor@googlegroups.com.

Fabio Ebner

unread,
Mar 17, 2015, 7:45:35 PM3/17/15
to caelum-vraptor
mas se tivesse problemas na dependencia quando eu rodasse tomcatRunWar ele tbm nao deveria dar o mesmo erro?? pq nesse caso nao da. funciona normalmente

Fabio Ebner

unread,
Mar 17, 2015, 9:11:55 PM3/17/15
to caelum-vraptor
Lucas estou tentando rodar meu projeto  em um jetty  e estou recebendo o seguinte erro:
/Users/fabioebner/AppData/Local/Temp/jetty-0.0.0.0-8080-seloeletronicoback.war-_seloeletronicoback-any-863849915375314371.dir/webapp/,STARTING}{C:\java\jetty-distribution-9.2.10.v20150310\webapps\seloeletronicoback.war}
javax.servlet.ServletException: Dependencies were not set. Do you have a Weld/CDI listener setup in your web.xml?
        at br.com.caelum.vraptor.VRaptor.validateIfCdiIsFound(VRaptor.java:177)
        at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:91)
        at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:138)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:852)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)

porem no meu web.xml esta assim:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
 <context-param>
  <param-name>br.com.caelum.vraptor.environment</param-name>
  <param-value>production</param-value>
  <!-- 
  <param-value>development</param-value>
  -->
 </context-param>
 
 <context-param>
<param-name>br.com.caelum.vraptor.encoding</param-name>
    <param-value>UTF-8</param-value>
</context-param>

 <context-param>
  <param-name>javax.servlet.jsp.jstl.fmt.locale</param-name>
  <param-value>pt_BR</param-value>
 </context-param>
 
 <context-param>
  <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
  <param-value>messages</param-value>
 </context-param>
 
 <listener>
  <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
 </listener>
 </web-app>

Fabio Ebner

unread,
Mar 17, 2015, 9:13:34 PM3/17/15
to caelum-vraptor
estou usando o jetty 9

Nykolas de Lima

unread,
Jan 11, 2016, 3:59:50 AM1/11/16
to caelum-vraptor
Alguém conseguiu uma solução para esse problema?

Estou tendo ele em um dos meus projetos. O estranho é que ele possui as mesmas versões de dependencias de outro projeto, e esse outro projeto funciona.

Estou tentando procurar o que pode ter de diferente, mas até agora não encontrei nada.

[]s
Reply all
Reply to author
Forward
0 new messages