• 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

Integrating Struts2 with BEA Weblogic10

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

I am trying a "Hello World" example using Struts2 with Weblogic 10 server, but running into issues. I have followed the correct procedures and have the correct directory structure. I have cross-verified with multiple sites.

But, I am getting 2 Errors while starting the managed weblogic server..not sure if they are inter-related

My first error in the server log file is
<Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:61
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)

- My web.xml entry is
><filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>

The second error in the stack is -
Action class [/HelloWorldAction] not found - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:61
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:355)

Now, I have setup the classpaths correctly by modifying the server startup scripts to load the necessary jars for Struts2...I have placed the jars in the lib folder under webapp\WEB-INF\....but nothing seems to work.

This seems to be specific to Weblogic. Has anybody run into this issue or any ideas on how to resolve them?

Thanks for your help.
 
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

blore boy wrote:Now, I have setup the classpaths correctly by modifying the server startup scripts to load the necessary jars for Struts2..



The server should not have Struts in its classpath. The correct way to load Struts is to put them in the WEB-INF/lib directory and let the application classloader discover them. If the same classes are in the server classpath the application will not load correctly.
 
Anurag Swaym
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the tip Joe.

But, I initially started out that setup..where-in all the jars were under WEB-INF/lib folder. Because of the error, I started making changes to the classpath and went down that path.

After your suggestion, I have again reverted back to the original configurstion, but still get the

<Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60

and later unable to find the action error

Action class [HelloWorldAction] not found - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)>
 
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
It looks like you aren't the only one with this problem.
Can you deploy the example applications that come with Struts 2?
If you can, then compare the WEB-INF/lib directory of your app with the blank example application.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a full stack trace? Have you pinged WebLogic support to see if there's a server setting to help get it to work?
 
Anurag Swaym
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying the empty HelloWorld application using Struts2. I have Struts1 successfully deployed on Weblogic. I have successfully done struts2 using Tomcat with the same folder structure. I identified 2 different exceptions.

The complete stack traces for Exception 1 is:

<Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:320)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:88)
at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:57)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1725)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

Stack trace for exception 2 is
Action class [HelloWorldAction] not found - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:355)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:265)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:189)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:320)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:88)
at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:57)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1725)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
>
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405) - I decompiled XmlConfigurationProvider class. The verifyAction() method has an "URI" as its input parameter and uses the class loader returns a boolean if the action class is present at that location. I verified that the class is present at the specified location in the staging area.

Someone suggested it might be a security/firewall issue. I have turned off all firewall on my computer.

So, not sure whats happening.
 
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

David Newton wrote:Have you pinged WebLogic support to see if there's a server setting to help get it to work?



I'm running Weblogic Server 10.3 here and I'm not aware of any problems with Struts 2 or settings that would fix this problem.
Speaking of which, are you running 10 or 10.3? There were some weird classpath issues with WLS 10. It appeared that the application classpath would not override the server classpath if I recall correctly. A Struts 1 app I maintain would not run under 10 but runs fine under 10.3. I don't know if the service packs available fix that problem.
 
Anurag Swaym
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying back Joe.

Thanks David for the tip on pinging Weblogic support. I have not yet pinged weblogic support regarding this issue. I will do it next.

I am currently using Weblogic version10.0.

 
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
Weblogic Server 10 known and resolved issues
There are none identified concerning Struts.
Have you tried deploying the example applications?
 
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
I was able to reproduce your problem under WLS 10.3. An application I wrote for Tomcat displays the same behavior you see:


I went into the Struts code and added a println in StrutsXmlConfigurationProvider to see which file is being reloaded: struts-default.xml
I checked the Struts Core jar file and struts-default.xml is in the correct place. As a matter of fact, I think it has to be read at least once to get the framework to the point it fails (hence the call to &quot;reload&quot;).
I spent way too much time trying to figure out the difference between the example apps and my app. It pretty much boils down to one line in struts.xml:



If the value of this line is &quot;true&quot;, the problem occurs. If the value is &quot;false&quot;, the problem does not.
It's a pretty trivial change. Give it a try.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, right; I *knew* I'd seen this:

XWork JIRA ticket
S2 ticket (marked dupe)

Dave
 
Anurag Swaym
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Allright...I have some closure on this issue.

The issue is related Weblogic 10.0. As Joe mentioned some classpath issues. I thought I had successfully tested struts1.x on Weblogic 10.0, but I was wrong. When I tried struts 1.x, I kept getting variations of FormBean "not found" or "null" errors.

Thanks to Joe Ess suggestion, I upgraded to Weblogic 10.3 and I immediately achieved successful results for both struts1.3 and struts2.0 version without any changes to the existing WAR.

I had a question regarding moving from 10.0 to 10.3. Is it better to upgrade or to completely uninstall 10.0 and then start on 10.3. I have just started building a webapp and do not want to run into issues later.

Thanks Joe and David for your help and suggestions.
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This solution worked for me on Weblogic 9.2 with STRUTS 2...Thanks

If the value of this line is &quot;true&quot;, the problem occurs. If the value is &quot;false&quot;, the problem does not.

Joe Ess wrote:
I spent way too much time trying to figure out the difference between the example apps and my app. It pretty much boils down to one line in struts.xml:



If the value of this line is &quot;true&quot;, the problem occurs. If the value is &quot;false&quot;, the problem does not.
It's a pretty trivial change. Give it a try.




 
Don't play dumb with me! But you can try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic