Hi together,
from today on I get the following error message and stack trace:
<output>
java.lang.IllegalArgumentException: URI is not absolute
        at java.net.URI.toURL(URI.java:1095)
        at
org.apache.openejb.config.PersistenceUnitLinkResolver.extractWebApp(PersistenceUnitLinkResolver.java:112)
        at
org.apache.openejb.config.PersistenceUnitLinkResolver.tryToResolveForEar(PersistenceUnitLinkResolver.java:46)
        at 
org.apache.openejb.util.LinkResolver.resolveLink(LinkResolver.java:93)
        at
org.apache.openejb.util.UniqueDefaultLinkResolver.resolveLink(UniqueDefaultLinkResolver.java:32)
        at
org.apache.openejb.config.AutoConfig.processPersistenceRef(AutoConfig.java:269)
        at
org.apache.openejb.config.AutoConfig.processPersistenceRefs(AutoConfig.java:254)
        at
org.apache.openejb.config.AutoConfig.resolvePersistenceRefs(AutoConfig.java:237)
        at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
        at
org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:396)
        at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:938)
        at
org.apache.tomee.catalina.TomcatWebAppBuilder.checkHost(TomcatWebAppBuilder.java:1954)
        at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
        at java.lang.Thread.run(Thread.java:744)
</output>
Independent from the error and its resolution (!! -> I'm not asking for
help on the issue) I'd like to suggest a review on error messages and
take this for an example what could be changed:
- print the URI which caused the exception
- if java.net.URI.toURL is invoked it is clear in the code which URI is
parsed, so the error message/cause might include information where the
URI is taken from, etc.
The first example takes no efforts at all (just one reference to the URI
object in a good class architecture), the second one needs one
try-catch-block and 10, maybe 15, words in a string literal without any
testing. The improvement of user experience in both cases is
indescribable :)

Regards,
Karl

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to