7 Replies Latest reply: Sep 21, 2011 7:14 AM by Sebastian Sachtleben RSS

Seam 3.1.0.Beta2

Hubert Schumacher Newbie

I'm new to Seam 3 (on JBOSS AS6.1) and don't manage to get jboss logging working.
What I want to do is just simple logging as it was possible in Seam2.2. No additional features are required.
According to the seam-solder documentation http://docs.jboss.org/seam/3/solder/latest/reference/en-US/html/logging.html, this should be easy and straight forward.


@Inject Logger log;


and then


log.info(test);



Doesn't work for me as I'm getting an NullPointerException. Am I missing something? Is there some documentation related to seam 3.1.0Beta2?


Hubert


  • 1. Re: Seam 3.1.0.Beta2
    Shane Bryzak Master

    Can you post the stack trace for the NPE?


    In general, don't use 3.1.0.Beta2 - it is an internal only release and a fair bit of stuff is still currently broken.  We'll be releasing a Beta3 in the next couple of weeks which will be much more stable.

  • 2. Re: Seam 3.1.0.Beta2
    Hubert Schumacher Newbie
    Thank you for your reply and the information about the status of 3.1.0.Beta2. The thrown Exception is the following:

    8:28:56,554 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/owl].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: javax.el.ELException: /views/viewImage.xhtml @23,20 createContent="#{image.drawHighResImage}": java.lang.NullPointerException
            at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111) [:2.1.2-FCS]
            at org.richfaces.resource.MediaOutputResource.encode(MediaOutputResource.java:62) [:4.1.0.20110805-M1]
            at org.richfaces.resource.UserResourceWrapperImpl.encode(UserResourceWrapperImpl.java:188) [:4.1.0.20110805-M1]
            at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:222) [:4.1.0.20110805-M1]
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:591) [:2.1.2-FCS]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:]
            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:2011-04-04 15:54]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:]
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:]
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:]
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0-SNAPSHOT]
            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0-SNAPSHOT]
            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0-SNAPSHOT]
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:]
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:]
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0-SNAPSHOT]
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:]
            at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0-SNAPSHOT]
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:]
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:]
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:]
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:]
            at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
    Caused by: java.lang.NullPointerException
            at net.hrrbrt.io.ImageHelper.rotateJpegImage(ImageHelper.java:41) [:]
            at net.hrrbrt.io.ImageHelper.rotateJpegImageClockwise(ImageHelper.java:29) [:]
            at net.hrrbrt.mammoth.entity.DocumentBinaryData.getRotatedData(DocumentBinaryData.java:84) [:]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
            at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
            at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197) [:3.6.5.Final]
            at net.hrrbrt.mammoth.entity.DocumentBinaryData_$$_javassist_40.getRotatedData(DocumentBinaryData_$$_javassist_40.java) [:]
            at net.hrrbrt.owl.media.Image.draw(Image.java:54) [:]
            at net.hrrbrt.owl.media.Image.drawHighResImage(Image.java:39) [:]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
            at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
            at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [:]
            at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [:]
            at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [:2011-04-04 15:54]
            at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [:2011-04-04 15:54]
            at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [:2011-04-04 15:54]
            at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [:2011-04-04 15:54]
            at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [:2.1.2-FCS]
            ... 26 more
  • 3. Re: Seam 3.1.0.Beta2
    Shane Bryzak Master

    This exception has nothing to do with logging...

  • 4. Re: Seam 3.1.0.Beta2
    Hubert Schumacher Newbie

    Thank you!
    You might be right, but out-commenting the logging statement in my code makes the Exception disappear an the code execute correctly?! For the time being I have switched back to SLF4J. thanks again!

  • 5. Re: Seam 3.1.0.Beta2
    Shane Bryzak Master

    What does your logging code look like?  I'm assuming that the injection of the Logger is working correctly as you're not getting a Weld exception.

  • 6. Re: Seam 3.1.0.Beta2
    John Ament Master

    Are you trying to inject a logger into your entity?  entities aren't managed by CDI, so they are not injectable targets.

  • 7. Re: Seam 3.1.0.Beta2
    Sebastian Sachtleben Novice

    Try this:


    private final Logger log = Logger.getLogger(MyClass.class);