You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2008/07/25 19:30:14 UTC

DO NOT REPLY [Bug 45485] New: Agent.java is sole dependency on jmxtools. jar with Java 5+

https://issues.apache.org/bugzilla/show_bug.cgi?id=45485

           Summary: Agent.java is sole dependency on jmxtools.jar with Java
                    5+
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: thorbjoern@gmail.com


Created an attachment (id=22319)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22319)
Agent.java rewritten with reflection

As part of an effort to remove the need to download components manually
(outside Maven) I have found that when compiling with Java 5+ it is only
Agent.java which need the jmxtools.jar in the compilation class path.

The attached patch is a rewrite of Agent.java using reflection so it can
compile without the presence of jmxtools.jar.  I would appreciate help in
getting a test environment running.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45485] Agent.java is sole dependency on jmxtools.jar with Java 5+

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45485





--- Comment #3 from Paul Smith <ps...@apache.org>  2008-07-31 15:32:33 PST ---
While I like the idea of removing the compile time dependency to those evil Sun
jars, I'm not so sure swallowing an exception is such a good idea, from a
stylistic point I think wrapping that exception and throwing an
IllegalStateException would be better.

Lets face it, if the Exception does happen, the use probably wants to know
about it (yes there's logging, but is continuing in the face of error a good
idea here?)

Still, that removal of the Sun jar dependency is tempting! :)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45485] Agent.java is sole dependency on jmxtools.jar with Java 5+

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45485


Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #22319|0                           |1
        is obsolete|                            |
  Attachment #22340|0                           |1
        is obsolete|                            |




--- Comment #5 from Curt Arnold <ca...@apache.org>  2008-08-05 12:15:22 PST ---
Created an attachment (id=22389)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22389)
Alternative patch that preserves existing log4j behavior

This patch changes the checked exceptions raised by reflection into the
equivalent error that would occur with the previous code in the same scenario.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45485] Agent.java is sole dependency on jmxtools.jar with Java 5+

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45485


Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #6 from Curt Arnold <ca...@apache.org>  2008-08-12 08:45:37 PST ---
Committed last patch in rev 682879, modified to throw RuntimeException instead
of Errors in rev 682998 and 683009 per discussion on log4j-dev.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45485] Agent.java is sole dependency on jmxtools.jar with Java 5+

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45485





--- Comment #4 from Thorbjørn Ravn Andersen <th...@gmail.com>  2008-07-31 15:43:33 PST ---
(In reply to comment #3)
> While I like the idea of removing the compile time dependency to those evil Sun
> jars, I'm not so sure swallowing an exception is such a good idea, from a
> stylistic point I think wrapping that exception and throwing an
> IllegalStateException would be better.
> 
> Lets face it, if the Exception does happen, the use probably wants to know
> about it (yes there's logging, but is continuing in the face of error a good
> idea here?)
> 
> Still, that removal of the Sun jar dependency is tempting! :)

Yes.

>From what I understand the try-catch-log.error-return approach is the way it is
done elsewhere.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45485] Agent.java is sole dependency on jmxtools.jar with Java 5+

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45485





--- Comment #2 from Thorbjørn Ravn Andersen <th...@gmail.com>  2008-07-31 09:14:59 PST ---
Additionally these dependencies can be removed from pom.xml

   <dependency>
      <groupId>com.sun.jdmk</groupId>
      <artifactId>jmxtools</artifactId>
      <version>1.2.1</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.sun.jmx</groupId>
      <artifactId>jmxri</artifactId>
      <version>1.2.1</version>
      <optional>true</optional>
    </dependency>


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45485] Agent.java is sole dependency on jmxtools.jar with Java 5+

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45485





--- Comment #1 from Thorbjørn Ravn Andersen <th...@gmail.com>  2008-07-31 09:13:45 PST ---
Created an attachment (id=22340)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22340)
Whole file (if patch is bad)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org