# Unnest Exceptions

**URL:** <https://discuss.elastic.co/t/unnest-exceptions/173743>\
**Category:** APM\
**Created:** [March 25, 2019, 11:45am UTC](https://discuss.elastic.co/t/unnest-exceptions/173743 "2019-03-25T11:45:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)\
**Post date:** [March 25, 2019, 11:45am UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/1 "2019-03-25T11:45:03Z")

</div>

Hi,

i get this error recorded by the APM-Agent.

```
Could not open Jcr Session; nested exception is javax.jcr.LoginException: Workspace access denied

```

i've set this in my properties file:

`unnest_exceptions`

and i also tried:

`unnest_exceptions=*nested*excpetion`

but it seems like the exception is not unnested. How should it look like, and what is the correct config for this case?

**APM Agent language and version** :  
Java 1.4.0

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 25, 2019, 1:08pm UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/2 "2019-03-25T13:08:42Z")

</div>

In order to unnest, you need to specify the class name of the Exception you want to unnest. So, if you want to unnest this `javax.jcr.LoginException`, your setting should be `unnest_exceptions=javax.jcr.LoginException` or any usage of pattern as described [in the docs](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-unnest-exceptions).

---

<div class="post-metadata">

**Author:** ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)\
**Post date:** [March 25, 2019, 1:18pm UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/3 "2019-03-25T13:18:50Z")

</div>

I changed it to `unnest_exceptions=javax.jcr.LoginException` but it looks and behaves the same.

How should it become visible in the gui that the exception is now unnested?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 25, 2019, 1:21pm UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/4 "2019-03-25T13:21:06Z")

</div>

Is `javax.jcr.LoginException` the nested one, or the nesting one? I can't say as I didn't get your full logs, but it should be the nesting Exception.

---

<div class="post-metadata">

**Author:** ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)\
**Post date:** [March 25, 2019, 1:51pm UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/5 "2019-03-25T13:51:46Z")

</div>

Here is the full stacktrace (unneeded things away 7k limit). When i get it correctly the filter should be `javax.jcr.AccessDeniedException` then?

```
2019-03-25 14:17:11,852 [SEVERE] 00000000 Servlet.service() for servlet [GenericServlet] in context with path [/analysis-ci] threw exception (org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/analysis-ci].[GenericServlet]: org.apache.catalina.core.StandardWrapperValve invoke) 
org.springframework.dao.DataAccessResourceFailureException: Could not open Jcr Session; nested exception is javax.jcr.LoginException: Workspace access denied
	at org.springframework.extensions.jcr.SessionFactoryUtils.getSession(SessionFactoryUtils.java:121)
	at ...
...
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: javax.jcr.LoginException: Workspace access denied
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1529)
	at org.pentaho.platform.repository2.unified.jcr.sejcr.NoCachePentahoJcrSessionFactory.getSession(NoCachePentahoJcrSessionFactory.java:44)
	at org.pentaho.platform.repository2.unified.jcr.sejcr.GuavaCachePoolPentahoJcrSessionFactory.getSession(GuavaCachePoolPentahoJcrSessionFactory.java:145)
	at org.pentaho.platform.repository2.unified.jcr.sejcr.CredentialsStrategySessionFactory.getSession(CredentialsStrategySessionFactory.java:364)
	at org.springframework.extensions.jcr.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:87)
	at org.springframework.extensions.jcr.SessionFactoryUtils.getSession(SessionFactoryUtils.java:119)
	... 77 more
Caused by: javax.jcr.AccessDeniedException: Not allowed to access Workspace default
	at org.apache.jackrabbit.core.security.DefaultAccessManager.init(DefaultAccessManager.java:159)
	at org.apache.jackrabbit.core.DefaultSecurityManager.getAccessManager(DefaultSecurityManager.java:280)
	at org.apache.jackrabbit.core.SessionImpl.createAccessManager(SessionImpl.java:358)
	at org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:273)
	at org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:239)
	at org.apache.jackrabbit.core.XASessionImpl.<init>(XASessionImpl.java:101)
	at org.apache.jackrabbit.core.RepositoryImpl.createSessionInstance(RepositoryImpl.java:1613)
	at org.apache.jackrabbit.core.RepositoryImpl.createSession(RepositoryImpl.java:956)
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1501)
	... 82 more
```

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 25, 2019, 2:12pm UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/6 "2019-03-25T14:12:09Z")

</div>

Looks like the unnesting should be done on `org.springframework.dao.DataAccessResourceFailureException` in order to get you the `javax.jcr.LoginException`. You can not go deeper than that, though, it is only one level.

---

<div class="post-metadata">

**Author:** ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)\
**Post date:** [March 25, 2019, 2:35pm UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/7 "2019-03-25T14:35:06Z")

</div>

Thanks now its working.

---

<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:** [April 15, 2019, 10:35am UTC](https://discuss.elastic.co/t/unnest-exceptions/173743/8 "2019-04-15T10:35:15Z")

</div>

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