# java.lang.IllegalArgumentException: Illegal character(s) in message header value: \_shibsession\_

**URL:** <https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-character-s-in-message-header-value-shibsession/336011>\
**Category:** APM\
**Tags:** java\
**Created:** [June 14, 2023, 8:44pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-character-s-in-message-header-value-shibsession/336011 "2023-06-14T20:44:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Chapman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scott_chapman/32/108983_2.png) [@Scott\_Chapman](https://discuss.elastic.co/u/Scott_Chapman)\
**Post date:** [June 14, 2023, 8:44pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-character-s-in-message-header-value-shibsession/336011/1 "2023-06-14T20:44:01Z")

</div>

I noticed the following error in my logs, I _assume_ it is coming from the Java APM agent? Any idea what it means?  
java.lang.IllegalArgumentException: Illegal character(s) in message header value: \_shibsession\_64656661756c747777772e6e6f63632e6e7373312e746e2e616b616d61692e636f6d=

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [June 15, 2023, 7:12am UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-character-s-in-message-header-value-shibsession/336011/2 "2023-06-15T07:12:56Z")

</div>

Hi @Scott_Chapman ,

can you provide the complete stack trace here ?

---

<div class="post-metadata">

**Author:** ![Scott\_Chapman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scott_chapman/32/108983_2.png) [@Scott\_Chapman](https://discuss.elastic.co/u/Scott_Chapman)\
**Post date:** [June 15, 2023, 12:06pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-character-s-in-message-header-value-shibsession/336011/3 "2023-06-15T12:06:16Z")

</div>

I can't because I didn't see a stack trace for it specifically. It just appeared in my logs.  
FWIW it may have been a result of my app launching a new JVM. I am also using APM agent as JVM agentlib via JAVA\_TOOL\_OPTIONS env var. so it is getting picked up by my subprocess (which isn't necessary)

---

<div class="post-metadata">

**Author:** ![Jonas\_Kunz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_kunz/32/110740_2.png) [@Jonas\_Kunz](https://discuss.elastic.co/u/Jonas_Kunz)\
**Post date:** [June 15, 2023, 1:22pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-character-s-in-message-header-value-shibsession/336011/4 "2023-06-15T13:22:49Z")

</div>

Then I would thing that it's highly unlikely that at least the printing of the exception comes from the agent.  
We had an edge case were exceptions could appear in stderr of the agent, but this has been fixed in `1.37.0`. Since then every exception printed by the agent should be printed in to the logs and not just `stdout`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 13, 2023, 1:23pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-character-s-in-message-header-value-shibsession/336011/5 "2023-07-13T13:23:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
