Back Forum Reply New

newbie question

.uclClassLoader.findClass#40;uclClassLoader.java#58;240#41;
at com.ibm.ws.bootstrap.ExtClassLoader.findClass#40;ExtClassLoader.java#58;38#41;
at java.lang.ClassLoader.loadClass#40;ClassLoader.java#58;516#41;
at java.lang.ClassLoader.loadClass#40;ClassLoader.java#58;448#41;
at java.lang.Class.forName0#40;Native Method#41;
at java.lang.Class.forName#40;Class.java#58;220#41;
at org..util.ClassUtils.forName#40;ClassUtils.java#58;84#41;
at org..beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition#40;BeanDefinitionReaderUtils.java#58;61#41;
at org..beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement#40;DefaultXmlBeanDefinitionParser.java#58;331#41;
at org..beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement#40;DefaultXmlBeanDefinitionParser.java#58;299#41;
at org..beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions#40;DefaultXmlBeanDefinitionParser.java#58;236#41;
at org..beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions#40;DefaultXmlBeanDefinitionParser.java#58;185#41;
at org..beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions#40;XmlBeanDefinitionReader.java#58;188#41;
at org..beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions#40;XmlBeanDefinitionReader.java#58;146#41;
at org..beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions#40;AbstractBeanDefinitionReader.java#58;99#41;
at org..web.context.support.XmlWebApplicationContext.loadBeanDefinitions#40;XmlWebApplicationContext.java#58;114#41;
at org..web.context.support.XmlWebApplicationContext.loadBeanDefinitions#40;XmlWebApplicationContext.java#58;82#41;
at org..context.support.AbstractRefreshableApplicationContext.refreshBeanFactory#40;AbstractRefreshableApplicationContext.java#58;87#41;
at org..context.support.AbstractApplicationContext.refresh#40;AbstractApplicationContext.java#58;264#41;
at org..web.context.support.AbstractRefreshableWebApplicationContext.refresh#40;AbstractRefreshableWebApplicationContext.java#58;131#41;
at org..web.context.ContextLoader.createWebApplicationContext#40;ContextLoader.java#58;230#41;
at org..web.context.ContextLoader.initWebApplicationContext#40;ContextLoader.java#58;156#41;
at org..web.context.ContextLoaderListener.contextInitialized#40;ContextLoaderListener.java#58;48#41;
at com.ibm.ws.webcontainer.srt.WebGroup.notifyServletContextCreated#40;WebGroup.java#58;1358#41;
at com.ibm.ws.webcontainer.srt.WebGroup.init#40;WebGroup.java#58;240#41;
at com.ibm.ws.webcontainer.WebContainer.addWebApplication#40;WebContainer.java#58;950#41;
at com.ibm.ws.runtime.component.WebContainerImpl.install#40;WebContainerImpl.java#58;133#41;
at com.ibm.ws.runtime.component.WebContainerImpl.start#40;WebContainerImpl.java#58;360#41;
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start#40;ApplicationMgrImpl.java#58;401#41;
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart#40;DeployedApplicationImpl.java#58;743#41;
at com.ibm.ws.runtime.component.DeployedModuleImpl.start#40;DeployedModuleImpl.java#58;337#41;
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start#40;DeployedApplicationImpl.java#58;531#41;
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication#40;ApplicationMgrImpl.java#58;254#41;
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start#40;ApplicationMgrImpl.java#58;232#41;
at com.ibm.ws.runtime.component.ContainerImpl.startComponents#40;ContainerImpl.java#58;343#41;
at com.ibm.ws.runtime.component.ContainerImpl.start#40;ContainerImpl.java#58;234#41;
at com.ibm.ws.runtime.component.ApplicationServerImpl.start#40;ApplicationServerImpl.java#58;117#41;
at com.ibm.ws.runtime.component.ContainerImpl.startComponents#40;ContainerImpl.java#58;343#41;
at com.ibm.ws.runtime.component.ContainerImpl.start#40;ContainerImpl.java#58;234#41;
at com.ibm.ws.runtime.component.ServerImpl.start#40;ServerImpl.java#58;182#41;
at com.ibm.ws.runtime.WsServer.start#40;WsServer.java#58;135#41;
at com.ibm.ws.runtime.WsServer.main#40;WsServer.java#58;232#41;
at java.lang.reflect.Method.invoke#40;Native Method#41;
at com.ibm.ws.bootstrap.WSLauncher.main#40;WSLauncher.java#58;94#41;
at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run#40;ServerRunnerV5.java#58;97#41;
Also, i've tried to find the clas by name Class.forName(quot;test.BeanTestquot;); and it works so the class is there...

The same code runs fine as stand-alone java app:

Code: BeanFactory beanFactory = new FileSystemXmlApplicationContext#40;quot;applicationContext.xmlquot;#41;; BeanTest bt = #40;BeanTest#41; beanFactory.getBean#40;quot;myBeanquot;#41;;
System.out.println#40;bt.getField#40;#41;#41;;
Well... Thanks!

i am using spring 1.2 RC2

I know its a twisted view, but WSAD test environment might call the listener before loading web application classes so it couldnt access test.BeanTest class. Anyone knows if is that possible? Any way to correct it?

I've run a dumb test configuring a String instead my bean and it does the right thing...

Code:
lt;beansgt;
lt;bean id=quot;myBeanquot; class=quot;java.lang.Stringquot;gt;
lt;constructor-arggt;lt;valuegt;myValuelt;/valuegt;lt;/constructor-arggt;
lt;/beangt;
lt;/beansgt;well...

the class is available when the ContextListener performs the configuration load process: i've coded ny BeanTest as a listener and executed it before spring's one so it's loaded at least in the same name space.

What is wrong?

I think I know the answer to this. I read it from Spring in Action this morning. It seems that WebSphere 5.x does not initialise listeners before servlets. Try something like this instead:Code:
lt;servletgt; lt;servlet-namegt;contextlt;/servlet-namegt; lt;servlet-classgt;org..web.context.ContextLoaderServletlt;/servlet-classgt; lt;load-on-startupgt;1lt;/load-on-startupgt;
lt;/servletgt;It worked...

I've got that book at univerity but couldn't find anything!

Thanks

Glad to help. I've got the eBook (or Digital Edition as is it now) - useful for searching in. Page 274 if you're interested.

Cheers
¥
Back Forum Reply New