Skip to content

Exception ' java.lang.IllegalArgumentException: Not an managed type' upon a tomcat context reload [DATACMNS-412] #881

@spring-projects-issues

Description

@spring-projects-issues

Nick Weedon opened DATACMNS-412 and commented

Exception ' java.lang.IllegalArgumentException: Not an managed type' upon a tomcat context reload when cached 'RepositoryInformation' (change added in DATACMNS-395) is returned by the 'RepositoryFactorySupport' class.

The 'Environment' field of this Jira issue contains details on my setup (emdedded tomcat 7).

The attached file 'tomcat-log.txt' contains the full trace of the exception and context reload.

If I modify RepositoryFactorySupport#getRepositoryInformation and have it always return new RepositoryInformation (i.e. effectively the old behaviour prior to the DATACMNS-395 change) then this exception does not occur.

Attached ("RepositoryInformationCmp.txt") is a dump of the cached version of RepositoryInformation vs a newly created instance (I used ReflectionToStringBuilder with a recursive 'ToStringStyle' strategey to produce the dump). The 'diff' utility reveals that the content of both instances is identical.
Note however that the recursion stops at java.lang classes and so does not include the contents of the 'Class' classes which is where I believe the difference lies.

My theory on the cause of this problem is that a new class loader is instantiated when the Tomcat context is reloaded, thereby somehow invalidating existing 'Class' meta-information.

Interestingly, the first comment I saw upon navigating to the Spring Data Commons Jira site, by Seppel Hardt read with words to the effect that he encountered a similar problem and had reached a similar conclusion.

By anecdotal observation of stack overflow posts, I see there appears to numerous other users facing this issue also.


Affects: 1.7 M1 (Codd), 1.6.3 (Babbage SR2)

Attachments:

Issue Links:

  • DATACMNS-395 RepositoryFactorySupport should cache RepositoryInformation instances

Backported to: 1.6.4 (Babbage SR3)

Metadata

Metadata

Assignees

Labels

in: coreIssues in core supporttype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions