• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compatibility of Spring JDK1.7, Spring and CXF

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We are upgrading from JDK1.5 to JDK1.7. Earlier with JDK1.5 we were using spring 2.0 and cxf 2.0.4. The application was working fine. Now along with JDK I have upgraded Spring to 2.5.3 and cxf 2.6.3. We are using jboss 4.0.3, spring 2.5.3, cxf 2.6.3. After compiling the source code with jdk 1.7, when I am deploying my ear file on JBOSS. I am getting below exception.

2013-09-04 17:07:27,022 org.springframework.web.context.ContextLoader [main] 227 ContextLoader.java ERROR org.springframework.web.context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource' defined in ServletContext resource [/WEB-INF/applicationContext-resources.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cxf' defined in class path resource [META-INF/cxf/cxf.xml]: Cannot resolve reference to bean 'logInbound' while setting bean property 'inInterceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logInbound' defined in ServletContext resource [/WEB-INF/applicationContext-rclWebservices.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut executingErrorManageableMethod
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:755)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:413)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at com.focus.rclcustomer.web.StartupListener.contextInitialized(StartupListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3669)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)
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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5005)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:280)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:88)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:357)

Can anybody advice me which spring jars, cxf jars are compatible with jdk1.7. Why my beans are not getting created.

 
Ranch Hand
Posts: 37
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please post your config (WEB-INF/applicationContext-rclWebservices.xml).

I'm curious why you chose 2.5.3 to upgrade to?
 
Radhika Peddi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michale,

Thanks for responding. Here is my xml file. Since we are using very old Spring version 2.0.4 I don't want to jump straight away to another major version like 3.0.

<?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:jaxws="http://cxf.apache.org/jaxws"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">


<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-jaxws.xml"/>


<!--
<bean id="messageLogger" class="com.focus.rcl.MessageLogger">
<constructor-arg type="java.lang.String" value="soap-messages.log"/>
</bean>
-->
<bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor">
<!--<constructor-arg ref="messageLogger"/>-->
<!--<property name="limit" value="16777216"/>-->
</bean>
<bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor">
<!--<constructor-arg ref="messageLogger"/>-->
<!--<property name="limit" value="16777216"/>-->
</bean>

<bean id="hibernateExport" class="com.focus.rcl.HibernateExportInterceptor">
<property name="sessionFactory" ref="rclSessionFactory">
</property>
</bean>
<bean id="sessionInterceptor" class="com.focus.rcl.UserSessionInterceptor">
<constructor-arg type="java.lang.String" value="pre-invoke"/>
</bean>
<cxf:bus>
<cxf:inInterceptors>
<ref bean="logInbound"/>
<ref bean="sessionInterceptor"/>
</cxf:inInterceptors>
<cxf:outInterceptors>
<ref bean="hibernateExport"/>
<ref bean="logOutbound"/>
</cxf:outInterceptors>
<cxf:inFaultInterceptors>

<ref bean="logOutbound"/>
</cxf:inFaultInterceptors>
</cxf:bus>


<!--WEB SERVICE SECURITY CONFIGURATION GOES HERE-->
<bean id="passwordCallback" class="com.focus.rcl.wssecurity.PasswordCallback">
<property name="rclUserService">
<ref bean="userService"/>
</property>
</bean>

<bean id="wss4jIn" class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken Timestamp"/>
<!--<entry key="passwordType" value="PasswordDigest"/>-->
<entry key="passwordType" value="PasswordText"/>
<entry>
<key>
<value>passwordCallbackRef</value>
</key>
<ref bean="passwordCallback"/>
</entry>
<!--<entry key="signaturePropFile" value="sign.properties"></entry>-->
</map>
</constructor-arg>
</bean>

<!--WEB SERVICE IMPLEMENATION BEANS GO HERE-->

<bean id="wsBase" abstract="true" class="com.focus.rcl.ws.AbstractWebService">
<property name="userDao">
<ref bean="userDao"/>
</property>
</bean>

<bean id="wsUserImpl" class="com.focus.rcl.ws.WsUser" parent="wsBase">
<property name="userService">
<ref bean="userService"/>
</property>
<property name="organizationService">
<ref bean="organizationService"/>
</property>
</bean>

<bean id="wsOrganizationImpl" class="com.focus.rcl.ws.WsOrganization" parent="wsBase">
<property name="organizationService">
<ref bean="organizationService"/>
</property>
</bean>

<tx:advice id="txAdvice" transaction-manager="rclTransactionManager">
<tx:attributes>
<tx:method name="*"/>
<tx:method name="submit*" propagation="NEVER"/>
</tx:attributes>
</tx:advice>

<!--<aop:config>-->
<!--<aop:pointcut id="webServiceOperation" expression="execution(* com.focus.rcl.ws.Ws*.*(..))"/>-->
<!--<aop:advisor advice-ref="txAdvice" pointcut-ref="webServiceOperation"/>-->
<!--</aop:config>-->

<bean id="wsContentManagementImpl" class="com.focus.rcl.ws.WsContentManagement" parent="wsBase">
<property name="contentManagementService">
<ref bean="contentManagementService"/>
</property>
</bean>

<bean id="wsReportImpl" class="com.focus.rcl.ws.WsReport" parent="wsBase">
<property name="reportService">
<ref bean="reportService"/>
</property>
<property name="contentManagementService">
<ref bean="contentManagementService"/>
</property>
</bean>

<bean id="wsSecurityImpl" class="com.focus.rcl.ws.WsSecurity" parent="wsBase">
<property name="passwordCallback">
<ref local="passwordCallback"/>
</property>
</bean>


<!--WEB SERVICE ENDPOINT CONFIGURATION GOES HERE-->
<jaxws:endpoint id="wsUser" implementor="#wsUserImpl" address="@ws.transport@User">
<jaxws:inInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
<ref local="wss4jIn"/>
</jaxws:inInterceptors>
</jaxws:endpoint>

<bean id="localTransportFactory" class="org.apache.cxf.transport.local.LocalTransportFactory" lazy-init="false">
<property name="transportIds">
<list>
<value>http://cxf.apache.org/transports/local</value>;
<value>http://schemas.xmlsoap.org/soap/http</value>;
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>;
</list>
</property>
</bean>

<jaxws:endpoint id="wsContentManagement" implementor="#wsContentManagementImpl"
address="@ws.transport@ContentManagement">
<jaxws:inInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
<ref local="wss4jIn"/>
</jaxws:inInterceptors>
</jaxws:endpoint>

<jaxws:endpoint id="wsReport" implementor="#wsReportImpl" address="/Report">
<jaxws:inInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
<ref local="wss4jIn"/>
</jaxws:inInterceptors>
</jaxws:endpoint>

<jaxws:endpoint id="wsOrganization" implementor="#wsOrganizationImpl" address="@ws.transport@Organization">
<jaxws:inInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
<ref local="wss4jIn"/>
</jaxws:inInterceptors>
</jaxws:endpoint>


<bean id="loginPasswordCallback" class="com.focus.rcl.wssecurity.LookupPasswordCallback">
<property name="rclUserDao">
<ref bean="userDao"/>
</property>
</bean>

<jaxws:endpoint id="wsSecurity" implementor="#wsSecurityImpl" address="@ws.transport@Security">
<jaxws:outInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken Timestamp"/>
<entry key="passwordType" value="PasswordText"/>
<entry>
<key>
<value>passwordCallbackRef</value>
</key>
<ref bean="loginPasswordCallback"/>
</entry>
</map>
</constructor-arg>
</bean>
</jaxws:outInterceptors>
</jaxws:endpoint>

</beans>
 
Michael A Hoffman
Ranch Hand
Posts: 37
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't believe your problem is with JDK 7 as much as an issue with the bean configuration for logInbound:

<bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor">
<!--<constructor-arg ref="messageLogger"/>-->
<!--<property name="limit" value="16777216"/>-->
</bean>

I'm not an AOP expert, but a few posts on the web refer to changing to a newer dependency for the AOP provider, such as AspectJ. Try that for starters.
 
Radhika Peddi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your reply. I am using the same aspectj jars which are bundled with spring2.5.0.

Regards,
Radhika
reply
    Bookmark Topic Watch Topic
  • New Topic