Solved

can not find org.apache.struts eventhough application has struts.jar file included

Posted on 2008-06-17
16
249 Views
Last Modified: 2010-03-30
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,
0
Comment
Question by:nav29
  • 7
  • 7
  • 2
16 Comments
 
LVL 10
ID: 21809906
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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21811039
Please post result of

jar tf your.war
0
 

Author Comment

by:nav29
ID: 21811913
CEHJ:  Are you talking about my application war file? If not, where can I find this file.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 86

Expert Comment

by:CEHJ
ID: 21812537
Yes
0
 

Author Comment

by:nav29
ID: 21813742
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/ApplicationResources.properties
WEB-INF/classes/ApplicationResources_fr.properties
WEB-INF/classes/ca/gc/csc/sb/BeanNames.class
WEB-INF/classes/ca/gc/csc/sb/PropertiesLoader.class
WEB-INF/classes/ca/gc/csc/sb/action/CitiesListAction.class
WEB-INF/classes/ca/gc/csc/sb/action/CityListAction.class
WEB-INF/classes/ca/gc/csc/sb/bo/CityBO.class
WEB-INF/classes/ca/gc/csc/sb/dao/CityDAO.class
WEB-INF/classes/ca/gc/csc/sb/exception/UserException.class
WEB-INF/classes/ca/gc/csc/sb/form/City.class
WEB-INF/classes/sql_city.properties
WEB-INF/lib/Password.jar
WEB-INF/lib/activation.jar
WEB-INF/lib/commons-beanutils.jar
WEB-INF/lib/commons-collections.jar
WEB-INF/lib/commons-digester.jar
WEB-INF/lib/commons-fileupload.jar
WEB-INF/lib/commons-lang.jar
WEB-INF/lib/commons-logging.jar
WEB-INF/lib/commons-validator.jar
WEB-INF/lib/jakarta-oro.jar
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.tld
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
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21814068
You might need to put those struts jars into the container's lib directory too. In Tomcat that would be $CATALINA_HOME/lib
0
 
LVL 10
ID: 21814643
remove struts-legacy.jar as it is not needed
0
 

Author Comment

by:nav29
ID: 21814942
$CATALINA_HOME\common\lib has following jar files:
[ant].jar                  [javamail]imap.jar           [jdbc-stdext].jar    mysql-connector-java-3.0.11-stable-bin.jar
[commons-collections].jar  [javamail]mailapi-1.3.1.jar  [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
0
 

Author Comment

by:nav29
ID: 21815002
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.AnySpeakerSearchAction
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
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21815007
No struts.jar in there unless i missed it ...
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21815055
>>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?
0
 

Author Comment

by:nav29
ID: 21815133
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.
0
 

Author Comment

by:nav29
ID: 21815563
and for
melchkishore:remove struts-legacy.jar as it is not needed i
i did that too still same issue :(
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 21816508
Well the original issue has been cleared up: as you can see from your log, the struts classes *have* been loaded
0
 

Author Comment

by:nav29
ID: 21816987
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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 22044998
That's another question entirely. Please open one
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping3 challenge 14 79
numbers ascending pyramid 101 193
java stored proc example 9 29
tomcat administrtor 12 46
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question