Bobby Sandhu
asked on
can not find org.apache.struts eventhough application has struts.jar file included
I have copied working version of java application war file onto server, it complains saying 'org.apache.struts' can not be found eventhough application has struts.jar included in it. It is working fine in development evironment. The link from one jsp page to another jsp page works fine but it does not reconganize .do in the url. action and .do is specified in web.xml file. It displays in the log file saying 'Creating Action Instance for the defined Action' and no errors.
Any idea as what's wrong??? Please let me know.
Thanks,
Any idea as what's wrong??? Please let me know.
Thanks,
you need to keep struts.jar in WEB-INF/lib and also check whether any other struts.jar is there in the classpath of other version.
Please post result of
jar tf your.war
jar tf your.war
ASKER
CEHJ: Are you talking about my application war file? If not, where can I find this file.
Yes
ASKER
melchkishore: I have Struts.jar and Struts-legacy.jar files under WEB-INF/lib directory.
CEHJ: Here is the list:
jar tf sbtest.war
META-INF/MANIFEST.MF
WEB-INF/classes/Applicatio nResources .propertie s
WEB-INF/classes/Applicatio nResources _fr.proper ties
WEB-INF/classes/ca/gc/csc/ sb/BeanNam es.class
WEB-INF/classes/ca/gc/csc/ sb/Propert iesLoader. class
WEB-INF/classes/ca/gc/csc/ sb/action/ CitiesList Action.cla ss
WEB-INF/classes/ca/gc/csc/ sb/action/ CityListAc tion.class
WEB-INF/classes/ca/gc/csc/ sb/bo/City BO.class
WEB-INF/classes/ca/gc/csc/ sb/dao/Cit yDAO.class
WEB-INF/classes/ca/gc/csc/ sb/excepti on/UserExc eption.cla ss
WEB-INF/classes/ca/gc/csc/ sb/form/Ci ty.class
WEB-INF/classes/sql_city.p roperties
WEB-INF/lib/Password.jar
WEB-INF/lib/activation.jar
WEB-INF/lib/commons-beanut ils.jar
WEB-INF/lib/commons-collec tions.jar
WEB-INF/lib/commons-digest er.jar
WEB-INF/lib/commons-fileup load.jar
WEB-INF/lib/commons-lang.j ar
WEB-INF/lib/commons-loggin g.jar
WEB-INF/lib/commons-valida tor.jar
WEB-INF/lib/jakarta-oro.ja r
WEB-INF/lib/jakarta-regexp -1.3.jar
WEB-INF/lib/jdbc2_0-stdext .jar
WEB-INF/lib/mail.jar
WEB-INF/lib/struts-legacy. jar
WEB-INF/lib/struts.jar
WEB-INF/struts-bean.tld
WEB-INF/struts-config.xml
WEB-INF/struts-html.tld
WEB-INF/struts-logic.tld
WEB-INF/struts-template.tl d
WEB-INF/web.xml
_footer.jsp
_header.jsp
_sb_header.jsp
citiesList.jsp
citiesMenu.jsp
cityAdd.jsp
cityEdit.jsp
confirmation.jsp
index.jsp
login.jsp
logout.jsp
welcome.jsp
CEHJ: Here is the list:
jar tf sbtest.war
META-INF/MANIFEST.MF
WEB-INF/classes/Applicatio
WEB-INF/classes/Applicatio
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/ca/gc/csc/
WEB-INF/classes/sql_city.p
WEB-INF/lib/Password.jar
WEB-INF/lib/activation.jar
WEB-INF/lib/commons-beanut
WEB-INF/lib/commons-collec
WEB-INF/lib/commons-digest
WEB-INF/lib/commons-fileup
WEB-INF/lib/commons-lang.j
WEB-INF/lib/commons-loggin
WEB-INF/lib/commons-valida
WEB-INF/lib/jakarta-oro.ja
WEB-INF/lib/jakarta-regexp
WEB-INF/lib/jdbc2_0-stdext
WEB-INF/lib/mail.jar
WEB-INF/lib/struts-legacy.
WEB-INF/lib/struts.jar
WEB-INF/struts-bean.tld
WEB-INF/struts-config.xml
WEB-INF/struts-html.tld
WEB-INF/struts-logic.tld
WEB-INF/struts-template.tl
WEB-INF/web.xml
_footer.jsp
_header.jsp
_sb_header.jsp
citiesList.jsp
citiesMenu.jsp
cityAdd.jsp
cityEdit.jsp
confirmation.jsp
index.jsp
login.jsp
logout.jsp
welcome.jsp
You might need to put those struts jars into the container's lib directory too. In Tomcat that would be $CATALINA_HOME/lib
remove struts-legacy.jar as it is not needed
ASKER
$CATALINA_HOME\common\lib has following jar files:
[ant].jar [javamail]imap.jar [jdbc-stdext].jar mysql-connector-java-3.0.1 1-stable-b in.jar
[commons-collections].jar [javamail]mailapi-1.3.1.ja r [jndi].jar naming-common.jar
[commons-dbcp].jar [javamail]mailapi.jar [jta].jar naming-factory.jar
[commons-logging-api].jar [javamail]pop3-1.3.1.jar [servletapi4].jar naming-resources.jar
[commons-pool].jar [javamail]pop3.jar ant.jar servlet.jar
[jaf].jar [javamail]smtp-1.3.1.jar jasper-compiler.jar
[javamail]imap-1.3.1.jar [javamail]smtp.jar jasper-runtime.jar
[ant].jar [javamail]imap.jar [jdbc-stdext].jar mysql-connector-java-3.0.1
[commons-collections].jar [javamail]mailapi-1.3.1.ja
[commons-dbcp].jar [javamail]mailapi.jar [jta].jar naming-factory.jar
[commons-logging-api].jar [javamail]pop3-1.3.1.jar [servletapi4].jar naming-resources.jar
[commons-pool].jar [javamail]pop3.jar ant.jar servlet.jar
[jaf].jar [javamail]smtp-1.3.1.jar jasper-compiler.jar
[javamail]imap-1.3.1.jar [javamail]smtp.jar jasper-runtime.jar
ASKER
Hello,
I copied struts.jar file into $CATALINA_HOME/common/lib directory. It works if I go from one jsp to another. As soon as it has to go to action class I mean .do in url, it hangs up and here is the entry from log files:
Processing a GET for /anySpeakerSearch
2008-06-18 17:11:58 action: Looking for ActionForm bean under attribute 'clientForm'
2008-06-18 17:11:58 action: Creating new ActionForm instance of class 'ca.gc.csc.sb.form.Client'
2008-06-18 17:11:58 action: Storing instance under attribute 'clientForm' in scope 'request'
2008-06-18 17:11:58 action: Populating bean properties from this request
2008-06-18 17:11:58 action: Validating input form properties
2008-06-18 17:11:58 action: Looking for Action instance for class ca.gc.csc.sb.action.AnySpe akerSearch Action
2008-06-18 17:11:58 action: Double checking for Action instance already there
2008-06-18 17:11:58 action: Creating new Action instance
I copied struts.jar file into $CATALINA_HOME/common/lib directory. It works if I go from one jsp to another. As soon as it has to go to action class I mean .do in url, it hangs up and here is the entry from log files:
Processing a GET for /anySpeakerSearch
2008-06-18 17:11:58 action: Looking for ActionForm bean under attribute 'clientForm'
2008-06-18 17:11:58 action: Creating new ActionForm instance of class 'ca.gc.csc.sb.form.Client'
2008-06-18 17:11:58 action: Storing instance under attribute 'clientForm' in scope 'request'
2008-06-18 17:11:58 action: Populating bean properties from this request
2008-06-18 17:11:58 action: Validating input form properties
2008-06-18 17:11:58 action: Looking for Action instance for class ca.gc.csc.sb.action.AnySpe
2008-06-18 17:11:58 action: Double checking for Action instance already there
2008-06-18 17:11:58 action: Creating new Action instance
No struts.jar in there unless i missed it ...
>>As soon as it has to go to action class I mean .do in url, it hangs up
Well that's not a jar/classloading issue i don't think
What log is that you're looking at btw?
Well that's not a jar/classloading issue i don't think
What log is that you're looking at btw?
ASKER
WEB-INF/lib/struts.jar is there in the file listings and I also added in $CATALINA_HOME/common/lib directory.
I am looking into localhost_logs under $CATALINA_HOME/logs directory and there is no errors in catalina.out file.
I am looking into localhost_logs under $CATALINA_HOME/logs directory and there is no errors in catalina.out file.
ASKER
and for
melchkishore:remove struts-legacy.jar as it is not needed i
i did that too still same issue :(
melchkishore:remove struts-legacy.jar as it is not needed i
i did that too still same issue :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
CEHJ:
I can see from logs that it is creating new Action instance and why the url with .do not working and displaying anything on the page eventhough same code and same url works fine in development. I am still having the same issue.
I can see from logs that it is creating new Action instance and why the url with .do not working and displaying anything on the page eventhough same code and same url works fine in development. I am still having the same issue.
That's another question entirely. Please open one