Announcement Announcement Module
Collapse
No announcement yet.
XFire help PLEASE :( Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XFire help PLEASE :(

    Hi Guys,

    I am a total newbie to Spring and XFire, so please when answering be as basic as possible

    When trying to run my code on the server, I get the following message:

    Code:
    20   [main] ERROR org.springframework.web.context.ContextLoader  - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xfire.typeMappingRegistry' defined in class path resource [org/codehaus/xfire/spring/xfire.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: null
    java.lang.NoClassDefFoundError
    	at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.class$(DefaultTypeMappingRegistry.java:62)
    	at  etc etc etc etc 
    Caused by: java.lang.ClassNotFoundException: org.jdom.Element
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:141)
    	... 42 more
    30   [main] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/MAP]  - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xfire.typeMappingRegistry' defined in class path resource [org/codehaus/xfire/spring/xfire.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: null
    java.lang.NoClassDefFoundError
    	at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.class$(DefaultTypeMappingRegistry.java:62)
    	at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.createDefaultMappings(DefaultTypeMappingRegistry.java:397)
    	at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.createDefaultMappings(DefaultTypeMappingRegistry.java:302)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:324)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1093)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1063)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
    	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
    	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:324)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
    Caused by: java.lang.ClassNotFoundException: org.jdom.Element
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:141)
    	... 42 more
    Here are some code snippets:

    Web.xml file:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    
    <web-app>
    
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			classpath:application-context.xml
    			classpath:application-context-dao-resources-oracle.xml
    			classpath:org/codehaus/xfire/spring/xfire.xml
    		</param-value>
    	</context-param>
    
    	<context-param>
    		<param-name>log4jConfigLocation</param-name>
    		<param-value>/WEB-INF/log4j.properties</param-value>
    	</context-param>
    
    	<listener>
    		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    	</listener>
    
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<servlet>
    		<servlet-name>xfire</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    	</servlet>
    
    	<servlet-mapping>
    		<servlet-name>xfire</servlet-name>
    		<url-pattern>/*</url-pattern>
    	</servlet-mapping>
    
    </web-app>
    xfire-servlet.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
    	<bean id="networkDataBean"
    		class="com.company.map.impl.NetworkDataWSSoapBindingImpl">
    	</bean>
    
    	<bean
    		class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="urlMap">
    			<map>
    				<entry key="/NetworkDataService">
    					<ref bean="networkData" />
    				</entry>
    			</map>
    		</property>
    	</bean>
    
    	<!-- Declare a parent bean with all properties common to both services -->
    	<bean id="networkData"
    		class="org.codehaus.xfire.spring.remoting.XFireExporter">
    		<property name="serviceFactory">
    			<ref bean="xfire.serviceFactory" />
    		</property>
    		<property name="xfire">
    			<ref bean="xfire" />
    		</property>
    		<property name="serviceBean">
    			<ref bean="networkDataBean" />
    		</property>
    		<property name="serviceClass">
    			<value>
    				com.company.map.services.NetworkDataWS
    			</value>
    		</property>
    	</bean>
    
    </beans>
    The NetworkDataWS is the interface, and NetworkDataWSSoapBindingImpl is the implementation of the interface.

    Any one see what I am doing wrong, and why I am getting that particular no class def error? Also, do I have to provide my own Aegis bindings, or does Xfire do that for me? Thanks so much in advance!!

  • #2
    Well,

    Seems to me your exception message tells you JDom.jar is not on your classpath. I would try fixing that first.

    Regards,
    Leo

    Comment

    Working...
    X