3 Replies Latest reply on Mar 8, 2004 4:29 AM by gsureshbabu

    No ClassLoaders found

    bwinspur

      Hi, I am trying to initialize the servlet context by dynamically instantiating
      a servlet-specific object, but am having problems with dynamically
      loading class com.wynnon.commandTunnel.LoopbackAdaptor, which resides in
      WEB-INF/classes/. Initially I used the statement:

      srvrClass = Class.forName(fqn);

      which threw
      java.lang.ClassNotFoundException: No ClassLoaders found for: com.wynnon.commandTunnel.LoopbackAdaptor

      Then, after reading through the JBoss JMX Implementation Architecture
      chapter of the 3.2.3 book, I tried to load the class using the servlet's
      classloader, i.e.
      srvrClass = this.getClass().getClassLoader().loadClass(fqn);
      

      assuming that I would be supplying the missing classloader, perhaps WARLoader.
      However, I got exactly the same exception: ... No Classloaders Found...

      Questions
      ---------
      1. What does the exception mean?

      2. Is there a way to associate a class loader with a class that
      does not have one, before one attempts to load the class ?

      3. Is this a jboss or a tomcat issue ?

      4. Can anyone direct me to an example of dynamic instantiation
      in the jboss/tomcat servlet environment?

      Thanks for your attention,

      Bill.



        • 1. Re: No ClassLoaders found

          What version of JBoss are you running? What does your jboss-web.sar/META-INF/jboss-service.xml settings look like? Did you try the thread context classloader?

          • 2. Re: No ClassLoaders found
            bwinspur

            juha, thanks for the reply,

            1. I'm running jboss 3.2.3

            2. I'm assuming that jboss-web.sar/META-INF/jboss-service.xml
            you ask about, corresponds to
            jboss-3.2.3/server/default/deploy/jbossweb-tomcat41.sar, in
            which case its META-INF/jboss-service.xml looks like below.

            3. I just tried using the thread context classloader, and it
            worked! My class loaded and instantiated.

            Thanks a bunch, I'm new to jboss and the level of response is
            as impressive as the implementation. I'll study the jvm spec
            etc. to get a better understanding of defining and initiating
            class loaders, quite new to me. Thanks again.

            Bill.
            =============================================================

            <?xml version="1.0" encoding="UTF-8" ?>
            - <!-- The service configuration for the embedded Tomcat4.1.x web container

            -->
            -
            -
            - <!--
            Get the flag indicating if the normal Java2 parent first class
            loading model should be used over the servlet 2.3 web container first
            model.


            -->
            true
            true
            - <!--
            A flag indicating if the JBoss Loader should be used. This loader
            uses a unified class loader as the class loader rather than the tomcat
            specific class loader.


            -->
            true
            - <!--
            The name of the request attribute under with the authenticated JAAS
            Subject is stored on successful authentication. If null or empty then
            the Subject will not be stored.


            -->
            j_subject
            - <!--
            *******************************************************
            ****************** CLUSTERING *************************
            *******************************************************
            In order to activate HTTP Session clustering for Tomcat
            make sure you run JBoss's "all" configuration i.e.
            "run -c all"
            (the default configuration doesn't contain clustering)

            Furthermore, you may change SnapshotMode and
            SnapshotInterval attributes below to indicate when to
            synchronize changes with the other node(s).

            If you use Apache+mod_jk(2) you will most probably use
            the AJP1.3 connector below. Thus, if you so wish,
            you may comment (i.e. deactivate) the HTTP connector
            as it won't be used anymore.

            *******************************************************
            *******************************************************
            *******************************************************


            -->
            - <!--
            If you are using clustering, the following two attributes
            define when the sessions are replicated to the other nodes.
            The default value, "instant", synchronously replicates changes
            to the other nodes. In this case, the "SnapshotInterval" attribute
            is not used.
            The "interval" mode, in association with the "SnapshotInterval"
            attribute, indicates that Tomcat will only replicates modified
            sessions every "SnapshotInterval" miliseconds at most.


            -->
            instant
            - <!-- you may switch to "interval"
            -->
            2000
            -
            -
            -
            -

            -
            - <!-- Access logger
            -->

            - <!--
            This valve clears any caller identity set by the realm
            and provides access to the realm about the existence of an
            authenticated caller to allow a web app to run with a realm
            that support unauthenticated identities. It also establishes
            any run-as principal for the servlet being accessed.


            -->

            - <!-- Default context parameters
            -->



            - <!-- A HTTP/1.1 Connector on port 8080
            -->

            - <!-- A AJP 1.3 Connector on port 8009
            -->

            - <!--
            SSL/TLS Connector configuration using the SSL domain keystore





            -->



            jboss:service=TransactionManager

            • 3. Re: No ClassLoaders found
              gsureshbabu

              hi all
              i have been trying to establish clustering with jboss-3.2.3 with two nodes.
              1.which properties i have to chnage in the jboss-service.xml in the
              jboss-3.2.3/server/default/deploy/jbossweb-tomcat41.sar/META-INF/jboss-service.xml
              for clustering.
              2. where we will store workers.properties in jboss-3.2.3. for mod_jk+apache
              Kindly help me (Urgent)

              Thanks
              suresh