[jira] [Commented] (JCRVLT-285) IllegalStateException logged on INFO level when using PackagingService
[
https://issues.apache.org/jira/browse/JCRVLT-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16431885#comment-16431885
]
Szymon Owczarzak commented on JCRVLT-285:
-
Thank you [~tripod] :)
> IllegalStateException logged on INFO level when using PackagingService
> --
>
> Key: JCRVLT-285
> URL: https://issues.apache.org/jira/browse/JCRVLT-285
> Project: Jackrabbit FileVault
> Issue Type: Improvement
>Reporter: Szymon Owczarzak
>Priority: Major
>
> When using:
> {code:java}
> PackagingService.getPackageManager(session)
> {code}
> Stack trace is logged on INFO level which is looking very awful. I think this
> kind of information should not be logged on info level - it is more a debug
> message from my point of view.
> Please consider changing implementation.
> {code:java}
> public static JcrPackageManager getPackageManager(Session session) {
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> // szymon: maybe better message should be used without whole
> stack trace ?
> }
> // todo: should somehow pass the package roots
> return new JcrPackageManagerImpl(session, new String[0]);
> }
> {code}
> [https://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/PackagingService.java]
> h2. Possible solution:
> {code:java}
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Stack trace
> logged on debug level.");
> log.debug("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
[jira] [Commented] (JCRVLT-285) IllegalStateException logged on INFO level when using PackagingService
[
https://issues.apache.org/jira/browse/JCRVLT-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16431869#comment-16431869
]
Tobias Bocanegra commented on JCRVLT-285:
-
if you are running in an OSGi environment, yes. use
{{org.apache.jackrabbit.vault.packaging.Packaging#getPackageManager(javax.jcr.Session)}}
if you are not running in an OSGi environment, then ... well, we need to add a
method to the API :-)
if you want to bypass the error, use:
{{org.apache.jackrabbit.vault.packaging.impl.JcrPackageManagerImpl}} directly.
> IllegalStateException logged on INFO level when using PackagingService
> --
>
> Key: JCRVLT-285
> URL: https://issues.apache.org/jira/browse/JCRVLT-285
> Project: Jackrabbit FileVault
> Issue Type: Improvement
>Reporter: Szymon Owczarzak
>Priority: Major
>
> When using:
> {code:java}
> PackagingService.getPackageManager(session)
> {code}
> Stack trace is logged on INFO level which is looking very awful. I think this
> kind of information should not be logged on info level - it is more a debug
> message from my point of view.
> Please consider changing implementation.
> {code:java}
> public static JcrPackageManager getPackageManager(Session session) {
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> // szymon: maybe better message should be used without whole
> stack trace ?
> }
> // todo: should somehow pass the package roots
> return new JcrPackageManagerImpl(session, new String[0]);
> }
> {code}
> [https://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/PackagingService.java]
> h2. Possible solution:
> {code:java}
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Stack trace
> logged on debug level.");
> log.debug("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
[jira] [Commented] (JCRVLT-285) IllegalStateException logged on INFO level when using PackagingService
[
https://issues.apache.org/jira/browse/JCRVLT-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16431859#comment-16431859
]
Szymon Owczarzak commented on JCRVLT-285:
-
Hey [~tripod] does it mean that using this method is deprecated? Should we use
the argument-less version of this method?
> IllegalStateException logged on INFO level when using PackagingService
> --
>
> Key: JCRVLT-285
> URL: https://issues.apache.org/jira/browse/JCRVLT-285
> Project: Jackrabbit FileVault
> Issue Type: Improvement
>Reporter: Szymon Owczarzak
>Priority: Major
>
> When using:
> {code:java}
> PackagingService.getPackageManager(session)
> {code}
> Stack trace is logged on INFO level which is looking very awful. I think this
> kind of information should not be logged on info level - it is more a debug
> message from my point of view.
> Please consider changing implementation.
> {code:java}
> public static JcrPackageManager getPackageManager(Session session) {
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> // szymon: maybe better message should be used without whole
> stack trace ?
> }
> // todo: should somehow pass the package roots
> return new JcrPackageManagerImpl(session, new String[0]);
> }
> {code}
> [https://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/PackagingService.java]
> h2. Possible solution:
> {code:java}
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Stack trace
> logged on debug level.");
> log.debug("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
[jira] [Commented] (JCRVLT-285) IllegalStateException logged on INFO level when using PackagingService
[
https://issues.apache.org/jira/browse/JCRVLT-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16428353#comment-16428353
]
Tobias Bocanegra commented on JCRVLT-285:
-
I somewhat agree...the reason why the stack trace is visible is, that people
fix it when they see it.
but it's not severe enough to classify as warning...
> IllegalStateException logged on INFO level when using PackagingService
> --
>
> Key: JCRVLT-285
> URL: https://issues.apache.org/jira/browse/JCRVLT-285
> Project: Jackrabbit FileVault
> Issue Type: Improvement
>Reporter: Szymon Owczarzak
>Priority: Major
>
> When using:
> {code:java}
> PackagingService.getPackageManager(session)
> {code}
> Stack trace is logged on INFO level which is looking very awful. I think this
> kind of information should not be logged on info level - it is more a debug
> message from my point of view.
> Please consider changing implementation.
> {code:java}
> public static JcrPackageManager getPackageManager(Session session) {
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> // szymon: maybe better message should be used without whole
> stack trace ?
> }
> // todo: should somehow pass the package roots
> return new JcrPackageManagerImpl(session, new String[0]);
> }
> {code}
> [https://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/PackagingService.java]
> h2. Possible solution:
> {code:java}
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Stack trace
> logged on debug level.");
> log.debug("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
[jira] [Commented] (JCRVLT-285) IllegalStateException logged on INFO level when using PackagingService
[
https://issues.apache.org/jira/browse/JCRVLT-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16428243#comment-16428243
]
Szymon Owczarzak commented on JCRVLT-285:
-
You are right [~tripod] this is not actually a bug more like bad code practice.
I've changed issue type to Improvement and added more description.
> IllegalStateException logged on INFO level when using PackagingService
> --
>
> Key: JCRVLT-285
> URL: https://issues.apache.org/jira/browse/JCRVLT-285
> Project: Jackrabbit FileVault
> Issue Type: Improvement
>Reporter: Szymon Owczarzak
>Priority: Major
>
> When using:
> {code:java}
> PackagingService.getPackageManager(session)
> {code}
> Stack trace is logged on INFO level which is looking very awful.
> {code:java}
> public static JcrPackageManager getPackageManager(Session session) {
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> // szymon: maybe better message should be used without whole
> stack trace ?
> }
> // todo: should somehow pass the package roots
> return new JcrPackageManagerImpl(session, new String[0]);
> }
> {code}
> [https://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/PackagingService.java]
> Possible solution:
>
> {code:java}
> try {
> throw new IllegalStateException();
> } catch (IllegalStateException e) {
> log.info("JcrPackageManager acquired w/o service! Stack trace
> logged on debug level.");
> log.debug("JcrPackageManager acquired w/o service! Alternate
> package roots will not be respected.", e);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
