0 Replies Latest reply on Jul 20, 2012 11:40 AM by luyanfei78

    Cann't trace weld-servlet?

    Newbie

      I want to see trace level logs about weld. Since Weld use slf4j, I have tested in log4j and logback, both show exception below:

      2012-7-20 22:53:51 org.apache.catalina.core.StandardContext listenerStart
      严重: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
      java.lang.NullPointerException
          at org.jboss.weld.interceptor.InterceptorBindingType.unwrap(InterceptorBindingType.java:30)
          at org.jboss.weld.bean.InterceptorImpl.getInterceptorBindings(InterceptorImpl.java:80)
          at org.jboss.weld.bean.InterceptorImpl.toString(InterceptorImpl.java:120)
          at java.text.MessageFormat.subformat(MessageFormat.java:1246)
          at java.text.MessageFormat.format(MessageFormat.java:836)
          at java.text.Format.format(Format.java:140)
          at java.text.MessageFormat.format(MessageFormat.java:812)
          at ch.qos.cal10n.MessageConveyor.getMessage(MessageConveyor.java:89)
          at org.jboss.weld.logging.WeldMessageConveyor.getMessage(WeldMessageConveyor.java:66)
          at org.slf4j.cal10n.LocLogger.trace(LocLogger.java:75)
          at org.jboss.weld.bean.AbstractBean.initDefaultQualifiers(AbstractBean.java:215)
          at org.jboss.weld.bean.AbstractBean.initQualifiers(AbstractBean.java:209)
          at org.jboss.weld.bean.ManagedBean.<init>(ManagedBean.java:281)
          at org.jboss.weld.bean.InterceptorImpl.<init>(InterceptorImpl.java:63)
          at org.jboss.weld.bean.InterceptorImpl.of(InterceptorImpl.java:59)
          at org.jboss.weld.bootstrap.AbstractBeanDeployer.createInterceptor(AbstractBeanDeployer.java:228)
          at org.jboss.weld.bootstrap.BeanDeployer.createBeans(BeanDeployer.java:137)
          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:204)
          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:350)
          at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4790)
          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5284)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1595)
          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1585)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:662)
      2012-7-20 22:53:51 org.apache.catalina.core.StandardContext startInternal
      严重: Error listenerStart
      
      

      I found this problem have something to do with cal10n-api. If use cal10n-api 0.7.2, the exception is what you have seen. If use cal10n-api 0.7.4, log shows other exception:

       

      严重: Exception sending context destroyed event to listener instance of class org.jboss.weld.environment.servlet.Listener
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
          at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:881)
          at java.lang.StringBuilder.substring(StringBuilder.java:55)
          at java.lang.AbstractStringBuilder.subSequence(AbstractStringBuilder.java:858)
          at java.lang.StringBuilder.subSequence(StringBuilder.java:55)
          at ch.qos.cal10n.util.LexicalUtil.convertSpecialCharacters(LexicalUtil.java:42)
          at ch.qos.cal10n.util.TokenStream.tokenizeLine(TokenStream.java:146)
          at ch.qos.cal10n.util.TokenStream.tokenize(TokenStream.java:67)
          at ch.qos.cal10n.util.Parser.<init>(Parser.java:56)
          at ch.qos.cal10n.util.CAL10NResourceBundle.read(CAL10NResourceBundle.java:56)
          at ch.qos.cal10n.util.CAL10NResourceBundle.<init>(CAL10NResourceBundle.java:50)
          at ch.qos.cal10n.util.CAL10NResourceBundleFinder.makePropertyResourceBundle(CAL10NResourceBundleFinder.java:83)
          at ch.qos.cal10n.util.CAL10NResourceBundleFinder.getBundle(CAL10NResourceBundleFinder.java:51)
          at ch.qos.cal10n.MessageConveyor.lookup(MessageConveyor.java:111)
          at ch.qos.cal10n.MessageConveyor.getMessage(MessageConveyor.java:77)
          at org.jboss.weld.logging.WeldMessageConveyor.getMessage(WeldMessageConveyor.java:66)
          at org.slf4j.cal10n.LocLogger.trace(LocLogger.java:75)
          at org.jboss.weld.context.AbstractContext.destroy(AbstractContext.java:141)
          at org.jboss.weld.context.AbstractSharedContext.destroy(AbstractSharedContext.java:64)
          at org.jboss.weld.context.AbstractSharedContext.invalidate(AbstractSharedContext.java:59)
          at org.jboss.weld.bootstrap.WeldBootstrap.shutdown(WeldBootstrap.java:464)
          at org.jboss.weld.environment.servlet.Listener.contextDestroyed(Listener.java:83)
          at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4830)
          at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5477)
          at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1595)
          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1585)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:662)
      

       

       

      What happened? How can I see trace log?