ERROR: RMI Class loader disabled

Despite of setting classpath, policy tool I am getting following error. What does the error mean and What is the solution?
E:\Javaprog\RMI>java MultiplyServerImpl
Server could not start java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: MultiplyServerImpl_Stub (no security manager: RMI class loader disabled)

Hello JAAZ,
I got the same error yesterday. I was a little frustrated, because the day before everything was fine...
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.lang.ClassNotFoundException: uk.co.it.ete.server.ETE_Server (no security manager: RMI class loader disabled)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)The solution was, that I did some refactoring and some of the classes were now in different packages. I updated the system on the client-side and now everything works again.
I think debugging RMI-applications is not as easy as "normal" applications ..
maybe this helps..
Regards
tk

Similar Messages

  • No security manager: RMI class loader disabled Error at RMI client programm

    Got following error on invoking remote method from RMI client,
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: com.rmi.RmiImpl_Stub (no security manager: RMI class loader disabled)
    Please let me know solution.

    Hello JAAZ,
    I got the same error yesterday. I was a little frustrated, because the day before everything was fine...
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.lang.ClassNotFoundException: uk.co.it.ete.server.ETE_Server (no security manager: RMI class loader disabled)
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)The solution was, that I did some refactoring and some of the classes were now in different packages. I updated the system on the client-side and now everything works again.
    I think debugging RMI-applications is not as easy as "normal" applications ..
    maybe this helps..
    Regards
    tk

  • No security manager: RMI class loader disabled

    i tried to add a filter to my client jmx
    my filter is:
    class Filter implements NotificationFilter {
    public boolean isNotificationEnabled(Notification n) {
              return (n.getType().equals("example.user.remove"))
              ? true
              : false;
    in my client i use:
    Filter filter=new Filter();
    Listener listener=new Listener();
    mbeanServer.addNotificationListener(mbeanName, listener, filter, null);
    if i dont put the filter(if i use null) my client works but when i include the filter I have this error:
    java.rmi.UnmarshalException: java.lang.ClassNotFoundException: Filter (no security manager: RMI class loader disabled); nested exception is:
         java.lang.ClassNotFoundException: Filter (no security manager: RMI class loader disabled)
    what is wrong?

    You need to make sure that Filter.class is on your classpath, either directly as the .class file or in a JAR file that is on the classpath.

  • Simple RMI/IIOP app : "no security manager: RMI class loader disabled"

    Hello colleagues!
    I do not understand the problem at all, and asking for your kind help.
    This is my first code for RMI/IIOP. We are using JBoss as application server.
    What I've done :
    1) created test.Command interface , extending Remote
    2) created test.CommandImpl , implementing above mentioned interface and java.io.Serializable, and extending javax.rmi.PortableRemoteObject.
    BTW, Serializable is not implemented in some tutorials, but absence of Serializable causes NotSerializableException when trying to rebind (next step).
    3) in server code, created initial context and called
    context.rebind("test/Command",new CommandImpl());
    4) Ran rmic -iiop test.CommandImpl . A result was two new cass files, CommandImplTie.class and CommandStub.class , both are also in package "test".
    5) Created remote client and put CommandStub.class to client
    classpath (under package "test", too).
    6) In client code, initialized the context and called
    context.lookup("test/Command").
    On this line (lookup), the following exception is being raised :
    javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: test.CommandImpl (no security manager: RMI class loader disabled)
         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:368)
         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:161)
         at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
         at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
         at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
         at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
         at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    Is _Stub class all that client needs from server classes, to obtain
    the reference ? I tried to put _Tie also to client, but with the same result.
    All Jndi paths to JBoss server are correct, as I've used them successfully in other applications.
    Many thanks in advance,
    Daniel

    Next few words to the topic.
    I made tests with canonical RMI/IIOP tutorial from Sun.
    When I use Sun's ORB (orbd.exe) , everything work fine. I started
    orbd on the same PC as JBoss, and client and server are running
    remotely.
    But with JBoss ORB, I have the same exception as described above.
    Server starts and registers in JNDI successfully, but client can not
    obtain a remote reference. Exception is being thrown on
    context.lookup().
    So the difference is definitely in security managers for two ORBs.
    I also tried to create new RMISecurityMananger and set it, but with
    no effect.
    Any ideas ?
    TIA,
    Daniel.

  • RMI Class Loader

    Hi, i Have an application which uses RMI and I need to change at runtime the codebase property to point to a local directory which is not on the CLASSPATH environment variable, so the JVM default Class Loader cannot load the classes located at that local directory. I guess I have to define my own subclass of the class java.rmi.server.RMIClassLoaderSpi and in my code I should change the property "java.rmi.server.RMIClassLoaderSpi" with the method System.setProperty() to point to another RMIClassLoaderSpi subclass as needed, right?
    I found the documentation of the class RMIClassLoaderSpi too vague. Can anyone tell me what code to place on which of her methods? An example would be great.

    I would suggest another simple approach - launch a new VM for every user application.
    I looked at the RMI implementation (you can also download the J2SDK source code and see how internal sun.* classes are implemented) and it looks like you will get the correct codebase annotation if you load your user classes with a URLClassLoader.
    Now if you want to use a dynamic codebase property you can have your own RMIClassLoaderSpi. It has a method "getClassAnnotation" which you can implement to return any codebase you wish for your classes.
    Genady

  • RMI Dynamic Class Loading

    Hello,
    I have a standalone Java Client which is connecting to an RMI based svr component on WLS 6.0sp1. However, before connecting to the RMI Svr, I am trying to boot strap couple of other CLASS files from the App Svr. using the RMIClassLoader. Now here's the problem...
    I have placed my classes( one which I want to download and instantiate before I start making conventional calls to RMI Svr remote methods) in the folder WL_HOME/config/examples/rmi/*.class
    which is the code_base url I use. However, the error I get when trying to download the classs using RMIClass loader is:
    No Security Manager: RMI Class Loader disabled"...
    due to which I can not even get connected to my remote object after that. Can somebody please tell me how can I set whatever option it is so that I can get this thing working.
    I tried using the "Grant all" security policy too on the client side & server side in vain.
    Any help is truly appreciated. Thanks a lot!
    cl I am trying to

    I'll try having a crack at this, see inline comments
    Chirag Shah wrote:
    Hello,
    I have a standalone Java Client which is connecting to an RMI based svr component on WLS 6.0sp1. However, before connecting to the RMI Svr, I am trying to boot strap couple of other CLASS files from the App Svr. using the RMIClassLoader. Now here's the problem...
    I have placed my classes( one which I want to download and instantiate before I start making conventional calls to RMI Svr remote methods) in the folder WL_HOME/config/examples/rmi/*.class
    which is the code_base url I use. However, the error I get when trying to download the classs using RMIClass loader is:I'll assume that you're using a proper URL (file://) to instanciate your ClassLoader.
    >
    No Security Manager: RMI Class Loader disabled"...
    Does your client explicitly set a SecurityManager using the following command?
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new java.rmi.RMISecurityManager());
    Also,I believe that it should only be your client changing its policy file (for the network classload).
    >
    due to which I can not even get connected to my remote object after that. Can somebody please tell me how can I set whatever option it is so that I can get this thing working.
    I tried using the "Grant all" security policy too on the client side & server side in vain.
    Any help is truly appreciated. Thanks a lot!
    cl I am trying toHope it helps,
    Stephane Vaucher
    CIRANO
    Research Professional

  • Application Loader Disabled

    I am a new BB user having serious difficulty with the Desktop Manager program.  First it kept crashing when processing calendar entries.  I fixed that after spending a lot of time on this forum. Now that that seems to be working there's another problem.  The application loader is disabled!  I reinstalled the manager to no avail.  Can anyone help?  Thanks.
    I have using desktop manager 4.6 with windows vista service pack 1.

    On Wed, 05 Jul 2006 16:52:48 -0500, ted stockwell wrote:
    > Cenk Dundar wrote:
    >> I am trying RMI comminication on RCP application. There are two application
    >> one of them server other client. but when I run client after server the
    >> error occured.
    >>
    >> Remote exception: error unmarshalling return; nested exception is:
    >>
    >> java.lang.ClassNotFoundException: com.ib.fp.plant.comm.Server_Stub (no
    >> security manager: RMI class loader disabled)
    >>
    >> But I can run RMI on normal application . How can I find a solution?
    >>
    >> Thank YOU
    >>
    >
    > I always get this error when running RMI applications if I don't
    > somewhere explicitly set the security manager.
    > So, somewhere in my RMI applications (both client and server sides) I
    > always have a snippet of code that's sets the SecurityManager to a
    > manager that allows full permissions.
    > Something like this...
    >
    > if (System.getSecurityManager() == null) {
    > System.setSecurityManager(new SecurityManager() {
    > public void checkPermission(Permission perm)
    > {
    > }
    > public void checkPermission(Permission perm, Object
    > context)
    > {
    > }
    > });
    > }
    Hi,
    Unlike Ted, I don't find it is necessary to set a security manager.
    However I had all sorts of classpath fun until I found the magic statement:
    DynamicImport-Package: *
    I don't understand OSGI very well but essentially adding this to the
    manifest file allows your plug-in dynamically discover all classes in all
    your plug-ins. There must be a downside (with '*' flags there always is).
    However it works perfectly where you have a plug-in that neede to reolve
    arbitary classes at runtime (e.g. RMI, Hibernate etc.).
    Mike E.

  • RMI and the class loader delegation model

    Hello,
    I need to know what the class loader delagation chain looks like when RMI does dynamic class loading. What is the RMIClassLoader's parent? Does it delegate to Thread.currentThread().getContextClassLoader()?
    In a test application I can debug the chain which looks like this:
    sun.misc.Launcher$AppClassLoader@bac748
    sun.misc.Launcher$ExtClassLoader@7172ea
    The AppClassLoader is the class loader for the test and is coincident with getSystemClassLoader(). Its parent is the ExtClassLoader which I believe is in charge of loading anything from jre/lib/ext. But I don't know how to get a reference to the RMIClassLoader in order to find out what it's parent is.
    I would appreciate any info on this.
    Thanks in advance,
    Joe

    Well that was easy.
    I just used the RMIClassLoader.getClassLoader(String codebase) and was able to determine the chain.
    FYI: the chian is as follows:
    ExtClassLoader <-- AppClassLoader <-- sun.rmi.server.LoaderHandler
    Of interest, if you have a custom class loader its parent will most likely be the AppClassLoader but the rmi class loader will not chain off of your custom class loader. It does some interesting things in order for this to work. It will look for custom class loader to load interfaces but will use the RMIClassLoader to load stubs. Pretty cool.
    Thanks anyway.
    Joe

  • Dynamic Class Loading (RMI)

    Hi,
    i have my rmi server, implementing objects,stubs and skeleton classes deployed in my Tomcat server and they are stored under the tomcat root folder.
    In anoather jvm iam trying to load the classes thru the below code.
    java -Djava.rmi.server.codebase=http://ssd8/tomcat-3.2.4/install_dir/webapps/ROOT/WEB-INF/rmicode stockMarketClient
    ssd8 is the hostname(machine) which contains all my rmi server files.
    and stockmarketclient is my rmi client.
    Iam getting the java.lang.noclassdeffound error.
    what may be the problem???
    Should i have the security policy file in the client machine.

    Please Do tell me if any of the following worked I'll be greatly obliged
    1) Try this
    java -Djava.rmi.server.codebase=http://servername/dir1/dir2/ RMIServer
    This / thing at the end of the URL is very important
    2) This is how I did it just Today
    Dynamic Class Loading Using RMI
         Server Side
    1) Main Interface
    2) Implementing Class
    3) Stub & Skel                    (RMI Server & Web Server)
    4) All Other Classes used by the Server
         Web Server Side
    1) Main Interface
    2) Stub & Skel                    (RMI Server & Web Server)
    3) All Other Classes (not Main Client Class)
         Client Side
    1) Main Interface
    2) Main Client Class
    3) Stubs
    4) Security Manager
         RUNNING
    SERVER
         java DataServerImpl
    CLIENT
         java DataClient xyz
    Note
    Make Calls as follows
    System.setSecurityManager(new LaxSecurityManager());
    DataServer server = (DataServer) Naming.lookup("rmi://localhost:1099/DataServer");
    Runnable r = (Runnable)server.getNewClass();
    r.run();
    DON'T make Calls as follows
    System.setSecurityManager(new LaxSecurityManager());
    DataServer server = (DataServer) Naming.lookup("rmi://localhost:1099/DataServer");
    NewClass obj = server.getNewClass();
    obj.run();
    if done as above provide the Class NewClass to the Client as well ( whole purpose defeated)
    Code
         // SecurityManager
    import java.rmi.*;
    import java.security.*;
    public class LaxSecurityManager extends RMISecurityManager
         // All Checks are routed through this method
         public void checkPermission(Permission p)
              // do nothing
         // Main Interface
    import java.rmi.*;
    public interface DataServer extends Remote
         public boolean login(String usr_name,char[] pass_wrd) throws RemoteException;
         public Object getNewClass() throws RemoteException;
         // Main Server
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    public class DataServerImpl /*extends UnicastRemoteObject*/ implements DataServer
         static
              try
                   LocateRegistry.createRegistry(1099);
              catch(Exception e)
                   System.err.println("Static " + e);
         public boolean login(String usr_name,char[] pass_wd) throws RemoteException
              System.out.println("Welcome " + usr_name);
              if( pass_wd == null || pass_wd.length == 0 || pass_wd.length > 10 )
                   return false;
              return true;
         public Object getNewClass() throws RemoteException
              System.out.println("Returning New Class");
              return new NewClass();
         public DataServerImpl() throws RemoteException
              try
                   System.setProperty("java.rmi.server.codebase","http://localhost:8080/");
                   UnicastRemoteObject.exportObject(this);
                   Naming.rebind("DataServer",this);
              catch(java.net.MalformedURLException e)
                   System.err.println("DataServerImpl " + e);
                   return;
              System.out.println("Server Registered");
         public static void main(String[] args) throws Exception
              new DataServerImpl();
         // Class Moving Around the Network
    public class NewClass implements java.io.Serializable,Runnable
         int num;
         public void run()
              System.out.println("Start the Server with Number = " + num);
         public NewClass()
              num = (int)(Math.random()*1000);
         public String toString()
              return num + "";
         // Client
    import java.rmi.*;
    public class DataClient
         public static void main(String[] args) throws Exception
              System.setSecurityManager(new LaxSecurityManager());
              String pass = new String();
              if(args.length == 0)
                   System.err.println("usage: java DataClient PassWord");
                   System.exit(1);
              else
                   pass = args[0];
              DataServer server = (DataServer) Naming.lookup("rmi://localhost:1099/DataServer");
              Runnable r = (Runnable)server.getNewClass();
              r.run();
    All the Best

  • Access to class loader RMI

    Hello,
    I am writing an RMI-chat program, but I have some problems using dynamic class loading.
    I do set my security manager, I've got a java.policy, use the right commandline-options, but I get the following error when I try to dynamicly load a class. The class is on the right server, and the server is running, and properly set in the codebase:
    ClassNotFoundException: access to class loader denied.
    Can anyone please help me?
    Johanna

    Sorry,
    I was using two codebases, and one was not accesible in the policy file.
    My bad

  • Error building project using kXML2 - "Class loading error: Wrong name"

    Hi,
    I'm testing the XML-Parser KXML2 and downloaded the latest package, but the minimal version (kxml2-min.zip). I put this file into the directory "%j2mewtk%\apps\KxmlTest\lib" and wrote the lines
    import org.kxml2.io.*;
    import org.xmlpull.v1.*;
    When I try to build the project with the Wireless Toolkit (v1.04) it spits out the following error:
    Error preverifying class kxml2.io.KXmlParser
    Class loading error: Wrong name
    com.sun.kvem.ktools.ExecutionException: Preverifier returned 1
    Build failed
    I also tried the full package "kxml2.zip" but the same error occurs.
    How can I get rid of this? Thanks in advance!

    Okay, finally worked it out (hopefully). I unpacked the archive to a directory (say "%J2MEWTK%\apps\KxmlTest\tmpclasses") and then preverified them "manually":
    %J2SDK%\bin\preverify.exe -classpath "%J2MEWTK%\apps\KxmlTest\tmpclasses";"%J2MEWTK%\lib\midpapi.zip" org.kxml2.io.KXmlParser
    %J2SDK%\bin\preverify.exe -classpath "%J2MEWTK%\apps\KxmlTest\tmpclasses";"%J2MEWTK%\lib\midpapi.zip" org.xmlpull.v1.XmlPullParser
    %J2SDK%\bin\preverify.exe -classpath "%J2MEWTK%\apps\KxmlTest\tmpclasses";"%J2MEWTK%\lib\midpapi.zip" org.xmlpull.v1.XmlPullParserException
    Then I packed them again to a jar-file:
    %J2SDK%\bin\jar.exe -cvf kxml2-min.jar %J2MEWTK%\apps\KxmlTest\tmpclasses\output\.
    That was all!

  • TS1717 I get the error "unable to load data class info from sync services" and eventually itunes freezes-will anything in this article help?

    I get the error "unable to load data class info from sync services" and eventully itunes freezes.  will this article help me?

    Hello there brigidfromca.
    Messages can always be pretty daunting when we're not sure where to start. I was able to locate the following Knowledge Base article that discusses the very message you're getting:
    iTunes for Windows: "Unable to load data class" or "Unable to load provider data" sync services alert
    http://support.apple.com/kb/TS2690
    It is a pretty thorough document with multiple steps to review, but looks to be great place to start for a resolution for you.
    Thanks for using Apple Support Communities to reach out to us for answers.
    Cheers,
    Pedro D.

  • When loading Firefox 5 I receive - Type Error: Conponents.classes[cid] is undefined

    When I acknowledge the error the Firefox loads. This happens with and occasional other application

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4+ you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Is Dynamic Class Loading(RMI) Possible in EJB?

    In Java RMI,it allows dynamic class loading,that is when the stub and interface class files are modified by the server,the client side can download the updated stub and inteface classes.
    As the remote interface of EJB extends Javax.ejb.EJBObject which in turn extends java.rmi.remote.Also the Home interface of EJB extends
    javax.ejb.EJBHome which also extends java.rmi.remote.
    Therefore I wonder if EJB also supports dynamic class
    loading as RMI does.If yes,how to do so?Is it the responsibility of the Application Servers and transparent
    to client? If No,then is this a defect in EJB??
    Thank you very much in advance!!
    John

    This would be done by the container and is transparent to the client. Most app servers support "hot deploy" where you can deploy beans while the server is running. This requires dynamic class loading.

  • Seemingly random errors (Class Loading)

    Hi,
    I wonder if anyone out there could help me or point me in the right direction to solve this problem im having.
    For a Uni project I am writing a Java application that takes three components stored in seperate Jar files (GUI, AI, and Model) dynamically from user defined locations by a central loading class.
    eg GUIAddress = "c:/java/guis/gui.jar"
    Each has a loading class defined in a MANIFEST.MF file within each Jar file and these are in turn defined by interfaces within my central loading program.
    I have set it out like this to allow me to quickly test out different components without changing the main structure of the program.
    The problem im having is that I keep getting different ClassFormatErrors depending on what I have changed. Errors include:
    Local variable name has bad constant pool index
    Extra bytes at the end of the class file
    Code segment has wrong length
    Illegal constant pool index
    Code of a method has length 0All these errors are produced with the same compiler (JRE1.4.2) and with minimal changes to the source code.
    For example I get the program to a stage where it works then add the un-used constant to a classprivate int foobar = 10; recompile and reload and i get the error Extra bytes at the end of the class file if I take it out again recompile and rerun and alls better.
    Now to me that one line shouldnt make a differene to the program in any significant way. But anyway thats just a small example to show you what my problem is.
    These problems started when i made a class Span (http://rex.homeip.net/~matt/java/gui/src/gui/graphs/Span.java) which as you can see does nothing special, but when i use it from another class (http://rex.homeip.net/~matt/java/gui/src/gui/GraphViewer.java) all hell breaks loose. Now i know the class is being loaded and methods can be called from it (line 84) but if i try to call setSpan() then i get the error Local variable name has bad constant pool indexIf anyone has any clues please let me know, im getting sick of going round in circles.
    Cheers in advance.
    Matt
    links
    Main loading class: http://rex.homeip.net/~matt/java/loader/src/loader/Loader.java
    Class Loader: http://rex.homeip.net/~matt/java/loader/src/loader/setup/SetupManager.java
    GUI: http://rex.homeip.net/~matt/java/gui/src/gui/Gui.java
    GraphViewer: http://rex.homeip.net/~matt/java/gui/src/gui/GraphViewer.java
    Span: http://rex.homeip.net/~matt/java/gui/src/gui/graphs/Span.java

    I think I have the solution....
    I had the same exact (seemingly random) ClassFormatExceptions being thrown from my custom Class-Loader as well. I would get the same variety of debug prints as you (Invalid constant pool, Code segment has wrong length, etc). At times it seemed to happen randomly to different classes that I loaded, depending on small changes I made to the code.
    Here is the background and how I solved it.
    I dervied from ClassLoader to make my custom class-loader. I overrode the findClass() method, and NOT the loadClass() method. This is the Java 2 method of making class-loaders, which is simplier than implementing your own loadClass() as in the older Java 1.1way of doing things.
    My custom class-loader (called JarFileClassLoader, BTW) already had a list of JAR files that it searched when its findClass() method was called from its parent. I was using a JarFile object to examine the contents of a particular JAR file. Once it found the JarEntry that represented the class I wanted to load, it asked for the InputStream by calling:
    JarEntry desiredEntry = // assigned to the JarEntry that represents the class you want to load
    InputStream myStream = myJar.getInputStream( desiredEntry );
    Then I asked how many bytes were available for reading, I created a byte array that could hold that many bytes, and I read the bytes from the InputStream:
    int totalBytes = myStream.available();
    byte[] classBytes = new byte[totalBytes];
    myStream.read( classBytes );
    Finally, I would define and resolve my class by:
    Class loadedClass = super.defineClass( className, classBytes, 0, classBytes.length );
    resolveClass( loadedClass );
    Sometimes, on the call to defineClass(), I would get all the weird ClassFormatExeptions.
    After the searching around these forums for a while, I found a lot of discussion about this problem, but I didn't find any concrete explanations or solutions. But I did see some cursory discussion about the InputStream class. This lead me to investigate how this class works exactly.
    As it turns out, when you call:
    myStream.read( classBytes );
    it is NOT guaranteed to read all the available bytes and completely fill the byte array you made for it. It could very easily read LESS than the total available bytes. I don't know why it would do this...maybe something to do with internal buffering of the stream. This happens more often on bigger sized class files that you are trying to read.
    The read() call will return an integer that represents the actual number of bytes read during that attempt to read. So, the solution is to check if you got all your bytes during the first call to read(), if not, then read some more.
    There is another version of the read() method that takes an 'offset' value into your array and a max bytes to read value. I used this method to modify my code to look like:
    int total = myStream.available();
    int numNeeded = total;
    int numRead = 0;
    int offset = 0;
    byte[] classBytes = new byte[total];
    do
    numNeeded -= numRead;
    offset = numRead;
    numRead += inStream.read( classBytes, offset, numNeeded );
    } while( numRead < total );
    This will continue looping until all the bytes are read. Then I never got those funky ClassFormatExceptions again. Before my fix, I was getting partial class definitions from calls to read() that didn't return all the bytes. Depending on which part of the class was omitted, I got the varied error prints that you got. Now, after this fix, it seems to work just fine.
    Hope this helps!
    -Mark

Maybe you are looking for

  • Error in Starting Active Data Cache

    Hi All, I am trying to start the BAM services, all other services are getting started except 'Active Data Cache'. Its erroring out with the following msg in the log.... Could any one look in to this issue......Thanks in Advance. here is the log msg 2

  • How to add all site activity to site Newsfeed

    Hi, After extensive search and research (and a number of dead ends) I am coming up empty handed on any info re: how to expand the functionality of Newsfeed within Sharepoint. My goal is to create a Newsfeed that includes more activity than just what

  • Notifications are not being sent when Bulk Load is done

    Hi All, I have OIM 11g setup on my machine. I use the bulk load utility for loading the user data. Now in my OIM setup, the notifications are being sent for all stuff like Reset Password. New account creation and other. However when I bulk load the u

  • Airport extreme vs optimum online

    here's the setup: i got my HDTV with my HD tivo box in the living room with a direct line connected to the coaxial cable line that runs in front of the house. using a splitter, i have another coaxial cable connected to my westgate modem. from the mod

  • Pictures leave blank space at bottom of 4x6 paper

    When I print pictures with photosmart C4680 on hp advanced 4x6 photo paper some of the pictures leave a blank space on the paper.  It seems like it starts to print before the paper is loaded the whole way into the printer.  The picture seems to be sl