You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "Jeremiah Johnson (JIRA)" <de...@beehive.apache.org> on 2005/09/14 19:30:55 UTC

[jira] Created: (BEEHIVE-928) additional logging requested for interceptor instantiation

additional logging requested for interceptor instantiation
----------------------------------------------------------

         Key: BEEHIVE-928
         URL: http://issues.apache.org/jira/browse/BEEHIVE-928
     Project: Beehive
        Type: Improvement
  Components: Controls  
    Versions: V1    
 Environment: Beehive dist built from SVN r280592
    Reporter: Jeremiah Johnson
    Priority: Minor
     Fix For: TBD


After going through the Wiki page about interceptors (http://wiki.apache.org/beehive/Controls/AnnotationBasedFeatures) I created an interceptor but wasn't getting the results I expected.  When the interceptor is instantiated, a failure to find the interceptor class is currently silently ignored; please consider logging the failure.

Proposed patch (note that I don't really like using SEP - just don't see any other logging used in the Controls Runtime):
--- trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java
@@ -932,6 +933,10 @@
             try
             {
                 i  = (Interceptor) getControlService( getControlBeanContext().getClassLoader().loadClass( n ), null );
+                if( i == null ) {
+                    System.err.println( "interceptor (" + n +
+                        ") not found in current classpath" );
+                }
             }
             catch ( Exception e )
             {
@@ -939,7 +944,7 @@
                 // isn't present on this system at runtime (ClassNotFoundException), or if the container of the
                 // control didn't registers the service.

-                // TODO log a message here to that effect, but just swallow the exception for now.
+                System.err.println( "failed to instantiate interceptor: " + e );
             }
             finally
             {
---

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (BEEHIVE-928) additional logging requested for interceptor instantiation

Posted by "Jeremiah Johnson (JIRA)" <de...@beehive.apache.org>.
    [ http://issues.apache.org/jira/browse/BEEHIVE-928?page=comments#action_12329352 ] 

Jeremiah Johnson commented on BEEHIVE-928:
------------------------------------------

Heh - sorry - didn't read the code very closely...  that first logging message was inaccurate.  I'll suggest a different patch when I fix my own code.  It is the context's Service that isn't getting loaded, not the interceptor class.

> additional logging requested for interceptor instantiation
> ----------------------------------------------------------
>
>          Key: BEEHIVE-928
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-928
>      Project: Beehive
>         Type: Improvement
>   Components: Controls
>     Versions: V1
>  Environment: Beehive dist built from SVN r280592
>     Reporter: Jeremiah Johnson
>     Priority: Minor
>      Fix For: TBD

>
> After going through the Wiki page about interceptors (http://wiki.apache.org/beehive/Controls/AnnotationBasedFeatures) I created an interceptor but wasn't getting the results I expected.  When the interceptor is instantiated, a failure to find the interceptor class is currently silently ignored; please consider logging the failure.
> Proposed patch (note that I don't really like using SEP - just don't see any other logging used in the Controls Runtime):
> --- trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java
> @@ -932,6 +933,10 @@
>              try
>              {
>                  i  = (Interceptor) getControlService( getControlBeanContext().getClassLoader().loadClass( n ), null );
> +                if( i == null ) {
> +                    System.err.println( "interceptor (" + n +
> +                        ") not found in current classpath" );
> +                }
>              }
>              catch ( Exception e )
>              {
> @@ -939,7 +944,7 @@
>                  // isn't present on this system at runtime (ClassNotFoundException), or if the container of the
>                  // control didn't registers the service.
> -                // TODO log a message here to that effect, but just swallow the exception for now.
> +                System.err.println( "failed to instantiate interceptor: " + e );
>              }
>              finally
>              {
> ---

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira