Announcement Announcement Module
Collapse
No announcement yet.
Problem in migrating app from Tomcat6.0 to Wepsphere7.0 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in migrating app from Tomcat6.0 to Wepsphere7.0

    Hi All,
    My application is of Struts2+spring+hibernate.

    I am at the initial stage of development. Initially a simple POC type module was done with tomcat v6.0 server.
    I tried to migrate it to Webpshere 7.0.
    I am able to deploy the application and see the home page

    strut actions are working fine in the default singleton scope. but throws error in the request or session scope. My validations need only request scope.

    the error trace is :

    [5/31/10 13:08:45:179 EDT] 00000023 webapp E com.ibm.ws.webcontainer.webapp.WebApp logError SRVE0293E: [Servlet Error]-[Unable to instantiate Action, transHistoryAction, defined for 'loadTrace' in namespace '/TransTrace'Error creating bean with name 'transHistoryAction': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: Unable to instantiate Action, transHistoryAction, defined for 'loadTrace' in namespace '/TransTrace'Error creating bean with name 'transHistoryAction': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
    at com.ibm.ws.webcontainer.webapp.WebAppDispatcherCon text.sendError(WebAppDispatcherContext.java:624)
    at com.ibm.ws.webcontainer.srt.SRTServletResponse.sen dError(SRTServletResponse.java:1071)
    at org.apache.struts2.dispatcher.Dispatcher.sendError (Dispatcher.java:770)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAc tion(Dispatcher.java:505)
    at org.apache.struts2.dispatcher.FilterDispatcher.doF ilter(FilterDispatcher.java:395)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:188)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:116)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._ doFilter(WebAppFilterChain.java:77)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager .doFilter(WebAppFilterManager.java:852)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager .invokeFilters(WebAppFilterManager.java:917)
    at com.ibm.ws.webcontainer.extension.DefaultExtension Processor.invokeFilters(DefaultExtensionProcessor. java:924)
    at com.ibm.ws.webcontainer.extension.DefaultExtension Processor.handleRequest(DefaultExtensionProcessor. java:852)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3610)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:274)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:926)
    at com.ibm.ws.webcontainer.WSWebContainer.handleReque st(WSWebContainer.java:1557)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:173)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:455)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java:384)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCa llback.complete(HttpICLReadCallback.java:83)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe ner.futureCompleted(AioReadCompletionListener.java :165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac k(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletion Actions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture .java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHand ler.java:202)
    at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:766)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler .java:896)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1527)



    My application context.xml is

    <?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:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-3.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schem...ontext-3.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
    <bean
    class="org.springframework.orm.jpa.support.Persist enceAnnotationBeanPostProcessor" />
    <bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="location" value="WEB-INF/jdbc.properties" />
    </bean>
    <bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
    <property name="driverClassName" value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    </bean>
    <bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerE ntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="jpaVendorAdapter">
    <bean class="org.springframework.orm.jpa.vendor.Hibernat eJpaVendorAdapter">
    <property name="database" value="ORACLE" />
    <property name="showSql" value="true" />
    </bean>
    </property>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionM anager">
    <property name="entityManagerFactory" ref="entityManagerFactory"></property>
    </bean>
    <tx:annotation-driven transaction-manager="transactionManager" />
    <aop:aspectj-autoproxy />
    <bean id="serviceToolDao" class="com.wellpoint.servicetool.dao.ServiceToolDa oImpl"/>
    <bean id="transHistoryService" class="com.wellpoint.servicetool.service.TransHist oryServiceImpl" >
    <property name = "serviceToolDao" ref = "serviceToolDao"></property>
    </bean>
    <bean name="transHistoryAction" class="com.wellpoint.servicetool.action.TransHisto ryAction" scope="request">
    <constructor-arg ref="transHistoryService"/>
    </bean>
    <bean id="transSubmissionService" class="com.wellpoint.servicetool.service.TransSubm issionServiceImpl" >
    <property name = "serviceToolDao" ref = "serviceToolDao"></property>
    </bean>
    <bean name="transSubmissionAction" class="com.wellpoint.servicetool.action.TransSubmi ssionAction">
    <constructor-arg ref="transSubmissionService"/>
    </bean>

    </beans>

  • #2
    struts.xml is:

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <constant name="struts.objectFactory" value="spring" />
    <constant name="struts.devMode" value="false" />
    <package name="TransTrace" namespace="/TransTrace" extends="struts-default">
    <result-types>
    <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
    </result-types>
    <action name="home">
    <result type="tiles">/home.tiles</result>
    </action>
    <action name="loadTrace" method="getTransTraceFilters" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods"> getTransTraceFilters</param>
    </interceptor-ref>
    <result type="tiles">/transTrace.tiles</result>
    </action>
    <action name="submitTrace" method="getFilteredTransactions" class="transHistoryAction">
    <interceptor-ref name="store">
    <param name="operationMode">STORE</param>
    </interceptor-ref>
    <interceptor-ref name="defaultStack" />
    <result name="success" type="tiles">/tranSelection.tiles</result>
    <result name="input" type="redirect">/TransTrace/loadTrace.action</result>
    </action>
    <action name="retrieveTrace" method="getTransactionDetail" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">getTransactionDet ail</param>
    </interceptor-ref>
    <result type="tiles">/transDetail.tiles</result>
    </action>
    <action name="retrieveX12Request" method="getX12RequestMessage" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">getX12RequestMess age</param>
    </interceptor-ref>
    <result >/pages/TransMessageDetailView.jsp</result>
    </action>
    <action name="retrieveX12Response" method="getX12ResponseMessage" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">getX12ResponseMes sage</param>
    </interceptor-ref>
    <result >/pages/TransMessageDetailView.jsp</result>
    </action>
    <action name="retrieveXmlRequest" method="getXmlRequestMessage" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">getXmlRequestMess age</param>
    </interceptor-ref>
    <result>/pages/TransMessageDetailView.jsp</result>
    </action>
    <action name="retrieveXmlResponse" method="getXmlReplyMessage" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">getXmlReplyMessag e</param>
    </interceptor-ref>
    <result>/pages/TransMessageDetailView.jsp</result>
    </action>
    <action name="retrievePitchRequest" method="getX12RequestMessage" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">getX12RequestMess age</param>
    </interceptor-ref>
    <result>/pages/TransMessageDetailView.jsp</result>
    </action>
    <action name="retrievePitchResponse" method="getX12ResponseMessage" class="transHistoryAction">
    <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">getX12ResponseMes sage</param>
    </interceptor-ref>
    <result>/pages/TransMessageDetailView.jsp</result>
    </action>
    <action name="loadSubmissionFilters" method="getTransSubmissionFilters" class="transSubmissionAction">
    <result type="tiles">/transSubmission.tiles</result>
    </action>
    <action name = "MessageSelection" method = "getDefaultMessage" class = "transSubmissionAction">
    <result type="tiles">/transMessageSubmission.tiles</result>
    </action>
    <action name = "MessageSubmission" method = "getReplyMesssage" class = "transSubmissionAction">
    <result type="tiles">/transMessageReply.tiles</result>
    </action>
    </package>
    </struts>




    my web.xml is:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" 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">
    <display-name>ServiceToolRewrite</display-name>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <context-param>
    <param-name>tilesDefinitions</param-name>
    <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatch er</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>
    <listener>
    <listener-class>
    org.springframework.web.context.request.RequestCon textListener</listener-class>
    </listener>
    <listener>
    <listener-class>org.apache.struts2.tiles.StrutsTilesListener </listener-class>
    </listener>
    <welcome-file-list>
    <welcome-file>/pages/index.jsp</welcome-file>
    </welcome-file-list>
    </web-app>



    eveything works fine if i change the scope of transHistoryAction to default.
    but i want it to be request. I am newbie to this.
    thanks for your help in advance.

    Comment


    • #3
      Issue with Migrating App from Tomcat60 to Websphere 70

      Hi
      I am also facing same while working on application developed in Struts2.

      Its developed against Tomcat and I am trying to deploy in WAS70 and facing following error message

      [6/17/10 18:35:59:796 GMT+05:30] 00000033 SystemOut O i am in roledetailsaction
      [6/17/10 18:35:59:921 GMT+05:30] 00000033 webapp E com.ibm.ws.webcontainer.webapp.WebApp logError SRVE0293E: [Servlet Error]-[null]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport:
      at com.ibm.ws.webcontainer.webapp.WebAppDispatcherCon text.sendError(WebAppDispatcherContext.java:636)
      at com.ibm.ws.webcontainer.srt.SRTServletResponse.sen dError(SRTServletResponse.java:1164)
      at org.apache.struts2.dispatcher.Dispatcher.sendError (Dispatcher.java:725)
      at org.apache.struts2.dispatcher.Dispatcher.serviceAc tion(Dispatcher.java:485)
      at org.apache.struts2.dispatcher.ng.ExecuteOperations .executeAction(ExecuteOperations.java:77)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrep areAndExecuteFilter.doFilter(StrutsPrepareAndExecu teFilter.java:76)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:188)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:116)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._ doFilter(WebAppFilterChain.java:77)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager .doFilter(WebAppFilterManager.java:858)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager .invokeFilters(WebAppFilterManager.java:936)
      at com.ibm.ws.webcontainer.extension.DefaultExtension Processor.invokeFilters(DefaultExtensionProcessor. java:985)
      at com.ibm.ws.webcontainer.extension.DefaultExtension Processor.handleRequest(DefaultExtensionProcessor. java:893)
      at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3742)
      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:276)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:929)
      at com.ibm.ws.webcontainer.WSWebContainer.handleReque st(WSWebContainer.java:1583)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:178)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:455)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java:384)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCa llback.complete(HttpICLReadCallback.java:83)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe ner.futureCompleted(AioReadCompletionListener.java :165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac k(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletion Actions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture .java:138)
      at com.ibm.io.async.ResultHandler.complete(ResultHand ler.java:204)
      at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:775)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler .java:905)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1550)


      As this is matching with your error message as well
      are you able solve this issue
      Its urgent let me know ASAP.

      Comment

      Working...
      X