Whenever we run a server application to use RMI to run our Java client inside the alps , We get an exception: java.io. StreamCorruptedException: Invalid type code: 01
It only happens from within eclipse, not anywhere else (IntelliJ, command line, etc.).
Do anyone know what's going on?
You think it is and it is.
This is usually the one:
- Classpath problem (you need to include some JB libraries)
- Or by any other method The stream is used.
- Or:
Classload loader
is in context when the viewer is runningorg.apache .catalina.loader.WebAppClassLoader
.So if I do the following:
class loader saved classloader = thread Courantthefread.GetConnected Classloader (); If (savedClassLoader.getClass (). GetName () .gnore equal ("org.apache.catalina.loader.WebappClassLoader")) {Thread.currentThread (). SetContextClassLoader (this.getClass (). GetClassLoader ()); }
and then set the saved loader back to
IConnection.Close ()
Comments
Post a Comment