1 2 Previous Next 17 Replies Latest reply on Feb 18, 2009 8:45 AM by jaikiran

    unifiedClassLoader jboss5

      how can i make UnifiedClassLoader as default classloader and the only laoder used by everything.

        • 1. Re: unifiedClassLoader jboss5
          alesj

          See CL deployers in deployers.xml.

          • 2. Re: unifiedClassLoader jboss5

            sir i checked it but thr is no condiguration for UnifiedClassLoader. in 4.0.2 it used to work with this setting

            <property name="useJBossWebLoader">true</property>


            now it seems that something extra is required. i debugged code and found out that org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader is being used.
            can u shed some light or put me on the right track.

            thanks

            • 3. Re: unifiedClassLoader jboss5

              do i need to change something in this configuration :

              deployers.xml:

              <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
               <property name="classLoading"><inject bean="ClassLoading"/></property>
               <property name="system"><inject bean="ClassLoaderSystem"/></property>
               </bean>


              <!--
              The core classloading system
              -->




              classloader.xml:

              <!--
               The classloader implementation
               -->
               <bean name="ClassLoaderSystem" class="org.jboss.classloader.spi.ClassLoaderSystem">
               <classloader><null/></classloader>
               <constructor factoryClass="org.jboss.classloader.spi.ClassLoaderSystem" factoryMethod="getInstance"/>
               </bean>
              
               <!--
               ClassLoader management and resolution
               -->
               <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
               <classloader><null/></classloader>
               <incallback method="addModule" state="Configured"/>
               <uncallback method="removeModule" state="Configured"/>
               </bean>
              
               <classloader name="bootstrap-classloader" xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY" import-all="true">
               <!-- System -->
               <root>${jboss.lib.url}jboss-system.jar</root>
               </classloader>
              
              </deployment>


              how do i set classloadersystem to use UnifiedClassLoader.
              kindly help

              thanks

              • 4. Re: unifiedClassLoader jboss5
                alesj

                UCL is no longer used.
                What exactly are you trying to do?
                Just saying "I wanna UCL" doesn't tell me anything. ;-)

                • 5. Re: unifiedClassLoader jboss5

                  ok. here is wat i want. my application was working on 4.0.2 earlier and UCL was used for loading everything. Now in jboss5 i can see different class loaders for everything like WebCtxLoader, NoAnnotationURLClassLoader,.... didnt check more. now my spring context file resides at root of a jar kept inside a sar. i try to access it by using ClassPathXmlApplicationContext. here jboss fails with FileNotFoundException.
                  so all i want is jboss5 class loader to b configured like it was in jboss4.0.2 UCL :)
                  is it possible

                  • 6. Re: unifiedClassLoader jboss5

                     

                    13:19:45,117 ERROR [ChannelDeployer] Failed to register channels from /com/nubridges/channels/channels-truExchange.xml (org.springframework.beans.factory.BeanDefinitionStoreException;org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [CoreFramework-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [CoreFramework-context.xml] cannot be opened because it does not exist)
                    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [CoreFramework-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [CoreFramework-context.xml] cannot be opened because it does not exist
                    java.io.FileNotFoundException: class path resource [CoreFramework-context.xml] cannot be opened because it does not exist
                     at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:137)
                     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:167)
                     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
                     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
                     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
                     at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
                     at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:81)
                     at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
                     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:269)
                     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
                     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
                     at com.nubridges.framework.ApplicationContextFactory.initializeBeanFactory(ApplicationContextFactory.java:55)
                     at com.nubridges.framework.ApplicationContextFactory.getBeanFactory(ApplicationContextFactory.java:41)
                     at com.nubridges.uportal.ChannelUtils.getSecurityService(ChannelUtils.java:385)
                     at com.nubridges.uportal.ChannelUtils.editChannel(ChannelUtils.java:171)
                     at com.nubridges.deployment.deployer.ChannelDeployer.registerChannels(ChannelDeployer.java:142)
                     at com.nubridges.deployment.deployer.ChannelDeployer.handleNotification2(ChannelDeployer.java:97)
                     at org.jboss.system.ListenerServiceMBeanSupport.handleNotification(ListenerServiceMBeanSupport.java:419)
                     at sun.reflect.GeneratedMethodAccessor240.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
                     at $Proxy93.handleNotification(Unknown Source)
                     at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:221)
                     at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:184)
                     at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:425)
                     at org.jboss.Main.boot(Main.java:209)
                     at org.jboss.Main$1.run(Main.java:547)
                     at java.lang.Thread.run(Thread.java:595)


                    • 7. Re: unifiedClassLoader jboss5
                      alesj

                       

                      "abhinav.ind" wrote:

                      so all i want is jboss5 class loader to b configured like it was in jboss4.0.2 UCL :)

                      This is already true.


                      • 8. Re: unifiedClassLoader jboss5
                        alesj

                        You should search the forums better instead of bluntly saying "I need UCL".
                        As you're wasting your time and mine with this.

                        Looking at the exception this has absolutely nothing to do with UCL. Or even CL for that matter.
                        This is probably an issue of this:
                        - http://jira.springframework.org/browse/SPR-5120

                        • 9. Re: unifiedClassLoader jboss5

                          i dont think this is spring issue. as there is a listner mbean which is invoked while server is starting. now that mbean requires spring context file to use some service API. the classLoader here is NoAnnotationURLClassLoader which fails to find the context file. when server is started n i access application url, it again loads my context file using WebCtxLoader which succeeds in finding context file. n i am able to login into the application after authentication by security API. so definitely its a classLoader problem n not related to spring.
                          wat do u say?

                          • 10. Re: unifiedClassLoader jboss5

                             

                            "alesj" wrote:
                            You should search the forums better instead of bluntly saying "I need UCL".


                            i did that, its not like i faced some problem n i straight away created a thread in this forum :)

                            • 11. Re: unifiedClassLoader jboss5
                              alesj

                               

                              "abhinav.ind" wrote:
                              so definitely its a classLoader problem n not related to spring.
                              wat do u say?

                              I think you're right. :-)
                              But that doesn't mean UCL is the solution. ;-)

                              How do you control the CL that gets used there?
                              As it seems to me you're relying on TCL,
                              which looks like its the right one - the one from AbstractServerImpl.
                              Or should/did our jmx listener/notification impl switch CL in-between?


                              • 12. Re: unifiedClassLoader jboss5

                                i just saw that AbstractServerImpl is loaded by NoAnnotationURLClassLoader which continues to b the classloader till the server is started. so is thr any way to change it so that i can load my context file while server is in booting process.

                                • 13. Re: unifiedClassLoader jboss5

                                  u r tight that UCL is not the solution. i was luking for UCL as i told u in earlier version we were using UCL which was wroking fine. pls help as i m stuck at this prob for 2 days now.

                                  • 14. Re: unifiedClassLoader jboss5
                                    alesj

                                    Perhaps change the TCL in ChannelUtils with the CL that loaded ChannelUtils.
                                    You need to push in the right CL, the one that would know how to find that file.

                                    1 2 Previous Next