[jboss-jira] [JBoss JIRA] (JBNAME-26) NumberFormatException when there is an extra space in jndi.properties for jnp.timeout

Ondrej Medek (JIRA) issues at jboss.org
Tue Apr 17 10:38:00 EDT 2018


    [ https://issues.jboss.org/browse/JBNAME-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562535#comment-13562535 ] 

Ondrej Medek commented on JBNAME-26:
------------------------------------

I had a similar problem while ago. I've provided a config.properties to my customer/users. To overcome this Java deficiency, I've made a wrapper/helper class trimming extra spaces for all properties.
This bug is 8 years old, I do not use JBoss now. It's just up to you how user-friendly you want to be to your users. 

> NumberFormatException when there is an extra space in jndi.properties for jnp.timeout
> -------------------------------------------------------------------------------------
>
>                 Key: JBNAME-26
>                 URL: https://issues.jboss.org/browse/JBNAME-26
>             Project: JBoss Naming
>          Issue Type: Bug
>          Components: jnp-client
>    Affects Versions: 5.0.1.GA
>            Reporter: Ondrej Medek
>            Assignee: Radovan Netuka
>            Priority: Minor
>
> Hi,
> if there's an extra space after the value of the property "jnp.timeout" or "jnp.sotimeout", then the exception is thrown:
> java.lang.NumberFormatException: For input string: "6000 "
> I had in jndi.properties the line: "jnp.timeout = 6000 " 
> (Note one extra space after "6000"). 
> I think, something like String.trim() should solve this issue.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list