• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Setting the 'forum.link' property, and exceptions from transactional mail

 
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure this is a 'bug'. How about calling it a 'chaotic slump'?

The forum is generally working. But (especially on deployment), email returns,

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

This is an evil error to trace, because it may occur only on deployment, the cause is deep in class, relies on configuration, and is located in utility code. It took me 2 hours.

There is nothing amiss in the mail software or configuration (you may know this already). The issue is in ViewCommon.getForumLink(), as used as a utility by the mail code.



If forum.link property in SystemGlobals is set,



then the property is returned 'null' (not the empty string). This will work for relative addressing, all kinds of JForum activity, but not for email path construction code.

The cleanest solution did not seem to be extra code, nor setting the property to '/'. For example, this property sets the domain name in emails (make it "/" and there will be no domain name). So, even if templating uses relative URLs, even if the action results in different deployment configurations, I'd use the full domain, without a trailing '/',




and email authentication now works.
 
robert crowther
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think saw some earlier posts on problems with email which may have been related to this...
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic