Skip to content

The type registry does not know about type id #165

Closed
@yissachar

Description

@yissachar

I'm receiving the following exception when using hot-reload with the Lettuce Redis library:

Caused by: java.lang.IllegalStateException: The type registry TypeRegistry(id=1346265082,loader=java.net.URLClassLoader) does not know about type id 901
    at org.springsource.loaded.TypeRegistry.getReloadableType(TypeRegistry.java:1688)
    at org.springsource.loaded.TypeRegistry.idyrun(TypeRegistry.java:1572)
    at com.lambdaworks.redis.protocol.RedisStateMachine.safeSet(RedisStateMachine.java:182)
    at com.lambdaworks.redis.protocol.RedisStateMachine.decode(RedisStateMachine.java:157)
    at com.lambdaworks.redis.protocol.CommandHandler.decode(CommandHandler.java:154)
    at com.lambdaworks.redis.protocol.CommandHandler.channelRead(CommandHandler.java:138)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
    ... 1 more

Here is the line in question:

protected void safeSet(CommandOutput<K, V, ?> output, ByteBuffer bytes, RedisCommand<K, V, ?> command) {
    safeSet(() -> output.set(bytes), command);
}

Activity

longwa

longwa commented on Apr 12, 2016

@longwa

I'm seeing the same thing reloading in a Grails app using Chronicle-Map to store off-heap data.

gferon

gferon commented on May 4, 2016

@gferon

I'm also seeing this issue with jsass that is also using lambda expressions from Java 8.

Should we have any hope to see this fix for a future version and Grails 2.x?

aclement

aclement commented on May 6, 2016

@aclement
Contributor

If anyone has a complete simple project they can share that demonstrates the problem, that is likely to speed up getting it fixed.

gferon

gferon commented on May 9, 2016

@gferon

Thanks! I just published a sample project to reproduce the issue.

Just run the app with the Grails wrapper and JDK8, and the two URLs:

As soon as you make any change to the app (and I guess springloaded is used) the exception gets thrown and the app is rendered useless.

gferon

gferon commented on May 10, 2016

@gferon

The test commits I made actually fix a different bug not the one described in this ticket 😮

mischkl

mischkl commented on Jul 7, 2016

@mischkl

Same issue here! Any word on this?

lquterqtd

lquterqtd commented on Jul 18, 2016

@lquterqtd

i have seen the same exception,also the lambda expression

equilibric

equilibric commented on Sep 9, 2016

@equilibric

+1 - errors out on reload on a line that contains a lambda expression in library that is a dependency.

craigraw

craigraw commented on Sep 15, 2016

@craigraw

This issue appears to occur when using Moneta, the javax.money RI. No hot reloading is possible in a Grails 3 app with that dependency.

johngamarra

johngamarra commented on Oct 8, 2016

@johngamarra

+1

timic

timic commented on Nov 17, 2016

@timic

+1

zyro23

zyro23 commented on Dec 4, 2016

@zyro23
Contributor

same issue (or at least stacktrace) with selenium 3.

Caused by: java.lang.IllegalStateException: The type registry TypeRegistry(id=1420603454,loader=sun.misc.Launcher$AppClassLoader) does not know about type id 5836
    at org.springsource.loaded.TypeRegistry.getReloadableType(TypeRegistry.java:1910)
    at org.springsource.loaded.TypeRegistry.idyrun(TypeRegistry.java:1789)
    at org.openqa.selenium.remote.ErrorCodes.toState(ErrorCodes.java:116)
    at org.openqa.selenium.remote.JsonToBeanConverter.convert(JsonToBeanConverter.java:138)
    at org.openqa.selenium.remote.JsonToBeanConverter.convert(JsonToBeanConverter.java:46)
    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:79)
    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)

offending code:

Set<String> possibleMatches = KNOWN_ERRORS.stream()
      .filter(knownError -> knownError.getJsonCode() == status)
      .filter(KnownError::isCanonicalForW3C)
      .map(KnownError::getW3cCode)
      .collect(Collectors.toSet());

communication with the remote webdriver browser fails after that so it is not just the reload that does not happen but the running app is affected.

also tried to exclude via exclusions=org.openqa.selenium..* - didnot help.

i think this issue is a real blocker because it happens if any class is reloaded, no matter if completely unrelated to the offending code.

if fixing the root cause is complicated, it would be great if at least excluding works in the meantime.

mischkl

mischkl commented on Dec 4, 2016

@mischkl

What is going on with the spring-loaded project in general? Seemingly no development since June, Java 8 code is still broken even though it's been out for two and half years... I guess everyone has moved on to HotSwap agent, or JRebel?

mlaccetti

mlaccetti commented on Dec 5, 2016

@mlaccetti

I switched to springloaded simply because JRebel became so damn expensive - be miserable for it to simply rot into nothingness.

14 remaining items

mateusmarquezini

mateusmarquezini commented on Apr 11, 2017

@mateusmarquezini

I'm trying to use Spring Loaded version 1.2.7-RELEASE and I'm getting this error every time when I try to make project again on IntelliJ. Does anybody still get this error?

animator013

animator013 commented on Apr 11, 2017

@animator013
mateusmarquezini

mateusmarquezini commented on Apr 12, 2017

@mateusmarquezini

thanks @animator013 , I will check this!

selimok

selimok commented on Apr 24, 2017

@selimok

In my case 1.2.8-SNAPSHOT doesn't solve my problem.

Part of the stack trace:

Caused by: java.lang.IllegalStateException: The type registry TypeRegistry(id=1088488879,loader=sun.misc.Launcher$AppClassLoader) does not know about type id 747
	at org.springsource.loaded.TypeRegistry.getReloadableType(TypeRegistry.java:1910) ~[springloaded-1.2.6.RELEASE.jar:1.2.6.RELEASE]
	at org.springsource.loaded.TypeRegistry.idyrun(TypeRegistry.java:1789) ~[springloaded-1.2.6.RELEASE.jar:1.2.6.RELEASE]
	at com.vaadin.server.communication.LegacyUidlWriter.sortByHierarchy(LegacyUidlWriter.java:91) ~[vaadin-server-8.0.0.jar:8.0.0]

Problematic part of the code (LegacyUidlWriter.java:91):

 Collections.sort(paintables, (Component c1, Component c2) -> {
...
animator013

animator013 commented on Apr 26, 2017

@animator013

@selimok are you sure you are using the 1.2.8 version ? From the exception i see

~[springloaded-1.2.6.RELEASE.jar:1.2.6.RELEASE
selimok

selimok commented on Apr 26, 2017

@selimok

@animator013 thanks for asking, but that was the code dependency for triggering auto reload of UI components. Agent version was 1.2.8-SNAPSHOT downloaded from the link you provided above.

-javaagent:/Devel/libs/springloaded-1.2.8.jar -noverify
animator013

animator013 commented on Apr 26, 2017

@animator013

Well it seems it is still not working correctly.

The type registry TypeRegistry(id=1385128737,loader=sun.misc.Launcher$AppClassLoader) does not know about type id 2497. Stacktrace follows:
java.lang.reflect.InvocationTargetException: null
	at org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:211)
	at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:188)
	at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	at sk.creativeweb.accomodation.filter.CorsFilter.doFilterInternal(CorsFilter.groovy:29)
	at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
	at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

I am using the 1.2.8-snapshot version in Grails. There is still some work which has to be done to correct the reloading.

This issue should be reopened.

graemerocher

graemerocher commented on Apr 26, 2017

@graemerocher
Contributor

Provide an example that reproduces the problem and we can reopen. Random reports without concrete examples aren't useful.

animator013

animator013 commented on Apr 26, 2017

@animator013

I think @selimok provided one. I need to further investigate this, it's something odd.

selimok

selimok commented on Apr 26, 2017

@selimok

Hi There,

Here a ready to execute example: https://github.com/selimok/spring-boot-loaded-vaadin .
Run it and afterwards change anything in MyUI class. You will see above exception I mentioned.

Thanks.

selimok

selimok commented on Apr 26, 2017

@selimok

@animator013 you were right. Although I passed the right version of springloaded version via -javaagent parameter, in project dependency avoided loading right version of springloaded. After changing pom dependency as 1.2.8.BUILD-SNAPSHOT, the problem is gone.

Sorry for false alarm and thanks for the great work :)

dekay2323

dekay2323 commented on Jun 6, 2017

@dekay2323

I have a similar bug and code to duplicate I am not sure what is causing it.
Here is the code and details
https://github.com/dekay2323/TypeRegistry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @pocket5s@graemerocher@stiancor@mlaccetti@aclement

      Issue actions

        The type registry does not know about type id · Issue #165 · spring-projects/spring-loaded