aspose file tools*
The moose likes Struts and the fly likes Deploy struts app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Deploy struts app" Watch "Deploy struts app" New topic
Author

Deploy struts app

PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
May be this is not a question specific to struts. But this is about a struts application I want to deploy.
If I have an �ear� file created using WSAD, how can I deploy it in a sun app server? How Do I create the sun specific deployment descriptors? And do I have to have the jar files for struts in the sun server?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
An EAR file is supposed to be deployable to any app server. In reality, though, there are usually a few minor changes that have to be made to accommodate a different app server. Specifically, if your Application uses a connection pool (Data Source), you will have to set that up differently in the Sun App Server than you did in WebSphere. However, as far as Struts goes, you shouldn't have any trouble. The necessary jar files are packaged in the WEB-INF/lib directory inside your WAR file and shouldn't require any changes regardless of which App Server you use.


Merrill
Consultant, Sima Solutions
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
For now I am not using any data source. The user name, password, url etc are read from a property file. How about the sun specific deployment descriptor? Since I used WSAD to create the "ear" file it does not have the sun specific deployment descriptor.
When I copy the "ear" file into the autodeploy directory, the file created is XxxxApp.ear_deployFailed. Any idea why it failed?
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
If I unzip the ear file and deploy the war file alone, it gets deployed. But when I go to my jsp it throws the following exception:
javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:827)
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
Okay. One more time I copied the �ear� file into the autodeploy directory. Looks like it got deployed now. I checked the applications\j2ee-apps directory under the server. Looks like all the files are there. But still I am getting the same error which is
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
org.apache.jsp.register_jsp._jspx_meth_html_form_0(register_jsp.java:192)
org.apache.jsp.register_jsp._jspService(register_jsp.java:141)
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
My WSAD is based on 1.3 version and sun app server is 1.4. Could that be a problem?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The error message "Cannot find ActionMappings or ActionFormBeans collection" indicates that you are trying to display a Struts JSP when the Struts ActionServlet has not yet initialized properly. The cause of this error is usually one of the following:

1-you didn't put a <load-on-startup> element in the web.xml file when you defined the ActionServlet.

2-the ActionServlet is throwintg an exception when it tries to initialize. This is usually due to malformed or invalid XML in your struts-config.xml file. See the app server's SystemOut log for the period of time when the server is first starting up in order to find the error.
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
I have
<load-on-startup>2</load-on-startup>
for the action servlet
in the web.xml.
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
I am posting the log here:

[#|2006-07-02T21:50:15.975-0400|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=12;|StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
at org.apache.jsp.register_jsp._jspx_meth_html_form_0(register_jsp.java:192)
at org.apache.jsp.register_jsp._jspService(register_jsp.java:141)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:272)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
at java.lang.Thread.run(Thread.java:534)
|#]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by Merrill Higginson:

2-the ActionServlet is throwing an exception when it tries to initialize. This is usually due to malformed or invalid XML in your struts-config.xml file. See the app server's SystemOut log for the period of time when the server is first starting up in order to find the error.
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
This is the log file created when I started the server:
Starting Sun Java System Application Server Platform Edition 8.0.0_01 (build b08-fcs) ...
[#|2006-07-05T11:40:15.713-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core|_ThreadID=10;|CORE5076: Using [Java HotSpot(TM) Client VM, Version 1.4.2_06] from [Sun Microsystems Inc.]|#]

[#|2006-07-05T11:40:17.151-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.tools.admin|_ThreadID=10;|ADM0020:Following is the information about the JMX MBeanServer used:|#]

[#|2006-07-05T11:40:17.338-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.tools.admin|_ThreadID=10;|ADM0001:MBeanServer initialized successfully|#]

[#|2006-07-05T11:40:20.245-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|Creating virtual server server|#]

[#|2006-07-05T11:40:20.260-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core|_ThreadID=10;|S1AS AVK Instrumentation disabled|#]

[#|2006-07-05T11:40:20.276-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core.security|_ThreadID=10;|SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.|#]

[#|2006-07-05T11:40:22.073-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core.transaction|_ThreadID=10;|JTS5014: Recoverable JTS instance, serverId = [100]|#]

[#|2006-07-05T11:40:23.291-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core|_ThreadID=10;|Satisfying Optional Packages dependencies...|#]

[#|2006-07-05T11:40:23.666-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=10;|RAR7008 : Initialized monitoring registry and listeners|#]

[#|2006-07-05T11:40:24.213-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core|_ThreadID=10;|CORE5100:Loading system apps|#]

[#|2006-07-05T11:40:24.870-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core.classloading|_ThreadID=10;|LDR5010: All ejb(s) of [MEjbApp] loaded successfully!|#]

[#|2006-07-05T11:40:25.823-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.ejb|_ThreadID=10;|EJB5109:EJB Timer Service started successfully for datasource [jdbc/__TimerPool]|#]

[#|2006-07-05T11:40:25.823-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core.classloading|_ThreadID=10;|LDR5010: All ejb(s) of [__ejb_container_timer_app] loaded successfully!|#]

[#|2006-07-05T11:40:25.901-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0302: Starting Tomcat.|#]

[#|2006-07-05T11:40:26.323-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0100: Loading web module [adminapp] in virtual server [server] at [/web1]|#]

[#|2006-07-05T11:40:26.479-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0100: Loading web module [admingui] in virtual server [server] at [/asadmin]|#]

[#|2006-07-05T11:40:26.494-0400|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0500: default-locale attribute of locale-charset-info element has been deprecated and is being ignored. Use default-charset attribute of parameter-encoding element instead|#]

[#|2006-07-05T11:40:26.494-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0100: Loading web module [com_sun_web_ui] in virtual server [server] at [/com_sun_web_ui]|#]

[#|2006-07-05T11:40:26.510-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0100: Loading web module [hello-jaxrpc] in virtual server [server] at [/hello-jaxrpc]|#]

[#|2006-07-05T11:40:26.526-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0100: Loading web module [jTravellerService] in virtual server [server] at [/jTravellerService]|#]

[#|2006-07-05T11:40:26.541-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0100: Loading web module [Project1Web] in virtual server [server] at [/Project1Web]|#]

[#|2006-07-05T11:40:26.541-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=10;|WEB0100: Loading web module [MyExample1Web] in virtual server [server] at [/MyExample1Web]|#]

[#|2006-07-05T11:40:26.557-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.catalina.startup.Embedded|_ThreadID=10;|Starting tomcat server|#]

[#|2006-07-05T11:40:26.557-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.catalina.startup.Embedded|_ThreadID=10;|Catalina naming disabled|#]

[#|2006-07-05T11:40:26.651-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.catalina.core.StandardEngine|_ThreadID=10;|Starting Servlet Engine: Sun-Java-System/Application-Server-PE-8.0|#]

[#|2006-07-05T11:40:32.088-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.resource.webservices.rpc.server.http|_ThreadID=10;|JAXRPC.JAXRPCSERVLET.12: JAX-RPC context listener initializing|#]

[#|2006-07-05T11:40:32.322-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.resource.webservices.rpc.server.http|_ThreadID=10;|JAXRPC.JAXRPCSERVLET.14: JAX-RPC servlet initializing|#]

[#|2006-07-05T11:40:32.369-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.catalina.startup.ContextConfig|_ThreadID=10;|Missing application web.xml, using defaults only StandardEngine[server].StandardHost[server].StandardContext[]|#]

[#|2006-07-05T11:40:34.635-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.resource.webservices.rpc.server.http|_ThreadID=10;|JAXRPC.JAXRPCSERVLET.12: JAX-RPC context listener initializing|#]

[#|2006-07-05T11:40:34.760-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.resource.webservices.rpc.server.http|_ThreadID=10;|JAXRPC.JAXRPCSERVLET.14: JAX-RPC servlet initializing|#]

[#|2006-07-05T11:40:35.588-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.coyote.http11.Http11Protocol|_ThreadID=10;|Initializing Coyote HTTP/1.1 on port 18080|#]

[#|2006-07-05T11:40:35.604-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.coyote.http11.Http11Protocol|_ThreadID=10;|Starting Coyote HTTP/1.1 on port 18080|#]

[#|2006-07-05T11:40:35.713-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.coyote.http11.Http11Protocol|_ThreadID=10;|Initializing Coyote HTTP/1.1 on port 11043|#]

[#|2006-07-05T11:40:35.729-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.coyote.http11.Http11Protocol|_ThreadID=10;|Starting Coyote HTTP/1.1 on port 11043|#]

[#|2006-07-05T11:40:35.760-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.coyote.http11.Http11Protocol|_ThreadID=10;|Initializing Coyote HTTP/1.1 on port 14848|#]

[#|2006-07-05T11:40:35.760-0400|INFO|sun-appserver-pe8.0.0_01|org.apache.coyote.http11.Http11Protocol|_ThreadID=10;|Starting Coyote HTTP/1.1 on port 14848|#]

[#|2006-07-05T11:40:35.979-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.resource.jms|_ThreadID=10;|JMS5023: JMS service successfully started. Instance Name = imqbroker, Home = [C:\Sun\Creator\SunAppServer8\imq\bin].|#]

[#|2006-07-05T11:40:35.994-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.tools.admin|_ThreadID=10;|[AutoDeploy] Enabling AutoDeployment service at :1152114035994|#]

[#|2006-07-05T11:40:35.994-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core|_ThreadID=10;|CORE5053: Application onReady complete.|#]

[#|2006-07-05T11:40:35.994-0400|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.core|_ThreadID=10;|Application server startup complete.|#]


Given below is the simplified struts-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>

<!-- Data Sources -->
<data-sources>
</data-sources>

<!-- Form Beans -->
<form-beans>
<form-bean name="regFormBean" type="com.seestockonline.struts.forms.RegFormBean">
</form-bean>
<form-bean name="thankyouFormBean" type="com.seestockonline.struts.forms.ThankyouFormBean">
</form-bean>
<form-bean name="stockFormBean" type="com.seestockonline.struts.forms.StockFormBean">
</form-bean>

</form-beans>

<!-- Global Exceptions -->
<global-exceptions>
</global-exceptions>

<!-- Global Forwards -->
<global-forwards>
</global-forwards>

<!-- Action Mappings -->
<action-mappings>
<action name="regFormBean" path="/register" scope="request" type="com.seestockonline.struts.actions.Register" input="register.jsp">
<forward name="success" path="/thankyou.jsp" redirect="false">
</forward>
<forward name="failure" path="/register.jsp">
</forward>
</action>
<action name="thankyouFormBean" path="/thankyou" scope="request" type="com.seestockonline.struts.actions.Thankyou" input="thankyou.jsp">
<forward name="success" path="/stockMajor.jsp">
</forward>
<forward name="failure" path="/thankyou.jsp">
</forward>
</action>
<action name="stockFormBean" path="/stockMajor" scope="request" type="com.seestockonline.struts.actions.StockMajor" input="stockMajor.jsp">
<forward name="success" path="/stockMajor.jsp">
</forward>
<forward name="failure" path="/stockMajor.jsp">
</forward>
</action>



</action-mappings>

<!-- Message Resources -->
<message-resources parameter="com.seestockonline.struts.resourcescom.seestockonline.struts.resources.ApplicationResources"/>

</struts-config>


This works fine in WSAD and I deployed the same ear file.
Any help is appreciated.
Thank you very much.
[ July 05, 2006: Message edited by: PradeepPillai Pradeep ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This line in your stack trace is significant:

Missing application web.xml, using defaults only

Even though you've provided a web.xml file, the App Server somehow isn't finding it.

I'm not at all familiar with the App Server you're using, but I'd suggest you look in the documentation to see if there are some XML files that are required to be in an EAR file for that server. If there are, unjar the EAR file created in WSAD, insert the required XML file, and then re-jar the file.
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
The container specific xml file is sun-web.xml and I have it already under web-inf. This is created at the time of deployment by the container.
I have the jar files under WEB-INF\lib and web.xml is under WEB-INF.
MANIFEST is under META-INF and Class-Path is not specified. The content of MANIFEST.MF is as follows.
Manifest-Version: 1.0
Class-Path:
I don't know if there is anything wrong. I am frustrated. May be I should just give up.
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
Would somebody be able to take a look if I send the ear file?
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
It is going to be a very small ear file with a couple of jsps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploy struts app