• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

execandwait - weblogic issue

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

I could finally get the execandwait interceptor to work for a file upload action in my struts2 application.
After the user selects a file and clicks submit, the wait page is displayed and then the success or error page based on the upload result.
Felt very accomplished when all this worked ..... on our development environment(Tomcat server).

However I am now having issues trying to get the same code to work on Weblogic 10.3.
On Weblogic: After I select the file and click submit, the wait page is displayed and after the first refresh I get the nullPointerException(details below)

class java.lang.NullPointerException

Error Message:

Stack Trace:

com.actions.myAction.upload(myAction.java:80)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:57)
java.lang.Thread.run(Thread.java:619)



While debugging, I see that everytime the wait page is refreshed, the control actually goes into myAction class which is not how the execAndWait interceptor is supposed to work (??)

Can anyone please help me with this?
What is the difference in the way the execAndWaitInterceptor works on Tomcat and Weblogic?

Note: Without the execAndWait interceptor, the file upload utility works fine on Weblogic too.


struts.xml
<action name=myAction"
class="myActionClass" method="myMethod">
<interceptor-ref name="completeStack" />
<interceptor-ref name="execAndWait">
<param name="delay">1000</param>
<param name="delaySleepInterval">500</param>
</interceptor-ref>
<result name="wait">/WEB-INF/pages/wait.jsp</result>
<result name="success">/WEB-INF/pages/success.jsp</result>
<result name="input">/WEB-INF/pages/inputPage.jsp</result>

</action>

wait.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="refresh" content="5;url=<s:url includeParams="all" />"/>
</head>
<body>
<h1>Struts 2 execAndWait example</h1>
<h3>Please wait ...</h3>
</body>
</html>

TIA
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please make it clear when posting your question to multiple sites. If the question were answered elsewhere, we don't want our community wasting their time.
BeForthrightWhenCrossPostingToOtherSites

And why would your development environment be different than your production environment? That means you will run into problems on production you couldn't catch in testing (like this one).
 
Mathew Geraldo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, thanks for the reminder.
 
Greenhorn
Posts: 9
Eclipse IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you add this in your interceptor?
<interceptor-ref name="defaultStack">
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
He has this in his struts.xml:
<interceptor-ref name="completeStack" />

which is a declared to be a synonym for the line:
<interceptor-ref name="defaultStack">
in struts-default.xml
 
Mathew Geraldo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am really out of luck and can't get this working. I hope someone out there has a solution. Thank you !
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it works on Tomcat, it should work in Weblogic. Searching for similar problems gets few hits. Since your development environment is different from your production, are you certain you are running the same code in both places?
Try searching the Struts Mailing List. When all else fails, post to the list.
 
Mathew Geraldo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I now have both Tomcat and Weblogic on my local machine. After testing with different browsers, I found that the issue isn't with Weblogic Server alone. It is actually the combination of Internet Explorer (7 & 8) and Weblogic Server. Everything is working fine in Firefox with the same Weblogic Server.

Thank you !
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic