Hi all,
I am new to webservices.
I am trying out a webservice based on a ejb in an environment that uses the
latest versions of Spring 2.x, xfire 1.2.5, weblogic 9.2x, Maven 2.0.5,
eclipse 3.2.2
The deployment of the EAR works fine in weblogic.
I have few questions:
1) In the weblogic console, in the deployed ear, I see ejb and web modules
but webservices folder is empty???
2) When I try to test the deployed web application, I get the following
exception on the console. I wonder what is wrong? Attached below are the
web, spring config file for xfire.
The exception trace is as follows:
ERROR .remoting.Jsr181HandlerMapping - Failed to get the User Target Class
of bean xzzStatelessSession
java.lang.NullPointerException
at
org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping.processBeans(Jsr181HandlerMapping.java:112)
at
org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping.initApplicationContext(Jsr181HandlerMapping.java:63)
at
org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:86)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:304)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1106)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:311)
at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:258)
at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:229)
at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:115)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:276)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at
weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:68)
at
weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at
weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:235)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3214)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
#######################################################################
The web.xml , xfireService-servlet.xml (Spring config file for xfire) and
the changes in the weblogic.xml are as follows:
Web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>xfireService</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/ xfireService-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet-mapping>
<servlet-name> xfireService </servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
xfireService-servlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
<bean id="webAnnotations"
class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/>
<bean id="handlerMapping"
class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping">
<property name="typeMappingRegistry"
ref="xfire.typeMappingRegistry"/>
<property name="xfire" ref="xfire"/>
<property name="webAnnotations" ref="webAnnotations"/>
</bean>
<bean
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/">
<ref bean="handlerMapping" />
</entry>
<entry key="/xfireService">
<ref bean="xzzSoapExporter" />
</entry>
</map>
</property>
</bean>
<bean id="xzzStatelessSession"
class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
<property name="jndiName">
<value>ejb/xxx/xxx/xxx/xxx/xxxSession</value>
</property>
<property name="jndiEnvironment">
<props>
<prop
key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
</props>
</property>
<property name="resourceRef">
<!-- <value>true</value>-->
<value>false</value>
</property>
<property name="lookupHomeOnStartup">
<value>false</value>
</property>
<property name="businessInterface">
<value>xxx.xxx.xxx.xxx.xxx.XyzInterface</value>
</property>
</bean>
<bean name="xzzSoapExporter"
class="org.codehaus.xfire.spring.remoting.XFireExporter">
<!-- the XFire bean is wired up in the xfire.xml file you've
linked in
earlier -->
<property name="serviceFactory">
<ref bean="xfire.serviceFactory" />
</property>
<property name="xfire" ref="xfire" />
<property name="serviceBean">
<ref bean="xzzStatelessSession" />
</property>
<property name="serviceInterface">
<value> xxx.xxx.xxx.xxx.xxx.XyzInterface </value>
</property>
</bean>
</beans>
Added the following in weblogic-application.xml:
<prefer-application-packages>
<package-name>javax.jws.*</package-name>
</prefer-application-packages>
--
View this message in context:
http://www.nabble.com/xfire-error-using-ejb-ass-web-service.-tf3573759.html#a9986057
Sent from the XFire - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email