You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Thomas Diesler (JIRA)" <ji...@apache.org> on 2010/02/17 23:47:27 UTC
[jira] Created: (ARIES-179) FrameworkMBean does not log/relay error
info
FrameworkMBean does not log/relay error info
--------------------------------------------
Key: ARIES-179
URL: https://issues.apache.org/jira/browse/ARIES-179
Project: Aries
Issue Type: Bug
Components: JMX
Reporter: Thomas Diesler
Various operations on the Framework don't log nor relay what went wrong in case of error.
The typical pattern is
public long installBundle(String location) throws IOException {
try {
Bundle bundle = context.installBundle(location);
return bundle.getBundleId();
} catch (BundleException be) {
throw new IOException("Can't install bundle with location: " + location);
}
}
Instead, I suggest an approach like this
public long installBundle(String location) throws IOException {
try {
Bundle bundle = context.installBundle(location);
return bundle.getBundleId();
} catch (BundleException be) {
IOException ioex = new IOException("Can't install bundle with location: " + location);
ioex.initCause(be);
throw ioex;
}
}
Alternatively, this would also work
public long installBundle(String location) throws IOException {
try {
Bundle bundle = context.installBundle(location);
return bundle.getBundleId();
} catch (BundleException be) {
log.error("Can't install bundle with location: " + location, be)
throw new IOException("Can't install bundle with location: " + location);
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ARIES-179) FrameworkMBean does not log/relay error
info
Posted by "Thomas Diesler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ARIES-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Diesler updated ARIES-179:
---------------------------------
Attachment: Framework.diff
diff attached
> FrameworkMBean does not log/relay error info
> --------------------------------------------
>
> Key: ARIES-179
> URL: https://issues.apache.org/jira/browse/ARIES-179
> Project: Aries
> Issue Type: Bug
> Components: JMX
> Reporter: Thomas Diesler
> Attachments: Framework.diff
>
>
> Various operations on the Framework don't log nor relay what went wrong in case of error.
> The typical pattern is
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
> Instead, I suggest an approach like this
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> IOException ioex = new IOException("Can't install bundle with location: " + location);
> ioex.initCause(be);
> throw ioex;
> }
> }
> Alternatively, this would also work
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> log.error("Can't install bundle with location: " + location, be)
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (ARIES-179) FrameworkMBean does not log/relay
error info
Posted by "Adam Wojtuniak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ARIES-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Wojtuniak resolved ARIES-179.
----------------------------------
Resolution: Fixed
Assignee: Adam Wojtuniak
I've changed the loging in Framework and UserAdmin to this format:
IOException ioex = new IOException("Can't install bundle with location: " + location);
ioex.initCause(be);
This is compatible with java 1.5 instead of new IOException(String message, Throwable cause)
introduced in 1.6.
Adam
> FrameworkMBean does not log/relay error info
> --------------------------------------------
>
> Key: ARIES-179
> URL: https://issues.apache.org/jira/browse/ARIES-179
> Project: Aries
> Issue Type: Bug
> Components: JMX
> Reporter: Thomas Diesler
> Assignee: Adam Wojtuniak
> Attachments: Framework.diff
>
>
> Various operations on the Framework don't log nor relay what went wrong in case of error.
> The typical pattern is
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
> Instead, I suggest an approach like this
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> IOException ioex = new IOException("Can't install bundle with location: " + location);
> ioex.initCause(be);
> throw ioex;
> }
> }
> Alternatively, this would also work
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> log.error("Can't install bundle with location: " + location, be)
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ARIES-179) FrameworkMBean does not log/relay
error info
Posted by "Adam Wojtuniak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ARIES-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835066#action_12835066 ]
Adam Wojtuniak commented on ARIES-179:
--------------------------------------
Hi Thomas
This issue is already fixed by ARIES-160 Set the initCause of exceptions in Framework.java and UserAdmin.java.
Thanks for diff file.
Regards,
Adam
> FrameworkMBean does not log/relay error info
> --------------------------------------------
>
> Key: ARIES-179
> URL: https://issues.apache.org/jira/browse/ARIES-179
> Project: Aries
> Issue Type: Bug
> Components: JMX
> Reporter: Thomas Diesler
> Attachments: Framework.diff
>
>
> Various operations on the Framework don't log nor relay what went wrong in case of error.
> The typical pattern is
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
> Instead, I suggest an approach like this
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> IOException ioex = new IOException("Can't install bundle with location: " + location);
> ioex.initCause(be);
> throw ioex;
> }
> }
> Alternatively, this would also work
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> log.error("Can't install bundle with location: " + location, be)
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.