dreams4ever
asked on
Calling an action class from a jar file
I have a struts application . I now add a jar file to the lib of the main struts application, the jar file is another struts application.
Now from the main struts application I have a jsp which calls a form bean and an action class from the second jared struts application .
In my main strutsconfig .xml I have an action mapping for the second action class and the form bean definition .
When I deploy my application I get an error in my server console
<Servlet: "action" failed to preload on startup in Web application: "ABCSYSTEM".
javax.servlet.UnavailableE xception: Parsing error processing resource path /WEB-INF/struts-config.xml
at org.apache.struts.action.A ctionServl et.handleC onfigExcep tion(Actio nServlet.j ava:769)
at org.apache.struts.action.A ctionServl et.parseMo duleConfig File(Actio nServlet.j ava:745)
at org.apache.struts.action.A ctionServl et.initMod uleConfig( ActionServ let.java:6 87)
at org.apache.struts.action.A ctionServl et.init(Ac tionServle t.java:333 )
at javax.servlet.GenericServl et.init(Ge nericServl et.java:25 8)
Please Advice
Thanks
Now from the main struts application I have a jsp which calls a form bean and an action class from the second jared struts application .
In my main strutsconfig .xml I have an action mapping for the second action class and the form bean definition .
When I deploy my application I get an error in my server console
<Servlet: "action" failed to preload on startup in Web application: "ABCSYSTEM".
javax.servlet.UnavailableE
at org.apache.struts.action.A
at org.apache.struts.action.A
at org.apache.struts.action.A
at org.apache.struts.action.A
at javax.servlet.GenericServl
Please Advice
Thanks
ASKER
everythis is closed perfectly
when I add this to the form-beans definition I get this exception
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac tions.XYZS trutAction Form" />
when I remove this line I get no exception on my server .
Thanks
when I add this to the form-beans definition I get this exception
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac
when I remove this line I get no exception on my server .
Thanks
ASKER
>> everythis is closed perfectly
everything is closed perfectly
everything is closed perfectly
You need to make sure that the form-bean tag is located in the correct place in the xml file and that it is surrounded by the form-bean tag and also that the class file declared exists and is on the classpath, and that you haven't made a spelling mistake in the declaration of the type attribute, e.g.
...
<struts-config>
<form-beans>
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac tions.XYZS trutAction Form" />
PS fargo, you really don't need to sign your name on every post! we know it's you by the title of the comment and it just adds redundant extra lines to the thread :-)
...
<struts-config>
<form-beans>
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac
PS fargo, you really don't need to sign your name on every post! we know it's you by the title of the comment and it just adds redundant extra lines to the thread :-)
ASKER
<form-beans >
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac tions.XYZS trutAction Form"/>
<form-bean name="loginForm" type="com.abc.ltab.form.Lo ginForm" />
</form-beans >
The below form bean is called from the jared file . Jar file is in the proper class path. which gives the exception
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac tions.XYZS trutAction Form"/>
Thanks
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac
<form-bean name="loginForm" type="com.abc.ltab.form.Lo
</form-beans >
The below form bean is called from the jared file . Jar file is in the proper class path. which gives the exception
<form-bean name="XYZStrutActionForm" type="com.xyz.simulator.ac
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
bloodredsun, you are keeping an eye on me -:)
;-)
ASKER
bloodredsun
I dont have any jar files in my WEB-INF folder
Thanks
I dont have any jar files in my WEB-INF folder
Thanks
And in your WEB-INF/lib folder?
So the bean file is found at WEB-INF/classes/com/xyz/si mulator/ac tions/XYZS trutAction Form.class
and it extends ActionForm, correct?
So the bean file is found at WEB-INF/classes/com/xyz/si
and it extends ActionForm, correct?
ASKER
bloodredsun,
I created the action class and the form bean in my main struts application and called other classes from the jar file which works perfectly
Thanks for all the comments
I created the action class and the form bean in my main struts application and called other classes from the jar file which works perfectly
Thanks for all the comments
Check the tag position, closing etc in the struts-config.xml file.
fargo